ModifyPosition


Summary

Modify the volume of a position

Syntax

public TradeResult ModifyPosition(Position position, double volume)
public TradeResult ModifyPosition(Position position, double? stopLoss, double? takeProfit)
public TradeResult ModifyPosition(Position position, double? stopLoss, double? takeProfit, bool hasTrailingStop)
public TradeResult ModifyPosition(Position position, double? stopLoss, double? takeProfit, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod)

Parameters

NameDescription

Example 1

var position = Positions.Find("myLabel", Symbol, TradeType.Buy);
if (position != null )
{
    ModifyPosition(position, 20000);
}