Skip to content

Instantly share code, notes, and snippets.

@mikecao
Last active May 28, 2019 02:32
Show Gist options
  • Save mikecao/f4860be8ba3e63b8a737cd7a98788c0e to your computer and use it in GitHub Desktop.
Save mikecao/f4860be8ba3e63b8a737cd7a98788c0e to your computer and use it in GitHub Desktop.
Show multiple SMA values in Tradingview
//@version=3
study("Multi SMA", overlay=true)
sma1 = input(title="SMA 1", type=integer, defval=5)
sma2 = input(title="SMA 2", type=integer, defval=10)
sma3 = input(title="SMA 3", type=integer, defval=50)
sma4 = input(title="SMA 4", type=integer, defval=200)
SMA1 = sma(close, sma1)
SMA2 = sma(close, sma2)
SMA3 = sma(close, sma3)
SMA4 = sma(close, sma4)
plot(SMA1, color=red)
plot(SMA2, color=blue)
plot(SMA3, color=orange)
plot(SMA4, color=purple)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment