Indicator.ExecuteMarketRangeOrder
method · Indicator · cAlgo.API
Execute a Market Order
Overloads
ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice)
Execute a Market Order
public TradeResult ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice)
api.ExecuteMarketRangeOrder(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: 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 |
marketRangePips | double | float | The market range (slippage) in Pips |
basePrice | double | float | Base price to calculate relative slippage price |
Returns TradeResult — Trade Result
Examples
ExecuteMarketRangeOrder(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid);
api.ExecuteMarketRangeOrder(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid)
ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label)
Execute a Market Order
public TradeResult ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label)
api.ExecuteMarketRangeOrder(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: 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 |
marketRangePips | double | float | The market range (slippage) in Pips |
basePrice | double | float | Base price to calculate relative slippage price |
label | string | str | Representing label |
Returns TradeResult — Trade Result
Examples
Example 1
ExecuteMarketRangeOrder(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid);
api.ExecuteMarketRangeOrder(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid)
Example 2
ExecuteMarketRangeOrder(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel");
api.ExecuteMarketRangeOrder(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, "myLabel")
ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, double? stopLossPips, double? takeProfitPips)
Execute a Market Order
public TradeResult ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, double? stopLossPips, double? takeProfitPips)
api.ExecuteMarketRangeOrder(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLossPips: float | None, takeProfitPips: float | 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 |
marketRangePips | double | float | The market range (slippage) in Pips |
basePrice | double | float | Base price to calculate relative slippage price |
label | string | str | Representing label |
stopLossPips | double? | float | None | Stop loss in pips |
takeProfitPips | double? | float | None | Take profit in pips |
Returns TradeResult — Trade Result
Examples
Example 1
ExecuteMarketRangeOrder(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid);
api.ExecuteMarketRangeOrder(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid)
Example 2
ExecuteMarketRangeOrder(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel");
api.ExecuteMarketRangeOrder(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, "myLabel")
Example 3
ExecuteMarketRangeOrder(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel", 10, 20);
api.ExecuteMarketRangeOrder(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, "myLabel", 10, 20)
ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits)
Execute a Market Order
public TradeResult ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits)
api.ExecuteMarketRangeOrder(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: 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 |
marketRangePips | double | float | The market range (slippage) in Pips |
basePrice | double | float | Base price to calculate relative slippage price |
label | string | str | Representing label |
stopLoss | RelativeStopLossProtection | RelativeStopLossProtection | Relative Stop loss |
takeProfits | RelativeTakeProfitProtections | RelativeTakeProfitProtections | Relative Take profits |
Returns TradeResult — Trade Result
Examples
Example 1
ExecuteMarketRangeOrder(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid);
api.ExecuteMarketRangeOrder(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid)
Example 2
ExecuteMarketRangeOrder(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel");
api.ExecuteMarketRangeOrder(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, "myLabel")
Example 3
ExecuteMarketRangeOrder(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)));
api.ExecuteMarketRangeOrder(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)))
ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, StopLossBreakEven stopLossBreakEven)
Execute a Market Order
public TradeResult ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, StopLossBreakEven stopLossBreakEven)
api.ExecuteMarketRangeOrder(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: 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 |
marketRangePips | double | float | The market range (slippage) in Pips |
basePrice | double | float | Base price to calculate relative slippage price |
label | string | str | Representing label |
stopLoss | RelativeStopLossProtection | RelativeStopLossProtection | Relative Stop loss |
takeProfits | RelativeTakeProfitProtections | RelativeTakeProfitProtections | Relative Take profits |
stopLossBreakEven | StopLossBreakEven | StopLossBreakEven | Break-even for position's StopLoss |
Returns TradeResult — Trade Result
Examples
ExecuteMarketRangeOrder(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));
api.ExecuteMarketRangeOrder(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))
ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, double? stopLossPips, double? takeProfitPips, string comment)
Execute a Market Order
public TradeResult ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, double? stopLossPips, double? takeProfitPips, string comment)
api.ExecuteMarketRangeOrder(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLossPips: float | None, takeProfitPips: float | 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 |
marketRangePips | double | float | The market range (slippage) in Pips |
basePrice | double | float | Base price to calculate relative slippage price |
label | string | str | Representing label |
stopLossPips | double? | float | None | Stop loss in pips |
takeProfitPips | double? | float | None | Take profit in pips |
comment | string | str | order comment |
Returns TradeResult — Trade Result
Examples
ExecuteMarketRangeOrder(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel", 10, 20, "order comment");
api.ExecuteMarketRangeOrder(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, "myLabel", 10, 20, "order comment")
ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment)
Execute a Market Order
public TradeResult ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment)
api.ExecuteMarketRangeOrder(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, 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 |
marketRangePips | double | float | The market range (slippage) in Pips |
basePrice | double | float | Base price to calculate relative slippage price |
label | string | str | Representing label |
stopLoss | RelativeStopLossProtection | RelativeStopLossProtection | Relative Stop loss |
takeProfits | RelativeTakeProfitProtections | RelativeTakeProfitProtections | Relative Take profits |
comment | string | str | order comment |
Returns TradeResult — Trade Result
Examples
ExecuteMarketRangeOrder(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");
api.ExecuteMarketRangeOrder(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), "order comment")
ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, StopLossBreakEven stopLossBreakEven)
Execute a Market Order
public TradeResult ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, StopLossBreakEven stopLossBreakEven)
api.ExecuteMarketRangeOrder(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, 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 |
marketRangePips | double | float | The market range (slippage) in Pips |
basePrice | double | float | Base price to calculate relative slippage price |
label | string | str | Representing label |
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 |
Returns TradeResult — Trade Result
Examples
ExecuteMarketRangeOrder(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));
api.ExecuteMarketRangeOrder(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))
ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, double? stopLossPips, double? takeProfitPips, string comment, bool hasTrailingStop)
Execute a Market Order
public TradeResult ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, double? stopLossPips, double? takeProfitPips, string comment, bool hasTrailingStop)
api.ExecuteMarketRangeOrder(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLossPips: float | None, takeProfitPips: float | 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 |
marketRangePips | double | float | The market range (slippage) in Pips |
basePrice | double | float | Base price to calculate relative slippage price |
label | string | str | Representing label |
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 |
Returns TradeResult — Trade Result
Examples
ExecuteMarketRangeOrder(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel", 10, 20, "order comment", true);
api.ExecuteMarketRangeOrder(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, "myLabel", 10, 20, "order comment", True)
ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, bool hasTrailingStop)
Execute a Market Order
public TradeResult ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, bool hasTrailingStop)
api.ExecuteMarketRangeOrder(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, 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 |
marketRangePips | double | float | The market range (slippage) in Pips |
basePrice | double | float | Base price to calculate relative slippage price |
label | string | str | Representing label |
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 |
Returns TradeResult — Trade Result
Examples
ExecuteMarketRangeOrder(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);
api.ExecuteMarketRangeOrder(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)
ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, bool hasTrailingStop, StopLossBreakEven stopLossBreakEven)
Execute a Market Order
public TradeResult ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, bool hasTrailingStop, StopLossBreakEven stopLossBreakEven)
api.ExecuteMarketRangeOrder(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, 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 |
marketRangePips | double | float | The market range (slippage) in Pips |
basePrice | double | float | Base price to calculate relative slippage price |
label | string | str | Representing label |
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 |
Returns TradeResult — Trade Result
Examples
ExecuteMarketRangeOrder(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));
api.ExecuteMarketRangeOrder(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))
ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, double? stopLossPips, double? takeProfitPips, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod)
Execute a Market Order
public TradeResult ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, double? stopLossPips, double? takeProfitPips, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod)
api.ExecuteMarketRangeOrder(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) -> 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 |
marketRangePips | double | float | The market range (slippage) in Pips |
basePrice | double | float | Base price to calculate relative slippage price |
label | string | str | Representing label |
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 |
Returns TradeResult — Trade Result
Examples
ExecuteMarketRangeOrder(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel", 10, 20, "order comment", true, StopTriggerMethod.Trade);
api.ExecuteMarketRangeOrder(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, "myLabel", 10, 20, "order comment", True, StopTriggerMethod.Trade)
ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod)
Execute a Market Order
public TradeResult ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod)
api.ExecuteMarketRangeOrder(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, 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 |
marketRangePips | double | float | The market range (slippage) in Pips |
basePrice | double | float | Base price to calculate relative slippage price |
label | string | str | Representing label |
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 |
Returns TradeResult — Trade Result
Examples
ExecuteMarketRangeOrder(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);
api.ExecuteMarketRangeOrder(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)
ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopLossBreakEven stopLossBreakEven)
Execute a Market Order
public TradeResult ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, bool hasTrailingStop, StopTriggerMethod? stopLossTriggerMethod, StopLossBreakEven stopLossBreakEven)
api.ExecuteMarketRangeOrder(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) -> 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 |
marketRangePips | double | float | The market range (slippage) in Pips |
basePrice | double | float | Base price to calculate relative slippage price |
label | string | str | Representing label |
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 |
Returns TradeResult — Trade Result
Examples
ExecuteMarketRangeOrder(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));
api.ExecuteMarketRangeOrder(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))