View Single Post
  #2 (permalink)  
Old 12-24-2005, 08:59 PM
codersguru's Avatar
codersguru codersguru is offline
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Arrow Hour!

Quote:
Originally Posted by Maury74
Hi all,

at first I want to thanks coders' guru for his great MQL4 course!!!

I'm new in this language and after coders' guru lessons I'm tryng to develop my own indicator and surely, after it, I will try to automated its signal in a EA.

I would like the indicator to plot its signal (green and red arrows) between 7 GMT and 19 GMT...I tried this code:

int start()
{
if(Hour()>7 && Hour()<19)
{
for (int x=0;x<=Bars;x++) {
if (CheckforOpen(x)==-100)
ExtMapBufferSell[x]=High[x]+5*Point;

if (CheckforOpen(x)==100)
ExtMapBufferBuy[x]=Low[x]-5*Point;
}
}
return(0);
}


but it doesn't work...if I use && it doesn't plot anything and if I use || it plots all the signal...can you help me???

Attached my graph...I want no signal between the two vertical red line...

Thanks and Merry Chrismast
Maury74,

Happy new year!
Please try this code:

PHP Code:
int start()
  {
//---- 

         
for (int x=0;x<=Bars;x++) 
         {
            if(
TimeHour(Time[x])>&& TimeHour(Time[x])<19)
            {
               
ExtMapBuffer[x]=High[x]+5*Point;
            
            }
         }
 
//----
   
return(0);
  } 
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Reply With Quote