---
id: "M:cAlgo.API.RelativeStopLossProtection.#ctor(System.Double)"
kind: "constructor"
type: "T:cAlgo.API.RelativeStopLossProtection"
url: "https://help.ctrader.com/ctrader-algo/references/Trading/RelativeStopLossProtection/Constructor/"
---

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

# RelativeStopLossProtection constructor

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

## RelativeStopLossProtection(double Distance)

Represents a stop loss defined as a distance (in pips) from the order's entry price.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public RelativeStopLossProtection(double Distance)
```

Python:

```python
RelativeStopLossProtection(Distance: float)
```

### Parameters

- `Distance` (`double`, Python `float`): The stop loss distance, in pips, from the order's entry price.

Available since cAlgo.API 5.8.

### Examples

C#:

```csharp
var takeProfits = new RelativeTakeProfitProtections(new RelativeTakeProfitLastProtection(40));
var result = ExecuteMarketOrder(TradeType.Buy, SymbolName, 10000, "myLabel", new RelativeStopLossProtection(20), takeProfits);
if (result.IsSuccessful)
    Print("Stop loss price: {0}", result.Position.StopLoss);
```

Python:

```python
takeProfits = RelativeTakeProfitProtections(RelativeTakeProfitLastProtection(40))
result = api.ExecuteMarketOrder(TradeType.Buy, api.SymbolName, 10000, "myLabel", RelativeStopLossProtection(20), takeProfits)
if result.IsSuccessful:
    api.Print(f"Stop loss price: {result.Position.StopLoss}")
```

## RelativeStopLossProtection(RelativeStopLossProtection original)



Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
public RelativeStopLossProtection(RelativeStopLossProtection original)
```

Python:

```python
RelativeStopLossProtection(original: RelativeStopLossProtection)
```

### Parameters

- `original` (`RelativeStopLossProtection`, Python `RelativeStopLossProtection`):

Available since cAlgo.API 5.8.

