| / | Forum |
|
samjesse
2007.10.17 03:15
Hi 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 |
|
A Trader's Assistant Based on Extended MACD Analysis Script 'Trader's Assistant' helps you to make a decision on opening positions, based on the extended analysis of the MACD status for the last three bars in the real-time trading on any timeframe. It can also be used for back testing. |
|
phy
2007.10.17 03:28
You might use iCustom() to access the indicator that is on the chart |
|
samjesse
2007.10.17 03:59
when I use iCustom() and give it the indicator name as suggested buy the help files. it gives
'Stochastic' - variable not defined here is how I used it in the code. iCustom(NULL, 0, Stochastic, 25, 7, 2, 1, 0) ); |
|
phy
2007.10.17 04:44
"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)
Note that if the indicator has "inputs", you have to put all the inputs into the iCustom() command.
|
|
samjesse
2007.10.17 05:07
here are the info from my PC, I don't know where I went wrong.
then name: ======= C:\Program Files\FXDD - MetaTrader 4\experts\indicators\Stochastic.ex4 so I used the name Stochastic the extern values: =========== //+------------------------------------------------------------------+ //| Stochastic. mq4 | //| Copyright © 2004, MetaQuotes Software Corp. | //| http://www.metaquotes.net/ | //+------------------------------------------------------------------+ #property copyright "Copyright © 2004, MetaQuotes Software Corp." #property link "http://www.metaquotes.net/" #property indicator_separate_window #property indicator_minimum 0 #property indicator_maximum 100 #property indicator_buffers 2 #property indicator_color1 LightSeaGreen #property indicator_color2 Red //---- input parameters extern int KPeriod=5; extern int DPeriod=3; extern int Slowing=3; //---- buffers |
|
phy
2007.10.17 06:00
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? |
|
samjesse
2007.10.17 12:09
the indicator on the chart is the standard built_in Stochastic Oscillator. thus
I see no custom indicator on the chart. therefore I expected to optain the indicator
values using the iStochasic function.
here is a scren shot http://www.mediafire.com/imageview.php?quickkey=4sr2znhutnn&thumb=4 |
|
phy
2007.10.17 12:54
samjesse wrote:
when I use iCustom() and give it the indicator name as suggested buy the help files. it gives 'Stochastic' - variable not defined here is how I used it in the code. iCustom(NULL, 0, Stochastic, 25, 7, 2, 1, 0) );
You must enclose the name in quotes becuase you are using a literal string for the parameter... iCustom(NULL, 0, "Stochastic", 25, 7, 2, 1, 0) ); |
|
samjesse
2007.10.17 14:00
thanks alot, that fixed it.
|
|
rbt
2009.02.14 16:32
samjesse wrote >>
the indicator on the chart is the standard built_in Stochastic Oscillator. thus I see no custom indicator on the chart. therefore I expected to optain the indicator values using the iStochasic function. here is a scren shot http://www.mediafire.com/imageview.php?quickkey=4sr2znhutnn&thumb=4 Hi, 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. |
|
blogzr3
2009.02.14 16:52
rbt wrote >>
Hi, 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(). |