Hi all,
I have some problem coding the stochastic. I want to code the stochastic and I think I have it right, but following the demo account on live, I can see the orders are launched two bars later than it should. That make me think that the stochastic I have coded is different than the stochastic I have as indicator in PRT.
I have set the Stochastic to (79,3,1) in the indicators section in PRT, but when it comes to coding only shows two parameters: Stochastic [79,3]. So, I would like to launch a BUYING order when the stochastic (79,3,1) crosses over the line of 50.
I thought that I had it right, but it doesn’t seems to work right.
What I did:
stoch76=stochastic[76,3]
//D=average[1](stoch76)
LONG= stoch76 crosses over 50
SHORT= stoch76 crosse under 50
Anyone can tell me if this is right??
Thanks in advance,
Juan
1. (close) is missing at the end of line 1, but it is probably assumed so it shouldn’t be the cause, but documentation has it;
2. your text talks about 79, while your code reads 76, could this be the problem?
1 means the period of the signal line of the stochastic, which is a simple moving average of 1 period in your example. If you are not using it, and since a 1 period sma is the same value of the stochastic, your code is already good.
Hi Roberto and Nicolas,
Roberto: Yes, you are right about 79 and 76. It was just my mistake here. In the code it is correct (76). I think, the delay, must be a code reading problem of PRT demo. I assumed close at the end was inferred.
Nicolas: I am not using D value in the code, so I have set it up to one.
I will continue working on this with more confident, knowing than the indicator and the code are fine.
Thank you very much to both of you.
Juan
How do I code a stochastic with a 8-3-3 setting? Thanks!
Please update your country flag in your profile. Thank you 🙂
K = stochastic[8,3]
D = average[3](K)
Robert Berenbaum – please do not double post! It does not get you a faster answer. It just wastes the time of those who are trying to help you. I will delete your identical post in the ProScreener forum to save others from wasting their time trying to provide you with an answer that you have already been given here.
I also answered the same question in the documentation section! 👿