Doge

//version=5
indicator("Simple Moving Average Strategy", overlay=true)

// Set the length for moving averages
short_ma_length = 9
long_ma_length = 21

// Calculate moving averages
short_ma = ta.sma(close, short_ma_length)
long_ma = ta.sma(close, long_ma_length)

// Plot the moving averages
plot(short_ma, color=color.blue, title="Short MA (9)")
plot(long_ma, color=color.red, title="Long MA (21)")

// Buy and Sell signals
buy_signal = ta.crossover(short_ma, long_ma)
sell_signal = ta.crossunder(short_ma, long_ma)

// Plot buy/sell signals on the chart
plotshape(buy_signal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(sell_signal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
Technical IndicatorsTrend AnalysisWave Analysis

免责声明