You are on page 1of 1

ma(source, length, type) =>

switch type

"SMA" => ta.sma(source, length)

"EMA" => ta.ema(source, length)

"SMMA (RMA)" => ta.rma(source, length)

"WMA" => ta.wma(source, length)

"VWMA" => ta.vwma(source, length)

typeMA = input.string(title = "Method", defval = "SMA", options=["SMA", "EMA", "SMMA (RMA)",


"WMA", "VWMA"], group="Smoothing")

smoothingLength = input.int(title = "Length", defval = 5, minval = 1, maxval = 100, group="Smoothing")

smoothingLine = ma(out, smoothingLength, typeMA)

plot(smoothingLine, title="Smoothing Line", color=color.rgb(243, 32, 32), offset=offset,


display=display.none)

plot(ta.ema(close, 44), color=color.rgb(48, 13, 249), linewidth=3, title='44Day EMA')

plot(ta.ema(close, 200), color=color.rgb(240, 112, 6), linewidth=3, title='200Day EMA')

You might also like