Please I need help to code an EA (in mql4) based on CCI indicator using iCustom function

 
Hello house, my name Lucky (I hope I get Lucky with my humble request I have been  trying out a lot of things in forex. At the moment I am experimenting with CCI and I would like to build an EA (based on CCI using the iCustom function. I would really appreciate it if someone could help me out.

Conditions for opening trade:

I would like the ea to open only a maximum of two trades at any given time

1. I would like the ea to open a buy order if CCI indicator is below -100 on the 1hour time frame and CCI goes above -100 (from below -100) on the 5minute time frame


I would like the ea to close the buy order when CCI goes above 100 on the one hour time frame



2. I would like the ea to open a sell order if CCI indicator is above 100 on the one hour time frame and CCI goes below 100 (from above 100) on the 5minute time frame


I would like the ea to close the sell order when CCI goes below -100 on the one hour time frame.


Take Profit should be put at 120pips


(I would like the ea to operate based on ticks)


Thank you and God bless.

Files:
cci.mq4  5 kb
 
iCustom - MQL4 Documentation is used to read the buffers of custom indicators. iCCI - MQL4 Documentation is built in.
Reason: