Hello Everyone!
I would like to create an alert bot on Tradingview with the following details.
I would like to have a 50 Exponential Moving Average on the chart and I would like to have notification from tradingview when the price is crossing the ema and the next candle is going to make a bullish or bearish engulfing candle pattern.
I have got this far yet:
// Step One: Initial Setting
strategy("SSL Channel and 50 EMA",overlay= true)
// Step Two: Parameter Setting
ma50 = ema(close,50)
bullishEC= close >= open[1] and close[1] < open[1]
bearishEC= close <= open[1] and close[1] > open[1]
//Step Three: Signals
longSignal= (crossover(ma50) and bullishEC)
shortSignal= (crossover(ma50) and bearishEC)
//Step Four: Entries
strategy.entry(id="longPosition", long=true, when=longSignal)
strategy.entry(id="shortPosition",long=false,when=shortSignal)
//Step Five: Alert!
alertcondition(longSignal, title="bull signal", message="long signal detected for{{ticker}}")
alertcondition(shortSignal, title="bear signal", message="short signal detected for{{ticker}}")
When I would like to add this to chart I am getting following errors:
[line 13: Cannot call 'crossover' with arguments (series[float]); available overloads: crossover(series[float], series[float]) => series[bool]; ](https://in.tradingview.com/chart/5E5fO6EQ/#)
[line 14: Cannot call 'crossover' with arguments (series[float]); available overloads: crossover(series[float], series[float]) => series[bool];](https://in.tradingview.com/chart/5E5fO6EQ/#)
Can someone please help me out?
Thank you!