Scanner for a “perfect SMA order” that returns results from within 1 bar only


Category:
0
0

Mr. Hahn,

Thank you so much for all the work you’ve been doing on this website.  Since I’m a newbie, I’m trying to start with something simple for a customized scan, but I think I’m doing something wrong.

What I’m trying to do is scan for stocks and ForEx pairs that meet the following criteria:
SMA 10 > SMA 20 > SMA 50 > SMA 100 > SMA 200 on the 1 hr chart.  Basically, just return stocks that look like the attached image.  I’d like the scan to give results and alert me when this occurs during the current bar or 1 bar previously.

Here is the what was generated when I used the custom scan to create this and then clicked on the thinkScript Editor:

SimpleMovingAvg(“length” = 10).”SMA” is greater than SimpleMovingAvg(“length” = 20).”SMA” and SimpleMovingAvg(“length” = 20).”SMA” is greater than SimpleMovingAvg(“length” = 50).”SMA” and SimpleMovingAvg(“length” = 50).”SMA” is greater than SimpleMovingAvg(“length” = 100).”SMA” and SimpleMovingAvg(“length” = 100).”SMA” is greater than SimpleMovingAvg(“length” = 200).”SMA”

However, when I run the scan it seems to show me any stock that has met that condition since the day’s open.  So when I run it in the afternoon it is showing results that were true hours ago but are no longer true (most commonly, the SMA20>SMA10).  I had saved this scan and tied it into the watchlist thinking it would update.  It kind of does but it only adds stocks, not subtract them when the conditions are no longer met.

Please advise what I am doing incorrectly.

Thank you,

Mark

Attachments:
Marked as spam
Posted by (Questions: 1, Answers: 0)
Asked on January 24, 2019 1:27 pm
94 views
0

So to be clear, you only want the scan to capture the very first bar where all these ma’s are in alignment? You don’t want to capture subsequent bars where the ma’s are still in alignment?

( at January 27, 2019 11:02 am)