40 period HMA with volume markers
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © eykpunter

//@version=5
indicator('40 period HMA with volume markers', shorttitle='HMA40+vol', overlay=true)
//values for HMA40 and its volume markers
hma40 = ta.hma(close, 40)               //40 period Hull Moving Average
morevol=ta.median(volume, 10)*1.5       //volume level 1.5 times recently usual i.e. median
volmark0= volume>morevol                //condition for marker color of strectch to current candle
volmark1= volume[1]>morevol             //condition for marker color, calculated for previous candle bc plot marking ends at current candle

//plot of the line
plot(hma40, title='HMA', color=volmark0? color.fuchsia: volmark1? color.black: color.rgb(190,123,45,20), linewidth=3)
