How to get my code to work

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #172747 quote
    Lialh
    Participant
    New

    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?

    once periods = 9 //last 9 bars
    
    myvol = Volume
    c1 = myvol >100000
    medprice = medianprice
    c2 = medprice > 3
    mymacd = MACD [12,26,9] (close)
    c3 = mymacd = 0
    myao = (Average[5](MedianPrice)-Average[34](MedianPrice))
    c4 = myao =0
    mystoch = Stochastic [14,3]
    c5 = mystoch =2
    mymfi = Moneyflowindex [y]
    c6 = mymfi >x
    
    if summation [period]  [c1 and c2 and c3 and c4 and c5 and c6] then
    endif
    
    Screener [trade]
    #172751 quote
    robertogozzi
    Moderator
    Master

    c3, 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!

    #172752 quote
    robertogozzi
    Moderator
    Master

    Moreover, try removing ONCE from line 1.

    #172763 quote
    Lialh
    Participant
    New

    Hi 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.

    #172774 quote
    Lialh
    Participant
    New

    Hi 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

    #172775 quote
    Nicolas
    Keymaster
    Master

    There are some errors, the summation conditions must be under parenthesis (you used brackets) and the Trade variable is not defined anywhere?

    robertogozzi thanked this post
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

How to get my code to work


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
Lialh @lialh Participant
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by Nicolas
4 years, 8 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 06/29/2021
Status: Active
Attachments: No files
Logo Logo
Loading...