Scan for an event within the last N bars


Category:
0
0

For TOS, Is there an example of a scan which scans for an event within last (most recent) N bars? If no example, how could I develop a thinkscript for it. For example, I’d like to scan for stocks for which ForceIndex crossed zero from above or below within the most recent 10 bars; earlier such crossings should be ignored.

Thank you

Marked as spam
Posted by (Questions: 3, Answers: 5)
Asked on July 5, 2019 7:31 pm
486 views
0
Private answer

No code required for this. Just a couple screenshots showing how to construct this using the Condition Wizard. Just add a Study Filter to your scan and click the Edit button.

Attachments:
Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on July 6, 2019 9:18 am
0
You provided a better solution than I was hoping for and, plus, I learned about the Wizard feature. Thank you!
( at July 6, 2019 10:18 am)