How to get my code to work
Forums › ProRealTime English forum › ProScreener support › How to get my code to work
- This topic has 5 replies, 3 voices, and was last updated 4 years ago by
Nicolas.
-
-
06/29/2021 at 9:15 PM #172747
Hi there,
I have been struggling with my ProScreener to correctly predict and show me relevant stocks that hit my 6 criteria on the 1 hour mark.
Where could I go to on the platform to have the code ‘reviewed’ to fix it?
At times the problem is that it returns zero results (which is incorrect when I check) and other times it leaves out shares that should be in the selection.
I am comfortable with my logic (so far) but it seems that my sequence of conditions may incorrectly throw shares out or even give zero result?
In essence I am trying to find out 6 scenarios that should happen at the same time and to look back if this was the case over the last 9 candlesticks/intervals.
Do you know where I am possibly going wrong here please?
12345678910111213141516171819once periods = 9 //last 9 barsmyvol = Volumec1 = myvol >100000medprice = medianpricec2 = medprice > 3mymacd = MACD [12,26,9] (close)c3 = mymacd = 0myao = (Average[5](MedianPrice)-Average[34](MedianPrice))c4 = myao =0mystoch = Stochastic [14,3]c5 = mystoch =2mymfi = Moneyflowindex [y]c6 = mymfi >xif summation [period] [c1 and c2 and c3 and c4 and c5 and c6] thenendifScreener [trade]06/29/2021 at 9:46 PM #172751c3, c4 and c5 are unlikely to happen individually, altogether… I think it’s impossible.
How can both MACD and AO be exactly 0 at the same time with the addition of Stochastic having to be 2?
They are usually used with relational operators > or < or >= or <=, just = is very hard to occur!
06/29/2021 at 9:47 PM #172752Moreover, try removing ONCE from line 1.
06/30/2021 at 7:57 AM #172763Hi Roberto,
Thanks, you are exactly right. It has to be > or < but even when I did that then it seemed that the code wouldn’t ‘read’.
Even if the metrics are > for MACD and AO, and the StochRSI >50 (which should be logically correct then) could it be that the format of how I am arranging my code is confusing the screener?
Thanks.
06/30/2021 at 9:31 AM #172774Hi Roberto,
Just to close this out – I spent some time this morning just going through the logic. I seem to have figured it out. The sequence of logic was off, and I rather removed the MFI criteria as it was messing up the entire code.
Thanks for your assistance though, I think this thread is now solved.
Cheers,
Lial
06/30/2021 at 9:31 AM #172775There are some errors, the summation conditions must be under parenthesis (you used brackets) and the Trade variable is not defined anywhere?
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on