How to get Bar number for a given date and time  [SOLVED]

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1292
Joined: Nov 23 2010
Has thanked: 725 times
Been thanked: 223 times

Oct 01 2013

Hello

If I got in variables, a date and time. How could I get a bar number that correspond to it.
Is there a better way than to go bar by bar and comparing the date & time?

Martin

User avatar
TJ
Posts: 7774
Joined: Aug 29 2006
Location: Global Citizen
Has thanked: 1036 times
Been thanked: 2233 times

Oct 01 2013

Hello
If I got in variables, a date and time. How could I get a bar number that correspond to it.
Is there a better way than to go bar by bar and comparing the date & time?
Martin
There is no easy way to pinpoint a bar in history. Because in your chart the date/time are not continuous; you have missing dates and times between now and the bar you are looking for. eg. weekends, holidays. And you won't know which date/time are missing unless you go and check them bar by bar.

Dru
Posts: 107
Joined: Aug 28 2007
Has thanked: 4 times
Been thanked: 171 times

Oct 02 2013

Is there a better way than to go bar by bar and comparing the date & time?
symbol_date+symbol_time+binary search algorithm