Skip to content

Robot.ExecuteMarketRangeOrderAsync

method · Robot · cAlgo.API

DesktopCLICloud

Execute a market order in asynchronous execution mode

Overloads

Signature Description
ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, Action<TradeResult> callback) Execute a market order in asynchronous execution mode
ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, Action<TradeResult> callback) Execute a market order in asynchronous execution mode
ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, double? stopLossPips, double? takeProfitPips, Action<TradeResult> callback) Execute a market order in asynchronous execution mode
ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, double? stopLossPips, double? takeProfitPips, string comment, Action<TradeResult> callback) Execute a market order in asynchronous execution mode
ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, double? stopLossPips, double? takeProfitPips, string comment, bool hasTrailingStop, Action<TradeResult> callback) Execute a market order in asynchronous execution mode
ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, double? stopLossPips, double? takeProfitPips, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, Action<TradeResult> callback) Execute a market order in asynchronous execution mode
ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, Action<TradeResult> callback) Execute a market range order in asynchronous execution mode
ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopLossBreakEven stopLossBreakEven, Action<TradeResult> callback) Execute a market range order in asynchronous execution mode
ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, Action<TradeResult> callback) Execute a market order in asynchronous execution mode
ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, StopLossBreakEven stopLossBreakEven, Action<TradeResult> callback) Execute a market order in asynchronous execution mode
ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, Action<TradeResult> callback) Execute a market order in asynchronous execution mode
ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, StopLossBreakEven stopLossBreakEven, Action<TradeResult> callback) Execute a market order in asynchronous execution mode
ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, bool hasTrailingStop, Action<TradeResult> callback) Execute a market order in asynchronous execution mode
ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, bool hasTrailingStop, StopLossBreakEven stopLossBreakEven, Action<TradeResult> callback) Execute a market order in asynchronous execution mode

ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, Action<TradeResult> callback)

Execute a market order in asynchronous execution mode

public TradeOperation ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, Action<TradeResult> callback)
api.ExecuteMarketRangeOrderAsync(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, callback: Callable[[TradeResult], None]) -> TradeOperation

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
marketRangePips double float The market range (slippage) in Pips
basePrice double float Base price to calculate relative slippage price
callback Action<TradeResult> Callable[[TradeResult], None] Event raised when position is opened

Returns TradeOperation — Trade Operation

Examples

ExecuteMarketRangeOrderAsync(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, result => Print("Trade operation successful: {0}", result.IsSuccessful));
api.ExecuteMarketRangeOrderAsync(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, lambda result: api.Print(f"Trade operation successful: {result.IsSuccessful}"))

ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, Action<TradeResult> callback)

Execute a market order in asynchronous execution mode

public TradeOperation ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, Action<TradeResult> callback)
api.ExecuteMarketRangeOrderAsync(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, callback: Callable[[TradeResult], None]) -> TradeOperation

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
marketRangePips double float The market range (slippage) in Pips
basePrice double float Base price to calculate relative slippage price
label string str Label representing the order
callback Action<TradeResult> Callable[[TradeResult], None] Event raised when position is opened

Returns TradeOperation — Trade Operation

Examples

Example 1

ExecuteMarketRangeOrderAsync(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, result => Print("Trade operation successful: {0}", result.IsSuccessful));
api.ExecuteMarketRangeOrderAsync(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, lambda result: api.Print(f"Trade operation successful: {result.IsSuccessful}"))

Example 2

ExecuteMarketRangeOrderAsync(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel", result => Print("Trade operation successful: {0}", result.IsSuccessful));
api.ExecuteMarketRangeOrderAsync(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, "myLabel", lambda result: api.Print(f"Trade operation successful: {result.IsSuccessful}"))

ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, double? stopLossPips, double? takeProfitPips, Action<TradeResult> callback)

Execute a market order in asynchronous execution mode

