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

 

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))))
         ObjectSetText("ORsignal",CharToStr(symbolCodeBuy),fontSize,
         "Wingdings",signalBuyColor); 
         
         else if(TimeHour(currentTime)>TimeHour(tokyo) && TimeHour(currentTime)<TimeHour(frankfurt) && Low[i]<iLow(NULL,0,iBarShift(NULL,0,TimeHour(tokyo))))
         ObjectSetText("ORsignal",CharToStr(symbolCodeSell),fontSize,
         "Wingdings",signalSellColor);   
         else
         ObjectSetText("ORsignal",CharToStr(symbolCodeNoSignal),fontSize,
         "Wingdings",noSignalColor);
         }
 
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?
Reason: