How do you get the highest and lowest price of past N days?

Created at 01 Mar 2023, 12:45
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!
YS

ys2310

Joined 03.12.2021

How do you get the highest and lowest price of past N days?
01 Mar 2023, 12:45


I'd like to get the lowest price among the past 21 days in cBot.

Simply, how can I do that?


@ys2310
Replies

PanagiotisChar
02 Mar 2023, 10:04

Hi there,

Here is an example

            var dailyBars = MarketData.GetBars(TimeFrame.Daily);
            var lowest = dailyBars.LowPrices.Minimum(21);

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

 


@PanagiotisChar