Idea by: Scriptor
Code mq5 by: barabashkakvn
The EA works on hedge accounts ONLY!
The EA uses the following indicators: iCCI (Commodity Channel Index, CCI) and two iMAs (Moving Average, MA). It is possible to set a timeframe for CCI other than that for Moving Average. It is recommended to run the EA on timeframe CCI: timeframe or MA Fast and Slow: timeframe.
For indicator CCI, additional parameters shall be set:
- CCI Up level - upper level (to be set as an integer)
- CCI Down level - lower level (to be set as an integer)
- CCI Current Bar - number of the bar, from which the CCI readings are taken
Trade signals for opening positions
- Opening a BUY position: MA Slow #1 > MA Slow #2 && MA Fast #0 > MA Fast #1 && (int)CCI #CCI Current Bar < CCI Down level
- Opening a SELL position: MA Slow #1 < MA Slow #2 && MA Fast #0 < MA Fast #1 && (int)CCI #CCI Current Bar > CCI Up level
Signals for closing positions
- Closing a BUY position: MA Slow #1 <= MA Slow #2
- Closing a SELL position: MA Slow #1 >= MA Slow #2