Hull Format, Label, Watchlist, Scan for ThinkorSwim

Yes, but it relies on the next future bar, '[-1]', which may not actually close to cause the HMA to change. The arrow may disappear (repaint] as a result. The plot of the arrow will look how you want only if the future bar closes to change the HMA.

You can test it with the following code to see which version you feel comfortable with using.
great job! thank you! will be possible to paint the bars with this system? thank you in advance!
 

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

great job! thank you! will be possible to paint the bars with this system? thank you in advance!
I have never painted candles using future bars. The repainting is an issue but the syntax would be:
Ruby:
AssignPriceColor(
if U1 then Color.yellow else
if D1 then color.blue else color.current);
 
Has anyone created the Hull Suite by Trading View that works the same? I have searched many threads (Eye Bleeding Now) and haven't found one that works. Seems like all of them have issues. If it has been created, Please provide link or code. Thanks.
 
Has anyone created the Hull Suite by Trading View that works the same? I have searched many threads (Eye Bleeding Now) and haven't found one that works. Seems like all of them have issues. If it has been created, Please provide link or code. Thanks.
I am interest myself, I would love to know the thinkscript for Thinkorswim.
Here is the one from Tradingview.
https://www.tradingview.com/script/hg92pFwS-Hull-Suite/
//@version=4
//Basic Hull Ma Pack tinkered by InSilico
Here is the converted version:
https://usethinkscript.com/threads/...ist-scan-for-thinkorswim.947/page-2#post-7685
 
I have converted the Hull Suite to scan for a bullish signal, i.e., the band turns green from red. I am not sure if I am getting the correct data or not. Can someone verify the script to see if this is acceptable or not?

Thanks


# 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
 
I have converted the Hull Suite to scan for a bullish signal, i.e., the band turns green from red. I am not sure if I am getting the correct data or not. Can someone verify the script to see if this is acceptable or not?

Thanks


# 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
https://usethinkscript.com/threads/...st-scan-for-thinkorswim.947/page-2#post-12501
 
I'm not much of a coder and I do a lot of copy and paste - thanks to everyone for that.

Right now I'm trying to get an up or down arrow to show up when the HULL moving average line has a color change indicating
an up move and then again when it changes to a down move.

The best I have been able to do is get an arrow to show up when the PRICE goes through the average, but that just throws a bunch
of arrows on the screen.

I have been searching for what I'm asking for, but I can't seem to find it....Any Help Out There.... and thanks in advance for any
clues or code....
I KNOW that the error is in the plot UpSignal and plot DownSignal........ I want an arrow to show up pointing out the color change....


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


plot HMA = MovingAverage(AverageType.HULL, price, length)[-displace];
plot UpSignal = price crosses above HMA;
plot DownSignal = price crosses below HMA;

HMA.SetDefaultColor(GetColor(1));
UpSignal.SetDefaultColor(Color.UPTICK);
UpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
DownSignal.SetDefaultColor(Color.DOWNTICK);
DownSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

HMA.DefineColor("Up", GetColor(1));
HMA.DefineColor("Down", GetColor(0));
HMA.AssignValueColor(if HMA > HMA[1] then HMA.color("Up") else HMA.color("Down"));
 
Hi All,
I use the attached hull inductor on a 1 Hour time frame. Is possible to add Label for the Day Hull to the 1 Hour chart so I can save some screen space?

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

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

HMA.DefineColor("Up", GetColor(1));
HMA.DefineColor("Down", GetColor(0));
HMA.AssignValueColor(if HMA > HMA[1] then HMA.color("Up") else HMA.color("Down"));
 
Hi All,
I use the attached hull inductor on a 1 Hour time frame. Is possible to add Label for the Day Hull to the 1 Hour chart so I can save some screen space?

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

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

HMA.DefineColor("Up", GetColor(1));
HMA.DefineColor("Down", GetColor(0));
HMA.AssignValueColor(if HMA > HMA[1] then HMA.color("Up") else HMA.color("Down"));


This will give you the option to show a label and/or a bubble with the 1hr data. The bubble can be moved sideways in the right expansion by the number of bars at the input bubblemover.

Screenshot 2023-10-24 161242.png
Code:
input price = close;
input length = 25;
input displace = 0;

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

HMA.DefineColor("Up", GetColor(1));
HMA.DefineColor("Down", GetColor(0));
HMA.AssignValueColor(if HMA > HMA[1] then HMA.Color("Up") else HMA.Color("Down"));

def HMA1hr = MovingAverage(AverageType.HULL, close(period = AggregationPeriod.HOUR), length)[-displace];

input label = yes;
AddLabel(label, "HMA1hr: " + AsDollars(HMA1hr), if HMA1hr > HMA1hr[1] then HMA.Color("Up") else HMA.Color("Down"));

input bubble = yes;
input bubblemover = 1;
def b  = bubblemover;
def b1 = b + 1;
AddChartBubble(bubble and IsNaN(close[b]) and !IsNaN(close[b1]), HMA1hr, "HMA1hr: " + AsDollars(HMA1hr[b1]), if HMA1hr[b1] > HMA1hr[b1 + 1] then HMA.Color("Up") else HMA.Color("Down"));

#
 
Here you go!

Chart Behavior

View attachment 5723

Watchlist:

View attachment 5725

