Help: stochastic readings

 

Hey all,


I have been trying to develop an expert based on stochastic.

I use readings on PERIOD_H1, with the following commands:


STO_Value_current = iStochastic(Symbol(),PERIOD_H1,K,D, Slowing,MODE_SMA,0,MODE_MAIN,0);

STO_Value_prev = iStochastic(Symbol(),PERIOD_H1,K,D, Slowing,MODE_SMA,0,MODE_MAIN,1);

(K,D,Slowing etc as parameters).


When I run the expert withMetaEditor, I get different readings than what I see on the actual graph.


Can any one help? How can I get the correct readings?


Thanks,


Zeev

 
What do you mean by different readings? If you use the same values, you should have the same results.. Can you post a screenshot?
 

STO_Value_current = iStochastic(Symbol(),PERIOD_H1,K,D, Slowing,MODE_SMA,0,MODE_MAIN,0);

STO_Value_prev = iStochastic(Symbol(),PERIOD_H1,K,D, Slowing,MODE_SMA,0,MODE_MAIN,1);

use shift of 1 and 2 instead of 0 and 1

because for 0, they will cross and uncross when the price is moving up or down

 
jirimac:
What do you mean by different readings? If you use the same values, you should have the same results.. Can you post a screenshot?

Attached is a screenshot.

On May1, readings on the graph are: Value=38.77, Signal=28.64. In the Journal I get different readings: Value=26.63, Signal=21.85.

 
jirimac:
What do you mean by different readings? If you use the same values, you should have the same results.. Can you post a screenshot?

Ooops, here's the pic

 
doshur:

STO_Value_current = iStochastic(Symbol(),PERIOD_H1,K,D, Slowing,MODE_SMA,0,MODE_MAIN,0);

STO_Value_prev = iStochastic(Symbol(),PERIOD_H1,K,D, Slowing,MODE_SMA,0,MODE_MAIN,1);

use shift of 1 and 2 instead of 0 and 1

because for 0, they will cross and uncross when the price is moving up or down

Same results with 1,2. Graph readings are different than Journal readings.

The up or down movement is exactly what I am looking for. Unless - you mean something else, that interests me:

When I read stochastic results on a specific hour, what do I get? the results known at that hour? results of the closest tick? results when candle opens/closes/high/low?

 
jirimac:
What do you mean by different readings? If you use the same values, you should have the same results.. Can you post a screenshot?

Ooops 2: pic

 
zevbn:

Attached is a screenshot.

On May1, readings on the graph are: Value=38.77, Signal=28.64. In the Journal I get different readings: Value=26.63, Signal=21.85.

There will be some differences between the graph and the Journal (you mean Experts tabs?) because Experts is at that point in time while the bar is still forming, and the graph is after the bar has completed.

But the differences you are seeing is probably too big to be explained by that, which leaves only one possible explanation which is the parameters between your EA code and the graph are different.

 

I think i works the way it should.

I guess you use the crosses of Signal and Main, so the first cross is at 10am since you use the 0 and 1 offset and because its calculated on closed, it will open the next Open candle which is at 11am.

You will find out that most of the signals generated based on the indicators are quite late..

You might want to try to generate the signal when direction of the Main line change, then you would get it one bar earlier. But I guess its all speculative..

 
blogzr3:

There will be some differences between the graph and the Journal (you mean Experts tabs?) because Experts is at that point in time while the bar is still forming, and the graph is after the bar has completed.

But the differences you are seeing is probably too big to be explained by that, which leaves only one possible explanation which is the parameters between your EA code and the graph are different.

1. I use Strategy tester, so Journal is one of its tabs.

2. No, parameters in Expert and graph are identical.

3. By the graph presented above, the BUY command is given on 3:00 instead on 2:00, and the Close command is given on 11:00 instead on 10:00. The logic is correct.

 

Looking post #1 again, it is possible you are not using iStochastic as it is mean to be. You are supposed to be comparing the %K and %D for the same shift, and comparing which is higher or lower.

Basically, it still comes down to something is not identical, or some logic is not correct, or you misinterpreted something. Whatever it is, without the code, no one can tell.

Reason: