Accurate Forex Trading Simulations Including Historically Accurate Swap Rates: Why interest is so important

A key limitation in most modern Forex back-testing software suites is the inability to conduct simulations that adequately address the issue of roll-over interest (also known commonly as “swaps”) for a trading system’s positions. Many consider the effect of swaps as “small” or negligible but this comes from a failure to understand that swap rates can not only influence the trading outcomes of the system (its total profit) but it can also heavily influence the reliability of back-testing results as a whole. Today I am going to talk a little bit about the problems of conducting “swap less” simulations along with some of the solutions we have developed at Asirikuy for this problem. In particular today I am going to share with you some results from our latest back-tester, which is able to simulate Forex pairs with historically accurate swap rates derived from true historical interest rate data.

First let us understand what swap rates are and how they can potentially affect our trading systems. When you buy a Forex pair, for example the EUR/USD, you are actually getting into two simultaneous individual currency positions. On one hand you have a EUR position and on the other you have a USD position. The holding of these two positions demands the payment of interest. If you go long on the EUR/USD you are entitles to receive interest on your EUR position (because this is what you’re holding) while you are required to pay interest on your USD position (because this is what you are staking to get EUR). In essence this means that you will be affected by the interest differential between the borrowing rate for EUR and the lending rate for USD. The net interest you actually make/pay will also depend on the volume you have traded and on the amount of time that you hold your position. Usually interest rates are quoted on a yearly basis, so the interest your position gets will be equal to ((EUR borrowing rate – USD lending rate)*(volume in lots)*(contract size  per standard lot in USD)*(time in years).

Since Forex positions are usually not held for that long and it’s impractical to pay interest on each second, Forex brokers have resorted to the crediting/debiting of  interest for each day on a given fixed time of the day (usually around the Asia open), for all open positions. Also to compensate for the fact that the market is closed on week-ends (but these days accumulate interest as well) swap rates are actually tripled on Wednesdays. The idea here is that someone holding a position for the long term will get the exact same interest as if it had been paid continuously. Obviously it has some inaccuracies, for example if you open a trade 2 minutes before interest is charged/credited you will get a change as if you had had your position open for a whole day (or even three days if you do this on Wednesday!) when in reality your position has only been open for a few seconds.


These “inaccuracies” obviously affect the market and they create some important cycles on pairs where swaps are significant. For example the GBP/JPY swap rates were quite large in 2006-2008 and there was a strong cyclic effect on the 15 minute candles before and after the Asia open as some people tried to exploit an inefficiency dealing with the scalping of the “swap” (open a position, take the swap and exit with a gain). This in effect was eliminated by most brokers at the time through a momentary increase in spreads (to make this unprofitable) but it was later erased as interest rate differentials became small. My point here is that swap rates actively affect the market and can generate market phenomena that simply wouldn’t exist without them.

It is also very important to understand that swap rates are changing, they change every time a central bank makes the decision to change the lending/borrowing costs for a currency. A simulation with constant swap rates is just as inaccurate as a simulation without swap rates at all. Right now swap rates are quite small since interest rate differentials have collapsed as a consequence of the financial crisis (meaning that swap rates tend to be small and overly negative)  but this doesn’t mean that today’s rates are by any means a “pessimistic” evaluation. This happens because although swap rates are overly negative right now, in the past they have been much more volatile, meaning that they were both more positive for favourable positions and more negative  for unfavourable positions. If a system was heavily biased towards a negative swap scenario under a historical period when this scenario was very unfavourable (paid interest was high), then the current swap rates would heavily underestimate negative interest charges.

Ignoring swap rates is a bad idea. It can lead to the creation of systems that exploit market inefficiencies that wouldn’t exist if swap rates were considered. For example a system can rely heavily on the opening of positions with an unfavourable swap at a time close to swap charging and the unsound nature of this strategy wouldn’t be revealed by a simple simulation because the negative swap rate is what actually eliminates the apparent inefficiency. Furthermore ignoring of swap rates can also undermine strategies that can make a lot of profit from this phenomena. For example some long term trend followers might appear much more unprofitable on pairs like the EUR/JPY and the USD/JPY when swap rates are ignored when in fact the accurate consideration of historical swap rates can show them to benefit greatly from this additional credit (what the classic carry trade is all about).

At Asirikuy I have attempted to create simulations with reliable swap rates a few times. My last attempt – which managed to do this with some success – was the Asirikuy strategy tester, in which I managed to produce simulations that accurately depicted the historical swap rates. My problem with this program was that it required the special porting of Asirikuy systems and therefore it wasn’t practical and I ended up never using this feature to enhance the result of our system simulations. However we have recently developed a new strategy tester – a post about this will come soon! – that has been especially designed to simulate systems from the F4 framework (our trading framework developed in C/C++). This means that I can use the exact same code I trade through MT4 and perform a simulation in whichever way I want. I have used the historical interest rates made available by Oanda (from 2000) and I have created interest rate files that are used to generate the long/short swap rates for any pair. The tester automatically generates the long/short swap rates for all the candles of a csv file – from all the interest rate changes since 2000 – allowing the tester to easily determine the interest to charge/credit for every position on every day.


The effects of accurately taking into account the swap rates are quite significant and they show you what you would expect from the variation in the central bank rates during the past 13 years. The first image above, which is a EUR/USD non-compounding test, shows you an Asirikuy system where the swap charges have been determined from accurate historical interest rate differentials. As you can see the system had the biggest losses from swaps in the 2006-2008 period, because the system took a significant portion of short trades during this period (which were a negative scenario regarding interest rates). The effect of swaps was overly negative after 2009 – as interest rate differentials collapsed – but the low magnitude of the interest rates meant that while most positions carried a negative swap, the amount paid was actually small.

This highlights while you cannot consider simulations with constant historical swap rates accurate, they are in fact extremely inaccurate as they ignore the very important effect of historical swap rates. The net profit of this strategy drops considering accurate historical rates, while the effect is much smaller if you consider constant swap based on current historical rates. However this strategy is completely symmetric and has been designed with a lot of care to mitigate the effect of the swap, an asymmetric strategy or a strategy with a timed entry and a small holding period could suffer much more greatly from this effect. A more dramatic case is showed in figure 2 (a USD/JPY system), here considering constant historical swap rates generates almost no effect while accurate historical rates generate a significant change in results. Also note that the USD/JPY interest differential has been much higher historically than the EUR/USD differential, reason why swap chargers went as high as 600 USD for one trade.

Long story short, I am glad to say that we can now perform simulations with accurate historical swap rates at Asirikuy (at least for the 2000-2013 period). Although this is by no means a perfect approach – as the actual interest rates charged also depend on each broker – it is a much closer approximation to trading reality at each point in time. If you would like to learn more about the F4 framework and performing trading system simulations outside of the MT4 platform  please consider joining, a website filled with educational videos, trading systems, development and a sound, honest and transparent approach towards automated trading in general . I hope you enjoyed this article ! :o)



Print Friendly, PDF & Email
You can leave a response, or trackback from your own site.

Leave a Reply

internal_server_error <![CDATA[WordPress &rsaquo; Error]]> 500