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.
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); }
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?
Perhaps something like:
Not getting the desired output on the graph .. can you please show me what graph you have got on your side?
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.
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.
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.
Try this.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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.