Ruby:
#Follow @Krose_TDA on twitter for updates to this and other custom columns
#TD Ameritrade IP Company, Inc. (c) 2008-2019
#Follow @Krose_TDA on twitter for updates to this and other custom columns
#Input desired parameters using the input statements below
#
#2019.10.11 - @diazlaz - Updated to include persist state
#

input price = close;
input length = 20;
input WithinBars = 1;

def hma = HullMovingAvg(price,length);

def TriglableBull = hma[1]<hma[2] and hma>hma[1];
def TriglableBear = hma[1]>hma[2]and hma < hma[1];
def trigger = TriglableBear or TriglableBull;
def sTrigger = if TriglableBear then -100 else if TriglableBull then 100 else sTrigger[1];

AddLabel(yes,
if sTrigger == -100 then "Bear" else "Bull",
if sTrigger == -100 then COLOR.RED  else COLOR.GREEN
);

#plot results = sTrigger;
I have 2 questions about the Hull code for a watchlist column:
!: How would you change the code to paint the background of the column green and red, instead of having bull and bear wrote in the column?
2: Instead of having bull or bear wrote in the column, is it possible to have how many bars has past since a color change? And how do you do it?
Thanks,
 
I can't find a way to search for a hull of any timeframe that is already positive (up) or negative (down). My goal is to find stocks that say already have a upward hull on the daily and hourly but the 15 minute just changed from negative to positive.

I know I need to enter each scan timeframe parameter separately and I know how to scan for the hull direction change (the 15 minute in my example) but I don't know how to tell the scan to be sure the daily and hourly hulls are already positive. Thanks!
 
Not sure if this is what you are looking for but this might help.

Code:
#MACD based on Hull Moving Average W/peak/ebb arrows

#TOS title = MACD_via_Hull_MA_fav



declare lower;



input fastLength = 12;

input slowLength = 26;

input MACDLength = 9;

input AverageType = {SMA, EMA, default HULL};



plot Value;

plot Avg;

switch (AverageType) {

  case SMA:

    Value = Average(close, fastLength) - Average(close, slowLength);

    Avg = Average(Value, MACDLength);

  case EMA:

    Value = ExpAverage(close, fastLength) - ExpAverage(close, slowLength);

    Avg = ExpAverage(Value, MACDLength);

  case HULL:

    Value =  MovingAverage(AverageType.HULL, close, fastLength) -  MovingAverage(AverageType.HULL, close, slowLength);

    Avg = Average(Value, MACDLength);

}



plot Diff = Value - Avg;

plot ZeroLine = 0;

Value.SetDefaultColor(GetColor(1));

Avg.SetDefaultColor(GetColor(8));

Diff.SetDefaultColor(GetColor(5));

Diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

Diff.SetLineWeight(3);

Diff.DefineColor("Positive and Up", Color.GREEN);

Diff.DefineColor("Positive and Down", Color.DARK_GREEN);

Diff.DefineColor("Negative and Down", Color.RED);

Diff.DefineColor("Negative and Up", Color.DARK_RED);

Diff.AssignValueColor(if Diff >= 0 then if Diff > Diff[1] then Diff.color("Positive and Up") else Diff.color("Positive and Down") else if Diff < Diff[1] then Diff.color("Negative and Down") else Diff.color("Negative and Up"));

ZeroLine.SetDefaultColor(GetColor(0));



#plot Min arrows*

def MinArrow = if (Value < Value[1] and value[1] < Value[2] and value[2] < Value[3] and value[-1] > Value and value < 0)

  then 0

  else if (Value > Value[1])

  then double.nan

  else double.nan;



plot UpArrow = if(MinArrow == 0, value, double.nan);

UpArrow.AssignValueColor(Color.Green);

UpArrow.SetPaintingStrategy(PaintingStrategy.ARROW_UP);

UpArrow.SetLineWeight(1);

UpArrow.HideBubble();



#plot Max arrows*

def MaxArrow = if (Value > Value[1] and value[1] > Value[2] and value[2] > Value[3] and value[-1] < Value and value > 0)

  then 0

  else if (Value > Value[1])

  then double.nan

  else double.nan;



plot DwnArrow = if(MaxArrow == 0, value, double.nan);

DwnArrow.AssignValueColor(Color.cyan);

DwnArrow.SetPaintingStrategy(PaintingStrategy.ARROW_Down);

DwnArrow.SetLineWeight(1);

DwnArrow.HideBubble();



#plot Max signal(Avg) arrows*

def SignalArrow = if (Avg > Avg[1] and Avg[1] > Avg[2] and Avg[2] > Avg[3] and Avg[-1] < Avg and Avg > 0)

  then 0

  else if (Avg > Avg[1])

  then double.nan

  else double.nan;



plot downSignalArrow = if(SignalArrow == 0, avg, double.nan);

downSignalArrow.AssignValueColor(Color.yellow);

downSignalArrow.SetPaintingStrategy(PaintingStrategy.ARROW_Down);

downSignalArrow.SetLineWeight(1);

downSignalArrow.HideBubble();



AddCloud(ZeroLine, Value, color.RED, color.GREEN);

# end

This is the source I found it from.

https://github.com/jshingler/TOS-an...llection.md#MACD_BASED_ON_HULL_MOVING_AVERAGE

I tried using this think script code but it says. Exactly one plot expected.
 
Last edited:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
342 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