public TradeOperation ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, double? stopLossPips, double? takeProfitPips, Action<TradeResult> callback)
api.ExecuteMarketRangeOrderAsync(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLossPips: float | None, takeProfitPips: float | None, callback: Callable[[TradeResult], None]) -> TradeOperation

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
marketRangePips double float The market range (slippage) in Pips
basePrice double float Base price to calculate relative slippage price
label string str Label representing the order
stopLossPips double? float | None Stop loss in pips
takeProfitPips double? float | None Take profit in pips
callback Action<TradeResult> Callable[[TradeResult], None] Event raised when position is opened

Returns TradeOperation — Trade Operation

Examples

Example 1

ExecuteMarketRangeOrderAsync(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, result => Print("Trade operation successful: {0}", result.IsSuccessful));
api.ExecuteMarketRangeOrderAsync(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, lambda result: api.Print(f"Trade operation successful: {result.IsSuccessful}"))

Example 2

ExecuteMarketRangeOrderAsync(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel", result => Print("Trade operation successful: {0}", result.IsSuccessful));
api.ExecuteMarketRangeOrderAsync(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, "myLabel", lambda result: api.Print(f"Trade operation successful: {result.IsSuccessful}"))

Example 3

ExecuteMarketRangeOrderAsync(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel", 10, 20, result => Print("Trade operation successful: {0}", result.IsSuccessful));
api.ExecuteMarketRangeOrderAsync(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, "myLabel", 10, 20, lambda result: api.Print(f"Trade operation successful: {result.IsSuccessful}"))

ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, double? stopLossPips, double? takeProfitPips, string comment, Action<TradeResult> callback)

Execute a market order in asynchronous execution mode

public TradeOperation ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, double? stopLossPips, double? takeProfitPips, string comment, Action<TradeResult> callback)
api.ExecuteMarketRangeOrderAsync(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLossPips: float | None, takeProfitPips: float | None, comment: str, callback: Callable[[TradeResult], None]) -> TradeOperation

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
marketRangePips double float The market range (slippage) in Pips
basePrice double float Base price to calculate relative slippage price
label string str Label representing the order
stopLossPips double? float | None Stop loss in pips
takeProfitPips double? float | None Take profit in pips
comment string str Order comment
callback Action<TradeResult> Callable[[TradeResult], None] Event raised when position is opened

Returns TradeOperation — Trade Operation

Examples

ExecuteMarketRangeOrderAsync(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel", 10, 20, "order comment", result => Print("Trade operation successful: {0}", result.IsSuccessful));
api.ExecuteMarketRangeOrderAsync(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, "myLabel", 10, 20, "order comment", lambda result: api.Print(f"Trade operation successful: {result.IsSuccessful}"))

ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, double? stopLossPips, double? takeProfitPips, string comment, bool hasTrailingStop, Action<TradeResult> callback)

Execute a market order in asynchronous execution mode

public TradeOperation ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, double? stopLossPips, double? takeProfitPips, string comment, bool hasTrailingStop, Action<TradeResult> callback)
api.ExecuteMarketRangeOrderAsync(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLossPips: float | None, takeProfitPips: float | None, comment: str, hasTrailingStop: bool, callback: Callable[[TradeResult], None]) -> TradeOperation

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
marketRangePips double float The market range (slippage) in Pips
basePrice double float Base price to calculate relative slippage price
label string str Label representing the order
stopLossPips double? float | None Stop loss in pips
takeProfitPips double? float | None Take profit in pips
comment string str Order comment
hasTrailingStop bool bool Enable/disable TrailingStop for position
callback Action<TradeResult> Callable[[TradeResult], None] Event raised when position is opened

Returns TradeOperation — Trade Operation

Examples

ExecuteMarketRangeOrderAsync(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel", 10, 20, "order comment", true, result => Print("Trade operation successful: {0}", result.IsSuccessful));
api.ExecuteMarketRangeOrderAsync(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, "myLabel", 10, 20, "order comment", True, lambda result: api.Print(f"Trade operation successful: {result.IsSuccessful}"))

ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, double? stopLossPips, double? takeProfitPips, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, Action<TradeResult> callback)

Execute a market order in asynchronous execution mode

