Hull moving average using data created with 9 period exponential MACD line ?

C-Note Johnson

C-Note Johnson

New member
Is it possible to create a Hull moving average using data created with 9 period exponential MACD line ? ThinkorSwim has the Hull moving average and it also has the MACD. If you change the MACD to use the Hull, it totally messes up the chart. I am asking if it is possible to use the data generated with the MACD 9 period to produce a hull moving average that can be displayed in green and red for up and down, respectively. Any input would be appreciated. C-Note Johnson
 
horserider

horserider

Well-known member
VIP
@C-Note Johnson Probably but first explain why and where the idea originated? What advantage?
My best guess is it will be another study with same information as standard MACD. Make a convincing case for your idea and I might try it.
 
T

Thomas

Active member
Read this, it is a method based around Hull,..........https://www.tradingsetupsreview.com/jjrvats-price-based-trading/?utm_source=Trading+Setups+Review&utm_campaign=bb0ada6a71-RSS+Driven+Email&utm_medium=email&utm_term=0_5348f209e1-bb0ada6a71-136565649
 
C-Note Johnson

C-Note Johnson

New member
Hello Thomas, I read the information at the link that you posted. It is about the Hull moving average in general. I am really interested in a very specific version of the Hull moving average. I am looking for a Hull moving average to be created using the data used to produce the MACD line.
 
horserider

horserider

Well-known member
VIP
Thought I did this. Hmmmm need to go look see. If it was no use might have deleted it. Will post if I find it.
 
C-Note Johnson

C-Note Johnson

New member
Hello horserider, Sorry for the delay in getting back to the questions you posed. Life got in the way... I think the MACD is an amazing tool to determine where a stock might be headed. The MACD line is a very fast and effective VISUAL depiction to determine if price is coming into a period of convergence or divergence.

I am also convinced that the Hull moving average is better than the WMA and the EMA. It seems to be more responsive AND smoother.

To answer your question about where the idea came from. I was looking at the signal line of the MACD line, and the MACD line. This got wondering if there was a happy medium between the two lines.

I don't think the potential study will be the same information as the standard issue MACD. The reason is the signal line is an exponential moving average of the MACD line data. It is definitely not a Hull moving average of the MACD line.

Currently I use Heiken Ashi 1 day candles and a 20 period Hull moving average. This combination reveals quite a but about the potential direction of stock prices. If you can sit on your hands, you can actually make a profit !

With the standard ThinkorSwim 20 period Hull moving average, I have it programmed to go from red to green when the slope changes from negative to positive. It also changes from green to red when the slope changes from positive to negative. It is a very cool tool.

I do not think this is a waste of time. I have never seen a Hull moving average created with the data generated to create the MACD line. In turn, I think this is a novel concept to pursue.

Thank you for your consideration horseride.
 
C-Note Johnson

C-Note Johnson

New member
Hello horserider, I was typing my reply above when you posted a moment ago.
 
horserider

horserider

Well-known member
VIP
For what it is worth, here you go.


Code:
declare lower;

input fastLength = 12;
input slowLength = 26;
input MACDLength = 9;
input averageType = AverageType.EXPONENTIAL;

input showBreakoutSignals = no;

plot Value = MovingAverage(averageType, close, fastLength) - MovingAverage(averageType, close, slowLength);
plot Avg = MovingAverage(averageType, Value, MACDLength);

plot Diff = Value - Avg;
plot ZeroLine = 0;

plot UpSignal = if Diff crosses above ZeroLine then ZeroLine else Double.NaN;
plot DownSignal = if Diff crosses below ZeroLine then ZeroLine else Double.NaN;

UpSignal.SetHiding(!showBreakoutSignals);
DownSignal.SetHiding(!showBreakoutSignals);

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));
UpSignal.SetDefaultColor(Color.UPTICK);
UpSignal.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
DownSignal.SetDefaultColor(Color.DOWNTICK);
DownSignal.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);



###############################
input price = close;
input length = 9;
input displace = 0;

plot HMA = MovingAverage(AverageType.HULL, diff, 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"));
 
C-Note Johnson

C-Note Johnson

New member
Hello horserider, I tried it out on my charts. I think I need to tinker around with the settings to get it to work. What was your impression of the concept ? Thanks again, C-Note Johnson
 
T

Thomas

Active member
Hello Thomas, I read the information at the link that you posted. It is about the Hull moving average in general. I am really interested in a very specific version of the Hull moving average. I am looking for a Hull moving average to be created using the data used to produce the MACD line.
C I mentioned the article as it was a tried and true tested strategy, glad you took time to look.
 
T

Thomas

Active member
Hello horserider, I tried it out on my charts. I think I need to tinker around with the settings to get it to work. What was your impression of the concept ? Thanks again, C-Note Johnson
Ya, dont waste time, find a set up,......I read about Stockbee and Wishing wealth explored them. I have been following Stockbee for years.
 

Top