Sample code for Moving averages crossover

 

Hello everybody,

I am a newbie to this site as well as to the forex market (2 months). I have metatrader 4 demo account on which I am practising currently. I read about this jumstart strategy and would like to automate this to test the efficiency of this siganl.

1. parameters - 3 SMA, 5 SMA, Moving average oscillator (12,26,9 ) which is default

2.Time frame - 15 Mts, 1 Hr (Preferred)

3.Entry: Buy when 3 SMA crosses 5 SMA on upward direction on the completion of the bar & Moving average oscillator is > zero

Sell when 3 SMA crosses 5 SMA on downward direction on the completion of the bar & Moving average oscillator is < zero

4.Exit: For 15 Mts, Target profit is - 5 Pips and for one hour target profit is - 20 Pips

Stoploss - for 15 mts or for one hr.. previous bar's lowest low (for buy) or highest high (for sell).

5. Currency pair - Any

This may not be a great strategy and the risk reward strategy is not really a favorable one. But I want to test this one to see the potential of this. Based on the performance I can fine tune this over period of time to draw consistent positive results.

Can someone provide some code for the above strategy ?

PS: I will be starting to understand this MQ4 launguage so that I can write my own code but It will take some time.. Meanwhile.. I am looking for help from here

Thank you

Reason: