---
id: "M:cAlgo.API.Indicator.ExecuteMarketRangeOrder(cAlgo.API.TradeType,System.String,System.Double,System.Double,System.Double)"
kind: "method"
type: "T:cAlgo.API.Indicator"
url: "https://help.ctrader.com/ctrader-algo/references/General/Indicator/ExecuteMarketRangeOrder/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# Indicator.ExecuteMarketRangeOrder

Member of [Indicator](https://help.ctrader.com/ctrader-algo/references/General/Indicator/index.md).

## ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice)

Execute a Market Order

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public TradeResult ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice)
```

Python:

```python
api.ExecuteMarketRangeOrder(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float) -> TradeResult
```

### Parameters

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `marketRangePips` (`double`, Python `float`): The market range (slippage) in Pips
- `basePrice` (`double`, Python `float`): Base price to calculate relative slippage price

### Returns

`TradeResult` — Trade Result

### Examples

C#:

```csharp
ExecuteMarketRangeOrder(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid);
```

Python:

```python
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

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public TradeResult ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label)
```

Python:

```python
api.ExecuteMarketRangeOrder(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str) -> TradeResult
```

### Parameters

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `marketRangePips` (`double`, Python `float`): The market range (slippage) in Pips
- `basePrice` (`double`, Python `float`): Base price to calculate relative slippage price
- `label` (`string`, Python `str`): Representing label

### Returns

`TradeResult` — Trade Result

### Examples

C#:

```csharp
ExecuteMarketRangeOrder(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid);
```

Python:

```python
api.ExecuteMarketRangeOrder(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid)
```

C#:

```csharp
ExecuteMarketRangeOrder(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel");
```

Python:

```python
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

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public TradeResult ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, double? stopLossPips, double? takeProfitPips)
```

Python:

```python
api.ExecuteMarketRangeOrder(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLossPips: float | None, takeProfitPips: float | None) -> TradeResult
```

### Parameters

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `marketRangePips` (`double`, Python `float`): The market range (slippage) in Pips
- `basePrice` (`double`, Python `float`): Base price to calculate relative slippage price
- `label` (`string`, Python `str`): Representing label
- `stopLossPips` (`double?`, Python `float | None`): Stop loss in pips
- `takeProfitPips` (`double?`, Python `float | None`): Take profit in pips

### Returns

`TradeResult` — Trade Result

### Examples

C#:

```csharp
ExecuteMarketRangeOrder(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid);
```

Python:

```python
api.ExecuteMarketRangeOrder(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid)
```

C#:

```csharp
ExecuteMarketRangeOrder(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel");
```

Python:

```python
api.ExecuteMarketRangeOrder(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, "myLabel")
```

C#:

```csharp
ExecuteMarketRangeOrder(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel", 10, 20);
```

Python:

```python
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

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public TradeResult ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits)
```

Python:

```python
api.ExecuteMarketRangeOrder(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections) -> TradeResult
```

### Parameters

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `marketRangePips` (`double`, Python `float`): The market range (slippage) in Pips
- `basePrice` (`double`, Python `float`): Base price to calculate relative slippage price
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`RelativeStopLossProtection`, Python `RelativeStopLossProtection`): Relative Stop loss
- `takeProfits` (`RelativeTakeProfitProtections`, Python `RelativeTakeProfitProtections`): Relative Take profits

### Returns

`TradeResult` — Trade Result

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
ExecuteMarketRangeOrder(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid);
```

Python:

```python
api.ExecuteMarketRangeOrder(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid)
```

C#:

```csharp
ExecuteMarketRangeOrder(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel");
```

Python:

```python
api.ExecuteMarketRangeOrder(TradeType.Buy, api.Symbol.Name, 10000, 2, api.Symbol.Bid, "myLabel")
```

C#:

```csharp
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)));
```

Python:

```python
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

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public TradeResult ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, StopLossBreakEven stopLossBreakEven)
```

Python:

```python
api.ExecuteMarketRangeOrder(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, stopLossBreakEven: StopLossBreakEven) -> TradeResult
```

### Parameters

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `marketRangePips` (`double`, Python `float`): The market range (slippage) in Pips
- `basePrice` (`double`, Python `float`): Base price to calculate relative slippage price
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`RelativeStopLossProtection`, Python `RelativeStopLossProtection`): Relative Stop loss
- `takeProfits` (`RelativeTakeProfitProtections`, Python `RelativeTakeProfitProtections`): Relative Take profits
- `stopLossBreakEven` (`StopLossBreakEven`, Python `StopLossBreakEven`): Break-even for position's StopLoss

