2-step price action relative to MA


New member
Greetings! I'd like to come up with a script for TOS that returns scan results for the following 2-step price action:

1st price closes below 12 day ExpAverage
2nd price closes above 12 day ExpAverage

Upon close of the 2nd price, the results would then be presented in the scan.

I would then modify the code to do the opposite to produce another scan that reverses the scenario.

I'm new to thinkscript and not sure how to start with this seemingly straightforward task. Hope I made the request clear enough.

Thanks in advance for your assistance!



You can do this with the built in ThinkorSwim Scanner. Add new filter, select study, then you will get this menu.

Put the first moving average as 1. That is the current close. Then the second moving average as whatever you want, such as 12.



New member
Thank you for the quick reply. You're exactly right in this approach producing the results as I had explained. I wasn't clear enough in the detail of that FIRST price . . . it would be one that opened above the EMA and then closed below the EMA. Another way of describing what I'm after would be a sell signal candle followed by a buy signal candle. Sorry for the confusion.

Similar threads