Hull Moving Average Turning Points and Concavity (2nd Derivatives)

madeinnyc

madeinnyc

Member
I've been experimenting using it on a 90 ATR style chart on the /NQH20....along with a few lower studies.
 
D

DB01

New member
Joreha - Sorry, what is AMM?

"Combined with AMM. only 3 trades in 1 day, but 100% win."
 
T

TosTrd

New member
It seems regarding the repaint issues, it depends on the bar after the arrow signal bar............if the prices go wayward then the signal disappears etc.

Any backtesting should be done only on the closing price of the bar after the signal bar. Many a times too much price movement has already taken place by the end of the "next" bar.
 
F

frugal

New member
This indicator cannot be used in its current form. The signal changes or decided after the fact.
 
T

TosTrd

New member
This indicator cannot be used in its current form. The signal changes or decided after the fact.
It can be in combination to other tools and indicators. If the price of the "next" bar after the "arrow/signal" bar has not moved by much then there is no repainting. Most important thing of this indicator is the "confidence boost" that it gives you while in the trade, especially for those who trade manually and not use any algo.
 
T

tradegeek

Member
2019 Donor
@mashume By any chance you can make the lower study plot arrow/dot/etc on the price chart when the Divergence line crosses the zero line in the lower study?
 
M

mashume

Active member
@mashume By any chance you can make the lower study plot arrow/dot/etc on the price chart when the Divergence line crosses the zero line in the lower study?
Sorry, I'm not sure how to have a lower study plot on the upper. I'm not even sure it's possible. You can run two studies with identical settings and only have the Concavity upper plot buy and sell signals (they should coincide with the crossovers on the lower)

-mashume
 
YungTraderFromMontana

YungTraderFromMontana

Active member
Sorry, I'm not sure how to have a lower study plot on the upper. I'm not even sure it's possible. You can run two studies with identical settings and only have the Concavity upper plot buy and sell signals (they should coincide with the crossovers on the lower)

-mashume
any new ideas on this indicator?
 
T

tradegeek

Member
2019 Donor
Sorry, I'm not sure how to have a lower study plot on the upper. I'm not even sure it's possible. You can run two studies with identical settings and only have the Concavity upper plot buy and sell signals (they should coincide with the crossovers on the lower)

-mashume
Actually, that was what I did. I place a copy of the indicator in the upper study. I didn’t like the zeroline and the divergence line plotting across the middle of my price chart so I replaced “plot””with “def” in the code for the zero line and the divergence line. After I had done that, nothing was showing.

--EDITED--

Nevermind. I figured it out. Under the plots for cx_up and cx_down, I had to replace "0" with "price" when the condition is true so tht it shows the arrows at the 'price' instead of at '0'.
 
Last edited:
M

mashume

Active member
Actually, that was what I did. I place a copy of the indicator in the upper study. I didn’t like the zeroline and the divergence line plotting across the middle of my price chart so I replaced “plot””with “def” in the code for the zero line and the divergence line. After I had done that, nothing was showing.
Couldn't tell if you got it working or not.
Try this:
I've only hacked it in a text editor, not in thinkorswim as it's not logging me in at the moment. Down for updates perhaps.

Code:
#
# Hull Moving Average Concavity Divergence
#  or
# The Second Derivative of the Hull Moving Average
#
# Author: Seth Urion (Mahsume)
# Version: 2020-02-23 V3
#
# This code is licensed (as applicable) under the GPL v3
#
# ----------------------

declare upper;

input price = HL2;

input HMA_length = 55;
input lookback = 2;

def HMA = HullMovingAvg(length = HMA_length, price = price);

def delta = HMA[1] - HMA[lookback + 1];
def delta_per_bar = delta / lookback;

def next_bar = HMA[1] + delta_per_bar;

def concavity = if HMA > next_bar then 1 else -1;

def divergence = HMA - next_bar;
# divergence.setDefaultColor(Color.LIME);
# divergence.SetLineweight(2);

plot cx_up = if divergence crosses above 0 then LOW else double.nan;
cx_up.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
cx_up.SetDefaultColor(Color.LIGHT_GREEN);
cx_up.SetLineWeight(3);

plot cx_down = if divergence crosses below 0 then HIGH else double.nan;
cx_down.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
cx_down.SetDefaultColor(Color.RED);
cx_down.SetLineWeight(3);
mashume
 
T

tradegeek

Member
2019 Donor
I actually posted my edit right before you posted your reply. I got it working. LOW and HIGH make sense. More than one way to skin a cat I guess. Thanks!
 
switchfire

switchfire

Member
VIP
I guess maybe that's one reason back testing showed more profitable using MA_Min/MA_Max vs the orginal signal
 
P

Playstation

Active member
VIP
but as some of us have tested it out, the max min will keep repainting. What does not repaint is the hull line and colors, so watch for together wholesomely.

Once all are in confluence, there's your⬆⬆⬇⬇⬅➡⬅➡🅱🅰
 
B

bobomatic

New member
Just curious, what other indicators are you guys using to confirm signals?
 
K

kshires4

Member
@mashume trying to use your lower study scan code. Looks like the signals are coming back a few days after on the scans. I am looking to get daily signals from the lower study
 
M

mashume

Active member
@kshires4

You may have an out-of-date version of the code. Please check to see what version number is in your code. I think the most recent is V3.

happy trading
mashume
 
T

Thomas

Active member
@mashume Sorry, but this reminded me of a set up I say, a strategy I took a look at and thought has possibilities, using HULL.....https://www.tradingsetupsreview.com/jjrvats-price-based-trading/
 
K

kshires4

Member
@mashume This is what I have: looks like version 3 - Is this giving a signal from the lower_hull_moving average?

Code:
script ConcavityDivergence {
#
# Hull Moving Average Concavity Divergence
#  or
# The Second Derivative of the Hull Moving Average
#
# Author: Seth Urion (Mahsume)
# Version: 2020-02-21 Initial Public
#
# This code is licensed (as applicable) under the GPL v3
#
# ----------------------

declare lower;

input price = HL2;

input HMA_length = 34;
input lookback = 2;

def HMA = HullMovingAvg(length = HMA_length, price = price);

def delta = HMA[1] - HMA[lookback + 1];
def delta_per_bar = delta / lookback;

def next_bar = HMA[1] + delta_per_bar;

def concavity = if HMA > next_bar then 1 else -1;

plot zero = 0;
zero.setdefaultcolor(color.gray);
zero.setpaintingstrategy(PaintingStrategy.DASHES);

plot divergence = displacer(-1, HMA - next_bar);
divergence.setDefaultColor(Color.LIME);
divergence.SetLineweight(2);

plot cx_up = if divergence crosses above zero then 0 else double.nan;
cx_up.SetPaintingStrategy(PaintingStrategy.POINTS);
cx_up.SetDefaultColor(Color.LIGHT_GREEN);
cx_up.SetLineWeight(4);

plot cx_down = if divergence crosses below zero then 0 else double.nan;
cx_down.SetPaintingStrategy(PaintingStrategy.POINTS);
cx_down.SetDefaultColor(Color.RED);
cx_down.SetLineWeight(4);

}

def signal = ConcavityDivergence("hma length" = 55)."concavity";
def HMA = ConcavityDivergence("hma length" = 55)."HMA";
def next = ConcavityDivergence("hma length" = 55)."next_bar";

plot buy = signal < 0 and (HMA - next) > (HMA[1] - next[1]);
 

Top