Hull Format, Label, Watchlist, Scan for ThinkorSwim

Yes - I did not have to load it in the charts. I just loaded it directly under MarketWatch > Quotes, there is kind of a wheel/sprocket on the far right, click that - it brings you to "Customize Quotes". From there I look for an unused template. I selected Custom20. Click Add Items. At this point I renamed the column as HULL and add the code from post #1. Click OK and I'm done. This is a bit difficult to explain via a forum. That's why I suggest you contact someone from TOS support to walk you through the steps
OK Thanks. I am going to start working on it. I was looking at my custom columns in my watchlist. There are Custom Columns 12-19. When I clicked on each on it moved it to the right column and when I clicked on the box it said Moving Average.
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Thanks for all your help. When I looking at the Custom Columns in my watchlist all I had to do is click on the scroll icon on the left of Custom. That brought up another window. I then clicked on Think or Swim editor. I then removed the script that was there and entered the script for Hull watchlist and named it. Live and learn (lol)
 
I just added a 2nd 2 HR Hull Watch list to my column. Now I have a 2HR Hull watchlist on the left and a Daily to the right of that. It sure makes things visually easy when you look at a watchlist of 100 and are trying to decide which stocks to buy or which stocks to short.
 
@tomsk please look at #7, 8 and 11 here. We have been tying to come up with a better way to catch rotation. #7 is from TSL, it never went anywhere.
Please give your thoughts.
https://usethinkscript.com/threads/hull-moving-average-watchlist-column-for-thinkorswim.801/


@markos Be happy to share my views. Over the past 4-5 years there has been several attempts to carve out a sector rotation model. Probably the closest one that resonated with me is Jaime Pinto's S&P 500 Sector Performance study. I'm aware that Paris improved that version by displaying labels of relative S&P sector performance in terms of percentages.

About 3, maybe 4 years ago now there was a gentleman called John Galt who came up with multiple renditions of a Dow Jones Sector Performance. I seem to recall there might have been more than 10 different versions floating out there. My preference is to base my analysis on a broader market index like the S&P 500 so I did not pay too much attention to Galt's model.

Around this same period, there was another attempt by a contributor that arrived at a S&P 500 composite weighted sector study,
that computes a score based on whether the percentage of each sector of the S&P 500 is above or below a certain price.

Finally Mobius had posted a Stochastic Rotation model that appeared to have a good framework/template based on a couple of S&P sectors. I think this required further work but I don't think there was ever any follow up by any one in the lounge.

For the purposes of having a good glance and see what the various sectors are doing, I'd say hands down that Jaimie Pinto's sector performance is the way to go. Hope this helps
 
I have been looking for a Hull Moving Average scanner and I have found this scan on here below: I was told that in order to use this scanner I first need to save it as a study then open it as custom then study and edit condition to (is true) (within 1 bar). Please see the pic below:

5JChyVR.png


When I called TOS I was told that because this is a moving average study I need to use (cross below) for a bear scan and or (cross above) for a bull scan under the edit conditions. Also I need to set the other conditions to as follows...Please see pic below:

NjEvcpc.png


So which is right? setting the edit condition to true or setting the conditions to cross below or above depending on bull or bear scan as per TOS instructions.

Not to further complicate things...but TOS also has their own Hull Average Change option under Study ---> Price Performance ---> Hull_Average_Change. Please see pic below:

cjYLquR.png


The weird part about all this is when I run the custom scan under the same parameters such as 15 length 1 hour scan...I get different results between the Hull Average Change TOS scanner vs the Hull Moving Average Scan that I found here...Please see pic below: Why is that IF all parameters are the same?

uuazxrV.png


Lastly...I heard and or experienced that when scanning for moving average cross overs not so much a Hull Moving Average scan...that the results can be delayed anywhere from 2-3 bars depending on the timeframe. Meaning that if you select a 1 hour time frame...such a delay can be 2-3 hours...Is this true? If so do I need to scan lets say on a 15 min timeframe to get the results desired for a 1 hour time frame? I thought that such results would be in real time or with a 3 min delay as per TOS scanner updates once the condition of Hull Moving Average were met on a 1 hour timeframe...

Perhaps I am doing something wrong here...anyone with experience can you please clarify this? I have read over the section that @markos wrote on the scanner...but none of these questions pertain to what I am experiencing here. Thanks in advance.

Code:
# Basic Hull Ma Pack tinkered by InSilico
# Original Port from https://www.tradingview.com/script/hg92pFwS-Hull-Suite

