Scan for net change over a set period


Category:
0
0

Try to set up a scan for stocks  that are down over $5 for the past 3 days.

Thanks

Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on December 3, 2023 2:35 pm
49 views
0
Private answer

Thinkorswim provides a built-in scan for percent change over X bars. But your request is for a net change over X bars and therefore requires a custom solution.

The following solution compares the current close to the close from X bars ago. The user input named "numberOfBars" is set to 3 as default. Which will cause this scan to compare the price of the current bar to the close of the bar from 3 bars ago.

(current bar is counted as bar 1, previous bar is counted as 2 bars ago, the bar before that being counted as 3 bars ago).

Which means the default settings included in this solution will find stocks which are down more than $5 over the most recent three bars.

Once you understand those specifications you can adjust the scan to suit your specific preferences.

input targetAmount = 5.0;
input numberOfBars = 3; # must be greater than 1
plot scan = close[numberOfBars - 1] - close > targetAmount;

 

Marked as spam
Posted by (Questions: 37, Answers: 4084)
Answered on December 3, 2023 2:43 pm
0
Thanks for your prompt response. Yes I have been using the percentage change with different scans set up for years.
( at December 3, 2023 3:40 pm)