In the following examples we have shown how easy and quick it is to create an Expert Advisor by using Excel. These strategies require intimate knowledge of MQL and over 50 lines of well programmed code. By using our approach this can be reduced to just a couple of Excel functions.
Example A 1
BUY
on the H1 chart SMA 10 crosses SMA 50 from below and if the current price is above SMA 50 on the D1 chart.
SELL
on the H1 chart SMA 10 crosses SMA 50 from above and if the current price is below SMA 50 on the D1 chart.
Using our solution this strategy can be expressed with the following Excel function (reverse for SELL):
BUY
=IF(AND(I6<I5,I4>=I5,P4>I7),OpenPosition(88,"B",0,1,"EURUSD",0,0,1))
Example B 2
BUY
MACD indicator is below zero, goes upwards and is crossed by the Signal Line going downwards.
SELL
MACD indicator is above zero, goes downwards and is crossed by the Signal Line going upwards.
Using our solution this strategy can be expressed with the following Excel function (reverse for SELL):
BUY
=IF(AND(I6<I5,I4>=I5,P4>I7),OpenPosition(88,"B",0,1,"EURUSD",0,0,1))
Using our solution this strategy can be expressed with the following Excel function (reverse for SELL):
The function would look like this if Take Profit = 25 pips and Stop Loss = 15 pips are added
=IF(AND(H6<H5,H4>=H5,O4>H7),OpenPosition(9341,"B",0,1,"EURJPY",D2+0.0025,C2-0.0015,1))
Example C 3
BUY
EURGBP when current candlestick has closed at or below the lower Bollinger Band and RSI is below 20.
SELL
EURGBP when current candlestick has closed at or above the upper Bollinger Band and RSI is above 80.
TAKE PROFIT
For long positions close once RSI retreats to 70. For short positions close once RSI rebounds to 30.
STOP LOSS
For long positions close if for 2 consecutive days the RSI remains above 80. For short positions close if for 2 consecutive days the RSI remains below 20.
Using our solution this strategy can be expressed with the following Excel function (reverse for BUY):
SELL
=IF(AND(Q5>J8,Q4>=J5,J10>80),OpenPosition(9088,"S",0,1,"EURGBP",0,0,1))
SELL SL
=IF(AND(J14>80,J15>80),ClosePosition(235,"90235867",1))
SELL TP
=IF(AND(J14<=70,J15<=70),ClosePosition(235,"90235867",1))
FX Dialogue Newsletter
Get updated on our latest news and developments.