I have now been automated trading using strategies on the real or live environment with FXCM for 20 months. During this time, I have run multiple different types of strategies in parallel between the real and demo environments.
Demo when compared to Live trading actually compares pretty well, as you would expect. During normal market volatility, I find there are usually only differences near boundary conditions/edge cases. When I say edge cases, I mean when the differences in behavior is caused by some very small difference in price or indicator value which causes a trade to go one way or the other. For example… a reversion strategy I was working on made the following trades in the Demo environment.
At the same time, the instance running in the live environment did the following:
You can see from the above example that the live environment made one less trade than the demo environment. In this case it resulted in the overall setup making less money in the real environment compared to the demo environment.
When I looked into this at the time, it turned out the conditions to generate the trade were not genuinely met in live when compared to demo, or rather, it seemed that the trade conditions were only temporarily met in Demo but never met in Live – the live environment just missed out on the trade.
If you have ever had the prices ticking side-by-side between live and demo you would know that they are not always in sync and sometimes there can be very small differences in the price and they do not both receive the same ticks, or even tick at the same time. Unfortunately these small differences are enough themselves or lead to a significant enough difference in an indicator value to result in a discrepancy between making a decision or not.
It is important to note a couple of things:
– Firstly, this kind of difference can impact all decisions, not just the opening of new positions but also the closing of them too.
– Secondly, this behavior is not always necessary against you. I have had it that the live environment did something good for me while the demo did not, for example, close a losing trade sooner etc.
Actually, it is quite common to have fractions of a pip difference between Demo and Live but it goes either way so I like to think it averages out. However, one should remember that the above only applies during normal market operation. We can also get differences in behavior in more extreme market conditions too.
For example, trading was suspended and prices went stale in the live environment due to the SNB shocker last month. However, that was not the case in the demo environment. In another example which is probably more common, I had a stop order execute in the live environment when the price had not reached the stop level yet, this did not happen in Demo. Here is the screenshot of the live environment:
You can see the dashed line from the arrow indicating the actual close price vs the price where the stop order was placed. Some people could easily mistake this for being ‘stop hunted’ but it turns out this happens when there is very low liquidity in the market and the advertised price is not the actual executable price. This, unfortunately, did not happen in the Demo environment.
So as you can see, one needs to be careful when evaluating an automated strategy in the Demo environment. It is best to adopt a conservative view on all decisions made by your strategy and if possible, tweak the configuration accordingly. For example, adjusted the stop or limit orders by half a pip etc as an extra confirmation that the price definitely reached the appropriate level.
Next post, I’ll discuss differences between backtesting and live trading.