Help with Multi-time frame

 

Hi guys

I am starting to get familiar with mql4 EA but I am stuck at a certain point. It would be great if I could get some support.

I writing a script for EA and couldnt get past this point. I am checking for conditions in daily chart and if it is successful i want to check another set of conditions on an hourly chart before placing an order.

Eg:

void OnTick()

{

if ChartPeriod()==1440

if ...conditions = true;

call hourly chart

In hourly chart

if ....conditions = true;

OrderSend()

}


Thank you for the support

 
hareshv92: I am checking for conditions in daily chart and if it is successful i want to check another set of conditions on an hourly chart 

Stop looking at/thinking about what the current chart's period is; irrevalent.

Read your first conditions from the D1 and read your second conditions from the H1.

On MT4: Unless the current chart is that specific symbol(s)/TF(s) referenced, you must handle 4066/4073 errors before accessing candle/indicator values.
          Download history in MQL4 EA - Forex Calendar - MQL4 programming forum - Page 3 #26 № 4