Return true if current 1hr candle closes on 4hr timeframe

 

Hi guys my EA opens trades on every close of 4hr timeframe thats why my mt4 is set to 4hr timeframe only. But i want to add a function that if price reach to a certain price then close the trade if that 1hr candle closes where the price reach that certain price.is that possible? Thanks 

 
Of course, it's possible. You know how to detect a new H4 bar. So you know how to detect a new H1 bar.
 
If you want to get H1 candle info from H4 chart then you've to use candle info functions with PERIOD_H1 parameter not PERIOR_CURRENT or predefined arrays.
 
mark692:

Hi guys my EA opens trades on every close of 4hr timeframe thats why my mt4 is set to 4hr timeframe only. But i want to add a function that if price reach to a certain price then close the trade if that 1hr candle closes where the price reach that certain price.is that possible? Thanks 

Set your close conditions for PERIOD_H1 instead of PERIOD_H4 or PERIOD_CURRENT

Reason: