Zolfagharipour: My question is why is the value is over 2 billion,
Unfilled buffer elements default to EMPTY_VALUE (2147483647 (0x7FFFFFFF)).
BufferData3[i] = BufferData2[ArrayMaximum(BufferData2,period,0)];
Don't you want to only look at filled values? [rates_total-1 … i]
William Roeder #:
ok now i understand why does the value give over 2billion, but how can i prevent it? cuz i feel what i calculate is filled value.
Unfilled buffer elements default to EMPTY_VALUE (2147483647 (0x7FFFFFFF)).
Don't you want to only look at filled values? [rates_total-1 … i]
William Roeder #:
my point is finding the highest divergent of price and MA in the last "period" (here set to 100). how else i can find this?You are calculated bar i. Lower bars have not been calculated yet. Stop looking at them with ArrayMaximum.
also, when i comment the "BufferData3[i]" it gives me a proper number, yet when i set it in MA_MX it will give me the wrong number.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello dear community, i wrote the Indicator below and the Array "MA_MX" supposed to find the max price difference with MA and draw a line above it.
However it sometimes gives me over 2Billion as the value and when i change the timeframe "sometimes" works seemingly ok. The problem is when it works ok it is obvious that its not the MAX line.
My question is why is the value is over 2 billion, why does it work when i change timeframe and why does it not calculate the max.
tnx.