---
id: "T:cAlgo.API.Internals.TotalMarginCalculationType"
kind: "enum"
namespace: "cAlgo.API.Internals"
url: "https://help.ctrader.com/ctrader-algo/references/Account/TotalMarginCalculationType/"
---

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

# TotalMarginCalculationType (enum)

Defines types of total margin requirements per Symbol.

Environments: Desktop supported · CLI supported · Cloud supported.

## Definition

```csharp
public enum TotalMarginCalculationType
```

## Examples

C#:

```csharp
if (Account.TotalMarginCalculationType == TotalMarginCalculationType.Max)
    Print("Hedged positions only use the margin of the larger side");
else
    Print("Total margin calculation type: {0}", Account.TotalMarginCalculationType);
```

Python:

```python
if api.Account.TotalMarginCalculationType == TotalMarginCalculationType.Max:
    api.Print("Hedged positions only use the margin of the larger side")
else:
    api.Print(f"Total margin calculation type: {api.Account.TotalMarginCalculationType}")
```

## Values

- `TotalMarginCalculationType.Sum` — Total margin requirements per Symbol are equal to Sum of all margin requirements of all positions of that Symbol.
- `TotalMarginCalculationType.Max` — Total margin requirements per Symbol are equal to Max margin requirements from all Long and all Short Positions of that Symbol.
- `TotalMarginCalculationType.Net` — Total margin requirements per Symbol are equal to the difference between margin requirements of all Long and all Short Positions of that Symbol.

