---
id: "M:cAlgo.API.Internals.Symbol.AmountRisked(System.Double,System.Double)"
kind: "method"
type: "T:cAlgo.API.Internals.Symbol"
url: "https://help.ctrader.com/ctrader-algo/references/MarketData/Symbols/Symbol/AmountRisked/"
---

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

# Symbol.AmountRisked

Member of [Symbol](https://help.ctrader.com/ctrader-algo/references/MarketData/Symbols/Symbol/index.md).

## AmountRisked(double volume, double stopLossInPips)

Calculates the amount to be risked based on the specified stop loss and trading volume. Note that the result of this calculation may be imprecise as the exact degree of risk always depends on market movement and is impossible to predict.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
double AmountRisked(double volume, double stopLossInPips)
```

Python:

```python
api.Symbol.AmountRisked(volume: float, stopLossInPips: float) -> float
```

### Parameters

- `volume` (`double`, Python `float`): The volume to be traded
- `stopLossInPips` (`double`, Python `float`): The stop loss in pips.

### Returns

`double` — The calculated volume in units.

### Examples

C#:

```csharp
using cAlgo.API;

namespace cAlgo.Robots;

public partial class TestExample : Robot
{
    protected override void OnStart()
    {
        var stopLossInPips = 50;
        var tradeVolume = Symbol.VolumeInUnitsMin;
        var amountRisked = Symbol.AmountRisked(tradeVolume, stopLossInPips);

        Print($"If you trade {tradeVolume} with a StopLoss of {stopLossInPips} pips you will risk losing {amountRisked} {Account.Asset.Name}");
    }
}
```

Python:

```python
import clr

clr.AddReference("cAlgo.API")

# Import cAlgo API types
from cAlgo.API import *

# Import trading wrapper functions
from robot_wrapper import *

class Test():
    def on_start(self):
        stopLossInPips = 50
        tradeVolume = api.Symbol.VolumeInUnitsMin
        amountRisked = api.Symbol.AmountRisked(tradeVolume, stopLossInPips)
        print(f"If you trade {tradeVolume} with a StopLoss of {stopLossInPips} pips you will risk losing {amountRisked} {api.Account.Asset.Name}")
```

config.json:

```json
{
  "AccessRights": "None"
}
```

