Can somebody please tell me if my coding solution is correct in solving a 4 H MTF call for an EA that runs on a 1 H chart, or at least clarify further the following:
I run a separate EA to call the 4 H CCI to my 1 H based EA as shown below:
if (iBars(NULL,PERIOD_H4)>14) CCI_H4 = iCCI(NULL,PERIOD_H4,14,PRICE_MEDIAN,1);
Then I run the following code in my EA:
static datetime candletime=0;
if(candletime!=Time && Cci!=0)
//---4 H Oscilator
//---1 Hour Trend
//--- Ema 200
//Did it make an up arrow on candle 1?
if(Fib5H1>Fib8H1 && Fib8H1>Fib13H1)
if(SarBackH1>SarH1 && SarH1<Price)
The question to clarify is that is this a workable solution? in that I read in MQL4 reference the following:
Global variables exist in the client terminal during 4 weeks since their last use, then they are automatically deleted.
Does this mean that they are deleted every 4 weeks or if they are used within a 4 week period then they are not deleted?
Any advice would be very much appreciated, I look forward to any help on this topic.
Why do you need to get the value and save it for other code?
This is a simpler working solution.......correct? or is there some other unforeseen reason that I can not use this code to fix a MTF issue?
The better working solution is to simply get the 4 hour cci data from the same EA instead of relying on an external program.