Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Scan for displaced moving average e.g. sma(1,h,20)

edited July 2019 in Scanning
Dear team,

how we are going to scan for a moving average of the highs, which is forwarded for 20 days into the future? In a chart I can see the line.
The scan engine only takes two parameters and shows an error. Is there a way to get around?

Best
stokkcharts

• mod
If you want to compare current data to past data as if the past data were occurring today, you would use "x days ago". For instance.

and [close > 20 days ago sma(20, high)]

• I want to compare data of today, with data in the future, like the high of today forwarded for 20 days. Is this possible? In the chart I can see it.
• ✭✭
When you say "in the chart I can see it" what and where?

If it's Ichimoku, that's based on formulas. You can replicate that formula or use the Ichimoku segment you are interested in, in your scan. It's available in the Technical Indicators dropdown in the Scan workbench. Some of the segments display "in the future" but that is more for a visual as to where the current data falls so that possible expected support and resistance are more visual.
• mod
How would the scan engine compare data of today with data in the future? Data in the future doesn't exist yet so the scan engine can't find it.
• schrts.co/KtDkBdSw I want to scan for this yellow crossover. I hope you can see the chart.
• mod
edited July 2019
So I read that as you want to scan for today's (or some prior day's) close crossing below the high of 20 days before.

sma(1, high) is just a line that connects all the highs. It's not really an "average" because the divisor is 1 and 1 into any number is the number, e.g. 12/1 = 12.

sma(1,20, high) is the sma(1,high) line pushed forward 20 bars, as if the value from 20 days ago is occurring 20 days later.

So, the scan would be as above, except using the crossover operator "x" and a scan date of Jun 11 or 12 (hard to tell from the chart).
• Thank you, that helps.

• To plot on the chart: 1,-20 for past, 1,20 to plot in future make sure to add extra time on your chart otherwise you will not see the future plot line