This forum is in read-only mode now. You may discuss your questions on forums of MQL4.community and MQL5.community

How to referrence first 4hr bars for every new day ?


Back to topics list
avatar
11
billybunt 2005.07.24 15:23 
How would i reference the details of the first bars for a new day on a 4hour charts ?

eg. i wanted to get the hi and low of the first 3 bars every new day, i really dont know how i would go about doing this ?

Thanks
avatar
7
cszoli 2005.07.24 15:46 
try
code]TimeDay(Time[1]) != TimeDay(Time[0])[[/code]
avatar
11
billybunt 2005.07.24 16:21 
cszoli - thanks for your response

Would i use it something like this ?


Open[TimeDay(Time[1])]


avatar
7
cszoli 2005.07.24 23:38 
not really!

try this.


//Check for 4Hr timeframe
if (Period() != PERIOD_H4){
    Alert("Attach ONLY 4Hr timeframe! EXIT...");
    return(0);
}

if (TimeDay(Time[1]) != TimeDay(Time[0])){
    //you can use open[0], as the new day open value...
    Alert(Open[0]);//for example show the open value for that day
}

avatar
11
billybunt 2005.07.25 08:25 
Thanks !

Thats just what i was looking for =)
Back to topics list  
Download MetaTrader 5 (450 Kb, web installer) — a new terminal for financial markets