New Members: Be sure to confirm your email address by clicking on the link that was sent to your email inbox. You will not be able to post messages until you click that link.

stocks where 20EMA <50MA and 9 EMA>20 EMA

how can i scan for stocks where
20EMA>50 MA and 9 EMA >20 EMA for last 30 days?

Comments

  • markdmarkd mod
    edited October 2020
    You can measure the difference between two emas using PPO Hist (or MACD Hist) with the third parameter (PPO) set to zero (0).

    So, if you want to know only the current reading (is ema 20 above ema50), you would write:

    [group is sp500]

    and [PPO Hist(20,50,0) > 0]

    If you want to know if the 20 has been above the 50 for some period of time:

    and [min(30, PPO Hist(20,50,0) > 0]


    That says that no value for Hist has been below zero for 30 days, so the 20 has not been below the 50 during that time.

    PPO can be more useful than MACD because it returns per cent values, which can be compared across different symbols. So, for instance, you could scan for emas that are 5% apart. You couldn't do that with MACD because it returns values whose size is dependent on the prices of the emas. For instance, emas separated by 5 points will have a different meaning for stocks priced in the 20s versus stocks priced over 100.




Sign In or Register to comment.