Author of the ideaΒ –Β
mq5 code authorΒ –Β
The EA uses iAC (Acceleration/Deceleration, Accelerator/Decelerator Oscillator, AC) indicator. The EA only operates when a new bar appears. The EA opens only one position at a time, therefore it is able to work both on hedging and netting accounts.
Lot is calculated based on the trading history for the last History days (the Maximum Risk in percentage and Descrease factor parameters are used as well).
The EA implements several signals for BUY and SELL (ac[] array here stands for AC indicator values)
BUY signals:
Β Β Β Β Β Β //--- indicator AC go UP Β Β Β Β Β Β if(ac[1]>0.0 && ac[2]>0.0) Β Β Β Β Β Β Β Β { Β Β Β Β Β Β Β Β //--- check signal BUY Β Β Β Β Β Β Β Β if(ac[1]>ac[2] && ac[2]>ac[3]) Β Β Β Β Β Β Β Β Β Β { *** Β Β Β Β Β Β Β Β Β Β } Β Β Β Β Β Β Β Β *** Β Β Β Β Β Β Β Β } Β Β Β Β Β Β //--- indicator AC go DOWN Β Β Β Β Β Β if(ac[1]<0 && ac[2]<0) Β Β Β Β Β Β Β Β { Β Β Β Β Β Β Β Β //--- check signal BUY Β Β Β Β Β Β Β Β if(ac[1]>ac[2] && ac[2]>ac[3] && ac[3]>ac[4]) Β Β Β Β Β Β Β Β Β Β { Β Β Β Β Β Β Β Β Β Β Β Β *** Β Β Β Β Β Β Β Β Β Β } Β Β Β Β Β Β Β Β *** Β Β Β Β Β Β Β Β } Β Β Β Β Β Β //--- indicator AC crosses zero from top to bottom Β Β Β Β Β Β if(ac[1]>0.0 && ac[2]<0.0) Β Β Β Β Β Β Β Β { Β Β Β Β Β Β Β Β *** Β Β Β Β Β Β Β Β } Β Β Β Β Β Β ***
SELL signals:
Β Β Β Β Β Β //--- indicator AC go UP Β Β Β Β Β Β if(ac[1]>0.0 && ac[2]>0.0) Β Β Β Β Β Β Β Β { Β Β Β Β Β Β Β Β *** Β Β Β Β Β Β Β Β //--- check signal SELL Β Β Β Β Β Β Β Β if(ac[1]<ac[2] && ac[2]<ac[3] && ac[3]<ac[4]) Β Β Β Β Β Β Β Β Β Β { Β Β Β Β Β Β Β Β Β Β Β Β *** Β Β Β Β Β Β Β Β } Β Β Β Β Β Β //--- indicator AC go DOWN Β Β Β Β Β Β if(ac[1]<0 && ac[2]<0) Β Β Β Β Β Β Β Β { Β Β Β Β Β Β Β Β *** Β Β Β Β Β Β Β Β //--- check signal SELL Β Β Β Β Β Β Β Β if(ac[1]<ac[2] && ac[2]<ac[3]) Β Β Β Β Β Β Β Β Β Β { Β Β Β Β Β Β Β Β Β Β Β Β *** Β Β Β Β Β Β Β Β Β Β } Β Β Β Β Β Β Β Β } Β Β Β Β Β Β *** Β Β Β Β Β Β //--- indicator AC crosses zero bottom up Β Β Β Β Β Β if(ac[1]<0.0 && ac[2]>0.0) Β Β Β Β Β Β Β Β { Β Β Β Β Β Β Β Β *** Β Β Β Β Β Β Β Β }
Example of opening BUY: