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

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

# Plugin.PlaceStopOrder

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

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

```csharp
public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice)
```

Python:

```python
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: 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
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order

### Returns

`TradeResult` — Trade Result

### Examples

C#:

```csharp
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask);
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask)
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

```csharp
public TradeResult PlaceStopOrder(TradeType tradeType, string symbolName, double volume, double targetPrice, string label)
```

Python:

```python
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: 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
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `label` (`string`, Python `str`): Representing label

### Returns

`TradeResult` — Trade Result

### Examples

C#:

```csharp
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel");
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel")
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

```python
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: float | None, takeProfit: float | None, protectionType: ProtectionType | 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
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`double?`, Python `float | None`): Stop loss
- `takeProfit` (`double?`, Python `float | None`): Take profit
- `protectionType` (`ProtectionType?`, Python `ProtectionType | None`): Protection type

### Returns

`TradeResult` — Trade Result

Available since cAlgo.API 5.1.

### Examples

C#:

```csharp
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", 10, 20, ProtectionType.Relative);
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", 10, 20, ProtectionType.Relative)
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

```python
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: 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
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `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
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)));
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)))
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

```python
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: 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
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `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
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), new StopLossBreakEven(15, 3));
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), StopLossBreakEven(15, 3))
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

```python
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections) -> 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
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`AbsoluteStopLossProtection`, Python `AbsoluteStopLossProtection`): Absolute Stop loss
- `takeProfits` (`AbsoluteTakeProfitProtections`, Python `AbsoluteTakeProfitProtections`): Absolute Take profits

### Returns

`TradeResult` — Trade Result

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)));
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)))
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

```python
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections, 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
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`AbsoluteStopLossProtection`, Python `AbsoluteStopLossProtection`): Absolute Stop loss
- `takeProfits` (`AbsoluteTakeProfitProtections`, Python `AbsoluteTakeProfitProtections`): Absolute 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
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), new StopLossBreakEven(15, 3));
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), StopLossBreakEven(15, 3))
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

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

### Parameters

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

### Returns

`TradeResult` — Trade Result

Available since cAlgo.API 5.1.

### Examples

C#:

```csharp
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", 10, 20, ProtectionType.Relative, Server.Time.AddDays(1));
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", 10, 20, ProtectionType.Relative, api.Server.Time.AddDays(1))
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

```python
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, expiration: DateTime | 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
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`RelativeStopLossProtection`, Python `RelativeStopLossProtection`): Relative Stop loss
- `takeProfits` (`RelativeTakeProfitProtections`, Python `RelativeTakeProfitProtections`): Relative Take profits
- `expiration` (`DateTime?`, Python `DateTime | None`): Order expiry time

### Returns

`TradeResult` — Trade Result

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1));
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1))
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

```python
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, expiration: DateTime | 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
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`RelativeStopLossProtection`, Python `RelativeStopLossProtection`): Relative Stop loss
- `takeProfits` (`RelativeTakeProfitProtections`, Python `RelativeTakeProfitProtections`): Relative Take profits
- `expiration` (`DateTime?`, Python `DateTime | None`): Order expiry time
- `stopLossBreakEven` (`StopLossBreakEven`, Python `StopLossBreakEven`): Break-even for position's StopLoss

### Returns

`TradeResult` — Trade Result

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1), new StopLossBreakEven(15, 3));
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), StopLossBreakEven(15, 3))
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

```python
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections, expiration: DateTime | 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
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`AbsoluteStopLossProtection`, Python `AbsoluteStopLossProtection`): Absolute Stop loss
- `takeProfits` (`AbsoluteTakeProfitProtections`, Python `AbsoluteTakeProfitProtections`): Absolute Take profits
- `expiration` (`DateTime?`, Python `DateTime | None`): Order expiry time

### Returns

`TradeResult` — Trade Result

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1));
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1))
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

```python
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections, expiration: DateTime | 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
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`AbsoluteStopLossProtection`, Python `AbsoluteStopLossProtection`): Absolute Stop loss
- `takeProfits` (`AbsoluteTakeProfitProtections`, Python `AbsoluteTakeProfitProtections`): Absolute Take profits
- `expiration` (`DateTime?`, Python `DateTime | None`): Order expiry time
- `stopLossBreakEven` (`StopLossBreakEven`, Python `StopLossBreakEven`): Break-even for position's StopLoss

### Returns

`TradeResult` — Trade Result

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1), new StopLossBreakEven(15, 3));
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), StopLossBreakEven(15, 3))
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

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

### Parameters

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

### Returns

`TradeResult` — Trade Result

Available since cAlgo.API 5.1.

### Examples

C#:

```csharp
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", 10, 20, ProtectionType.Relative, Server.Time.AddDays(1), "order comment");
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", 10, 20, ProtectionType.Relative, api.Server.Time.AddDays(1), "order comment")
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

```python
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: RelativeStopLossProtection, takeProfits: RelativeTakeProfitProtections, expiration: DateTime | 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
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`RelativeStopLossProtection`, Python `RelativeStopLossProtection`): Relative Stop loss
- `takeProfits` (`RelativeTakeProfitProtections`, Python `RelativeTakeProfitProtections`): Relative Take profits
- `expiration` (`DateTime?`, Python `DateTime | None`): Order expiry time
- `comment` (`string`, Python `str`): Order comment

### Returns

`TradeResult` — Trade Result

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1), "order comment");
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment")
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

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

### Parameters

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`RelativeStopLossProtection`, Python `RelativeStopLossProtection`): Relative Stop loss
- `takeProfits` (`RelativeTakeProfitProtections`, Python `RelativeTakeProfitProtections`): Relative Take profits
- `expiration` (`DateTime?`, Python `DateTime | None`): Order expiry time
- `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
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1), "order comment", new StopLossBreakEven(15, 3));
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment", StopLossBreakEven(15, 3))
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

```python
api.PlaceStopOrder(tradeType: TradeType, symbolName: str, volume: float, targetPrice: float, label: str, stopLoss: AbsoluteStopLossProtection, takeProfits: AbsoluteTakeProfitProtections, expiration: DateTime | 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
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`AbsoluteStopLossProtection`, Python `AbsoluteStopLossProtection`): Absolute Stop loss
- `takeProfits` (`AbsoluteTakeProfitProtections`, Python `AbsoluteTakeProfitProtections`): Absolute Take profits
- `expiration` (`DateTime?`, Python `DateTime | None`): Order expiry time
- `comment` (`string`, Python `str`): Order comment

### Returns

`TradeResult` — Trade Result

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1), "order comment");
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), "order comment")
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

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

### Parameters

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`AbsoluteStopLossProtection`, Python `AbsoluteStopLossProtection`): Absolute Stop loss
- `takeProfits` (`AbsoluteTakeProfitProtections`, Python `AbsoluteTakeProfitProtections`): Absolute Take profits
- `expiration` (`DateTime?`, Python `DateTime | None`): Order expiry time
- `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
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1), "order comment", new StopLossBreakEven(15, 3));
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), "order comment", StopLossBreakEven(15, 3))
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

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

### Parameters

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

### Returns

`TradeResult` — Trade Result

Available since cAlgo.API 5.1.

### Examples

C#:

```csharp
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", 10, 20, ProtectionType.Relative, Server.Time.AddDays(1), "order comment", true);
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", 10, 20, ProtectionType.Relative, api.Server.Time.AddDays(1), "order comment", True)
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

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

### Parameters

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`RelativeStopLossProtection`, Python `RelativeStopLossProtection`): Relative Stop loss
- `takeProfits` (`RelativeTakeProfitProtections`, Python `RelativeTakeProfitProtections`): Relative Take profits
- `expiration` (`DateTime?`, Python `DateTime | None`): Order expiry time
- `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
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1), "order comment", true);
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment", True)
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

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

### Parameters

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`RelativeStopLossProtection`, Python `RelativeStopLossProtection`): Relative Stop loss
- `takeProfits` (`RelativeTakeProfitProtections`, Python `RelativeTakeProfitProtections`): Relative Take profits
- `expiration` (`DateTime?`, Python `DateTime | None`): Order expiry time
- `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
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1), "order comment", true, new StopLossBreakEven(15, 3));
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment", True, StopLossBreakEven(15, 3))
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

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

### Parameters

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`AbsoluteStopLossProtection`, Python `AbsoluteStopLossProtection`): Absolute Stop loss
- `takeProfits` (`AbsoluteTakeProfitProtections`, Python `AbsoluteTakeProfitProtections`): Absolute Take profits
- `expiration` (`DateTime?`, Python `DateTime | None`): Order expiry time
- `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
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1), "order comment", true);
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), "order comment", True)
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

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

### Parameters

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`AbsoluteStopLossProtection`, Python `AbsoluteStopLossProtection`): Absolute Stop loss
- `takeProfits` (`AbsoluteTakeProfitProtections`, Python `AbsoluteTakeProfitProtections`): Absolute Take profits
- `expiration` (`DateTime?`, Python `DateTime | None`): Order expiry time
- `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
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1), "order comment", true, new StopLossBreakEven(15, 3));
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), "order comment", True, StopLossBreakEven(15, 3))
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

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

### Parameters

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`double?`, Python `float | None`): Stop loss
- `takeProfit` (`double?`, Python `float | None`): Take profit
- `protectionType` (`ProtectionType?`, Python `ProtectionType | None`): Protection type
- `expiration` (`DateTime?`, Python `DateTime | None`): Order expiry time
- `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.1.

### Examples

C#:

```csharp
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", 10, 20, ProtectionType.Relative, Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade);
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", 10, 20, ProtectionType.Relative, api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade)
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

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

### Parameters

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`RelativeStopLossProtection`, Python `RelativeStopLossProtection`): Relative Stop loss
- `takeProfits` (`RelativeTakeProfitProtections`, Python `RelativeTakeProfitProtections`): Relative Take profits
- `expiration` (`DateTime?`, Python `DateTime | None`): Order expiry time
- `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
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade);
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade)
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

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

### Parameters

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`RelativeStopLossProtection`, Python `RelativeStopLossProtection`): Relative Stop loss
- `takeProfits` (`RelativeTakeProfitProtections`, Python `RelativeTakeProfitProtections`): Relative Take profits
- `expiration` (`DateTime?`, Python `DateTime | None`): Order expiry time
- `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
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade, new StopLossBreakEven(15, 3));
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade, StopLossBreakEven(15, 3))
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

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

### Parameters

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`AbsoluteStopLossProtection`, Python `AbsoluteStopLossProtection`): Absolute Stop loss
- `takeProfits` (`AbsoluteTakeProfitProtections`, Python `AbsoluteTakeProfitProtections`): Absolute Take profits
- `expiration` (`DateTime?`, Python `DateTime | None`): Order expiry time
- `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
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade);
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade)
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

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

### Parameters

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`AbsoluteStopLossProtection`, Python `AbsoluteStopLossProtection`): Absolute Stop loss
- `takeProfits` (`AbsoluteTakeProfitProtections`, Python `AbsoluteTakeProfitProtections`): Absolute Take profits
- `expiration` (`DateTime?`, Python `DateTime | None`): Order expiry time
- `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
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade, new StopLossBreakEven(15, 3));
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade, StopLossBreakEven(15, 3))
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

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

### Parameters

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`double?`, Python `float | None`): Stop loss
- `takeProfit` (`double?`, Python `float | None`): Take profit
- `protectionType` (`ProtectionType?`, Python `ProtectionType | None`): Protection type
- `expiration` (`DateTime?`, Python `DateTime | None`): Order expiry time
- `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
- `stopOrderTriggerMethod` (`StopTriggerMethod`, Python `StopTriggerMethod`): Determines how pending order will be triggered in case it is a StopOrder

### Returns

`TradeResult` — Trade Result

Available since cAlgo.API 5.1.

### Examples

C#:

```csharp
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", 10, 20, ProtectionType.Relative, Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade, StopTriggerMethod.Trade);
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", 10, 20, ProtectionType.Relative, api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade, StopTriggerMethod.Trade)
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

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

### Parameters

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`RelativeStopLossProtection`, Python `RelativeStopLossProtection`): Relative Stop loss
- `takeProfits` (`RelativeTakeProfitProtections`, Python `RelativeTakeProfitProtections`): Relative Take profits
- `expiration` (`DateTime?`, Python `DateTime | None`): Order expiry time
- `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
- `stopOrderTriggerMethod` (`StopTriggerMethod`, Python `StopTriggerMethod`): Determines how pending order will be triggered in case it is a StopOrder

### Returns

`TradeResult` — Trade Result

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade, StopTriggerMethod.Trade);
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade, StopTriggerMethod.Trade)
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

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

