Code:
#Converted from Trading View VDub HMA trading Bands V2 by H enry Kaczmarczyk
#use with Heiken ASHI Bars
Declare Upper;
Input Length1 = 34;
Input Length2 = 21;
Input Arrows = no;
input Dotsize = 3;
Plot HMAClose = wma(2*WMA(Close,Length2/2) – WMA(Close,Length2),Round(Sqrt(Length2)));
HMAClose.setdefaultColor(Color.yellow);
Plot HMAHigh = wma(2*WMA(High,Length1/2) – WMA(High,Length1),Round(Sqrt(Length1)));
HMAHigh.setdefaultColor(Color.Cyan);
Plot HMALow = wma(2*WMA(Low,Length1/2) – WMA(Low,Length1),Round(Sqrt(Length1)));
HMALow.setdefaultColor(Color.Magenta);
AddCloud(HMAClose , HMAHigh,Color.Cyan,Color.Black);
AddCloud(HMAClose , HMALow,Color.Black,Color.Magenta);
plot ArrowDown = if arrows and (HMAClose Crosses below HMAHigh) then HMAHigh else double.nan;
ArrowDown.setpaintingStrategy(paintingStrategy.Arrow_Down);
ArrowDown.setDefaultColor(color.Cyan);
ArrowDown.setLineWeight(dotsize);
plot ArrowUp = if arrows and (HMAClose crosses above HMALow ) then HMALow else double.nan;
ArrowUp.setpaintingStrategy(paintingStrategy.Arrow_Up);
ArrowUp.setDefaultColor(color.Magenta);
ArrowUp.setLineWeight(dotsize);
plot ArrowDown2 = if arrows and (HMAClose Crosses below HMALow) then HMALow else double.nan;
ArrowDown2.setpaintingStrategy(paintingStrategy.Arrow_Down);
ArrowDown2.setDefaultColor(color.Yellow);
ArrowDown2.setLineWeight(dotsize +1);
plot ArrowUp2 = if arrows and (HMAClose crosses above HMAHigh ) then HMAHigh else double.nan;
ArrowUp2.setpaintingStrategy(paintingStrategy.Arrow_Up);
ArrowUp2.setDefaultColor(color.Yellow);
ArrowUp2.setLineWeight(dotsize+1);