搜尋
產品
社群
市場
新聞
經紀商
更多
TW
立即開始
比特幣
2024年10月18日
Doge
3
取得這個圖表
取得這個圖表
//
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")
nuttapard
關注
Technical Indicators
Trend Analysis
Wave Analysis
nuttapard
關注
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在
使用條款
閱讀更多資訊。