Skip to content

Instantly share code, notes, and snippets.

@hbthegreat
Created April 18, 2018 01:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hbthegreat/5422565597c7427009c08d36943af9d4 to your computer and use it in GitHub Desktop.
Save hbthegreat/5422565597c7427009c08d36943af9d4 to your computer and use it in GitHub Desktop.
EMA pine script
////////////////////////////////////////////////////////////
// 5 EMA lines as per Hbthegreat EMA Cross strategy
////////////////////////////////////////////////////////////
study(title="5EMA", shorttitle="5EMA", overlay = true )
Length1 = input(9, minval=1)
Length2 = input(13, minval=1)
Length3 = input(21, minval=1)
Length4 = input(55, minval=1)
Length5 = input(100, minval=1)
xPrice = close
xEMA1 = ema(xPrice, Length1)
xEMA2 = ema(xPrice, Length2)
xEMA3 = ema(xPrice, Length3)
xEMA4 = ema(xPrice, Length4)
xEMA5 = ema(xPrice, Length5)
plot(xEMA1, color=blue, title="5EMA 9")
plot(xEMA2, color=purple, title="5EMA 13")
plot(xEMA3, color=orange, title="5EMA 21")
plot(xEMA4, color=yellow, title="5EMA 55")
plot(xEMA5, color=white, title="5EMA 100")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment