Bug in build 1090.
Indicator compiles but
won't show ?? - Average Directional Movement Index, ADX -
Technical Indicators - MQL5 programming forum
Give the buffer(s) a type:
#property indicator_type1 DRAW_LINE // Bug 1090 must set. :
or
SetIndexBuffer(0, RSI_buffer); SetIndexStyle(0, DRAW_LINE); :
Bug in build 1090.
Indicator compiles but
won't show ?? - Average Directional Movement Index, ADX -
Technical Indicators - MQL5 programming forum
Give the buffer(s) a type:
or
I tried that but not working.
In your case it is not related to the drawing style bug of build 1090 (missing a few values can never be caused by that bug) but to your code
In this part :
if(avg_lose != 0) { double rs = avg_gain/avg_lose; RSI_buffer[x] = 100.0-(100.0/(1+rs)); }
you do not have a case when avg_lose==0 (and then you have empty value of your drawing buffer). Fix that and it will work
PS: in your place I would invert the loop direction. It is not changing the result of your current code, but it is always better to calculate from past to future, not the opposite way - some of the best know repainters are made the way you are using that kind of loops and I doubt that you will be happy in cases when your code starts to repaint because of the wrong loop direction
In your case it is not related to the drawing style bug of build 1090 (missing a few values can never be caused by that bug) but to your code
In this part :
you do not have a case when avg_lose==0 (and then you have empty value of your drawing buffer). Fix that and it will work
PS: in your place I would invert the loop direction. It is not changing the result of your current code, but it is always better to calculate from past to future, not the opposite way - some of the best know repainters are made the way you are using that kind of loops and I doubt that you will be happy in cases when your code starts to repaint because of the wrong loop direction
Can you elaborate more?
What value does the RSI_buffer[nnn] have when avg_lose == 0?
You did not assign any value to RSI_buffer for that case and the default assigned by metatrader in that case is EMPTY_VALUE - which is the "missing" value in your example. Assign some controlled value to RSI_buffer when avg_lose == 0 and it will be OK
As of loops : according to you, what is the natural way? From future to past? If you think so, would you mind explaining why would that be a natural way (in any trading platform and in any coding language)
What value does the RSI_buffer[nnn] have when avg_lose == 0?
You did not assign any value to RSI_buffer for that case and the default assigned by metatrader in that case is EMPTY_VALUE - which is the "missing" value in your example. Assign some controlled value to RSI_buffer when avg_lose == 0 and it will be OK
As of loops : according to you, what is the natural way? From future to past? If you think so, would you mind explaining why would that be a natural way (in any trading platform and in any coding language)
Bug in build 1090.
Indicator compiles but
won't show ?? - Average Directional Movement Index, ADX -
Technical Indicators - MQL5 programming forum
Give the buffer(s) a type:
Bug in build 1090.
Indicator compiles but
won't show ?? - Average Directional Movement Index, ADX -
Technical Indicators - MQL5 programming forum
Give the buffer(s) a type:
or
thankyou!!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
[Help] Custom RSI is Missing Some Portion of Indicator Lines in 4-Hour timeframe (GBPUSD).
I used SMA to get average gain/lose instead of Wilder's SMMA the default mode in MT4/MT5. If I used SMMA then everything works as expected but If I use SMA then some portion of lines is missing.
I can't figure out what cause of this problem. I uploaded the image and code.