How to get n-Bars ago ClosePrices
Created at 22 Aug 2023, 00:30
V.
How to get n-Bars ago ClosePrices
22 Aug 2023, 00:30
Hello.
Typically Im using something like Bars.ClosePrices.Last(1) or (2) to get a single ClosePrice of a Bar.
How is it possible to get something like
double closePrices[] = Bars.ClosePrices.Last[1-50] ? To get array/list of last 50 ClosePrices/ For example in OnBar() method
Replies
v.fiodorov83
22 Aug 2023, 10:02
RE: How to get n-Bars ago ClosePrices
PanagiotisChar said:
Hi there,
Try this
var last50bars = Bars.ClosePrices.Reverse().Take(50);
Need help? Join us on Telegram
Thank you! It works as expected
@v.fiodorov83
PanagiotisChar
22 Aug 2023, 05:17
Hi there,
Try this
var last50bars = Bars.ClosePrices.Reverse().Take(50);
Aieden Technologies
Need help? Join us on Telegram
@PanagiotisChar