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

Repaints
Status
Not open for further replies.
Good Day All. First time poster. Couple months as a lurker.

What an awesome thread! Starting from page 1 and reading through everything has been very beneficial.

I'm a ToS user and solely focus on the SPY trading options (simple Calls and Puts...nothing fancy because i'm still learning).

I've been following the BlackFlagSwingArms thread for some time, learning, and I was wanting to learn more about the Hull Moving average that was part of that strategy. In searching this forum it was pretty cool to find Jose's posts within this thread and learning how that code came to life. Thank you @mashume .

The question I would like to ask everyone is:
When does one use the "extended hours" on their charts? Or what makes one use the "extended hours"?

I've never really come across a clear answer/opinion.

Appreciate everyone's contribution,

~DG
 
Thanks. I was also playing with the HMA. But was not able to write the addchartbubble because my limited scripting skill. If anyone can just poste the addchartbubble code for different pivoting points would be great. Appreciate your help.
 
@mashume So idk why this isn't working but the scan is not working. Simple example SCAN for BLUE ARROW within 2 bars.. Here's the code everything is defined YET it still is not working....

Here's the code and see screenshot.

I defined EVERYTHING in the indicator like you should in the scan and it still is not working... what am I doing wrong been banging my head on the table and can not figure this out. Plz help and send the full code revised back.

you can edit the code here with codeshare - https://codeshare.io/21jlL3

Code:
input price = HL2;
input HMA_Length = 55;
input lookback = 2;

def HMA = HullMovingAvg(price = price, length = HMA_Length);
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 turning_point = if concavity[1] != concavity then 1 else 0;

Def MA_Max = if HMA[-1] < HMA and HMA > HMA[1] then 1 else 0; # white squares
Def MA_Min = if HMA[-1] > HMA and HMA < HMA[1] then 1 else 0; # white triangles
Def sell = if turning_point and concavity == -1 then 1 else 0; # orange arrow down
Def buy = if turning_point and concavity == 1 then 1 else 0; # blue - cyan arrow up
def divergence = HMA - next_bar;

def scan = if

turning_point and concavity == 1

then 1 else 0 ;

plot sc = scan within 1 bars ;


9gVVCKL.png
 
@axlerod Perhaps, and I'm really no expert on the internals of ThinkScript by any stretch of the imagination, when you define scan you give it a value of either 1 or 0, both of which are values. In the plot for sc, scan may be returning true any time scan has a value, which is always.

Can you try either
A) then 1 else double.nan; as the then clause in def scan
or
B) plot sc = scan == 1 within 1 bars; and explicitly define sc as only when scan is 1

-mashume
 
@axlerod Because of the look-back/look-forward nature, the variable actually fired 2 candles ago so you have to scan within 2 bars.
 
@mashume THIS IS AMAZING! Sorry I can see this almost a year late, lol. Please share with me the updated shareable thinkscript link and colored watchlist link too, And since I use Fibonacci extensions to determine my take profit levels, is it possible to plot them on the code too?

the code wont work for me when trying to creat cusytom watchlist , i see an error highlighted in red, plot data=concavityDivergence () .divergence * 10000 help. Thannks
 
Hi @mashume, excellent study. I've been using it extensively the past week. I have one question - is there a way to also plot a higher timeframe HMA so as to be able to make a judgement on a lower timeframe on whether to stay in a trade longer? Even as a lower study with a series of dots with the same colours so as to be able to quickly view the state without having to switch the chart. What do you think?

I've been overlaying a higher timeframe HMA on my chart using a higher aggregationPeriod on the price but it's very choppy and very difficult to follow.
 
Hi @mashume, excellent study. I've been using it extensively the past week. I have one question - is there a way to also plot a higher timeframe HMA so as to be able to make a judgement on a lower timeframe on whether to stay in a trade longer? Even as a lower study with a series of dots with the same colours so as to be able to quickly view the state without having to switch the chart. What do you think?

I've been overlaying a higher timeframe HMA on my chart using a higher aggregationPeriod on the price but it's very choppy and very difficult to follow.

Try this: https://usethinkscript.com/threads/...and-concavity-2nd-derivatives.1803/post-26455
 
