---
id: "P:cAlgo.API.Position.HasTrailingStop"
kind: "property"
type: "T:cAlgo.API.Position"
url: "https://help.ctrader.com/ctrader-algo/references/Trading/Positions/Position/HasTrailingStop/"
---

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

# Position.HasTrailingStop

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

## HasTrailingStop

When HasTrailingStop set to true, the server updates the Stop Loss every time the position moves in your favor.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
bool HasTrailingStop {get;}
```

Python:

```python
position.HasTrailingStop: bool
```

### Returns

`bool` — 

### Examples

C#:

```csharp
var result = ExecuteMarketOrder(TradeType.Buy, SymbolName, 10000, "myLabel", 20, 40, "Trailing", true);
if (result.IsSuccessful)
    Print("Position has trailing stop: {0}", result.Position.HasTrailingStop);
```

Python:

```python
result = api.ExecuteMarketOrder(TradeType.Buy, api.SymbolName, 10000, "myLabel", 20, 40, "Trailing", True)
if result.IsSuccessful:
    api.Print(f"Position has trailing stop: {result.Position.HasTrailingStop}")
```

