Is "Bars.Timeframe" synonymous with "Chart.Timeframe"?
Created at 11 May 2023, 03:37
Is "Bars.Timeframe" synonymous with "Chart.Timeframe"?
11 May 2023, 03:37
Hi all:
are these two statements always equivalent?
Bars b = MarketData.GetBars(Chart.TimeFrame, Symbol.Name);
and
Bars b = MarketData.GetBars(Bars.TimeFrame, Symbol.Name);
The API seems to indicate they are. If you look at the API for Bars:
it says the "Bars.Last" property, "Gets the last bar in the chart.". So it reads from whatever the chart is set to.
The API for Chart.Timeframe:
says it "Gets the chart Bar objects." So it reads from whatever the chart is set to as well.
So are they essentially equivalent?
If not, when would those two statements return different bar data?
Thank you.
PanagiotisChar
11 May 2023, 09:36
Hi firemyst,
Yes they should be equivalent.
Aieden Technologies
Need help? Join us on Telegram
Need premium support? Trade with us
@PanagiotisChar