@mashume excellent work on this. Very intriguing to me and something I have been imitating just by checking one bar back for MAs... which obviously has its issues. I added the following code to the lower Divergence study... very basic no frills that shows two standard deviation bands. It is interesting to look at as a lower study. It seems to offer the best clues of a turning point when the Std Dev bands are not compressed and the divergence is close to its historical highs (obvious), but still I wonder if it could be used to fine tune this study. This is going to be my main focus going forward.

Also, you mentioned a mathematically intensive way to make the original Hull Concavity script faster by solving for the unknown variable using the source math equation for the Hull MA. Could you expand on that a bit? Much appreciated.

I am trying to figure out a way to add it and/or the Hull script to my proprietary algo script to get better entrances... will keep everyone updated on it. See below:

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
#
# ----------------------
# TheBewb - Added Standard Deviation bars for divergence amounts.
declare lower;

input price = OPEN;



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 diffave = HMA - next_bar;
diffave.setdefaultColor(getColor(5));
diffave.SetPaintingStrategy(PaintingStrategy.line);
diffave.SetLineWeight(3);
diffave.DefineColor("Positive and Up", Color.green);
diffave.DefineColor("Positive and Down", Color.dark_green);
diffave.DefineColor("Negative and Down", Color.dark_red);
diffave.DefineColor("Negative and Up", Color.red);
diffave.AssignValueColor(if diffave >= 0 then if diffave > diffave[1] then diffave.Color("Positive and Up") else diffave.Color("Positive and Down") else if diffave < diffave[1] then diffave.Color("Negative and Down") else diffave.Color("Negative and Up"));

plot cx_up = if diffave 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 diffave crosses below zero then 0 else double.nan;
cx_down.SetPaintingStrategy(PaintingStrategy.POINTS);
cx_down.SetDefaultColor(Color.RED);
cx_down.SetLineWeight(4);

input stddev_len = 21;
def divergence_stddev = StandardDeviation(price = diffave, length = stddev_len);
plot div_StdDev = divergence_stddev;
plot div_StdDevNeg = -divergence_stddev;
plot div_StdDev2 = divergence_stddev*2;
plot div_StdDevNeg2 = -divergence_stddev*2;
 
@mashume I can't figure out which one I took this part out of, but it's super accurate. I have used it in 1 to 5 minute time frames. I use Ma Min for buys and Ma Max for sells. I tried to set onscreen alerts fort those buy and sell spots but it doesn't work. Maybe you could take a look at it?

Code:
#
# Hull Moving Average Concavity and Turning Points
#  or
# The Second Derivative of the Hull Moving Average
#
# Author: Seth Urion (Mahsume)
# Version: 2020-05-01 V4
#
# Now with support for ToS Mobile
#
# This code is licensed (as applicable) under the GPL v3
#
# ----------------------


declare upper;

input price = HL2;
input HMA_Length = 55;
input lookback = 2;

# I read somewhere that it's faster to define nan's and then use the def'd var rather than call double.nan every time.
def nan = double.nan;

plot HMA = HullMovingAvg(price = price, length = HMA_Length);

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 turning_point = if concavity[1] != concavity then HMA else nan;

HMA.AssignValueColor(color = if concavity[1] == -1 then
    if HMA > HMA[1] then color.dark_orange else color.red else
    if HMA < HMA[1] then color.dark_green else color.green);

HMA.SetLineWeight(3);

turning_point.SetLineWeight(4);
turning_point.SetPaintingStrategy(paintingStrategy = PaintingStrategy.POINTS);
turning_point.SetDefaultColor(color.white);

plot MA_Max = if HMA[-1] < HMA and HMA > HMA[1] then HMA else NaN;
MA_Max.SetDefaultColor(Color.WHITE);
MA_Max.SetPaintingStrategy(PaintingStrategy.SQUARES);
MA_Max.SetLineWeight(3);

plot MA_Min = if HMA[-1] > HMA and HMA < HMA[1] then HMA else Nan;
MA_Min.SetDefaultColor(Color.WHITE);
MA_Min.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
MA_Min.SetLineWeight(3);

