Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=3
- study("Trend & Momentum", overlay=true)
- //inputs
- _Period1 = input(3, "EMA1 Period")
- _Period2 = input(5, "EMA2 Period")
- _Period3 = input(8, "EMA3 Period")
- _Period4 = input(10, "EMA4 Period")
- _Period5 = input(12, "EMA5 Period")
- _Period6 = input(15, "EMA6 Period")
- _Period7 = input(30, "EMA7 Period")
- _Period8 = input(35, "EMA8 Period")
- _Period9 = input(40, "EMA9 Period")
- _Period10 = input(45, "EMA10 Period")
- _Period11 = input(50, "EMA11 Period")
- _Period12 = input(60, "EMA12 Period")
- //calculate ema
- ema1 = ema(close, _Period1)
- ema2 = ema(close, _Period2)
- ema3 = ema(close, _Period3)
- ema4 = ema(close, _Period4)
- ema5 = ema(close, _Period5)
- ema6 = ema(close, _Period6)
- ema7 = ema(close, _Period7)
- ema8 = ema(close, _Period8)
- ema9 = ema(close, _Period9)
- ema10 = ema(close, _Period10)
- ema11 = ema(close, _Period11)
- ema12 = ema(close, _Period12)
- plot(ema1, color=ema1>ema1[1] ? green : red, title="short1",linewidth=1)
- plot(ema2, color=ema2>ema2[1] ? green : red, title="short2", linewidth=1)
- plot(ema3, color=ema3>ema3[1] ? green : red, title="short3", linewidth=1)
- plot(ema4, color=ema4>ema4[1] ? green : red, title="short4", linewidth=1)
- plot(ema5, color=ema5>ema5[1] ? green : red, title="short5", linewidth=1)
- plot(ema6, color=ema6>ema6[1] ? green : red, title="short6", linewidth=1)
- plot(ema7, color=ema7>ema7[1] ? green : red, title="long1", linewidth=2)
- plot(ema8, color=ema8>ema8[1] ? green : red, title="long2", linewidth=2)
- plot(ema9, color=ema9>ema9[1] ? green : red, title="long3", linewidth=2)
- plot(ema10, color=ema10>ema10[1] ? green : red, title="long4", linewidth=2)
- plot(ema11, color=ema11>ema11[1] ? green : red, title="long5", linewidth=2)
- plot(ema12, color=ema12>ema12[1] ? green : red, title="long6", linewidth=2)
Advertisement
Add Comment
Please, Sign In to add comment