Not getting wanted barssince result in screener

Forums ProRealTime English forum ProScreener support Not getting wanted barssince result in screener

  • This topic has 5 replies, 3 voices, and was last updated 5 days ago by avatarJS.
Viewing 6 posts - 1 through 6 (of 6 total)
  • #249360

    some very simply code  below (in theory) and I can’t explain some of the results  eg the screen returns MNG (UK) where the close was last below 20ma 4 bars ago but 32 is returned – this is driving me nuts what on earth am I doing wrong?

    timeframe(monthly)
    ma = average[20](close)

    c1 = barssince(close < ma)

    SCREENER[c1](c1 as “bars”)

     

     

    #249363

    The line

    assigns C1 the bar where the condition has been met, which will ALWAYS retain a value other than 0, so it will always be true, thus returning ALL instruments.

    Try changing the last line so that it only scans the instruments where the condition has only been met within the last 5 (or any other number of your choice) bars:

     

     

    #249366
    JS

    Hi,

    I’m getting the right results…

    Did you set the “Period” to “Month”… ?

    #249368
    JS

    It is also possible that your “data” has not yet been adjusted to dividends…

    1 user thanked author for this post.
    #249378

    So I was not adjusting for dividend, data now look consistent.  Thanks so much.

     

    This leads onto a separate question, should adjustment be enabled or disabled.  The chart for the particular asset I was looking is massively different probably becuase it has a hefty 10% yield!

    #249383
    JS

    When you use a “screener” you always have to adjust the data for dividend because a “screener” works with “real-time” data (data adjusted for dividend)…

Viewing 6 posts - 1 through 6 (of 6 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login