---
id: "P:cAlgo.API.Internals.IAccount.Balance"
kind: "property"
type: "T:cAlgo.API.Internals.IAccount"
url: "https://help.ctrader.com/ctrader-algo/references/Account/IAccount/Balance/"
---

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

# IAccount.Balance

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

## Balance

Returns the balance of the current account.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
double Balance {get;}
```

Python:

```python
api.Account.Balance: float
```

### Returns

`double` — 

### Examples

C#:

```csharp
double balanceBefore;
double balanceAfter;

protected override void OnStart()
{
   // store the balance upon start up of the robot
   balanceBefore = Account.Balance;
}


protected override void OnStop()
{
    // Store the balance upon stop of the robot.
    balanceAfter = Account.Balance;
    // print the difference
	Print("The difference of balanceBefore and balanceAfter is: {0}", balanceBefore-balanceAfter);
}
```

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):
        # store the balance upon start up of the robot
        self.balanceBefore = api.Account.Balance

    def on_stop(self):
        # Store the balance upon stop of the robot.
        balanceAfter = api.Account.Balance
        # print the difference
        api.Print(f"The difference of balanceBefore and balanceAfter is: {self.balanceBefore-balanceAfter}")
```

C#:

```csharp
if ( Account.Balance <= 0 )
    Stop();
```

Python:

```python
if api.Account.Balance <= 0:
    api.Stop()
```

