Mio test

49
//version=5
indicator("BTC EMA Strategy", overlay=true)

// Impostazione delle medie mobili esponenziali
ema50 = ta.ema(close, 50)
ema200 = ta.ema(close, 200)

// Traccia le medie mobili esponenziali sul grafico
plot(ema50, title="EMA 50", color=color.blue, linewidth=2)
plot(ema200, title="EMA 200", color=color.red, linewidth=2)

// Segnali di acquisto/vendita
longCondition = ta.crossover(ema50, ema200)
shortCondition = ta.crossunder(ema50, ema200)

plotshape(series=longCondition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=shortCondition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")

// Output nel pannello inferiore per i segnali di acquisto/vendita
bgcolor(longCondition ? color.new(color.green, 90) : na, title="Buy Signal Background")
bgcolor(shortCondition ? color.new(color.red, 90) : na, title="Sell Signal Background")

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.