Coding the stochastic
Forums › ProRealTime English forum › ProOrder support › Coding the stochastic
- This topic has 7 replies, 5 voices, and was last updated 5 years ago by Nicolas.
-
-
05/12/2018 at 3:06 PM #70256
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:
12345stoch76=stochastic[76,3]//D=average[1](stoch76)LONG= stoch76 crosses over 50SHORT= stoch76 crosse under 50Anyone can tell me if this is right??
Thanks in advance,
Juan
05/12/2018 at 3:20 PM #702571. (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 user thanked author for this post.
05/12/2018 at 9:27 PM #702721 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.
1 user thanked author for this post.
05/13/2018 at 9:31 AM #70278Hi 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
07/31/2019 at 8:15 PM #103909How do I code a stochastic with a 8-3-3 setting? Thanks!
07/31/2019 at 8:25 PM #103910Please update your country flag in your profile. Thank you 🙂
12K = stochastic[8,3]D = average[3](K)07/31/2019 at 10:24 PM #103911Robert 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.
08/01/2019 at 7:48 AM #103932 -
AuthorPosts
Find exclusive trading pro-tools on