How to turn the High Low Study 2 into a Scan Query


Category:
0
0

Hey Pete! How can you turn your study into a scan query? Thanks for the great videos and tutorials!

Marked as spam
Posted by (Questions: 10, Answers: 14)
Asked on February 11, 2017 8:06 pm
698 views
0
Private answer

Ok, we will not be posting the entire code here. Because we want to be sure that folks watch the entire video so they understand what it does and how to adjust it’s inputs. This is very important because if you don’t know how to adjust the inputs you will be lost.

This code is published as version one and version two.

The original version is found here:
https://www.hahn-tech.com/thinkorswim-alert-high-low/

And version two is found here:
https://www.hahn-tech.com/thinkorswim-alert-high-low-version-two/

Here are the step-by-step instructions to convert version two into a scan. The scan it to be run on an intraday time frame. Select a time frame based on how often you want the scan to pick up new intraday highs and lows.

  1. Copy and paste the code into the custom scan criteria
  2. Change the existing “plot” statements to “def”
  3. Delete the two style statements that turn red after step 2
  4. Delete the “AddLabel()” statements
  5. Delete the “AddChartBubble()” statements
  6. Delete the “Alert()” statements
  7. Add the following statements at the very bottom of the code

# use this to scan for new intraday highs
plot scan = DailyHigh > DailyHigh[1];
# use this to scan for new intrady lows
#plot scan = DailyLow < DailyLow[1];

The “#” sign is used as a comment marker. So you can switch this from scanning for new highs to scanning for new lows by moving the “#” sign for the appropriate “plot scan” statement.

When using this to create a custom scan, the inputs will need to be adjusted within the code itself.

input marketOpen = 930;
input marketClose = 1600;
input intraDaySpan = {Default "SameDay" , "OverNight"};

So you will need to manually adjust the marketOpen and marketClose directly within the code. If you need to switch the intraDaySpan from “SameDay” to “OverNight” you will need to move the word “Default” in front of whichever setting you want.

I understand there are a lot of modifications here. So if you get hung up on something just post in the comments below and I will clarify things further if needed.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on February 11, 2017 10:48 pm
0
I think that worked! Thanks! How would you recommend I sort the scan results to get the most recent at the top of the list??? Or make results disappear after a few seconds?
( at February 11, 2017 11:22 pm)
0

There are some advanced techniques we can employ to do this. And this would require we save the scan and then load it into a watchlist widget. I don’t think you are going to get the reaction time you expect. There may be several minutes of delay as the counts are updated and older signals drop off the scan. The solution is beyond the scope of what we would cover in the Q&A forum. If you are interested in pursuing a custom Thinkscript project for this just fill out the contact form at the bottom of the About page.

( at February 12, 2017 9:18 am)
0

Ok thanks for the work you’re doing!

( at February 12, 2017 10:02 am)
0
Private answer

Hi

Is it possible to create a dynamic watchlist with ThinkScript that’ll show all tickers that have reached a new high/low

1. for X period, eg. 52 week, daily, weekly, etc
2. sets the color to Green/Red respectively
3. Has a count column that shows the amount of times the high/low has been broken since the first break occurred

Option 1 is my main objective, the others are bonus

tx

Marked as spam
Posted by (Questions: 1, Answers: 3)
Answered on March 6, 2017 4:55 am
0

I can provide a solution for options 1 and 2. Option 3 would be something we provide for a fee. Please post this as a new question in the watchlist topic so other viewers will be able to find it.

( at March 6, 2017 9:25 am)
0
Private answer

Hello, although the study is set  2200 to 1100 and overnight when I look at the study code to use it for a scan it shows the below. Now I can change the times but the Default “SameDay” , “OverNight” is confusing, in fact I tried removing “SameDay” and get an error.

I’m trying to make this a new high new low after hours scanner, can this be done just by changing these parameters?

input marketOpen = 0930;
input marketClose = 1600;
input intraDaySpan = {Default “SameDay” , “OverNight”};
input numberOfDays = 1;
input numberOfYears = 0;

 

Marked as spam
Posted by (Questions: 3, Answers: 3)
Answered on March 20, 2017 1:48 pm
0

Yes, it should work. Although I have not tested it. Keep in mind the scan is going to use local time and not exchange time. So the time you use for marketOpen and marketClose should be adjusted accordingly. As for the intraDaySpan. In order to change that setting in the scan, delete the word Default from in front of ”SameDay” and add it after the comma and before the word ”OverNight”
Let us know how it works.

( at March 20, 2017 2:33 pm)