Take value from a nother timeframes

 

 Hi everyone

This is my promblem.

  if  expression 1( in H1) && expression 2 ( in M30 )  

       operator

But i don' t know how to take value from M30 when EA is working in H1. Can you help me, Please. And if you can, help me make a simple Example. Thank a lot

 

Please read the MQL4 documentation on — Access to Timeseries and Indicator Data

You can use the functions like the following to retrieve price quotes for different time-frames or symbols ...

iClose

Returns Close price value for the bar of specified symbol with timeframe and shift

iHigh

Returns High price value for the bar of specified symbol with timeframe and shift

iLow

Returns Low price value for the bar of indicated symbol with timeframe and shift

iOpen

Returns Open price value for the bar of specified symbol with timeframe and shift

 
Fernando Carreiro #:

Please read the MQL4 documentation on — Access to Timeseries and Indicator Data

You can use the functions like the following to retrieve price quotes for different time-frames or symbols ...

iClose

Returns Close price value for the bar of specified symbol with timeframe and shift

iHigh

Returns High price value for the bar of specified symbol with timeframe and shift

iLow

Returns Low price value for the bar of indicated symbol with timeframe and shift

iOpen

Returns Open price value for the bar of specified symbol with timeframe and shift

OH sorry. that my misstake. I want the value about RSI in M30

 
  1. It is Mr B57 #: OH sorry. that my misstake. I want the value about RSI in M30

    Same answer: perhaps you should read the manual. iRSI - Technical Indicators - MQL4 Reference
       How To Ask Questions The Smart Way. (2004)
          How To Interpret Answers.
             RTFM and STFW: How To Tell You've Seriously Screwed Up.

  2. It is Mr B57: But i don' t know how to take value from M30 when EA is working in 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 - MQL4 programming forum - Page 3 #26.4 (2019)

 
It is Mr B57:

 Hi everyone

This is my promblem.

  if  expression 1( in H1) && expression 2 ( in M30 )  

       operator

But i don' t know how to take value from M30 when EA is working in H1. Can you help me, Please. And if you can, help me make a simple Example. Thank a lot

Something like this

double rsi60=iRSI(_Symbol,60,14,PRICE_CLOSE,1);
double rsi30=iRSI(_Symbol,30,14,PRICE_CLOSE,1);
Comment(rsi60," ",rsi30);

But, as others have said, you'll have to do something different to access the value for a different symbol than the chart your EA is on. (another topic);