### Parameters

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`RelativeStopLossProtection`, Python `RelativeStopLossProtection`): Relative Stop loss
- `takeProfits` (`RelativeTakeProfitProtections`, Python `RelativeTakeProfitProtections`): Relative Take profits
- `expiration` (`DateTime?`, Python `DateTime | None`): Order expiry time
- `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
- `stopOrderTriggerMethod` (`StopTriggerMethod`, Python `StopTriggerMethod`): Determines how pending order will be triggered in case it is a StopOrder
- `stopLossBreakEven` (`StopLossBreakEven`, Python `StopLossBreakEven`): Break-even for position's StopLoss

### Returns

`TradeResult` — Trade Result

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new RelativeStopLossProtection(10), new RelativeTakeProfitProtections(new RelativeTakeProfitProtection(1000, 10), new RelativeTakeProfitProtection(2000, 20), new RelativeTakeProfitLastProtection(30)), Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade, StopTriggerMethod.Trade, new StopLossBreakEven(15, 3));
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", RelativeStopLossProtection(10), RelativeTakeProfitProtections(RelativeTakeProfitProtection(1000, 10), RelativeTakeProfitProtection(2000, 20), RelativeTakeProfitLastProtection(30)), api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade, StopTriggerMethod.Trade, StopLossBreakEven(15, 3))
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

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

### Parameters

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`AbsoluteStopLossProtection`, Python `AbsoluteStopLossProtection`): Absolute Stop loss
- `takeProfits` (`AbsoluteTakeProfitProtections`, Python `AbsoluteTakeProfitProtections`): Absolute Take profits
- `expiration` (`DateTime?`, Python `DateTime | None`): Order expiry time
- `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
- `stopOrderTriggerMethod` (`StopTriggerMethod`, Python `StopTriggerMethod`): Determines how pending order will be triggered in case it is a StopOrder

### Returns

`TradeResult` — Trade Result

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade, StopTriggerMethod.Trade);
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade, StopTriggerMethod.Trade)
```

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

Place a stop order

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Plugins cannot run in the CLI: ctrader-cli runs cBots only.
- Cloud: Plugins cannot run in the cloud: it runs cBots only.

C#:

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

Python:

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

### Parameters

- `tradeType` (`TradeType`, Python `TradeType`): Direction of trade
- `symbolName` (`string`, Python `str`): Symbol name of trade
- `volume` (`double`, Python `float`): Volume (in units) of trade
- `targetPrice` (`double`, Python `float`): Price at which order becomes a market order
- `label` (`string`, Python `str`): Representing label
- `stopLoss` (`AbsoluteStopLossProtection`, Python `AbsoluteStopLossProtection`): Absolute Stop loss
- `takeProfits` (`AbsoluteTakeProfitProtections`, Python `AbsoluteTakeProfitProtections`): Absolute Take profits
- `expiration` (`DateTime?`, Python `DateTime | None`): Order expiry time
- `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
- `stopOrderTriggerMethod` (`StopTriggerMethod`, Python `StopTriggerMethod`): Determines how pending order will be triggered in case it is a StopOrder
- `stopLossBreakEven` (`StopLossBreakEven`, Python `StopLossBreakEven`): Break-even for position's StopLoss

### Returns

`TradeResult` — Trade Result

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, Symbols.GetSymbol("EURUSD").Ask, "myLabel", new AbsoluteStopLossProtection(1.0), new AbsoluteTakeProfitProtections(new AbsoluteTakeProfitProtection(1000, 1.05), new AbsoluteTakeProfitProtection(2000, 1.06), new AbsoluteTakeProfitLastProtection(1.07)), Server.Time.AddDays(1), "order comment", true, StopTriggerMethod.Trade, StopTriggerMethod.Trade, new StopLossBreakEven(15, 3));
```

Python:

```python
api.PlaceStopOrder(TradeType.Buy, "EURUSD", 10000, api.Symbols.GetSymbol("EURUSD").Ask, "myLabel", AbsoluteStopLossProtection(1.0), AbsoluteTakeProfitProtections(AbsoluteTakeProfitProtection(1000, 1.05), AbsoluteTakeProfitProtection(2000, 1.06), AbsoluteTakeProfitLastProtection(1.07)), api.Server.Time.AddDays(1), "order comment", True, StopTriggerMethod.Trade, StopTriggerMethod.Trade, StopLossBreakEven(15, 3))
```

