SWAP calculation during Backtest
Created at 16 Jan 2021, 13:43
UW
SWAP calculation during Backtest
16 Jan 2021, 13:43
As we see a column named SWAp ind History Window of realtime trades, I would suggest the same column in Backtest History window.
Since the information of accumulated swap is essential for backtest analysis. I checked that the backtest is calculated and taken into account of the "Gross" result column. But the "Net" column only takes care of the commissions, I think this is realy missleading and confusing.
cTrader Automate
@uwescheffold
lukas.ourada
19 Jan 2021, 12:25
Hi, I needed something similar. I don't know why it can't be automated in the cTrader API, but I think the broker probably changes these rates and they are not in the historical data between Ticks. I solved temporarily by creating my own configurable parameter swapLong , swapShort and to OnTimer () write this code:
it calculates the total swap which you set in the parameters according to your broker (its in cTrader/trade/ panel symbol details) and writes it to the console. At the same time, it is also in the SwapTotal variable, so you can use it to get the actual real account equity and balance by subtraction it.
maybe it will help
Sorry for my bad english :-)
Lukas
@lukas.ourada