input modeSwitch = {default "Hma", "Thma", "Ehma"}; #Hull Variation
input length = 55; #Length(180-200 for floating S/R , 55 for swing entry)
input src = close; #Source

def hma;
switch (modeSwitch) {
case "Hma":
    hma = wma(2 * wma(src, length / 2) - wma(src, length), round(sqrt(length)));
case "Ehma":
    hma = expAverage(2 * expAverage(src, length / 2) - expAverage(src, length), round(sqrt(length)));
case "Thma":
    hma = wma(wma(src,(length/2) / 3) * 3 - wma(src, (length/2) / 2) - wma(src, (length/2)), (length/2));
}

def hull = hma;
def transition = hull > hull[2];

# Delete (#) the plot not needed

#plot scanBull = !transition[1] and transition;
plot scanBear = transition[1] and !transition;

# End Basic Hull Ma Pack Scan
 
You should use the "True" statement when there is an arrow or an indication on the chart. For example, if there is a function in the code that plot an arrow every time the price crosses above or below the moving average, then in the Scanner, you would want to use the "True" option. If there isn't such a thing, you will have to use "crosses," "crosses above," or "crosses below" in the Scanner.

Looking at the source code, it already include the scan snippet for you.

As far as delay time, it's between 5-10 mins; it doesn't matter which timeframe you're using.
 
@horserider thanks! :). I'm almost there!

So I made some small changes. You can toggle the HMA on and off. Can't figure out how to make it dual colored (up/down) like its supposed to be though, but its fine the way it is I guess since the arrows show direction change. That and have to fix the labels (uptrending/downtrending) to work, that broke somehow.

Only thing missing at this point is assigning the candle painting variable to a toggle on/off option in the settings.

Here is the current code:

Code:
# Hull MA Trend Indicator - Arrows Alerts & Paint
# TD Ameritrade IP Company, Inc. (c) 2008-2017
# colors and arrows and labels by EBTrader 02.22.15
# modified by tiny bull 2.7.20
# version 1.3

input price = close;
input length = 20;
input displace = 0;
def HMA = MovingAverage(AverageType.HULL, price, length)[-displace];
def hmaAscending = HMA > HMA[1] and HMA[1] > HMA[2];
def hmaDescending = HMA < HMA[1] and HMA[1] < HMA[2];

#==============start painted candles...need to finish input (I'm lost there)...
#told to add paint candles variable to your assignpricecolor
#need to make hma dual colored up/down, currently just one color

input usehma = yes;
plot HullMA = if usehma then hma else double.NaN;

plot candlesHMA = MovingAverage(AverageType.HULL, price, length)[-displace];

input paint_candles = yes;
candlesHMA.DefineColor("Up", color.green);
candlesHMA.DefineColor("Down", color.red);
candlesHMA.AssignValueColor(if hmaascending then candlesHMA.color("Up") else candlesHMA.color("Down"));
AssignPriceColor(if hmaascending then candlesHMA.color("Up") else candlesHMA.color("Down"));

#===================start arrows and labels

input crossingType = {default any, above, below};
def signal = CompoundValue(1, if hmaascending then 1 else if hmadescending then -1 else signal[1], 0);
input showarrows = yes;
plot U1 = showarrows and signal > 0 and signal[1] <= 0;
U1.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
U1.SetDefaultColor(Color.green);
U1.SetLineWeight(3);
plot D1 = showarrows and signal < 0 and signal[1] >= 0;
D1.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
D1.SetDefaultColor(Color.red);
D1.SetLineWeight(3);

input usealerts = no;
Alert(usealerts and U1, "UP", Alert.BAR, Sound.Bell);
Alert(usealerts and D1, "DOWN", Alert.BAR, Sound.Chimes);

def uptrend = hmaascending;
def downtrend = hmadescending;

#label stopped working, need to fix

addlabel(uptrend, "Uptrend", color.green);
addlabel(downtrend, "Downtrend", color.red);
 
Came across this Hull streategy and its working very well... https://tos.mx/XJnywQ4

lGxq2VA.png


Code:
#  One Note Download
addOrder(OrderType.BUY_AUTO, no);input price = close;
input length = 49;
input displace = 0;

plot HMA = MovingAverage(AverageType.HULL, price, length)[-displace];

