Thanks for that. How often have I not wished for exactly that !
Junja
I'm getting these error messages:
StochNR GBPJPY,H1: incorrect start position 8767 for ArrayMinimum function
StochNR GBPJPY,H1: incorrect start position 8767 for ArrayMaximum function
And there's no difference between a standard Stoch and NRStoch display.
I've tried different parameters but that changes nothing.
I'm getting these error messages:
StochNR GBPJPY,H1: incorrect start position 8767 for ArrayMinimum function
StochNR GBPJPY,H1: incorrect start position 8767 for ArrayMaximum function
To fix the problem use this version of function:
double Stoch(int Kperiod, int Slowing, int PriceFild, double sens, int i) { if(i+Kperiod+Slowing>Bars) return(-1); // недостаточно баров - выход // not enough bars - exit // экстремумы цены в цикле замедления/сглаживания double max,min,c; for(int j=i; j<i+Slowing; j++) { if(PriceFild==1) { // по Close max+=Close[ArrayMaximum(Close,Kperiod,j)]; min+=Close[ArrayMinimum(Close,Kperiod,j)]; } else { // по High/Low max+=High[ArrayMaximum(High,Kperiod,j)]; min+=Low[ArrayMinimum(Low,Kperiod,j)]; } c+=Close[j]; } // шумоподавление sens*=Slowing; // приведение чувствительности в соответствие с периодом замедления double delta=max-min; // размах double diff=sens-delta; // разница между порогом чувств. и размахом if(diff>0) { // если разница >0 (размах меньше порога), то delta=sens; // размах = порогу, min-=diff/2; // новое значение минимума } // вычисление осциллятора if(delta==0) return(-1); else return(100*(c-min)/delta); }
I've tried different parameters but that changes nothing.
Use threshold for M1 appr.20 points, for M5 30 etc. Try to experiment with the field (Sensitivity).
To fix the problem use this version of function:
Use threshold for M1 appr.20 points, for M5 30 etc. Try to experiment with the field (Sensitivity).
Thanks. Both problems fixed. Very clever.
Junja
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Stochastic with Noise Reduction:
Author: Петр