Download MetaTrader 5

Help with defining current time and specifying a high/low price using iBarShift & iHigh/iLow

To add comments, please log in or register
Join MQL5 Cloud Network. Start earning money!
Andrew 2014.06.09 22:51 

Hi folks,

I'm making a signal table indicator, much like a basic "traffic light" and one of my parametres is whether price is above or below the opening range for a session.

Below is the code for the Asian Session, it's compiling ok but not working (traffic light isn't green or red). Any suggestions on where I'm going wrong?


extern int sydney = 2, extern int frankfurt = 8,
int currentTime = Time[i];

          if current time is more than tokyo open && less that frankfurt open (ie: Asia session) && the price is above the iHigh of the Asian open...
         if(TimeHour(currentTime)>TimeHour(tokyo) && TimeHour(currentTime)<TimeHour(frankfurt) && High[i]>iHigh(NULL,0,iBarShift(NULL,0,TimeHour(tokyo))))
         else if(TimeHour(currentTime)>TimeHour(tokyo) && TimeHour(currentTime)<TimeHour(frankfurt) && Low[i]<iLow(NULL,0,iBarShift(NULL,0,TimeHour(tokyo))))
whroeder1 2014.06.10 11:26  
jalapeno: but not working
extern int frankfurt = 8,
if(TimeHour(currentTime)>TimeHour(tokyo) && TimeHour(currentTime)<TimeHour(frankfurt)
  1. Perhaps you should post all the code your have the problem with. tokyo is not shown
  2. frankfurt is an int not a datetime, so how do you expect to get the hour from an int?
To add comments, please log in or register