Download MetaTrader 5

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

To add comments, please log in or register
jafferwilson
163
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:  

image

Kindly, let me know.

Emma Schwatson
1642
Emma Schwatson  
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.
whroeder1
17529
whroeder1  
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);
}
jafferwilson
163
jafferwilson  
Emma Schwatson:
Linear regression slope. The easier method would be using the MA of channel width, a shrinking channel = less volatile market.

Can you please share an example that would be helpful?

jafferwilson
163
jafferwilson  
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?

Dmitry Fedoseev
48565
Dmitry Fedoseev  
Look at this. Set up a flat FlatK. The red dots show the flat parts.
Files:
jafferwilson
163
jafferwilson  
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.

figure required and got

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.

Dmitry Fedoseev
48565
Dmitry Fedoseev  
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.

To add comments, please log in or register