public TradeOperation ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, double? stopLossPips, double? takeProfitPips, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, Action<TradeResult> callback)
api.ExecuteMarketRangeOrderAsync(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLossPips: float | None, takeProfitPips: float | None, comment: str, hasTrailingStop: bool, stopLossTriggerMethod: StopTriggerMethod | None, callback: Callable[[TradeResult], None]) -> TradeOperation

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
marketRangePips double float The market range (slippage) in Pips
basePrice double float Base price to calculate relative slippage price
label string str Label representing the order
stopLossPips double? float | None Stop loss in pips
takeProfitPips double? float | None Take profit in pips
comment string str Order comment
hasTrailingStop bool bool Enable/disable TrailingStop for position
stopLossTriggerMethod StopTriggerMethod? StopTriggerMethod | None Trigger method for position's StopLoss
callback Action<TradeResult> Callable[[TradeResult], None] Event raised when position is opened

Returns TradeOperation — Trade Operation

Examples

ExecuteMarketRangeOrderAsync(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel", 10, 20, "order comment", true, StopTriggerMethod.Trade, result => Print("Trade operation successful: {0}", result.IsSuccessful));
api.ExecuteMarketRangeOrderAsync(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, "myLabel", 10, 20, "order comment", True, StopTriggerMethod.Trade, lambda result: api.Print(f"Trade operation successful: {result.IsSuccessful}"))

ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, Action<TradeResult> callback)

Execute a market range order in asynchronous execution mode

public TradeOperation ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, Action<TradeResult> callback)
api.ExecuteMarketRangeOrderAsync(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, comment: str, hasTrailingStop: bool, stopLossTriggerMethod: StopTriggerMethod | None, callback: Callable[[TradeResult], None]) -> TradeOperation

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
marketRangePips double float The market range (slippage) in Pips
basePrice double float Base price to calculate relative slippage price
label string str Label representing the order
stopLoss RelativeStopLossProtection RelativeStopLossProtection Relative Stop loss
takeProfits RelativeTakeProfitProtections RelativeTakeProfitProtections Relative Take profits
comment string str Order comment
hasTrailingStop bool bool Enable/disable TrailingStop for position
stopLossTriggerMethod StopTriggerMethod? StopTriggerMethod | None Trigger method for position's StopLoss
callback Action<TradeResult> Callable[[TradeResult], None] Event raised when position is opened

Returns TradeOperation — Trade Operation

Examples

ExecuteMarketRangeOrderAsync(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), "order comment", true, StopTriggerMethod.Trade, result => Print("Trade operation successful: {0}", result.IsSuccessful));
api.ExecuteMarketRangeOrderAsync(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), "order comment", True, StopTriggerMethod.Trade, lambda result: api.Print(f"Trade operation successful: {result.IsSuccessful}"))

ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopLossBreakEven stopLossBreakEven, Action<TradeResult> callback)

Execute a market range order in asynchronous execution mode

public TradeOperation ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopLossBreakEven stopLossBreakEven, Action<TradeResult> callback)
api.ExecuteMarketRangeOrderAsync(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, comment: str, hasTrailingStop: bool, stopLossTriggerMethod: StopTriggerMethod | None, stopLossBreakEven: StopLossBreakEven, callback: Callable[[TradeResult], None]) -> TradeOperation

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
marketRangePips double float The market range (slippage) in Pips
basePrice double float Base price to calculate relative slippage price
label string str Label representing the order
stopLoss RelativeStopLossProtection RelativeStopLossProtection Relative Stop loss
takeProfits RelativeTakeProfitProtections RelativeTakeProfitProtections Relative Take profits
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
callback Action<TradeResult> Callable[[TradeResult], None] Event raised when position is opened

Returns TradeOperation — Trade Operation

Examples

