5/10 cloud
//@TV: olegnator Twitter: @olegvibes
study("5/10 cloud", overlay=true)
slow = input(10, title ="Slow EMA")
fast = input(5, title="Fast EMA")
//ema definitions
emaSlow = ema(close, slow)
emaFast = ema(close, fast)
//Color definition for Moving Averages
col = emaFast > emaSlow ? lime : emaFast < emaSlow ? red : yellow
//Moving Average Plots and Fill
p1 = plot(emaSlow, title="Slow MA", style=linebr, linewidth=4, color=col)
p2 = plot(emaFast, title="Fast MA", style=linebr, linewidth=2, color=col)
fill(p1, p2, color = emaFast > emaSlow ? green : red)
plotshape(crossover(emaFast, emaSlow), style=shape.triangleup, size=size.tiny, color=green, text="Buy", title="Buy", location=location.belowbar)
plotshape(crossover(emaSlow, emaFast), style=shape.triangledown, size=size.tiny, color=red, text="Sell", title="Sell")
alertcondition(crossover(emaSlow, emaFast), title="Sell", message="Sell")
alertcondition(crossover(emaFast, emaSlow), title="Buy", message="Buy")
study("5/10 cloud", overlay=true)
slow = input(10, title ="Slow EMA")
fast = input(5, title="Fast EMA")
//ema definitions
emaSlow = ema(close, slow)
emaFast = ema(close, fast)
//Color definition for Moving Averages
col = emaFast > emaSlow ? lime : emaFast < emaSlow ? red : yellow
//Moving Average Plots and Fill
p1 = plot(emaSlow, title="Slow MA", style=linebr, linewidth=4, color=col)
p2 = plot(emaFast, title="Fast MA", style=linebr, linewidth=2, color=col)
fill(p1, p2, color = emaFast > emaSlow ? green : red)
plotshape(crossover(emaFast, emaSlow), style=shape.triangleup, size=size.tiny, color=green, text="Buy", title="Buy", location=location.belowbar)
plotshape(crossover(emaSlow, emaFast), style=shape.triangledown, size=size.tiny, color=red, text="Sell", title="Sell")
alertcondition(crossover(emaSlow, emaFast), title="Sell", message="Sell")
alertcondition(crossover(emaFast, emaSlow), title="Buy", message="Buy")
Comments
Post a Comment