Coding for the Local maximum?

schnitzeltrader  
Hi All,

I am trying to figure out how to code an indicator into my EA.
Any assistance would be greatly appreciated.

Basically, as per the picture attached, the indicator here gets to a maximum level, and flattens off. As indicated between the green vertical lines I have drawn.
To the eye, and in terms of pixels it is flat. However if you run the mouse of this area, the values across this section continue to vary on a microscopic level.
Basically given this I am unsure how to code this as I want to define the first bar where its visually flat if that makes sense.
How do i detect this area when the values aren't stationary here, but they look to the eye as though they are?

Thank you for your time!
Files:
507_82p.PNG  3 kb
Dominik Christian Egert  
As far as I am aware, stationary data or values refere to something else.

I would say, you are looking for a rounding. You will need a rounding function with a certain amount of decimals as precision. This way you can eliminate the noise.

Other methods include an average or a hysteresis or a combination of these.
schnitzeltrader  
Dominik Christian Egert #:
As far as I am aware, stationary data or values refere to something else.

I would say, you are looking for a rounding. You will need a rounding function with a certain amount of decimals as precision. This way you can eliminate the noise.

Other methods include an average or a hysteresis or a combination of these.
Thanks for your assistance!
Vladimir Karputov  
schnitzeltrader:

Try lowering the indicator's accuracy threshold, like so:

//--- set accuracy
   IndicatorSetInteger(INDICATOR_DIGITS,Digits());