How to check if the middle line of bollinger is stable?

163

How to check if the middle line in Bollinger indicator is some what straight or stable?

See the following red circle in the image:

Kindly, let me know.

1642

jafferwilson:

How to check if the middle line in Bollinger indicator is some what straight or stable?

See the following red circle in the image:

Kindly, let me know.

Linear regression slope. The easier method would be using the MA of channel width, a shrinking channel = less volatile market.
17529

Perhaps something like:
```bool isBBFlat(int iBar=1, int percentage=10, int smoothing=10){
double ma1 = bands(iBar, MODE_MAIN),
ma2 = bands(iBar+smoothing, MODE_MAIN),
ma3 = bands(iBar+smoothing*2, MODE_MAIN);
double slope1 = (ma1 - ma2) / smoothing,
slope2 = (ma2 - ma3) / smoothing;
return MathAbs(slope1) < MathAbs(slope2) * percentage/100.0;
}
double bands(int iBar, int mode){
return iBandsMQL4( // MT4: iBands
_Symbol, PERIOD_CURRENT,
BB_Length,
BB_Deviations,
0, // Shift
PRICE_CLOSE,
mode, iBar);
}```
163

Emma Schwatson:
Linear regression slope. The easier method would be using the MA of channel width, a shrinking channel = less volatile market.

163

whroeder1:
Perhaps something like:

Not getting the desired output on the graph .. can you please show me what graph you have got on your side?

48565

Look at this. Set up a flat FlatK. The red dots show the flat parts.
Files:
163

Dmitry Fedoseev:
Look at this. Set up a flat FlatK. The red dots show the flat parts.

Not getting the right output as require. See the following figure the output what your program gives and what was expected. Please let me know.

The blue region is what the program is giving, while the yellow region is what expected. Kindly, let me know what should be done, please.

48565

jafferwilson:

Not getting the right output as require. See the following figure the output what your program gives and what was expected. Please let me know.

The blue region is what the program is giving, while the yellow region is what expected. Kindly, let me know what should be done, please.

You show the segment by means of which the flat is detected. As flat is detected, so it is immediately displayed with red dots. It is possible to draw red dots where you are showing, but it will be practically impossible to use it.

In order to draw some conclusion, it is necessary to analyze the preceding data. Therefore, everything happens with a delay.

What you are dreaming of is impossible.