Skip to content

Robot.PlaceStopOrder

method · Robot · cAlgo.API

DesktopCLICloud

Place a stop order

Overloads

Signature
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, StopLossBreakEven stopLossBreakEven)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, StopLossBreakEven stopLossBreakEven)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, StopLossBreakEven stopLossBreakEven)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, StopLossBreakEven stopLossBreakEven)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration, string comment)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, StopLossBreakEven stopLossBreakEven)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, StopLossBreakEven stopLossBreakEven)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration, string comment, bool hasTrailingStop)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopLossBreakEven stopLossBreakEven)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopLossBreakEven stopLossBreakEven)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopLossBreakEven stopLossBreakEven)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopLossBreakEven stopLossBreakEven)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod, StopLossBreakEven stopLossBreakEven)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod)
PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod, StopLossBreakEven stopLossBreakEven)

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask);
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask)

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label

Returns TradeResult — Trade Result

Examples

Example 1

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask);
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask)

Example 2

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel");
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel")

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: float | None, takeProfit: float | None, protectionType: ProtectionType | None) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss double? float | None Stop loss
takeProfit double? float | None Take profit
protectionType ProtectionType? ProtectionType | None Protection type

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", 10, 20, ProtectionType.Relative);
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", 10, 20, ProtectionType.Relative)

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss RelativeStopLossProtection RelativeStopLossProtection Relative Stop loss
takeProfits RelativeTakeProfitProtections RelativeTakeProfitProtections Relative Take profits

Returns TradeResult — Trade Result

Examples

Example 1

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask);
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask)

Example 2

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel");
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel")

Example 3

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)));
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)))

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, StopLossBreakEven stopLossBreakEven)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, StopLossBreakEven stopLossBreakEven)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, stopLossBreakEven: StopLossBreakEven) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss RelativeStopLossProtection RelativeStopLossProtection Relative Stop loss
takeProfits RelativeTakeProfitProtections RelativeTakeProfitProtections Relative Take profits
stopLossBreakEven StopLossBreakEven StopLossBreakEven Break-even for position's StopLoss

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), new StopLossBreakEven(15, 3));
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), StopLossBreakEven(15, 3))

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss AbsoluteStopLossProtection AbsoluteStopLossProtection Absolute Stop loss
takeProfits AbsoluteTakeProfitProtections AbsoluteTakeProfitProtections Absolute Take profits

Returns TradeResult — Trade Result

Examples

Example 1

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask);
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask)

Example 2

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel");
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel")

Example 3

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)));
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)))

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, StopLossBreakEven stopLossBreakEven)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, StopLossBreakEven stopLossBreakEven)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections, stopLossBreakEven: StopLossBreakEven) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss AbsoluteStopLossProtection AbsoluteStopLossProtection Absolute Stop loss
takeProfits AbsoluteTakeProfitProtections AbsoluteTakeProfitProtections Absolute Take profits
stopLossBreakEven StopLossBreakEven StopLossBreakEven Break-even for position's StopLoss

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), new StopLossBreakEven(15, 3));
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), StopLossBreakEven(15, 3))

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: float | None, takeProfit: float | None, protectionType: ProtectionType | None, expiration: DateTime | None) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss double? float | None Stop loss
takeProfit double? float | None Take profit
protectionType ProtectionType? ProtectionType | None Protection type
expiration DateTime? DateTime | None Order expiry time

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", 10, 20, ProtectionType.Relative, Server.Time.AddDays(1));
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", 10, 20, ProtectionType.Relative, api.Server.Time.AddDays(1))

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, expiration: DateTime | None) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss RelativeStopLossProtection RelativeStopLossProtection Relative Stop loss
takeProfits RelativeTakeProfitProtections RelativeTakeProfitProtections Relative Take profits
expiration DateTime? DateTime | None Order expiry time

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1));
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1))

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, StopLossBreakEven stopLossBreakEven)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, StopLossBreakEven stopLossBreakEven)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, expiration: DateTime | None, stopLossBreakEven: StopLossBreakEven) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss RelativeStopLossProtection RelativeStopLossProtection Relative Stop loss
takeProfits RelativeTakeProfitProtections RelativeTakeProfitProtections Relative Take profits
expiration DateTime? DateTime | None Order expiry time
stopLossBreakEven StopLossBreakEven StopLossBreakEven Break-even for position's StopLoss

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1), new StopLossBreakEven(15, 3));
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), StopLossBreakEven(15, 3))

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections, expiration: DateTime | None) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss AbsoluteStopLossProtection AbsoluteStopLossProtection Absolute Stop loss
takeProfits AbsoluteTakeProfitProtections AbsoluteTakeProfitProtections Absolute Take profits
expiration DateTime? DateTime | None Order expiry time

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1));
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1))

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, StopLossBreakEven stopLossBreakEven)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, StopLossBreakEven stopLossBreakEven)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections, expiration: DateTime | None, stopLossBreakEven: StopLossBreakEven) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss AbsoluteStopLossProtection AbsoluteStopLossProtection Absolute Stop loss
takeProfits AbsoluteTakeProfitProtections AbsoluteTakeProfitProtections Absolute Take profits
expiration DateTime? DateTime | None Order expiry time
stopLossBreakEven StopLossBreakEven StopLossBreakEven Break-even for position's StopLoss

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1), new StopLossBreakEven(15, 3));
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), StopLossBreakEven(15, 3))

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration, string comment)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration, string comment)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: float | None, takeProfit: float | None, protectionType: ProtectionType | None, expiration: DateTime | None, comment: str) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss double? float | None Stop loss
takeProfit double? float | None Take profit
protectionType ProtectionType? ProtectionType | None Protection type
expiration DateTime? DateTime | None Order expiry time
comment string str Order comment

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", 10, 20, ProtectionType.Relative, Server.Time.AddDays(1), "order comment");
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", 10, 20, ProtectionType.Relative, api.Server.Time.AddDays(1), "order comment")

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, expiration: DateTime | None, comment: str) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss RelativeStopLossProtection RelativeStopLossProtection Relative Stop loss
takeProfits RelativeTakeProfitProtections RelativeTakeProfitProtections Relative Take profits
expiration DateTime? DateTime | None Order expiry time
comment string str Order comment

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1), "order comment");
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment")

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, StopLossBreakEven stopLossBreakEven)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, StopLossBreakEven stopLossBreakEven)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, expiration: DateTime | None, comment: str, stopLossBreakEven: StopLossBreakEven) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss RelativeStopLossProtection RelativeStopLossProtection Relative Stop loss
takeProfits RelativeTakeProfitProtections RelativeTakeProfitProtections Relative Take profits
expiration DateTime? DateTime | None Order expiry time
comment string str Order comment
stopLossBreakEven StopLossBreakEven StopLossBreakEven Break-even for position's StopLoss

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1), "order comment", new StopLossBreakEven(15, 3));
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment", StopLossBreakEven(15, 3))

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections, expiration: DateTime | None, comment: str) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss AbsoluteStopLossProtection AbsoluteStopLossProtection Absolute Stop loss
takeProfits AbsoluteTakeProfitProtections AbsoluteTakeProfitProtections Absolute Take profits
expiration DateTime? DateTime | None Order expiry time
comment string str Order comment

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1), "order comment");
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), "order comment")

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, StopLossBreakEven stopLossBreakEven)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, StopLossBreakEven stopLossBreakEven)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections, expiration: DateTime | None, comment: str, stopLossBreakEven: StopLossBreakEven) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss AbsoluteStopLossProtection AbsoluteStopLossProtection Absolute Stop loss
takeProfits AbsoluteTakeProfitProtections AbsoluteTakeProfitProtections Absolute Take profits
expiration DateTime? DateTime | None Order expiry time
comment string str Order comment
stopLossBreakEven StopLossBreakEven StopLossBreakEven Break-even for position's StopLoss

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1), "order comment", new StopLossBreakEven(15, 3));
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), "order comment", StopLossBreakEven(15, 3))

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration, string comment, bool hasTrailingStop)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration, string comment, bool hasTrailingStop)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: float | None, takeProfit: float | None, protectionType: ProtectionType | None, expiration: DateTime | None, comment: str, hasTrailingStop: bool) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss double? float | None Stop loss
takeProfit double? float | None Take profit
protectionType ProtectionType? ProtectionType | None Protection type
expiration DateTime? DateTime | None Order expiry time
comment string str Order comment
hasTrailingStop bool bool Enable/disable TrailingStop for position

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", 10, 20, ProtectionType.Relative, Server.Time.AddDays(1), "order comment", true);
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", 10, 20, ProtectionType.Relative, api.Server.Time.AddDays(1), "order comment", True)

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, expiration: DateTime | None, comment: str, hasTrailingStop: bool) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss RelativeStopLossProtection RelativeStopLossProtection Relative Stop loss
takeProfits RelativeTakeProfitProtections RelativeTakeProfitProtections Relative Take profits
expiration DateTime? DateTime | None Order expiry time
comment string str Order comment
hasTrailingStop bool bool Enable/disable TrailingStop for position

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1), "order comment", true);
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment", True)

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopLossBreakEven stopLossBreakEven)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopLossBreakEven stopLossBreakEven)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, expiration: DateTime | None, comment: str, hasTrailingStop: bool, stopLossBreakEven: StopLossBreakEven) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss RelativeStopLossProtection RelativeStopLossProtection Relative Stop loss
takeProfits RelativeTakeProfitProtections RelativeTakeProfitProtections Relative Take profits
expiration DateTime? DateTime | None Order expiry time
comment string str Order comment
hasTrailingStop bool bool Enable/disable TrailingStop for position
stopLossBreakEven StopLossBreakEven StopLossBreakEven Break-even for position's StopLoss

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1), "order comment", true, new StopLossBreakEven(15, 3));
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment", True, StopLossBreakEven(15, 3))

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections, expiration: DateTime | None, comment: str, hasTrailingStop: bool) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss AbsoluteStopLossProtection AbsoluteStopLossProtection Absolute Stop loss
takeProfits AbsoluteTakeProfitProtections AbsoluteTakeProfitProtections Absolute Take profits
expiration DateTime? DateTime | None Order expiry time
comment string str Order comment
hasTrailingStop bool bool Enable/disable TrailingStop for position

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1), "order comment", true);
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), "order comment", True)

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopLossBreakEven stopLossBreakEven)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopLossBreakEven stopLossBreakEven)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections, expiration: DateTime | None, comment: str, hasTrailingStop: bool, stopLossBreakEven: StopLossBreakEven) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss AbsoluteStopLossProtection AbsoluteStopLossProtection Absolute Stop loss
takeProfits AbsoluteTakeProfitProtections AbsoluteTakeProfitProtections Absolute Take profits
expiration DateTime? DateTime | None Order expiry time
comment string str Order comment
hasTrailingStop bool bool Enable/disable TrailingStop for position
stopLossBreakEven StopLossBreakEven StopLossBreakEven Break-even for position's StopLoss

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1), "order comment", true, new StopLossBreakEven(15, 3));
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), "order comment", True, StopLossBreakEven(15, 3))

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: float | None, takeProfit: float | None, protectionType: ProtectionType | None, expiration: DateTime | None, comment: str, hasTrailingStop: bool, stopLossTriggerMethod: StopTriggerMethod | None) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss double? float | None Stop loss
takeProfit double? float | None Take profit
protectionType ProtectionType? ProtectionType | None Protection type
expiration DateTime? DateTime | None Order expiry time
comment string str Order comment
hasTrailingStop bool bool Enable/disable TrailingStop for position
stopLossTriggerMethod StopTriggerMethod? StopTriggerMethod | None Trigger method for position's StopLoss

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", 10, 20, ProtectionType.Relative, Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade);
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", 10, 20, ProtectionType.Relative, api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade)

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, expiration: DateTime | None, comment: str, hasTrailingStop: bool, stopLossTriggerMethod: StopTriggerMethod | None) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss RelativeStopLossProtection RelativeStopLossProtection Relative Stop loss
takeProfits RelativeTakeProfitProtections RelativeTakeProfitProtections Relative Take profits
expiration DateTime? DateTime | None Order expiry time
comment string str Order comment
hasTrailingStop bool bool Enable/disable TrailingStop for position
stopLossTriggerMethod StopTriggerMethod? StopTriggerMethod | None Trigger method for position's StopLoss

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade);
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade)

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopLossBreakEven stopLossBreakEven)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopLossBreakEven stopLossBreakEven)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, expiration: DateTime | None, comment: str, hasTrailingStop: bool, stopLossTriggerMethod: StopTriggerMethod | None, stopLossBreakEven: StopLossBreakEven) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss RelativeStopLossProtection RelativeStopLossProtection Relative Stop loss
takeProfits RelativeTakeProfitProtections RelativeTakeProfitProtections Relative Take profits
expiration DateTime? DateTime | None Order expiry time
comment string str Order comment
hasTrailingStop bool bool Enable/disable TrailingStop for position
stopLossTriggerMethod StopTriggerMethod? StopTriggerMethod | None Trigger method for position's StopLoss
stopLossBreakEven StopLossBreakEven StopLossBreakEven Break-even for position's StopLoss

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade, new StopLossBreakEven(15, 3));
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade, StopLossBreakEven(15, 3))

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections, expiration: DateTime | None, comment: str, hasTrailingStop: bool, stopLossTriggerMethod: StopTriggerMethod | None) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss AbsoluteStopLossProtection AbsoluteStopLossProtection Absolute Stop loss
takeProfits AbsoluteTakeProfitProtections AbsoluteTakeProfitProtections Absolute Take profits
expiration DateTime? DateTime | None Order expiry time
comment string str Order comment
hasTrailingStop bool bool Enable/disable TrailingStop for position
stopLossTriggerMethod StopTriggerMethod? StopTriggerMethod | None Trigger method for position's StopLoss

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade);
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade)

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopLossBreakEven stopLossBreakEven)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopLossBreakEven stopLossBreakEven)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections, expiration: DateTime | None, comment: str, hasTrailingStop: bool, stopLossTriggerMethod: StopTriggerMethod | None, stopLossBreakEven: StopLossBreakEven) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss AbsoluteStopLossProtection AbsoluteStopLossProtection Absolute Stop loss
takeProfits AbsoluteTakeProfitProtections AbsoluteTakeProfitProtections Absolute Take profits
expiration DateTime? DateTime | None Order expiry time
comment string str Order comment
hasTrailingStop bool bool Enable/disable TrailingStop for position
stopLossTriggerMethod StopTriggerMethod? StopTriggerMethod | None Trigger method for position's StopLoss
stopLossBreakEven StopLossBreakEven StopLossBreakEven Break-even for position's StopLoss

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade, new StopLossBreakEven(15, 3));
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade, StopLossBreakEven(15, 3))

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: float | None, takeProfit: float | None, protectionType: ProtectionType | None, expiration: DateTime | None, comment: str, hasTrailingStop: bool, stopLossTriggerMethod: StopTriggerMethod | None, stopOrderTriggerMethod: StopTriggerMethod) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss double? float | None Stop loss
takeProfit double? float | None Take profit
protectionType ProtectionType? ProtectionType | None Protection type
expiration DateTime? DateTime | None Order expiry time
comment string str Order comment
hasTrailingStop bool bool Enable/disable TrailingStop for position
stopLossTriggerMethod StopTriggerMethod? StopTriggerMethod | None Trigger method for position's StopLoss
stopOrderTriggerMethod StopTriggerMethod StopTriggerMethod Determines how pending order will be triggered in case it is a StopOrder

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", 10, 20, ProtectionType.Relative, Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade, StopTriggerMethod.Trade);
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", 10, 20, ProtectionType.Relative, api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade, StopTriggerMethod.Trade)

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, expiration: DateTime | None, comment: str, hasTrailingStop: bool, stopLossTriggerMethod: StopTriggerMethod | None, stopOrderTriggerMethod: StopTriggerMethod) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss RelativeStopLossProtection RelativeStopLossProtection Relative Stop loss
takeProfits RelativeTakeProfitProtections RelativeTakeProfitProtections Relative Take profits
expiration DateTime? DateTime | None Order expiry time
comment string str Order comment
hasTrailingStop bool bool Enable/disable TrailingStop for position
stopLossTriggerMethod StopTriggerMethod? StopTriggerMethod | None Trigger method for position's StopLoss
stopOrderTriggerMethod StopTriggerMethod StopTriggerMethod Determines how pending order will be triggered in case it is a StopOrder

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade, StopTriggerMethod.Trade);
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade, StopTriggerMethod.Trade)

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod, StopLossBreakEven stopLossBreakEven)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod, StopLossBreakEven stopLossBreakEven)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, expiration: DateTime | None, comment: str, hasTrailingStop: bool, stopLossTriggerMethod: StopTriggerMethod | None, stopOrderTriggerMethod: StopTriggerMethod, stopLossBreakEven: StopLossBreakEven) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss RelativeStopLossProtection RelativeStopLossProtection Relative Stop loss
takeProfits RelativeTakeProfitProtections RelativeTakeProfitProtections Relative Take profits
expiration DateTime? DateTime | None Order expiry time
comment string str Order comment
hasTrailingStop bool bool Enable/disable TrailingStop for position
stopLossTriggerMethod StopTriggerMethod? StopTriggerMethod | None Trigger method for position's StopLoss
stopOrderTriggerMethod StopTriggerMethod StopTriggerMethod Determines how pending order will be triggered in case it is a StopOrder
stopLossBreakEven StopLossBreakEven StopLossBreakEven Break-even for position's StopLoss

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade, StopTriggerMethod.Trade, new StopLossBreakEven(15, 3));
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade, StopTriggerMethod.Trade, StopLossBreakEven(15, 3))

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections, expiration: DateTime | None, comment: str, hasTrailingStop: bool, stopLossTriggerMethod: StopTriggerMethod | None, stopOrderTriggerMethod: StopTriggerMethod) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss AbsoluteStopLossProtection AbsoluteStopLossProtection Absolute Stop loss
takeProfits AbsoluteTakeProfitProtections AbsoluteTakeProfitProtections Absolute Take profits
expiration DateTime? DateTime | None Order expiry time
comment string str Order comment
hasTrailingStop bool bool Enable/disable TrailingStop for position
stopLossTriggerMethod StopTriggerMethod? StopTriggerMethod | None Trigger method for position's StopLoss
stopOrderTriggerMethod StopTriggerMethod StopTriggerMethod Determines how pending order will be triggered in case it is a StopOrder

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade, StopTriggerMethod.Trade);
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade, StopTriggerMethod.Trade)

PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod, StopLossBreakEven stopLossBreakEven)

Place a stop order

public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod, StopLossBreakEven stopLossBreakEven)
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections, expiration: DateTime | None, comment: str, hasTrailingStop: bool, stopLossTriggerMethod: StopTriggerMethod | None, stopOrderTriggerMethod: StopTriggerMethod, stopLossBreakEven: StopLossBreakEven) -> TradeResult

Parameters

Name C# type Python type Description
tradeType TradeType TradeType Direction of trade
symbolName string str Symbol name of trade
volume double float Volume (in units) of trade
targetPrice double float Price at which order becomes a market order
label string str Representing label
stopLoss AbsoluteStopLossProtection AbsoluteStopLossProtection Absolute Stop loss
takeProfits AbsoluteTakeProfitProtections AbsoluteTakeProfitProtections Absolute Take profits
expiration DateTime? DateTime | None Order expiry time
comment string str Order comment
hasTrailingStop bool bool Enable/disable TrailingStop for position
stopLossTriggerMethod StopTriggerMethod? StopTriggerMethod | None Trigger method for position's StopLoss
stopOrderTriggerMethod StopTriggerMethod StopTriggerMethod Determines how pending order will be triggered in case it is a StopOrder
stopLossBreakEven StopLossBreakEven StopLossBreakEven Break-even for position's StopLoss

Returns TradeResult — Trade Result

Examples

PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade, StopTriggerMethod.Trade, new StopLossBreakEven(15, 3));
api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade, StopTriggerMethod.Trade, StopLossBreakEven(15, 3))