Finding market sector leaders


Category:
0
0

Hello Pete,

I am starting this thread to see how to create a scan to find market sector leaders. Below is thinkscript I use to find range breaks. I needed a little help altering it to find market sector leaders. Thanks for your time and help with this.

input ShowORB = Yes;
input ORBRange = 30;
def Market_Open_Time = 730;
def Market_Close_Time = 1600;
def day = GetDay();
def pastOpen = If((SecondsTillTime(Market_Open_Time) > 0), 0, 1);
def pastClose = If((SecondsTillTime(Market_Close_Time) > 0), 0, 1);
def IsmarketOpen = If(pastOpen and !pastClose, 1, 0);
def firstBar = If (day[1] != day, day – 1, 0);
def secondsUntilOpen = SecondsTillTime(Market_Open_Time);
def regularHours = SecondsTillTime(Market_Close_Time);
def secondsFromOpen1 = SecondsFromTime(Market_Open_Time);
def pastOpeningRange = If(secondsFromOpen1 >= ((ORBRange – 15) * 60), 1, 0);
rec displayedHigh = If(high > displayedHigh[1] and IsmarketOpen and ShowORB, high, If(IsmarketOpen and !firstBar, displayedHigh[1], high));
rec displayedLow = If(low < displayedLow[1] and IsmarketOpen and ShowORB, low, If(IsmarketOpen and !firstBar, displayedLow[1], low));
rec ORHigh = If(pastOpeningRange, ORHigh[1], displayedHigh);
rec ORLow = If(pastOpeningRange, ORLow[1], displayedLow);
plot scan = high > ORHigh or low < ORLow;

 

http://tos.mx/RWquvX

Marked as spam
Posted by (Questions: 6, Answers: 12)
Asked on November 10, 2018 2:15 pm
340 views
1
Private answer

So exactly how do you plan to define a “market sector leader”? Not sure if you searched the forum for similar posts. But others have asked for a similar solution and the end result is that Thinkorswim does not have tools to address this.

It is entirely a manual process. You could use relative strength scan to find over-performing stocks. But you will have to run that scan against each and every market sector you want to cover. Then export those results to a watchlist. Add a custom column to that watchlist to display the relative strength for each. Then short by that column and pick out the ones you want.

The piece lacking in Thinkorswim (as already mentioned in previous posts) is the ability to tell what sector any given ticker symbol belongs to. It’s just not there in the language. So there is no code that can be written to fully automate it.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on November 10, 2018 3:52 pm
0

Thank you again, Pete.

I did look through the previous posts and obviously missed the post. What you suggested in regard to the relative strength scan I will look for in the previous posts.

( at November 10, 2018 4:09 pm)
0

If you choose to use Relative Strength you will want to view our video on the topic and grab the custom code it provides: https://www.hahn-tech.com/thinkorswim-scan-relative-strength/

( at November 10, 2018 5:12 pm)
0

Thank you, Pete!

( at November 11, 2018 6:46 pm)