# NOTE: I PREFER TO TURN OFF UP ARROWS WHEN IN DOWN TREND.  IF IN DOWNTRENDING SWINGARM, THE TURN ON ONLY DOWN SELL ARROWS. YOU CAN DO THIS USING THE INPUT SETTINGS SCREEN.

plot sell = if turning_point and concavity == -1 then high else nan;
sell.SetDefaultColor(Color.DARK_ORANGE);
sell.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
sell.SetLineWeight(3);

plot buy = if turning_point and concavity == 1 then low else nan;
buy.SetDefaultColor(Color.CYAN);
buy.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
buy.SetLineWeight(3);

def divergence = HMA - next_bar;

addLabel(yes, concat("DIVERGENCE: " , divergence), color = if concavity < 0 then if divergence[1] > divergence then Color.RED else color.PINK else if divergence[1] < divergence then color.green else color.yellow);

###################
#
# ALERTS
#
###################

Alert(condition = MA_Min, text = "Buy", "alert type" = Alert.BAR, sound = Sound.Bell);

Alert(condition = MA_Max, text = "Sell", "alert type" = Alert.BAR, sound = Sound.Chimes);

###################
#
# 2020-05-01
#
# MOBILE TOS SUPPORT
#
# Each color of the HMA needs to be a separate plot as ToS Mobile
# lacks the ability to assign colors the way ToS Desktop does.
# I recommend a plain colored HMA behind the line
# Set the line color of the HMA above to gray or some neutral
#
# CCD_D -> ConCave Down and Decreasing
# CCD_I -> ConCave Down and Increasing
# CCU_D -> ConCave Up and Decreasing
# CCU_I -> ConCave Up and Increasing
#
###################
plot CCD_D = if concavity == -1 and HMA < HMA[1] then HMA else nan;
CCD_D.SetDefaultColor(Color.RED);
CCD_D.SetLineWeight(3);

plot CCD_I = if concavity == -1 and HMA >= HMA[1] then HMA else nan;
CCD_I.SetDefaultColor(Color.DARK_ORANGE);
CCD_I.SetLineWeight(3);

plot CCU_D = if concavity == 1 and HMA <= HMA[1] then HMA else nan;
CCU_D.SetDefaultColor(COLOR.DARK_GREEN);
CCU_D.SetLineWeight(3);

plot CCU_I = if concavity == 1 and HMA > HMA[1] then HMA else nan;
CCU_I.SetDefaultColor(COLOR.GREEN);
CCU_I.SetLineWeight(3);
 
@mashume excellent work on this. Very intriguing to me and something I have been imitating just by checking one bar back for MAs... which obviously has its issues. I added the following code to the lower Divergence study... very basic no frills that shows two standard deviation bands. It is interesting to look at as a lower study. It seems to offer the best clues of a turning point when the Std Dev bands are not compressed and the divergence is close to its historical highs (obvious), but still I wonder if it could be used to fine tune this study. This is going to be my main focus going forward.

Also, you mentioned a mathematically intensive way to make the original Hull Concavity script faster by solving for the unknown variable using the source math equation for the Hull MA. Could you expand on that a bit? Much appreciated.

I am trying to figure out a way to add it and/or the Hull script to my proprietary algo script to get better entrances... will keep everyone updated on it. See below:

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
#
# ----------------------
# TheBewb - Added Standard Deviation bars for divergence amounts.
declare lower;

input price = OPEN;



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 diffave = HMA - next_bar;
diffave.setdefaultColor(getColor(5));
diffave.SetPaintingStrategy(PaintingStrategy.line);
diffave.SetLineWeight(3);
diffave.DefineColor("Positive and Up", Color.green);
diffave.DefineColor("Positive and Down", Color.dark_green);
diffave.DefineColor("Negative and Down", Color.dark_red);
diffave.DefineColor("Negative and Up", Color.red);
diffave.AssignValueColor(if diffave >= 0 then if diffave > diffave[1] then diffave.Color("Positive and Up") else diffave.Color("Positive and Down") else if diffave < diffave[1] then diffave.Color("Negative and Down") else diffave.Color("Negative and Up"));