ExecuteMarketRangeOrderAsync(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), "order comment", true, StopTriggerMethod.Trade, new StopLossBreakEven(15, 3), result => Print("Trade operation successful: {0}", result.IsSuccessful));
api.ExecuteMarketRangeOrderAsync(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), "order comment", True, StopTriggerMethod.Trade, StopLossBreakEven(15, 3), lambda result: api.Print(f"Trade operation successful: {result.IsSuccessful}"))

ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, Action<TradeResult> callback)

Execute a market order in asynchronous execution mode

public TradeOperation ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, Action<TradeResult> callback)
api.ExecuteMarketRangeOrderAsync(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, callback: Callable[[TradeResult], None]) -> TradeOperation

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
marketRangePips double float The market range (slippage) in Pips
basePrice double float Base price to calculate relative slippage price
label string str Label representing the order
stopLoss RelativeStopLossProtection RelativeStopLossProtection Relative Stop loss
takeProfits RelativeTakeProfitProtections RelativeTakeProfitProtections Relative Take profits
callback Action<TradeResult> Callable[[TradeResult], None] Event raised when position is opened

Returns TradeOperation — Trade Operation

Examples

Example 1

ExecuteMarketRangeOrderAsync(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, result => Print("Trade operation successful: {0}", result.IsSuccessful));
api.ExecuteMarketRangeOrderAsync(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, lambda result: api.Print(f"Trade operation successful: {result.IsSuccessful}"))

Example 2

ExecuteMarketRangeOrderAsync(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel", result => Print("Trade operation successful: {0}", result.IsSuccessful));
api.ExecuteMarketRangeOrderAsync(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, "myLabel", lambda result: api.Print(f"Trade operation successful: {result.IsSuccessful}"))

Example 3

ExecuteMarketRangeOrderAsync(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), result => Print("Trade operation successful: {0}", result.IsSuccessful));
api.ExecuteMarketRangeOrderAsync(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), lambda result: api.Print(f"Trade operation successful: {result.IsSuccessful}"))

ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, StopLossBreakEven stopLossBreakEven, Action<TradeResult> callback)

Execute a market order in asynchronous execution mode

public TradeOperation ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, StopLossBreakEven stopLossBreakEven, Action<TradeResult> callback)
api.ExecuteMarketRangeOrderAsync(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, stopLossBreakEven: StopLossBreakEven, callback: Callable[[TradeResult], None]) -> TradeOperation

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
marketRangePips double float The market range (slippage) in Pips
basePrice double float Base price to calculate relative slippage 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
callback Action<TradeResult> Callable[[TradeResult], None] Event raised when position is opened

Returns TradeOperation — Trade Operation

Examples

ExecuteMarketRangeOrderAsync(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), new StopLossBreakEven(15, 3), result => Print("Trade operation successful: {0}", result.IsSuccessful));
api.ExecuteMarketRangeOrderAsync(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), StopLossBreakEven(15, 3), lambda result: api.Print(f"Trade operation successful: {result.IsSuccessful}"))

ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, Action<TradeResult> callback)

Execute a market order in asynchronous execution mode

public TradeOperation ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, Action<TradeResult> callback)
api.ExecuteMarketRangeOrderAsync(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, comment: str, callback: Callable[[TradeResult], None]) -> TradeOperation

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
marketRangePips double float The market range (slippage) in Pips
basePrice double float Base price to calculate relative slippage price
label string str Label representing the order
stopLoss RelativeStopLossProtection RelativeStopLossProtection Relative Stop loss
takeProfits RelativeTakeProfitProtections RelativeTakeProfitProtections Relative Take profits
comment string str Order comment
callback Action<TradeResult> Callable[[TradeResult], None] Event raised when position is opened

Returns TradeOperation — Trade Operation

Examples

ExecuteMarketRangeOrderAsync(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), "order comment", result => Print("Trade operation successful: {0}", result.IsSuccessful));
api.ExecuteMarketRangeOrderAsync(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), "order comment", lambda result: api.Print(f"Trade operation successful: {result.IsSuccessful}"))

ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, StopLossBreakEven stopLossBreakEven, Action<TradeResult> callback)

Execute a market order in asynchronous execution mode

