Referencing specific Bars

Created at 26 Jan 2021, 21:06
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!
JA

jackhpfilerrowson

Joined 26.11.2020

Referencing specific Bars
26 Jan 2021, 21:06


HI, I was just wondering if there is a way to reference back to a specific bar instead of just .last(x)?


@jackhpfilerrowson
Replies

prosteel1
26 Jan 2021, 21:18 ( Updated at: 26 Jan 2021, 21:30 )

RE:

jackhpfilerrowson said:

HI, I was just wondering if there is a way to reference back to a specific bar instead of just .last(x)?

I use the .Count where the zero Count is the earliest bar in the history and as new bars form the .Count increases.

I use this so I can assign charts to a specific Count that doesn't change (unless more history is loaded after the bot is started by scrolling).

Can't find a better example then the below atm sorry. 

Basically declare: Bars series0 = MarketData.GetBars(Daily);

and then you can use series0.Count which is for a specific bar that doesn't change.

 


@prosteel1

jackhpfilerrowson
27 Jan 2021, 00:18

RE: RE:

Thanks for the reply Prosteel1, Ill give that a go

 


@jackhpfilerrowson