Baller2356
New member
How do you change this code to work for an ema instead of sma?
Code:
input SMA_Length = 200;
def ma = simpleMovingAvg("length"= SMA_Length);
def triggerLow = open > ma and low <= ma;
def triggerHigh = open < ma and high >= ma;
def MasterTrigger = TriggerHigh and TriggerLow;
plot SmaTouch = triggerHigh or triggerLow;