Stock with tight price range and volume > 150k


Category:
0
0

I am looking for help in getting a thinkscript which can be used as scanner to select all stocks for a particular day where the stock price hasn’t moved much for the day (difference between open vs high / low is not greater than 2%) though it has had more than 150k volume. Kindly help.

RESOLVED
Marked as spam
Posted by (Questions: 3, Answers: 7)
Asked on December 9, 2020 6:36 am
121 views
0
Private answer

Sorry but I have read this statement several times and I cannot understand how this gets computed:

difference between open vs high / low is not greater than 2%

You will need to provide an actual mathematical formula. If I interpret your statement literally this is what I end up with:

open - (high / low)

Let's take an example from yesterdays daily candle of AAPL:

124.37 - (124.98 / 123.09) = 123.35

Obviously this is not correct. You need to provide the math to compute this so-called "tight price range".

Edit: In the comments section below we now have a full set of specifications for how to compute a stock that has a "tight range". Here is the basic description of how this should be computed for this particular request. "for example AAPL is open at 125$ and its high for the day is 127$ and low for the day is 123$ then AAPL will get selected since it meets the 2% range i.e. (127-125)/125 = 1.6% for high and (125-123)/125 = 1.6% for low which is below or equal to 2% range".

So we need to compute this value twice and the code must check that both values are within the specificied amount. I have included two user inputs to allow folks to adjust the percent thresholds to suite their own needs.

The volume portion of the reuqest will not be included in this solution because it is already provided as a built-in stock filter on Thinkorswim Stock Hacker.

I blieve this should do the trick but I have not taken the time to test it.

input percentThresholdHigh = 2.0;
input percentThresholdLow = 2.0;
def range = high - low;
def percentHighFromOpen = 100 * (high - open) / open;
def percentLowFromOpen = 100 * (open - low) / open;
plot scan = percentHighFromOpen < percentThresholdHigh and percentLowFromOpen and percentThresholdLow;

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on December 9, 2020 9:57 am
0
Just to provide additional details, if for example AAPL is open at 125$ and its high for the day is 127$ and low for the day is 123$ then AAPL will get selected since it meets the 2% range i.e. (127-125)/125 = 1.6% for high and (125-123)/125 = 1.6% for low which is below or equal to 2% range. I am looking at selecting all stocks where the high for the day is less than 2% from the open and the low for the day is less than 2% from the open i.e. both of these parameters (high from open and low from open) should match for any stock to be selected for that day. Hopefully this helps. Sorry if my query wasn’t clear earlier.
( at December 11, 2020 3:10 pm)
0
Thanks for providing those details. I have updated my answer to include the solution you requested.
( at December 11, 2020 4:01 pm)
0
Thanks a lot. I will try to use this and will revert back. Truly appreciate the help.
( at December 12, 2020 6:50 pm)
0
Hi Pete, This query was real helpful. Truly appreciate the help. I will mark this as resolved.
( at December 17, 2020 8:15 am)