I plotted the Stochastic Oscillator from the Indicators folder shipped with MetaTrader version 4 build 210 and wanted
to use its values in a my code. so I found
double iStochastic(string symbol, int timeframe, int %Kperiod, int %Dperiod, int
slowing, int method, int price_field, int mode, int shift)
But the above function does not give the same exact values I see plotted on the
indicator window on my chart.
The arguments “method, price_field and mode” are not inputs in the indcator parameters from the custom window
but they are given as arguments in the function.
How can I get the values from the Stochastic Oscillator I have plotted on the chart
to use in my code?
Thanks a lot
You might use iCustom() to access the indicator that is on the chart
"But the above function does not give the same exact values I see plotted on
the indicator window on my chart."
Calculates the specified custom indicator and returns its value. The custom indicator
must be compiled (*.EX4 file)
and be in the terminal_directory\experts\indicators directory. Use the name of the indicator that you attached to the chart.
If the name is SuperStochasticBombasticator, you use that (minus the . ex4 suffix).
Note that if the indicator has "inputs", you have to put all the inputs
into the iCustom() command.
Well, what do you want to do..
Use the iStochastic() function or use iCustom() to get values that you like from the indicator you
see on chart?
Sorry, my eye was not sharp earlier...
You must enclose the name in quotes becuase you are using a literal string for the
iCustom(NULL, 0, "Stochastic", 25, 7, 2, 1, 0) );
I have exactly the same question. How can I get the value of standard built-in Stochastic Oscillator? because I can see it's better than using iStochastic() function.
The standard built-in Stochastic Oscillator is iStochastic().
Please enable the necessary setting in your browser, otherwise you will not be able to log in.