IS there a way to access bar index for a different time frame?

Created at 17 Apr 2022, 05:40
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
RO

rohitkarki

Joined 05.06.2018

IS there a way to access bar index for a different time frame?
17 Apr 2022, 05:40


Hello,

I was wondering if I run the indicator on 4H chart is there a way to access bar index of 5m bars?  Any input will be appreciated. thanks!


@rohitkarki
Replies

amusleh
18 Apr 2022, 10:18

Hi,

Do you mean the current bar index?

To access current bar index of another time frame Bars you can use Bars.OpenTimes.GetIndexByTime method: cAlgo API Reference - TimeSeries Interface (ctrader.com)


@amusleh