plot cx_up = if diffave 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 diffave crosses below zero then 0 else double.nan;
cx_down.SetPaintingStrategy(PaintingStrategy.POINTS);
cx_down.SetDefaultColor(Color.RED);
cx_down.SetLineWeight(4);

input stddev_len = 21;
def divergence_stddev = StandardDeviation(price = diffave, length = stddev_len);
plot div_StdDev = divergence_stddev;
plot div_StdDevNeg = -divergence_stddev;
plot div_StdDev2 = divergence_stddev*2;
plot div_StdDevNeg2 = -divergence_stddev*2;
@mashume Seth, broski... can you help me out on the in depth math required to make this indicator more accurate? Just point me in the right direction as to what you were inferring. Thanks!
 
@mashume Seth, broski... can you help me out on the in depth math required to make this indicator more accurate? Just point me in the right direction as to what you were inferring. Thanks!
I've got a conference all week this week... presenter Thursday. I may be able to get back to this stuff at the weekend or so.
-mashume
 
All - Wanted to post something that I thought may be helpful to give more information and less clutter on the upper chart. It is a script that shows the concavity colorings of different HMAs with different lengths and different aggregations that is customizable. I used OPEN as my price as I like how that won't repaint and it still backtests extremely well. Please let me know how you like the study and how you use it in trading... could be a good confirmation signal, but a lot of information there so easy to get mixed signals.
Code:
#
# Hull Moving Average Concavity and Turning Points
#  or
# The Second Derivative of the Hull Moving Average
#
# Author: Seth Urion (Mahsume)
# Version: 2020-02-23 V3
# Faster, but not necessarily mathematically as good as the first
#
# This code is licensed (as applicable) under the GPL v3
#
# ----------------------
# Update Author: TheBewb
# Created a study based of Mahsume's Hull Concavity study that shows the concavity of different aggregations and length HMAs as a lower study. It is a lot of information and not sure how actionable since you get mixed signals a lot but if the market is trending good confirmation


declare lower;
input aggperiod = AggregationPeriod.FIVE_MIN;
input aggperiod2 = AggregationPeriod.FIFTEEN_MIN;
def price = open(period = aggperiod);
def price2 = open(period = aggperiod2);
input HMA_Length = 21;
input HMA_length2 = 34;
input HMA_length3 = 55;
input HMA_Length4 = 21;
input HMA_length5 = 34;
input HMA_length6 = 55;
input lookback = 2;

def HMA = HullMovingAvg(price = price, length = HMA_Length);
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 turning_point = if concavity[1] != concavity then HMA else Double.NaN;
def preBull = concavity[1] == 1 and HMA < HMA[1];
def Bull = concavity[1] == 1 and HMA > HMA[1];
def preBear = concavity[1] == -1 and HMA > HMA[1];
def Bear = concavity[1] == -1 and HMA < HMA [1];
def MA_Max = if HMA[-1] < HMA and HMA > HMA[1] then HMA else Double.NaN;
def MA_Min = if HMA[-1] > HMA and HMA < HMA[1] then HMA else Double.NaN;