### Returns

`TradeResult` — Trade Result

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
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));
```

Python:

```python
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

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public TradeResult ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, double? stopLossPips, double? takeProfitPips, string comment)
```

Python:

```python
api.ExecuteMarketRangeOrder(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLossPips: float | None, takeProfitPips: float | None, comment: str) -> TradeResult
```

### Parameters

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `marketRangePips` (`double`, Python `float`): The market range (slippage) in Pips
- `basePrice` (`double`, Python `float`): Base price to calculate relative slippage price
- `label` (`string`, Python `str`): Representing label
- `stopLossPips` (`double?`, Python `float | None`): Stop loss in pips
- `takeProfitPips` (`double?`, Python `float | None`): Take profit in pips
- `comment` (`string`, Python `str`): order comment

### Returns

`TradeResult` — Trade Result

### Examples

C#:

```csharp
ExecuteMarketRangeOrder(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel", 10, 20, "order comment");
```

Python:

```python
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

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public TradeResult ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment)
```

Python:

```python
api.ExecuteMarketRangeOrder(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, comment: str) -> TradeResult
```

### Parameters

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `marketRangePips` (`double`, Python `float`): The market range (slippage) in Pips
- `basePrice` (`double`, Python `float`): Base price to calculate relative slippage price
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`RelativeStopLossProtection`, Python `RelativeStopLossProtection`): Relative Stop loss
- `takeProfits` (`RelativeTakeProfitProtections`, Python `RelativeTakeProfitProtections`): Relative Take profits
- `comment` (`string`, Python `str`): order comment

### Returns

`TradeResult` — Trade Result

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
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");
```

Python:

```python
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

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public TradeResult ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, StopLossBreakEven stopLossBreakEven)
```

Python:

```python
api.ExecuteMarketRangeOrder(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, comment: str, stopLossBreakEven: StopLossBreakEven) -> TradeResult
```

### Parameters

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `marketRangePips` (`double`, Python `float`): The market range (slippage) in Pips
- `basePrice` (`double`, Python `float`): Base price to calculate relative slippage price
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`RelativeStopLossProtection`, Python `RelativeStopLossProtection`): Relative Stop loss
- `takeProfits` (`RelativeTakeProfitProtections`, Python `RelativeTakeProfitProtections`): Relative Take profits
- `comment` (`string`, Python `str`): order comment
- `stopLossBreakEven` (`StopLossBreakEven`, Python `StopLossBreakEven`): Break-even for position's StopLoss

### Returns

`TradeResult` — Trade Result

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
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));
```

Python:

```python
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

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public TradeResult ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, double? stopLossPips, double? takeProfitPips, string comment, bool hasTrailingStop)
```

Python:

```python
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

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `marketRangePips` (`double`, Python `float`): The market range (slippage) in Pips
- `basePrice` (`double`, Python `float`): Base price to calculate relative slippage price
- `label` (`string`, Python `str`): Representing label
- `stopLossPips` (`double?`, Python `float | None`): Stop loss in pips
- `takeProfitPips` (`double?`, Python `float | None`): Take profit in pips
- `comment` (`string`, Python `str`): order comment
- `hasTrailingStop` (`bool`, Python `bool`): Enable/disable TrailingStop for position

### Returns

`TradeResult` — Trade Result

### Examples

C#:

```csharp
ExecuteMarketRangeOrder(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel", 10, 20, "order comment", true);
```

Python:

```python
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

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public TradeResult ExecuteMarketRangeOrder(TradeType tradeType, string symbolName, double volume, double marketRangePips, double basePrice, string label, RelativeStopLossProtection stopLoss, RelativeTakeProfitProtections takeProfits, string comment, bool hasTrailingStop)
```

Python:

```python
api.ExecuteMarketRangeOrder(tradeType: TradeType, symbolName: str, volume: float, marketRangePips: float, basePrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, comment: str, hasTrailingStop: bool) -> TradeResult
```

### Parameters

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `marketRangePips` (`double`, Python `float`): The market range (slippage) in Pips
- `basePrice` (`double`, Python `float`): Base price to calculate relative slippage price
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`RelativeStopLossProtection`, Python `RelativeStopLossProtection`): Relative Stop loss
- `takeProfits` (`RelativeTakeProfitProtections`, Python `RelativeTakeProfitProtections`): Relative Take profits
- `comment` (`string`, Python `str`): order comment
- `hasTrailingStop` (`bool`, Python `bool`): Enable/disable TrailingStop for position

### Returns

`TradeResult` — Trade Result

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
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);
```

Python:

```python
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

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
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)
```

Python:

```python
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

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `marketRangePips` (`double`, Python `float`): The market range (slippage) in Pips
- `basePrice` (`double`, Python `float`): Base price to calculate relative slippage price
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`RelativeStopLossProtection`, Python `RelativeStopLossProtection`): Relative Stop loss
- `takeProfits` (`RelativeTakeProfitProtections`, Python `RelativeTakeProfitProtections`): Relative Take profits
- `comment` (`string`, Python `str`): order comment
- `hasTrailingStop` (`bool`, Python `bool`): Enable/disable TrailingStop for position
- `stopLossBreakEven` (`StopLossBreakEven`, Python `StopLossBreakEven`): Break-even for position's StopLoss

### Returns

`TradeResult` — Trade Result

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
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));
```

Python:

```python
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

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
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)
```

Python:

```python
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

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `marketRangePips` (`double`, Python `float`): The market range (slippage) in Pips
- `basePrice` (`double`, Python `float`): Base price to calculate relative slippage price
- `label` (`string`, Python `str`): Representing label
- `stopLossPips` (`double?`, Python `float | None`): Stop loss in pips
- `takeProfitPips` (`double?`, Python `float | None`): Take profit in pips
- `comment` (`string`, Python `str`): order comment
- `hasTrailingStop` (`bool`, Python `bool`): Enable/disable TrailingStop for position
- `stopLossTriggerMethod` (`StopTriggerMethod?`, Python `StopTriggerMethod | None`): Trigger method for position's StopLoss

### Returns

`TradeResult` — Trade Result

### Examples

C#:

```csharp
ExecuteMarketRangeOrder(TradeType.Buy, Symbol.Name, 10000, 2, Symbol.Bid, "myLabel", 10, 20, "order comment", true, StopTriggerMethod.Trade);
```

Python:

```python
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

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
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)
```

Python:

```python
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

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `marketRangePips` (`double`, Python `float`): The market range (slippage) in Pips
- `basePrice` (`double`, Python `float`): Base price to calculate relative slippage price
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`RelativeStopLossProtection`, Python `RelativeStopLossProtection`): Relative Stop loss
- `takeProfits` (`RelativeTakeProfitProtections`, Python `RelativeTakeProfitProtections`): Relative Take profits
- `comment` (`string`, Python `str`): order comment
- `hasTrailingStop` (`bool`, Python `bool`): Enable/disable TrailingStop for position
- `stopLossTriggerMethod` (`StopTriggerMethod?`, Python `StopTriggerMethod | None`): Trigger method for position's StopLoss

### Returns

`TradeResult` — Trade Result

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
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);
```

Python:

```python
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

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
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)
```

Python:

```python
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

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `marketRangePips` (`double`, Python `float`): The market range (slippage) in Pips
- `basePrice` (`double`, Python `float`): Base price to calculate relative slippage price
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`RelativeStopLossProtection`, Python `RelativeStopLossProtection`): Relative Stop loss
- `takeProfits` (`RelativeTakeProfitProtections`, Python `RelativeTakeProfitProtections`): Relative Take profits
- `comment` (`string`, Python `str`): order comment
- `hasTrailingStop` (`bool`, Python `bool`): Enable/disable TrailingStop for position
- `stopLossTriggerMethod` (`StopTriggerMethod?`, Python `StopTriggerMethod | None`): Trigger method for position's StopLoss
- `stopLossBreakEven` (`StopLossBreakEven`, Python `StopLossBreakEven`): Break-even for position's StopLoss

### Returns

`TradeResult` — Trade Result

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
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));
```

Python:

```python
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))
```

