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
How to get Bar number for a given date and time [SOLVED]
- TJ
- Posts: 7774
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
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.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
symbol_date+symbol_time+binary search algorithmIs there a better way than to go bar by bar and comparing the date & time?