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

Scan for price above SMA 20 over a duration of time.

Does anyone know of a way of consolidating this into one line command?

and [1 day ago low > 1 day ago sma(20)*0.95]
and [2 days ago low > 2 days ago sma(20)*0.95]
and [3 days ago low > 3 days ago sma(20)*0.95]
and [4 days ago low > 4 days ago sma(20)*0.95]
and [5 days ago low > 5 days ago sma(20)*0.95]
and [6 days ago low > 6 days ago sma(20)*0.95]
and [7 days ago low > 7 days ago sma(20)*0.95]
and [8 days ago low > 8 days ago sma(20)*0.95]
and [9 days ago low > 9 days ago sma(20)*0.95]

Comments

  • Options
    markdmarkd mod
    edited July 2020
    I don't think so. If you wanted close above .95 ema for 10 days (including the most recent close), you could do

    and [min(10, PPO(1,20,1) > -.05]

    I haven't tested this. Try it on a chart first - 20 ema on the chart, PPO 1,20,1 below. When price closes below the ema on the chart, PPO should be below zero by some per cent. Unfortunately, as far as I know, you can't specify low instead of close for PPO.
Sign In or Register to comment.