//@version=4
study(title=VISHNU SIGNAL
, overlay=true)
LengthSEMA = input(title=SEMA Length
, defval=9)
LengthLEMA = input(title=LEMA Length
, defval=21)
LengthSlow50MA=input(title=50 MA Length
, defval=50)
Length34EMA=input(title=34 MA Length
, defval=34)
Length50EMA=input(title=50 MA Length
, defval=50)
SEMA = ema(close, LengthSEMA)
LEMA = ema(close, LengthLEMA)
Slow50MA = sma(close,LengthSlow50MA)
slow34ema=ema(close, Length34EMA)
slow50ema=ema(close, Length50EMA)
//buy = crossover(SEMA, LEMA ) and close > Slow50MA
// MACD
//buy = crossover(SEMA, LEMA ) and close > Slow50MA and histLine >0.1
buy = crossover(SEMA, LEMA ) and close > Slow50MA and close >slow50ema
if buy
alert(BUY alert on
+ timeframe.period)
sell=crossover(LEMA, SEMA ) and close < Slow50MA and close < slow50ema
if sell
alert(SELL alert on
+ timeframe.period)
////plot(MA, color=color.new(color.green, 0), title=MA
)
//plot(EMA, color=color.new(color.red, 0), title=EMA
)
//emadiff = LengthLEMA - slow34ema
cross = crossover(SEMA, LEMA ) or crossover(LEMA, SEMA )
if cross
alert(CROSS alert on
+ timeframe.period)
plotshape(cross, style=shape.labeldown, location=location.abovebar, color=color.rgb(106, 76, 175), size=size.tiny, title=Cross
, text=C
, textcolor=color.white)
plotshape(buy, style=shape.labelup, location=location.bottom, color=color.green, size=size.tiny, title=Buy
, text=B
, textcolor=color.white)
plotshape(sell, style=shape.labeldown, location=location.top, color=color.red, size=size.tiny, title=Sell
, text=SELL
, textcolor=color.white)
ERROR:
11:27:07 AM — Compiling...
11:27:07 AM — Compilation error. Line 28: Syntax error at input 'buy'.
11:27:07 AM — 'VIshnu_EMA_Crossover' saved.
11:27:52 AM — Compiling...
11:27:53 AM — Compilation error. Line 23: Syntax error at input 'buy'.