0% found this document useful (0 votes)
8 views1 page

Simple Pinescript Indicator

Uploaded by

solijon.j.bscs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views1 page

Simple Pinescript Indicator

Uploaded by

solijon.j.bscs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

//@version=5

indicator("EMA Cross", overlay=true)

// Inputs
fast = input.int(9, "Fast EMA")
slow = input.int(21, "Slow EMA")

// Calculate EMAs
ema_fast = ta.ema(close, fast)
ema_slow = ta.ema(close, slow)

// Plot EMAs
plot(ema_fast, color=color.blue, title="Fast EMA")
plot(ema_slow, color=color.red, title="Slow EMA")

// Signals
bullish = ta.crossover(ema_fast, ema_slow)
bearish = ta.crossunder(ema_fast, ema_slow)

// Plot signals
plotshape(bullish, style=shape.triangleup, location=location.belowbar,
color=color.green, size=size.small)
plotshape(bearish, style=shape.triangledown, location=location.abovebar,
color=color.red, size=size.small)

// Alerts
alertcondition(bullish, "Bull Cross", "Fast EMA crossed above Slow EMA")
alertcondition(bearish, "Bear Cross", "Fast EMA crossed below Slow EMA")

You might also like