Micro Dots with VMA line [Crypto_Chili_]
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Crypto_Chili_
// Credit to LazyBear for the Variable Moving Average
// Credit to KivancOzbilgic for his Supertrend
// The Micro Dots were hours of testing different combinations of indicators and settings to find what looked and worked best. This is what I came up with, use it as a rough draft as it could probably be added to or changed around.
// Send me a message if you create something I'd love it see it!
// Thank you friends I hope you enjoy!

//@version=5
indicator('Micro Dots with VMA line', shorttitle='Micro Track', overlay=true, format=format.price, precision=0)

microDots = input.bool(true, title='Show Micro Dots?')
stl=input.bool(true, title="Show VMA Trend Line?", inline='1')
vmaString   = input.string('Fast', '‎ ‎ ‎ ‎ ‎ ‎  Intensity:', options=['Fast', 'Medium', 'Slow'], inline='1')
vmalength   = vmaString == 'Fast' ? 9 : vmaString == 'Medium' ? 18 : 27

// Micro Dot Super Trend
MD_Multiplier = 
      timeframe.period == '720' ? 1.2
     : timeframe.period == 'D' ? 1.3
     : timeframe.period == '2D' ? 1.3 
     : timeframe.period == '3D' ? 1.3 
     : timeframe.period == '4D' ? 1.3 
     : timeframe.period == '5D' ? 1.3 
     : timeframe.period == '6D' ? 1.3 :  1.1
MD_Periods = 10
MD_src = hl2
MD_atr = ta.sma(ta.tr, MD_Periods)
MD_up = MD_src - (MD_Multiplier * MD_atr)
MD_up := close[1] > nz(MD_up[1], MD_up) ? math.max(MD_up, nz(MD_up[1], MD_up)) : MD_up
MD_dn = MD_src + (MD_Multiplier * MD_atr)
MD_dn := close[1] < nz(MD_dn[1], MD_dn) ? math.min(MD_dn, nz(MD_dn[1], MD_dn)) : MD_dn
MD_trend = 1
MD_trend := nz(MD_trend[1], MD_trend)
MD_trend := MD_trend == -1 and close > nz(MD_dn[1], MD_dn) ? 1 : MD_trend == 1 and close < nz(MD_up[1], MD_up) ? -1 : MD_trend

// Micro Dot Variable Moving Average
MD_vmasrc = close
MD_vmalength = 3
MD_k = 1.0/MD_vmalength
MD_pdm = math.max((MD_vmasrc - MD_vmasrc[1]), 0)
MD_mdm = math.max((MD_vmasrc[1] - MD_vmasrc), 0)
MD_pdmS = 0.0
MD_pdmS := ((1 - MD_k)*nz(MD_pdmS[1]) + MD_k*MD_pdm)
MD_mdmS = 0.0
MD_mdmS := ((1 - MD_k)*nz(MD_mdmS[1]) + MD_k*MD_mdm)
MD_s = MD_pdmS + MD_mdmS
MD_pdi = MD_pdmS/MD_s
MD_mdi = MD_mdmS/MD_s
MD_pdiS = 0.0
MD_pdiS := ((1 - MD_k)*nz(MD_pdiS[1]) + MD_k*MD_pdi)
MD_mdiS = 0.0
MD_mdiS := ((1 - MD_k)*nz(MD_mdiS[1]) + MD_k*MD_mdi)
MD_d = math.abs(MD_pdiS - MD_mdiS)
MD_s1 = MD_pdiS + MD_mdiS
MD_iS = 0.0
MD_iS := ((1 - MD_k)*nz(MD_iS[1]) + MD_k*MD_d/MD_s1)
MD_hhv = ta.highest(MD_iS, MD_vmalength) 
MD_llv = ta.lowest(MD_iS, MD_vmalength) 
MD_d1 = MD_hhv - MD_llv
MD_vI = (MD_iS - MD_llv)/MD_d1
MD_vma = 0.0
MD_vma := (1 - MD_k*MD_vI)*nz(MD_vma[1]) + MD_k*MD_vI*MD_vmasrc

// Micro Dot Moving Average
srcMD = (close)
lengthMD = (18) 
maMD = ta.sma(srcMD, lengthMD)

// MOM
lenMD = 7
srcmomMD = hlc3
mom = srcmomMD - srcmomMD[lenMD]

// Calculating Data
trendUp = MD_trend == 1 ? MD_up : na
trendDown = MD_trend == 1 ? na : MD_dn

// Variable Moving Average
vmaUp = MD_vma < close 
vmaDown = MD_vma > close
// Moving Average
maUp = close > maMD
maDown = close < maMD
// Momentum
momUp = mom > 0
momDown = mom < 0
//
// Mixing Data
microUp = momUp and vmaUp and maUp and trendUp and not vmaDown 
microDown = momDown and maDown and maDown and trendDown and not vmaUp

// Plotting Micro Dots
plotshape(microDots ? microUp : na, title="Strength Dot", color=#00ff8f, style=shape.circle, size=size.auto, location=location.belowbar)
plotshape(microDots ? microDown : na, title="Weakness Dot", color=#f74557, style=shape.circle, size=size.auto, location=location.abovebar)

alertcondition(microUp != 0, title="Strength Dot", message="Strength Dot has started, and may indicator the new direction of the overall Trend")
alertcondition(microDown != 0, title="Weakness Dot", message="Weakness Dot has started, and may indicator the new direction of the overall Trend")
alertcondition(microUp or microDown == 0, title="No Dots", message="No dots are dispalying, trend could be reversing")

// VMA Trend Line
vmasrc=close
k = 1.0/vmalength
pdm = math.max((vmasrc - vmasrc[1]), 0)
mdm = math.max((vmasrc[1] - vmasrc), 0)
pdmS = 0.0
pdmS := ((1 - k)*nz(pdmS[1]) + k*pdm)
mdmS = 0.0
mdmS := ((1 - k)*nz(mdmS[1]) + k*mdm)
s = pdmS + mdmS
pdi = pdmS/s
mdi = mdmS/s
pdiS = 0.0
pdiS := ((1 - k)*nz(pdiS[1]) + k*pdi)
mdiS = 0.0
mdiS := ((1 - k)*nz(mdiS[1]) + k*mdi)
d = math.abs(pdiS - mdiS)
s1 = pdiS + mdiS
iS = 0.0
iS := ((1 - k)*nz(iS[1]) + k*d/s1)
hhv = ta.highest(iS, vmalength) 
llv = ta.lowest(iS, vmalength) 
d1 = hhv - llv
vI = (iS - llv)/d1
vma = 0.0
vma := (1 - k*vI)*nz(vma[1]) + k*vI*vmasrc
vmaC=(vma > vma[1]) ? color.new(#008000,10) : (vma<vma[1]) ? color.new(#FF0000,10) : (vma==vma[1]) ? color.new(#ff9800,10) : na

plot(vma, color=stl?vmaC:na, linewidth=3, title="VMA Trend Line")