MQL4 - automated forex trading   /  

Forum

Login | Register | Language: ru cn en
Post Your News in Blogs and Become Famous!

iStochastic() returning wrong value?

Back to topics list To post a new topic, please log in or register
avatar
2
redwarf 2010.05.16 00:37
 

Hello, I recently tried my new Expert advisor, but it didnt work as it should. I couldnt figure out where the problem is, but now i know. It seems like the iStochastic returns wrong value. Look at the picture in attachment. You can see here clearly, that the value of one stochastic is around 88, and the second 84. But when you look on the indicator window, both the signal and main lines are under these values. Can anyone help me to fix this?

 
STRATEGY: Account Up 108%
STRATEGY: Account Up 108%
Gary Comey | 24 November 2014, 13:10 | Views: 102
EUR/USD traded in range for some time, but eventually lost ground and closed under 1.24. Can it extend its falls further below 1.2356?The main events this week are the preliminary inflation releases, employment data as well as another German business survey is already out today. Here is an outlook on the highlights of this week and an updated technical analysis for EUR/USD.
avatar
443
blogzr3 2010.05.16 08:26 #
 

Your chart parameters and iStochastic parameters in your code are exactly the same?

avatar
2
redwarf 2010.05.16 18:33 #
 
blogzr3:

Your chart parameters and iStochastic parameters in your code are exactly the same?


Yes, i opened this chart with the "open chart" button in strategy tester. The stochastic values for other Bars are usually right, but sometimes here and there the wrong value occurs. I even tried another stochastic indicator downloaded somewhere on the net, but the results were still wrong. I really don´t know how to solve this.
 
avatar
416
cameofx 2010.05.17 06:41 #
 

perhaps check from Data window : hover & point the two Indicators you need to compare & check the info label values & the values in data window. They should be the same.

& the picture you post has different (30,3,3) & (9,3,3) parameter settings.

 
avatar
7
bouchepat 2010.05.19 05:22 #
 
redwarf wrote >>

Hello, I recently tried my new Expert advisor, but it didnt work as it should. I couldnt figure out where the problem is, but now i know. It seems like the iStochastic returns wrong value. Look at the picture in attachment. You can see here clearly, that the value of one stochastic is around 88, and the second 84. But when you look on the indicator window, both the signal and main lines are under these values. Can anyone help me to fix this?


Hi, well i had the same issue. And i found the error:

It depends on the price_field enumeration:

iStochastic(Pair,PERIOD_H1,5,5,5,MODE_EMA,PRICE_CLOSE,MODE_SIGNAL,1) or iStochastic(Pair,PERIOD_H1,5,5,5,MODE_EMA,1,MODE_SIGNAL,1)

The funny thing is, both ways work whithout generating any error but the return value is completely different.

You must enter 1: for price close and not PRICE_CLOSE :

price_field - Price field parameter. Can be one of this values: 0 - Low/High or 1 - Close/Close.

Hope it will fix your problem..... Pat

 
Back to topics list  

To add comments, please log in or register