public TradeOperation ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, StopLossBreakEven stopLossBreakEven, Action<TradeResult> callback)
api.ExecuteMarketRangeOrderAsync(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, comment: str, stopLossBreakEven: StopLossBreakEven, callback: Callable[[TradeResult], None]) -> TradeOperation

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
marketRangePips double float The market range (slippage) in Pips
basePrice double float Base price to calculate relative slippage price
label string str Label representing the order
stopLoss RelativeStopLossProtection RelativeStopLossProtection Relative Stop loss
takeProfits RelativeTakeProfitProtections RelativeTakeProfitProtections Relative Take profits
comment string str Order comment
stopLossBreakEven StopLossBreakEven StopLossBreakEven Break-even for position's StopLoss
callback Action<TradeResult> Callable[[TradeResult], None] Event raised when position is opened

Returns TradeOperation — Trade Operation

Examples

ExecuteMarketRangeOrderAsync(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), "order comment", new StopLossBreakEven(15, 3), result => Print("Trade operation successful: {0}", result.IsSuccessful));
api.ExecuteMarketRangeOrderAsync(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), "order comment", StopLossBreakEven(15, 3), lambda result: api.Print(f"Trade operation successful: {result.IsSuccessful}"))

ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, bool hasTrailingStop, Action<TradeResult> callback)

Execute a market order in asynchronous execution mode

public TradeOperation ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, bool hasTrailingStop, Action<TradeResult> callback)
api.ExecuteMarketRangeOrderAsync(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, comment: str, hasTrailingStop: bool, callback: Callable[[TradeResult], None]) -> TradeOperation

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
marketRangePips double float The market range (slippage) in Pips
basePrice double float Base price to calculate relative slippage price
label string str Label representing the order
stopLoss RelativeStopLossProtection RelativeStopLossProtection Relative Stop loss
takeProfits RelativeTakeProfitProtections RelativeTakeProfitProtections Relative Take profits
comment string str Order comment
hasTrailingStop bool bool Enable/disable TrailingStop for position
callback Action<TradeResult> Callable[[TradeResult], None] Event raised when position is opened

Returns TradeOperation — Trade Operation

Examples

ExecuteMarketRangeOrderAsync(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), "order comment", true, result => Print("Trade operation successful: {0}", result.IsSuccessful));
api.ExecuteMarketRangeOrderAsync(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), "order comment", True, lambda result: api.Print(f"Trade operation successful: {result.IsSuccessful}"))

ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, bool hasTrailingStop, StopLossBreakEven stopLossBreakEven, Action<TradeResult> callback)

Execute a market order in asynchronous execution mode

public TradeOperation ExecuteMarketRangeOrderAsync(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, bool hasTrailingStop, StopLossBreakEven stopLossBreakEven, Action<TradeResult> callback)
api.ExecuteMarketRangeOrderAsync(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, comment: str, hasTrailingStop: bool, stopLossBreakEven: StopLossBreakEven, callback: Callable[[TradeResult], None]) -> TradeOperation

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
marketRangePips double float The market range (slippage) in Pips
basePrice double float Base price to calculate relative slippage price
label string str Label representing the order
stopLoss RelativeStopLossProtection RelativeStopLossProtection Relative Stop loss
takeProfits RelativeTakeProfitProtections RelativeTakeProfitProtections Relative Take profits
comment string str Order comment
hasTrailingStop bool bool Enable/disable TrailingStop for position
stopLossBreakEven StopLossBreakEven StopLossBreakEven Break-even for position's StopLoss
callback Action<TradeResult> Callable[[TradeResult], None] Event raised when position is opened

Returns TradeOperation — Trade Operation

Examples

ExecuteMarketRangeOrderAsync(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), "order comment", true, new StopLossBreakEven(15, 3), result => Print("Trade operation successful: {0}", result.IsSuccessful));
api.ExecuteMarketRangeOrderAsync(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), "order comment", True, StopLossBreakEven(15, 3), lambda result: api.Print(f"Trade operation successful: {result.IsSuccessful}"))