HMA.DefineColor("Bullish", GetColor(1));
HMA.DefineColor("Bearish", GetColor(0));
HMA.AssignValueColor(if HMA > HMA[1] then HMA.color("Bullish") else HMA.color("Bearish"));
AssignPriceColor(if HMA > HMA[1] then HMA.color("Bullish") else HMA.color("Bearish"));
addOrder(OrderType.BUY_AUTO, HMA crosses above HMA[1]);
addOrder(OrderType.Sell_AUTO, HMA crosses below HMA[1]);
 
Can someone who is proficient in coding make a scan for this particular Hull MA for both Bullish and Bearish conditions? This particular Hull MA is not based on the color change from negative to positive or vice versa but rather when the candle pierces through the moving average above or below the line...This would allow for a possible quicker entry/exit for a swing trade. Ideal for daily charts. Thanks.

Code:
plot Data = close;#Hull Moving Average
#Colors and arrows and labels by EBTrader 02.22.15

input price = close;
input length = 20;
input displace = 0;

plot HMA = MovingAverage(AverageType.HULL, price, length)[-displace];

HMA.DefineColor("Up", color.green);
HMA.DefineColor("Down", color.red);
HMA.AssignValueColor(if price > HMA then HMA.color("Up") else HMA.color("Down"));
AssignPriceColor(if price > HMA then HMA.color("Up") else HMA.color("Down"));

#===================start arrows and labels

input crossingType = {default any, above, below};
def signal = CompoundValue(1, if crosses(price, HMA,crossingDirection.ABOVE) then 1 else if crosses(price, HMA, crossingDirection.BELOW)  then -1 else signal[1], 0);
input showarrows = yes;
plot U1 = showarrows and signal > 0 and signal[1] <= 0;
U1.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
U1.SetDefaultColor(Color.green);
U1.SetLineWeight(3);
plot D1 = showarrows and signal < 0 and signal[1] >= 0;
D1.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
D1.SetDefaultColor(Color.red);
D1.SetLineWeight(3);

input usealerts = no;
Alert(usealerts and U1, "UP", Alert.BAR, Sound.Bell);
Alert(usealerts and D1, "DOWN", Alert.BAR, Sound.Chimes);

def uptrend = price > HMA;
def downtrend = price < HMA;

addlabel(uptrend, "Uptrend", color.green);
addlabel(downtrend, "Downtrend", color.red);




#================end arrows and labels
 
Code:
#Hull Moving Average
#Colors and arrows and labels by EBTrader 02.22.15

input price = high;
input length = 20;
input displace = 0;

def HMA = MovingAverage(AverageType.HULL, price, length)[-displace];
def uptrend = price > HMA;
def downtrend = price < HMA;



plot bullish = (price[1] < hma) and (price > hma)


#================end arrows and labels
I think this should do it. For bearish just swap < and > on the plot.
 
Last edited:
@YungTraderFromMontana cool...thank you...Let me check this out in live market tomorrow...and just to double check this scan is based on the candle crossing the MA line and not the color change of the Hull MA?
If I understood you right then yes, I essentially made a scan that will scan for tickers if the high crosses the hma. I used high instead of close so you can use it midday and pick up on stocks that crossed so you don't have to wait for until close for confirmation on the scan.
 
I haven't been able to find a scan for the turning point of the HullMA. I know it's color coded on desktop when it turns to bullish, does anyone have a scan to share that detects the bullish move on it? I found the one that has been posted here https://usethinkscript.com/threads/hull-ma-scanner.1842/ but the plot line doesn't work. I still don't think that one is going to look for the bullish turning point for the indicator

thanks in advance,
 
try this one
Code:
# Basic Hull Ma Pack tinkered by InSilico
# Original Port from https://www.tradingview.com/script/hg92pFwS-Hull-Suite

input modeSwitch = {default "Hma", "Thma", "Ehma"}; #Hull Variation
input length = 15; #Length(180-200 for floating S/R , 55 for swing entry)
input src = close; #Source

def hma;
switch (modeSwitch) {
case "Hma":
    hma = wma(2 * wma(src, length / 2) - wma(src, length), round(sqrt(length)));
case "Ehma":
    hma = expAverage(2 * expAverage(src, length / 2) - expAverage(src, length), round(sqrt(length)));
case "Thma":
    hma = wma(wma(src,(length/2) / 3) * 3 - wma(src, (length/2) / 2) - wma(src, (length/2)), (length/2));
}

def hull = hma;
def transition = hull > hull[2];

# Delete (#) the plot not needed

#plot scanBull = !transition[1] and transition;
plot scanBear = transition[1] and !transition;

# End Basic Hull Ma Pack Scan
 
Last edited by a moderator:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
264 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top