Hey folks,
Here you have two lousy algorithms, the idea is to test he strategies shared by QTJ in this blog entry.
First strategy implementation details:
- I used the EURGBP, AUDUSD and EURUSD pairs.
- I used a leverage of 10 and for each operation I went short by a fixed proportion (the exposure) divided by the number of trading pairs (three in this example).
- The backtest starts in January 1st 2010 and finished September 1st 2017.
- The starting capital is $25.000.
- I used OANDA as broker to have a very accurate measure if the transaction cost; as you know OANDA only charges spread so with the price you have all the costs included. There is not a slippage model, but it can be easily added if the results worth it.
I also implemented one of the ideas in the comments (attached below). Is a little more advanced and I made use of an auxiliary class to check the state of two moving averages.
I know, you all want some money maker ideas, but the quant path is full of testing bad strategies. I think the best you can take from this post is how to implement an strategy from one of the many resources out there.
Hope you enjoy it.