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