How to calculate the number of Bars since the start of the trade session?

 
Hi all. I have another small problem that i cannot figure. If i log on at any time during the day and need to analysie the bars since the start of the day's session, how can i do that? For example if i logged in at 12.20 in the after noon and want to know and analyse the bars since the morning start session, what codeing wud i need to do for that? Can anyone tell me this? Thanks.
 

Hi,

Try to use iBarShift function.

 

hi thanks. but since i am quite new cud you possibly elaborate how i cud use this function through an example. For eg. if i logged in around 12.30 PM and want to know exactly how many candles have elapsed or been generated since the opening of the session ( whatever time that may be say 9.00 AM) then how can i use the ibarshift to find the number of bars?

 

extern InterestingTime = D'2010.09.14 09:00';

int numberOfCandles;

start(){

numberOfCandles = iBarShift(Symbol(), Period(), InterestingTime );

 

is there any time variable that defines the opening time of the market ?

 

as far as i know this market works 5/24

 
qjol:

as far as i know this market works 5/24

Oh ok ! thanks

Reason: