You are getting array exceeded because you don't handle your lookbacks correctly (at all) | #define LOOKBACK Aver_Bars - 1 counted_bars = IndicatorCounted(); //# of calculated bars i = Bars - MathMax(LOOKBACK, counted_bars) - 1; //#index of 1st uncounted while(i>=0) //Cycle of uncounted bars { Sum_R=0; Sum_Dev=0; Std_Dev=0; //Nulling at beginning of loop for(n=i;n<=i+Aver_Bars-1;n++) //Loop of summing valuesSimplify your code: for(n=i; n-i <Aver_Bars; ++-n) |
You can try this
i = Bars - 500; if( counted_bars >= 500) i = Bars - counted_bars - 1; //#index of 1st uncounted while(i>=0) //Cycle of uncounted bars {
what kind of information this z score will provide ?
Thanks, WHRoeder. Of course, Aver_Bars was leading to arrayOutOfRange.
ffoorr, the z score informs me of ranges that are too large compared to earlier bars.
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, MQL community
I am trying to create an indicator which returns, in Histogram format, values equivalent to the Standardize function in Excel.
However, I am trying to do it for Ranges of candles, not prices.
Description of Standardize function from Excel Help: Returns a normalized value from a distribution characterized by mean and standard_dev.
The code compiles fine but nothing prints on the separate_window. Can anyone tell me why?
Thanks in advance,
Thad