Long term/Short term MA trend screener error

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #223020 quote
    langdon
    Participant
    New

    Hi, I am trying to setup a simple screener to identify stocks in both a ST and LT uptrend.

    It is pretty simple but I am getting results that are not correct. I have tried a number of variations of the code and the current one has the LT trend calculation as the screener. The screener (LT trend calc, which is the EMA144/EMA233) gives me a figure of greater than one but when I look at some of the results the EMA233 is clearly above the EMA144 which would result in a screener calcuation of less then 1 but that is not the result given.

    See attached eg for Alderan resources (AL8). Of the 43 results, at least 6 are incorrect.

     

     

    
    REM Calculate a exp moving average over the last 21 days
    ema21 = ExponentialAverage[21](close)
    
    REM Calculate a exp moving average over the last 34 days
    ema34 = ExponentialAverage[34](close)
    
    REM Calculate a exp moving average over the last 144 days
    ema144 = ExponentialAverage[144](close)
    
    REM Calculate a exp moving average over the last 233 days
    ema233 = ExponentialAverage[233](close)
    
    LTtrend = ema144/ema233
    STtrend = ema21/ema34
    
    REM if both LT and ST trend is up
    IF LTtrend >1  then
    if STtrend >1 THEN
    SCREENER (LTtrend AS "Trend")
    endif
    ENDIF
    PRT-error.odt
    #223022 quote
    JS
    Participant
    Veteran
    Hi @langdon

    ProScreener uses the last 256 bars (Premium 1024 bars) to make calculations, probably your EMA233 needs more history for a correct calculation…

    #223034 quote
    robertogozzi
    Moderator
    Master
    Yes, as JS  said, EMAs require more than twice the periods written within brackets, thus exceeding the built-in limits.
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Long term/Short term MA trend screener error


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
langdon @langdon Participant
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by robertogozzi
2 years, 4 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 10/29/2023
Status: Active
Attachments: 1 files
Logo Logo
Loading...