♥ 0 |
Hi all. So I have an idea I’d like to test out, but I’m not sure how to put it together into a working thing. I basically want to scan for premarket price spikes that have happened say up to 30 days ago. I want the scanner to return the list of tickers and some basic info (how many days back the premarket price spike was, how big a percentage did it spike from from the close of the day prior, etc). I know you can use the AfterHours_Percent_Change study for the current day, but how would you go about scanning the last 30 days to return a list of stocks that spiked to an extended hours high for some after hours/premarket session within those 30 days, with that high being greater than some defined percentage from the close prior to the spike? I only know how to return the list for the current day: def PMhrs = RegularTradingStart (GetYYYYMMDD()) > GetTime(); plot scan = PMHigh > 1.15*close[0];
Marked as spam
|
Private answer
Custom scans on Thinkorswim only have access to 11 trading sessions of historical data when using an intraday time frame: https://toslc.thinkorswim.com/center/howToTos/thinkManual/Scan/Stock-Hacker/studyfilters Here is a more detailed list of limitations:
Marked as spam
|
Please log in to post questions.
Copy the code from the "AfterHours_Percent_Change" Study Filter of the scan tool. Remove the last line of code and replace it with the following:
rec trackSpikes = if BarNumber() == 0 then 0 else if meet_scan_criteria then 1 else trackSpikes[1];
plot hasSpiked = trackSpikes > 0;
Adjust the various inputs parameters as needed.