Tri-MayerMultiple by USCG_Vet
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Written by USCG_Vet; All credit to Trace Mayer.  Notice, this indicator is for educational purposes only and is not financial advice.

//@version=4
study(title="Tri-MayerMultiple by USCG_Vet", overlay=false)

HiOrLow = input(title="high vs low vs avg", type=input.string, defval = "high")

n1 = high
if HiOrLow == "high"
    n1 = high 
else if HiOrLow == "low"
    n1 = low
else
    n1 = high + low / 2 

smavema = input(title="SMA vs EMA", type=input.integer, defval=1, minval=1, maxval=2, step=1)

d1 = input(title="Long MA", type=input.integer, defval=150, minval=1, maxval=99999, step=1)

ma200d = 0.0
ma21d = 0.0
ma75d = 0.0
 
if smavema == 2
    ma200d := ema(close, d1) 
else
    ma200d := sma(close, d1) 


d2 = input(title="Short MA", type=input.integer, defval=5, minval=1, maxval=99999, step=1)
if smavema == 2 
    ma21d := ema(close, d2) 
else 
    ma21d := sma(close, d2)
            
d3 = input(title="Med MA", type=input.integer, defval=75, minval=1, maxval=99999, step=1)
if smavema == 2 
    ma75d := ema(close, d3)  
else
    ma75d := sma(close, d3) 


MyerMultiple = n1 / ma200d // Risk is between 0 and n
MyerMultipleb = n1 / ma75d // Risk is between 0 and n
MyerMultiple2 = n1 / ma21d // Risk is between 0 and n


topCol = color.orange
plot(MyerMultiple, color=topCol, linewidth=1)

bottCol = color.yellow    
plot(MyerMultipleb, color=bottCol, linewidth=1)


plot(MyerMultiple2, color=color.red, linewidth=1)
