CALCULATE AVERAGE OF HIGHMINUSLOW FOR PREVIOUS SET OF BARS

Created at 14 Nov 2023, 14:02
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!
SA

sarvann24

Joined 25.10.2023

CALCULATE AVERAGE OF HIGHMINUSLOW FOR PREVIOUS SET OF BARS
14 Nov 2023, 14:02


HI,

Can anybody provide me the code to calculate average or moving average of [high-low] for previous set of bars 

Regards,

Saravanan

 


@sarvann24
Replies

PanagiotisCharalampous
15 Nov 2023, 06:51

reply

Hi there,

Here is an example how to calculate the moving average for the high prices

        var ma = Indicators.MovingAverage(Bars.HighPrices, 14, MovingAverageType.Exponential);

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
15 Nov 2023, 06:51

reply

Hi there,

Here is an example how to calculate the moving average for the high prices

        var ma = Indicators.MovingAverage(Bars.HighPrices, 14, MovingAverageType.Exponential);

Best regards,

Panagiotis


@PanagiotisCharalampous

sarvann24
15 Nov 2023, 07:29 ( Updated at: 15 Nov 2023, 07:30 )

RE: reply

PanagiotisCharalampous said: 

Hi there,

Here is an example how to calculate the moving average for the high prices

        var ma = Indicators.MovingAverage(Bars.HighPrices, 14, MovingAverageType.Exponential);

Best regards,

Panagiotis

Thanks :)


@sarvann24