這裏是用於TradingView的專業Pine腳本(v5),完全用英語編寫。該腳本根據OGUSDT的RSI指標識別買入和賣出區域。
OGUSDT交易策略腳本//@version=5
strategy("OGUSDT高級RSI策略", overlay=true, initial_capital=1000, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// --- 輸入設置 ---
rsiLength = input.int(14, title="RSI長度")
overboughtLevel = input.int(70, title="超買水平(賣出)")
oversoldLevel = input.int(30, title="超賣水平(買入)")
// --- 計算 ---
rsiValue = ta.rsi(close, rsiLength)
// --- 邏輯 ---
buySignal = ta.crossover(rsiValue, oversoldLevel)
sellSignal = ta.crossunder(rsiValue, overboughtLevel)
// --- 可視化(在圖表上繪製) ---
plotshape(buySignal, title="買入標籤", location=location.belowbar, color=color.green, style=shape.labelup, text="買入", textcolor=color.white)
plotshape(sellSignal, title="賣出標籤", location=location.abovebar, color=color.red, style=shape.labeldown, text="賣出", textcolor=color.white)
// --- 執行 ---
if (buySignal)
strategy.entry("多頭頭寸", strategy.long, comment="進入買入")
if (sellSignal)
strategy.close("多頭頭寸", comment="退出買入")
// 爲RSI背景上色以便於視覺輔助
plot(rsiValue, "RSI值", color=color.purple)
hline(overboughtLevel, "超買", color=color.red)
hline(oversoldLevel, "超賣", color=color.green)
如何使用此腳本:
打開TradingView並選擇OG/USDT圖表。
點擊屏幕底部的"Pine編輯器"選項卡。
刪除任何現有代碼並粘貼上面提供的英文代碼。
點擊"保存",然後點擊"添加到圖表"。
現在您將在圖表上直接看到綠色的買入和紅色的賣出標籤。
#OGNUSDT #WriteToEarnUpgrade #GoldSilverAtRecordHighs #USJobsData #BTCVSGOLD