def HMA2 = HullMovingAvg(price = price, length = HMA_length2);
def delta2 = HMA2[1] - HMA2[lookback + 1];
def delta_per_bar2 = delta2 / lookback;
def next_bar2 = HMA2[1] + delta_per_bar2;
def concavity2 = if HMA2 > next_bar2 then 1 else -1;
def turning_point2 = if concavity2[1] != concavity2 then HMA2 else Double.NaN;
def preBull2 = concavity2[1] == 1 and HMA2 < HMA2[1];
def Bull2 = concavity2[1] == 1 and HMA2 > HMA2[1];
def preBear2 = concavity2[1] == -1 and HMA2 > HMA2[1];
def Bear2 = concavity2[1] == -1 and HMA2 < HMA2[1];
def MA_Max2 = if HMA2[-1] < HMA2 and HMA2 > HMA2[1] then HMA2 else Double.NaN;
def MA_Min2 = if HMA2[-1] > HMA2 and HMA2 < HMA2[1] then HMA2 else Double.NaN;
def HMA3 = HullMovingAvg(price = price, length = HMA_length3);
def delta3 = HMA3[1] - HMA3[lookback + 1];
def delta_per_bar3 = delta3 / lookback;
def next_bar3 = HMA3[1] + delta_per_bar3;
def concavity3 = if HMA3 > next_bar3 then 1 else -1;
def turning_point3 = if concavity3[1] != concavity3 then HMA3 else Double.NaN;
def preBull3 = concavity3[1] == 1 and HMA3 < HMA3[1];
def Bull3 = concavity3[1] == 1 and HMA3 > HMA3[1];
def preBear3 = concavity3[1] == -1 and HMA3 > HMA3[1];
def Bear3 = concavity3[1] == -1 and HMA3 < HMA3[1];
def MA_Max3 = if HMA3[-1] < HMA3 and HMA3 > HMA3[1] then HMA3 else Double.NaN;
def MA_Min3 = if HMA3[-1] > HMA3 and HMA3 < HMA3[1] then HMA3 else Double.NaN;
def HMA4 = HullMovingAvg(price = price2, length = HMA_Length4);
def delta4 = HMA4[1] - HMA4[lookback + 1];
def delta_per_bar4 = delta4 / lookback;
def next_bar4 = HMA4[1] + delta_per_bar4;
def concavity4 = if HMA4 > next_bar4 then 1 else -1;
def turning_point4 = if concavity4[1] != concavity4 then HMA4 else Double.NaN;
def preBull4 = concavity4[1] == 1 and HMA4 < HMA4[1];
def Bull4 = concavity4[1] == 1 and HMA4 > HMA4[1];
def preBear4 = concavity4[1] == -1 and HMA4 > HMA4[1];
def Bear4 = concavity4[1] == -1 and HMA4 < HMA4[1];
def MA_Max4 = if HMA4[-1] < HMA4 and HMA4 > HMA4[1] then HMA4 else Double.NaN;
def MA_Min4 = if HMA4[-1] > HMA4 and HMA4 < HMA4[1] then HMA4 else Double.NaN;

def HMA5 = HullMovingAvg(price = price2, length = HMA_length5);
def delta5 = HMA5[1] - HMA5[lookback + 1];
def delta_per_bar5 = delta5 / lookback;
def next_bar5 = HMA5[1] + delta_per_bar5;
def concavity5 = if HMA5 > next_bar5 then 1 else -1;
def turning_point5 = if concavity5[1] != concavity5 then HMA5 else Double.NaN;
def preBull5 = concavity5[1] == 1 and HMA5 < HMA5[1];
def Bull5 = concavity5[1] == 1 and HMA5 > HMA5[1];
def preBear5 = concavity5[1] == -1 and HMA5 > HMA5[1];
def Bear5 = concavity5[1] == -1 and HMA5 < HMA5[1];
def MA_Max5 = if HMA5[-1] < HMA5 and HMA5 > HMA5[1] then HMA5 else Double.NaN;
def MA_Min5 = if HMA5[-1] > HMA5 and HMA5 < HMA5[1] then HMA5 else Double.NaN;

def HMA6 = HullMovingAvg(price = price2, length = HMA_length6);
def delta6 = HMA6[1] - HMA6[lookback + 1];
def delta_per_bar6 = delta6 / lookback;
def next_bar6 = HMA6[1] + delta_per_bar6;
def concavity6 = if HMA6 > next_bar6 then 1 else -1;
def turning_point6 = if concavity6[1] != concavity6 then HMA6 else Double.NaN;
def preBull6 = concavity6[1] == 1 and HMA6 < HMA6[1];
def Bull6 = concavity6[1] == 1 and HMA6 > HMA6[1];
def preBear6 = concavity6[1] == -1 and HMA6 > HMA6[1];
def Bear6 = concavity6[1] == -1 and HMA6 < HMA6[1];
def MA_Max6 = if HMA6[-1] < HMA6 and HMA6 > HMA6[1] then HMA6 else Double.NaN;
def MA_Min6 = if HMA6[-1] > HMA6 and HMA6 < HMA6[1] then HMA6 else Double.NaN;

plot Trend1 = If(IsNaN(Price[0]), Double.NaN, 6);
Trend1.AssignValueColor(if bull then color.green else if bear then color.red else if prebull then color.dark_green else if prebear then color.DARK_ORANGE else color.magenta);
Trend1.SetPaintingStrategy(PaintingStrategy.POINTS);
Trend1.SetLineWeight(3);

plot Trend2 = If(IsNaN(Price[0]), Double.NaN, 5);
Trend2.AssignValueColor(if bull2 then color.green else if bear2 then color.red else if prebull2 then color.dark_green else if prebear2 then color.DARK_ORANGE else color.magenta);
Trend2.SetPaintingStrategy(PaintingStrategy.POINTS);
Trend2.SetLineWeight(3);

plot Trend3 = If(IsNaN(Price[0]), Double.NaN, 4);
Trend3.AssignValueColor(if bull3 then color.green else if bear3 then color.red else if prebull3 then color.dark_green else if prebear3 then color.DARK_ORANGE else color.magenta);
Trend3.SetPaintingStrategy(PaintingStrategy.POINTS);
Trend3.SetLineWeight(3);

plot Trend4 = If(IsNaN(Price[0]), Double.NaN, 3);
Trend4.AssignValueColor(if bull4 then color.green else if bear4 then color.red else if prebull4 then color.dark_green else if prebear4 then color.DARK_ORANGE else color.magenta);
Trend4.SetPaintingStrategy(PaintingStrategy.POINTS);
Trend4.SetLineWeight(3);

plot Trend5 = If(IsNaN(Price[0]), Double.NaN, 2);
Trend5.AssignValueColor(if bull5 then color.green else if bear5 then color.red else if prebull5 then color.dark_green else if prebear5 then color.DARK_ORANGE else color.magenta);
Trend5.SetPaintingStrategy(PaintingStrategy.POINTS);
Trend5.SetLineWeight(3);

plot Trend6 = If(IsNaN(Price[0]), Double.NaN, 1);
Trend6.AssignValueColor(if bull6 then color.green else if bear6 then color.red else if prebull6 then color.dark_green else if prebear6 then color.DARK_ORANGE else color.magenta);
Trend6.SetPaintingStrategy(PaintingStrategy.POINTS);
Trend6.SetLineWeight(3);
 
@mashume I took a stab at the math and "laborious" is putting it mildly. I tried to do a quick and dirty estimate of the price needed to turn concavity by taking the change in price used to calculate the HULL MA over the corresponding change in difference between actual & expected. Its close but running into the issue of differences in sign e.g., price goes up a minimal amount and Hull still decreases... Its definitely a fun exercise trying to figure out a lazy way to predict it.
 
@mashume I took a stab at the math and "laborious" is putting it mildly. I tried to do a quick and dirty estimate of the price needed to turn concavity by taking the change in price used to calculate the HULL MA over the corresponding change in difference between actual & expected. Its close but running into the issue of differences in sign e.g., price goes up a minimal amount and Hull still decreases... Its definitely a fun exercise trying to figure out a lazy way to predict it.

I started writing a python notebook to do the math using sympy for symbolic equation constructon and a few (many) loops to write the equations. Got about halfway before deciding I had better things to do. Perhaps some day, when I feel really bored I may drag it back out... but there are many projects before that.

It's and interesting exercise though, and certainly sheds light on the complexities of the mathematics we use every day. Glad you had a go of it.

-mashume
 
@mashume beautiful system you built here.
Is it possible to add VWAP as a filter for signals ?
If Hull is above vwap show Long entry signals only and if Hull is below vwap show Short entry signals only ?
 
Love the indicator, I keep it on all of my charts.

I was wondering if you've had any comments/observations about the turning points and how well they work in being Support/Resistance levels.

I've been using it on the 15m/30m charts and have noticed how often they have saved me from making a huge mistake or have given me great opportunities to enter positions. Below when the Early Dark green showed it's head and ended up bouncing off one of the previous turning points, I was able to re-enter into some Amazon puts and ride them down quite a bit.

my23BQA.png
 
@mashume Is it possible to get alert when MA_Max and MA_Min hits? also if possible can we get strategy buy-side MA_Min to MA_max and sell-side MA_Max to MA_min? Thank you in advance.
 
Status
Not open for further replies.

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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