Keep track of the balances of each asset, at different points in time. On this page: Balance, Begin Balance, and End Balance.

Balances are the basis of the account-keeping features, by which you may know exactly how much of each asset there is on the account at any given point in time.

The system keeps track of balances in multiple contexts, but also saves snapshots of what the balance was at key moments in time, so that such information may be available both to study the results of operations, and so that it may be used form within trading strategies.

It is important to understand that balances are an internal concept managed by the trading engine, and are calculated based on the information processed by the trading bot. Balances do not necessarily reflect the actual amount of assets at the exchange.

Balance

Balance is the running balance, that is, the amount of the asset that exists at any point in time.

The balance of an asset changes every time an order involving the asset is filled. When the trading bot consults the exchange to find out the status of each order placed, the exchange answers with the size filled and actual rate for the order. That is the information used to calculate balances.

Begin Balance

Begin balance is the balance at the datetime of the begin property of the parent node or concept.

In the context of an episode, it is the balance at the datetime the episode started.

In the context of a position, it is the balance at the datetime the position started.

End Balance

End balance is the balance at the datetime of the end property of the parent node or concept.

In the context of an episode, it is the balance at the datetime the episode ended.

In the context of a position, it is the balance at the datetime the position was closed.