This script is for custom candles based on an HMA calculation with a default period of 10 as well as an SMA of the close price, defaulted to 1 period to only show the current price. The purpose of the custom candles is to try and reduce noise from candles and help identify trends. These custom candles somewhat resemble Heikin-Ashi candles in their appearance.
Explained: - Open, High, Low and Close (o, h, l, and c) are all calculated using an HMA calculation based on a user input length/period, defaulted at 10. - Candle colors are determined by using the same HMA calculation on the ohcl4 and comparing it to the previous candle. Green candles have an ohlc4 greater than the previous candle, all other candles are red. - The current price is plotted with the default blue line with an SMA calculation with 1 period to allow customization of smoothing if necessary to identify trends.
DISCLAIMER: For educational and entertainment purposes only. Nothing in this content should be interpreted as financial advice or a recommendation to buy or sell any sort of security or investment including all types of crypto. DYOR, TYOB.
Notes de version
⋅
Added a new input for the HMA length used to calculate the body color. This will allow you to adjust when candle body colors change without changing the actual candles.
This publication will be featured in our "Best Scripts of The Month" selection. Thank you for your valuable contribution to the TradingView community, and congrats!
TheFirstHerodotus
⋅
Excellent - many thanks! Can I ask: Does this repaint?
BigBitsIO
⋅
@TheFirstHerodotus, No. The candles are based on current hma values, so once the candle is completed it will not change.
SWANLII
⋅
@BigBitsIO, so it wont repaint during the opening of the candle ? Meaning whatever color it is when the candle opens is the color it will be when it closes correct?
asguardian_h
⋅
@SWANLII, I don't think that is correct. The color of the candle won't be confirmed until the close of the bar. I don't think any indicator could confirm its final state at the open of the bar.
kennairne
⋅
A fantastic script my friend. I changed the settings and it works fantastic on the 4H Chart. Thank you. Ken (UK)
@AJJAZ, Hi AJJAZ, I change the settings from 10, 10 to 18, 18, and add the Hull Moving Average with a setting of 35 and it works very well for me using the 4H chart. Remember though, that I'm trading cryptos so I don't know how it will work on any other currencies. Good luck. Ken