Download MetaTrader 5
To add comments, please log in or register
They are already making profit from their signals. Publish your signal and join them!
Andrew
71
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))))
         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);
         }
whroeder1
13607
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