Plugin.PlaceStopLimitOrder
method · Plugin · cAlgo.API
Place a Stop Limit Order
Environment behaviour
CLI — not supported. Plugins cannot run in the CLI: ctrader-cli runs cBots only.
Cloud — not supported. Plugins cannot run in the cloud: it runs cBots only.
Overloads
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
Returns TradeResult — Trade Result
Examples
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5);
api.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5)
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
Returns TradeResult — Trade Result
Examples
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel");
api.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel")
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | double? | float | None | Stop loss |
takeProfit | double? | float | None | Take profit |
protectionType | ProtectionType? | ProtectionType | None | Protection type |
Returns TradeResult — Trade Result
Examples
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", 10, 20, ProtectionType.Relative);
api.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", 10, 20, ProtectionType.Relative)
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | RelativeStopLossProtection | RelativeStopLossProtection | Relative Stop loss |
takeProfits | RelativeTakeProfitProtections | RelativeTakeProfitProtections | Relative Take profits |
Returns TradeResult — Trade Result
Examples
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)));
api.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)))
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, StopLossBreakEven stopLossBreakEven)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, StopLossBreakEven stopLossBreakEven)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
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
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), new StopLossBreakEven(15, 3));
api.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), StopLossBreakEven(15, 3))
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | AbsoluteStopLossProtection | AbsoluteStopLossProtection | Absolute Stop loss |
takeProfits | AbsoluteTakeProfitProtections | AbsoluteTakeProfitProtections | Absolute Take profits |
Returns TradeResult — Trade Result
Examples
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)));
api.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)))
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, StopLossBreakEven stopLossBreakEven)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, StopLossBreakEven stopLossBreakEven)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
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
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "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.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), StopLossBreakEven(15, 3))
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | double? | float | None | Stop loss |
takeProfit | double? | float | None | Take profit |
protectionType | ProtectionType? | ProtectionType | None | Protection type |
expiration | DateTime? | DateTime | None | Order expiry date and time |
Returns TradeResult — Trade Result
Examples
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", 10, 20, ProtectionType.Relative, Server.Time.AddDays(1));
api.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", 10, 20, ProtectionType.Relative, api.Server.Time.AddDays(1))
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | RelativeStopLossProtection | RelativeStopLossProtection | Relative Stop loss |
takeProfits | RelativeTakeProfitProtections | RelativeTakeProfitProtections | Relative Take profits |
expiration | DateTime? | DateTime | None | Order expiry date and time |
Returns TradeResult — Trade Result
Examples
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1));
api.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1))
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, StopLossBreakEven stopLossBreakEven)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, StopLossBreakEven stopLossBreakEven)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | RelativeStopLossProtection | RelativeStopLossProtection | Relative Stop loss |
takeProfits | RelativeTakeProfitProtections | RelativeTakeProfitProtections | Relative Take profits |
expiration | DateTime? | DateTime | None | Order expiry date and time |
stopLossBreakEven | StopLossBreakEven | StopLossBreakEven | Break-even for position's StopLoss |
Returns TradeResult — Trade Result
Examples
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "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.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), StopLossBreakEven(15, 3))
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | AbsoluteStopLossProtection | AbsoluteStopLossProtection | Absolute Stop loss |
takeProfits | AbsoluteTakeProfitProtections | AbsoluteTakeProfitProtections | Absolute Take profits |
expiration | DateTime? | DateTime | None | Order expiry date and time |
Returns TradeResult — Trade Result
Examples
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "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.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1))
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, StopLossBreakEven stopLossBreakEven)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, StopLossBreakEven stopLossBreakEven)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | AbsoluteStopLossProtection | AbsoluteStopLossProtection | Absolute Stop loss |
takeProfits | AbsoluteTakeProfitProtections | AbsoluteTakeProfitProtections | Absolute Take profits |
expiration | DateTime? | DateTime | None | Order expiry date and time |
stopLossBreakEven | StopLossBreakEven | StopLossBreakEven | Break-even for position's StopLoss |
Returns TradeResult — Trade Result
Examples
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "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.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), StopLossBreakEven(15, 3))
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration, string comment)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration, string comment)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | double? | float | None | Stop loss |
takeProfit | double? | float | None | Take profit |
protectionType | ProtectionType? | ProtectionType | None | Protection type |
expiration | DateTime? | DateTime | None | Order expiry date and time |
comment | string | str | Order comment |
Returns TradeResult — Trade Result
Examples
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", 10, 20, ProtectionType.Relative, Server.Time.AddDays(1), "order comment");
api.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", 10, 20, ProtectionType.Relative, api.Server.Time.AddDays(1), "order comment")
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | RelativeStopLossProtection | RelativeStopLossProtection | Relative Stop loss |
takeProfits | RelativeTakeProfitProtections | RelativeTakeProfitProtections | Relative Take profits |
expiration | DateTime? | DateTime | None | Order expiry date and time |
comment | string | str | Order comment |
Returns TradeResult — Trade Result
Examples
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1), "order comment");
api.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment")
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, StopLossBreakEven stopLossBreakEven)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, StopLossBreakEven stopLossBreakEven)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | RelativeStopLossProtection | RelativeStopLossProtection | Relative Stop loss |
takeProfits | RelativeTakeProfitProtections | RelativeTakeProfitProtections | Relative Take profits |
expiration | DateTime? | DateTime | None | Order expiry date and time |
comment | string | str | Order comment |
stopLossBreakEven | StopLossBreakEven | StopLossBreakEven | Break-even for position's StopLoss |
Returns TradeResult — Trade Result
Examples
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "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.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment", StopLossBreakEven(15, 3))
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | AbsoluteStopLossProtection | AbsoluteStopLossProtection | Absolute Stop loss |
takeProfits | AbsoluteTakeProfitProtections | AbsoluteTakeProfitProtections | Absolute Take profits |
expiration | DateTime? | DateTime | None | Order expiry date and time |
comment | string | str | Order comment |
Returns TradeResult — Trade Result
Examples
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "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.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), "order comment")
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, StopLossBreakEven stopLossBreakEven)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, StopLossBreakEven stopLossBreakEven)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | AbsoluteStopLossProtection | AbsoluteStopLossProtection | Absolute Stop loss |
takeProfits | AbsoluteTakeProfitProtections | AbsoluteTakeProfitProtections | Absolute Take profits |
expiration | DateTime? | DateTime | None | Order expiry date and time |
comment | string | str | Order comment |
stopLossBreakEven | StopLossBreakEven | StopLossBreakEven | Break-even for position's StopLoss |
Returns TradeResult — Trade Result
Examples
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "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.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "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))
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration, string comment, bool hasTrailingStop)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration, string comment, bool hasTrailingStop)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | double? | float | None | Stop loss |
takeProfit | double? | float | None | Take profit |
protectionType | ProtectionType? | ProtectionType | None | Protection type |
expiration | DateTime? | DateTime | None | Order expiry date and time |
comment | string | str | Order comment |
hasTrailingStop | bool | bool | Enable/disable TrailingStop for position |
Returns TradeResult — Trade Result
Examples
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", 10, 20, ProtectionType.Relative, Server.Time.AddDays(1), "order comment", true);
api.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", 10, 20, ProtectionType.Relative, api.Server.Time.AddDays(1), "order comment", True)
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | RelativeStopLossProtection | RelativeStopLossProtection | Relative Stop loss |
takeProfits | RelativeTakeProfitProtections | RelativeTakeProfitProtections | Relative Take profits |
expiration | DateTime? | DateTime | None | Order expiry date and time |
comment | string | str | Order comment |
hasTrailingStop | bool | bool | Enable/disable TrailingStop for position |
Returns TradeResult — Trade Result
Examples
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "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.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment", True)
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopLossBreakEven stopLossBreakEven)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopLossBreakEven stopLossBreakEven)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | RelativeStopLossProtection | RelativeStopLossProtection | Relative Stop loss |
takeProfits | RelativeTakeProfitProtections | RelativeTakeProfitProtections | Relative Take profits |
expiration | DateTime? | DateTime | None | Order expiry date and 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
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "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.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment", True, StopLossBreakEven(15, 3))
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | AbsoluteStopLossProtection | AbsoluteStopLossProtection | Absolute Stop loss |
takeProfits | AbsoluteTakeProfitProtections | AbsoluteTakeProfitProtections | Absolute Take profits |
expiration | DateTime? | DateTime | None | Order expiry date and time |
comment | string | str | Order comment |
hasTrailingStop | bool | bool | Enable/disable TrailingStop for position |
Returns TradeResult — Trade Result
Examples
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "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.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), "order comment", True)
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopLossBreakEven stopLossBreakEven)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopLossBreakEven stopLossBreakEven)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | AbsoluteStopLossProtection | AbsoluteStopLossProtection | Absolute Stop loss |
takeProfits | AbsoluteTakeProfitProtections | AbsoluteTakeProfitProtections | Absolute Take profits |
expiration | DateTime? | DateTime | None | Order expiry date and 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
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "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.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "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))
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | double? | float | None | Stop loss |
takeProfit | double? | float | None | Take profit |
protectionType | ProtectionType? | ProtectionType | None | Protection type |
expiration | DateTime? | DateTime | None | Order expiry date and 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
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", 10, 20, ProtectionType.Relative, Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade);
api.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", 10, 20, ProtectionType.Relative, api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade)
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | RelativeStopLossProtection | RelativeStopLossProtection | Relative Stop loss |
takeProfits | RelativeTakeProfitProtections | RelativeTakeProfitProtections | Relative Take profits |
expiration | DateTime? | DateTime | None | Order expiry date and 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
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "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.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade)
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopLossBreakEven stopLossBreakEven)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopLossBreakEven stopLossBreakEven)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | RelativeStopLossProtection | RelativeStopLossProtection | Relative Stop loss |
takeProfits | RelativeTakeProfitProtections | RelativeTakeProfitProtections | Relative Take profits |
expiration | DateTime? | DateTime | None | Order expiry date and 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
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "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.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "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))
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | AbsoluteStopLossProtection | AbsoluteStopLossProtection | Absolute Stop loss |
takeProfits | AbsoluteTakeProfitProtections | AbsoluteTakeProfitProtections | Absolute Take profits |
expiration | DateTime? | DateTime | None | Order expiry date and 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
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "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.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "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)
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopLossBreakEven stopLossBreakEven)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopLossBreakEven stopLossBreakEven)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | AbsoluteStopLossProtection | AbsoluteStopLossProtection | Absolute Stop loss |
takeProfits | AbsoluteTakeProfitProtections | AbsoluteTakeProfitProtections | Absolute Take profits |
expiration | DateTime? | DateTime | None | Order expiry date and 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
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "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.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "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))
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, double? stopLoss, double? takeProfit, ProtectionType? protectionType, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | double? | float | None | Stop loss |
takeProfit | double? | float | None | Take profit |
protectionType | ProtectionType? | ProtectionType | None | Protection type |
expiration | DateTime? | DateTime | None | Order expiry date and 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 StopLimitOrder |
Returns TradeResult — Trade Result
Examples
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", 10, 20, ProtectionType.Relative, Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade, StopTriggerMethod.Trade);
api.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", 10, 20, ProtectionType.Relative, api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade, StopTriggerMethod.Trade)
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | RelativeStopLossProtection | RelativeStopLossProtection | Relative Stop loss |
takeProfits | RelativeTakeProfitProtections | RelativeTakeProfitProtections | Relative Take profits |
expiration | DateTime? | DateTime | None | Order expiry date and 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 StopLimitOrder |
Returns TradeResult — Trade Result
Examples
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "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.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade, StopTriggerMethod.Trade)
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod, StopLossBreakEven stopLossBreakEven)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod, StopLossBreakEven stopLossBreakEven)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | RelativeStopLossProtection | RelativeStopLossProtection | Relative Stop loss |
takeProfits | RelativeTakeProfitProtections | RelativeTakeProfitProtections | Relative Take profits |
expiration | DateTime? | DateTime | None | Order expiry date and 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 StopLimitOrder |
stopLossBreakEven | StopLossBreakEven | StopLossBreakEven | Break-even for position's StopLoss |
Returns TradeResult — Trade Result
Examples
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "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.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "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))
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | AbsoluteStopLossProtection | AbsoluteStopLossProtection | Absolute Stop loss |
takeProfits | AbsoluteTakeProfitProtections | AbsoluteTakeProfitProtections | Absolute Take profits |
expiration | DateTime? | DateTime | None | Order expiry date and 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 StopLimitOrder |
Returns TradeResult — Trade Result
Examples
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "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.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "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)
PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod, StopLossBreakEven stopLossBreakEven)
Place a Stop Limit Order
public TradeResult PlaceStopLimitOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, double stopLimitRangePips, string label, AbsoluteStopLossProtection stopLoss, AbsoluteTakeProfitProtections takeProfits, DateTime? expiration, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopTriggerMethod stopOrderTriggerMethod, StopLossBreakEven stopLossBreakEven)
api.PlaceStopLimitOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, stopLimitRangePips: 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 (or better) at which order is filled |
stopLimitRangePips | double | float | Maximum distance for order execution from target price |
label | string | str | Label representing the order |
stopLoss | AbsoluteStopLossProtection | AbsoluteStopLossProtection | Absolute Stop loss |
takeProfits | AbsoluteTakeProfitProtections | AbsoluteTakeProfitProtections | Absolute Take profits |
expiration | DateTime? | DateTime | None | Order expiry date and 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 StopLimitOrder |
stopLossBreakEven | StopLossBreakEven | StopLossBreakEven | Break-even for position's StopLoss |
Returns TradeResult — Trade Result
Examples
PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, 5, "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.PlaceStopLimitOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, 5, "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))