Monte Carlo – Randomize SWAP of every trade
A SWAP is the interest fee or credit that is applied to a trader’s account when they hold a position overnight in forex or CFD trading. This fee is determined by the interest rate differential between the two currencies in a forex pair or the cost of maintaining a position in CFDs. It can be either positive (a credit) or negative (a debit) depending on the direction of the trade and the interest rate differential.
If we apply this Monte Carlo test, each trade during the backtest will contain swap values that are randomly generated within the range [-Range,Range].Simply said, by doing 500 (or a different number) backtests with randomly generated swaps for every trade, you can acquire a Monte Carlo analysis perspective on the altering of the Swaps.
In this particular example, we have run 100 simulations with randomised SWAP for every trade.
This test differs from the previous one in that it randomizes each trade in the current backtest. The initial trade may involve a positive long swap and a negative short swap, while the subsequent trades may have swap combinations that are entirely distinct. Therefore, this test implements a random swap for each trade. If the number of Monte Varlo simulations is set to 500, there will be 500 existing backtests, each of which has a unique swap.
How to import custom indicators to SQX:
- https://strategyquant.com/doc/programming-for-sq/import-export-custom-indicators-and-other-snippets/
Thank you Ivan !