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
Like this:
Like Loading...
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.
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/
Thank you, Pete!