My first foray into coding with Meta Trader MQ4 has been to code a very simple reversal system using two moving averages.
The system is a long term trend following strategy that buys when the smaller moving average moves above the longer and sells when the smaller MA moves below the longer one.
Once the first trade has been placed, the system always has a current trade. There are no stops in place as the stop occurs when the averages next cross.
I also added the ability to add stops using multiples of the ATR value, but interestingly enough, and value of this decreases the overall profitability of the system.
I also found that there was no clear optimum values for the MAs to maximise profitability. Some combinations increases profitability massively but a slight variation would decrease again with no discernible pattern.
I wouldnt trade this system as it is too long term for me, but it is a good exercise in learning the MQ4 language and meta trader platform.
You can see the MQ4 code here: