TradingView
Skrymten
Mar 31, 2019 10:36 AM

Hull MA 

Bitcoin / DollarBitfinex

Description

This Hull MA uses the default settings of the built-in MA. The basic idea is that we are in a buy setup when hull is below price, and a sell setup when hull is above price. The indicator is extended with slightly change in contrast when moving average is declining and it plot the ma/price crossovers: green dot when a buy setup is appearing, and red dot when a sell setup is forming. It is possible to hide crossovers in the option panel.

Three alert conditions is added "Hull MA cross", "Hull MA sell" and "Hull MA buy". I use "Hull MA cross" on slow frames (2w, M) and "Hull MA buy/sell" on faster frames.

Release Notes

Updated support of pinescript 4.
Changed sell and buy condition to use the built in crossover and crossunder method (maybe a little faster).
Added exchange, price, hull, volume and time variables to "Hull cross" alertcondition.
Change showCrossovers option default to true.

Release Notes

Pinescript 5 update.

Release Notes

Screenshot update.

Release Notes

Added crossover and crossunder combined alert condition.
Comments
AsmuiAS
Thanks for developing this indicator, I've asked those who trade with me to use your indicator as I found it useful, especially on the crossover part.

I think what an earlier poster was asking for, in terms of an alert, is the change from a downtrending line (red for example), to an uptrending line (green, for example).
In current form, we can put in an alert only in the event of a crossover to monitor.
However, to actually see the change in HMA from a downtrend (HMA at a lower number) to an uptrend (HMA at a lower number), we would need to wait for the candle to close and the HMA line will change colour to green.

Prior to discovering this indicator, I actually recorded what was the HMA reading for the prior candle, and what is the closing HMA of the current candle, before making a decision to take an entry.
For alerts purposes, is it possible to code it, e.g. when the current candle closes and its HMA is higher than the HMA at close of the prior candle, an alert such as "Monitor for a Long Entry" would appear?

Thanks a lot!
Skrymten
@AsmuiAS, tanks for the reply! You can change the color of the Hull MA in the indicators options panel under "Style" -> color 0 (up) and color1 (down). Regarding the alert conditions you can also experiment with the builtin options such as crossing, cross up or cross down. I guess with HMA selected and "cross up" or "greater than" triggered "once per bar" you may achieve what you're asking.
gorkemsevindi
@skrymtn can you add alert for the line
for example line color change turn buy or sell
Skrymten
@gorkemsevindi, it's all ready buy and sell indication in there, green dot = buy, red dot = sell (see "Show crossovers" in the indicator options).
You can listen to alert conditions, "Buy", "Sell" and "Cross".

It may also help to switch from candlestick to line to see the crossovers earlier.
dpanday
@Skrymtn Do you know how to use this formula of the hull in Python?
Skrymten
@dpanday, try google e.g "tulip indicators python hull ma"
SerbanBTC
Hello. I really like your script. Can you tell me what are the setups you found working best on btc please? With defaults, on 4h and D there are a lot of mixed/false signals. You said for smaller time frames buy/sell signals should be used, there is also the color change for the Hull MA. thank you!
Skrymten
@SerbanBTC, try to change the candlesticks to line, and you will see the crossovers better
More