- ago
I want to get the start date of a bar history. How can I do that? I tried bars.DateTimes[0] but this depends on the date range of the backtest. Is there a way to get the actual start date of the time series no matter what date range is selected?

I noticed that I missed "first" in the title of the post...
0
118
Solved
2 Replies

Reply

Bookmark

Sort
Cone8
 ( 4.25% )
- ago
#1
QUOTE:
actual start date of the time series
You mean start of a BarHistory.
That will depend on the provider, but you can request a Daily history of "All Bars" like this, where bars is a reference to the current BarHistory.

CODE:
BarHistory allbars = GetHistoryUnsynched(bars.Symbol, HistoryScale.Daily); //then ... allbars.DateTimes[0];
0
Best Answer
- ago
#2
Yes that's what I'm looking for. Thanks @Cone.
1

Reply

Bookmark

Sort