Margin Estimations¶
In cTrader Windows 4.5, we have added estimated margin calculations to the Algo API. In other words, you can now use a method to check how much of your margin will be used by a new position or an order.
How Margin Estimations Work¶
To calculate estimated margin, call the Symbol.GetEstimatedMargin()
method and pass the required arguments, namely the trade type (either buy or sell) and the order volume.
1 2 3 4 |
|
As GetEstimatedMargin()
is an interface method, you can use it with any Symbol
/ SymbolInfo
objects as shown below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
|
Note
During backtesting/optimisation, the GetEstimatedMargin()
method will return the estimated margin without taking account exposure into consideration.