![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
The standard built-in Stochastic Oscillator is iStochastic().
Thanks.
But it's different! once you put built-in Stochastic Oscillator and another Stochastic made by iStochastic() in a chart.
Thanks.
But it's different! once you put built-in Stochastic Oscillator and another Stochastic made by iStochastic() in a chart.
No, its not. I tried before I posted.
I compared the "built-in" from the Navigator Window, Indicators/Stochastic Oscillator versus a "made by iStochastic()" with the following code, and they look exactly the same:
buffer1[i]=iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_MAIN,i);
buffer2[i]=iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_SIGNAL,i);
Do you have an example where they are different?
Thank you.
You're right. I had a wrong parameter.
Thank you.
You're right. I had a wrong parameter.
What's the difference between using price_field = 0 (low/high) vs price_field = 1 (close/close). The stochastic formula calculates how far from the lowest low the last close is, relative to the recent range (high - low). what does close/close use instead? sorry the mql4 documentation doesn't seem to address this
No, its not. I tried before I posted.
I compared the "built-in" from the Navigator Window, Indicators/Stochastic Oscillator versus a "made by iStochastic()" with the following code, and they look exactly the same:
buffer1[i]=iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_MAIN,i);
buffer2[i]=iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_SIGNAL,i);
Do you have an example where they are different?
I appreciate this thread is a couple of years old, but I've been slowly going crazy with the same problem.
If I place the standard Stochatic Oscillator indicator directly onto a chart with a 17,5,3 using LWMA mode with CLOSE price I get the base and signal plot just fine.
If I use an in-code call to iStochastic using EXACTLY the same parameters - I get slightly different data.
I've double-checked all my parameters a few hundred times...
edit: attached the screenshot showing the standard Stochastic Oscillator indicator in window 1 and the iStochastic in-code call plots in window 2. The settings are 17,5,3 using MODE_LWMA and PRICE_CLOSE. Even a cursory glance at the two plots show differences, but the most obvious is the the current values for each as shown in the upper left hand corner of each of the windows.
I have also attached the code used to plot the iStochastic as I'm hopeful, even at this late stage, to have someone, anyone, point out how stupid I've been and where my error lies. Or not.
I too can't find any way to get the same values out of iStochastic or iCustom( ... "Stochastic" ...) as I do when I display a "Stochastic Oscillator" standard indicator.
Bizarre.