
이 전략은 RSI (대비적으로 강한 지표) 에 기반한 적응 거래 시스템으로, 동적으로 오버 바이 오버 시드 경계를 조정하여 거래 신호를 최적화합니다. 전략의 핵심 혁신은 Bufi의 적응 경계를 도입한 것입니다. (BAT) 이 RSI의 촉발 경계를 시장 추세와 가격 변동 동력에 따라 조정하는 Bufi의 적응 경계를 도입하여 전통적인 RSI 전략의 효과를 향상시킵니다.
이 전략의 핵심은 전통적인 고정값 RSI 시스템을 동적값 시스템으로 업그레이드하는 것이다. 구체적으로 구현하는 방법은 다음과 같다:
이 전략에는 다음과 같은 두 가지의 위험 관리 장치가 포함되어 있습니다.
이것은 역동적 하락 최적화를 통해 전통적인 RSI 전략의 한계를 해결하는 혁신적인 자기 적응 거래 전략입니다. 전략은 시장의 추세와 변동성을 통합적으로 고려하고 강한 적응력과 위험 제어 능력을 가지고 있습니다. 변수 최적화와 같은 과제가 있지만, 지속적인 개선과 최적화를 통해 전략은 실제 거래에서 안정적인 성능을 얻을 수 있습니다. 거래자는 실장 사용 전에 충분한 피드백과 변수 최적화를 수행하고 특정 시장 특성에 따라 적절하게 조정하는 것이 좋습니다.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-11-11 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © PineCodersTASC
// TASC Issue: October 2024
// Article: Overbought/Oversold
// Oscillators: Useless Or Just Misused
// Article By: Francesco P. Bufi
// Language: TradingView's Pine Script™ v5
// Provided By: PineCoders, for tradingview.com
//@version=5
title ='TASC 2024.10 Adaptive Oscillator Threshold'
stitle = 'AdapThrs'
strategy(title, stitle, false, default_qty_type = strategy.percent_of_equity,
default_qty_value = 10, slippage = 5)
// --- Inputs ---
string sys = input.string("BAT", "System", options=["Traditional", "BAT"])
int rsiLen = input.int(2, "RSI Length", 1)
int buyLevel = input.int(14, "Buy Level", 0)
int adapLen = input.int(8, "Adaptive Length", 2)
float adapK = input.float(6, "Adaptive Coefficient")
int exitBars = input.int(28, "Fixed-Bar Exit", 1, group = "Strategy Settings")
float DSL = input.float(1600, "Dollar Stop-Loss", 0, group = "Strategy Settings")
// --- Functions ---
// Bufi's Adaptive Threshold
BAT(float price, int length) =>
float sd = ta.stdev(price, length)
float lr = ta.linreg(price, length, 0)
float slope = (lr - price[length]) / (length + 1)
math.min(0.5, math.max(-0.5, slope / sd))
// --- Calculations ---
float osc = ta.rsi(close, rsiLen)
// Strategy entry rules
// - Traditional system
if sys == "Traditional" and osc < buyLevel
strategy.entry("long", strategy.long)
// - BAT system
float thrs = buyLevel * adapK * BAT(close, adapLen)
if sys == "BAT" and osc < thrs
strategy.entry("long", strategy.long)
// Strategy exit rules
// - Fixed-bar exit
int nBar = bar_index - strategy.opentrades.entry_bar_index(0)
if exitBars > 0 and nBar >= exitBars
strategy.close("long", "exit")
// - Dollar stop-loss
if DSL > 0 and strategy.opentrades.profit(0) <= - DSL
strategy.close("long", "Stop-loss", immediately = true)
// Visuals
rsiColor = #1b9e77
thrsColor = #d95f02
rsiLine = plot(osc, "RSI", rsiColor, 1)
thrsLine = plot(sys == "BAT" ? thrs : buyLevel, "Threshold", thrsColor, 1)
zeroLine = plot(0.0, "Zero", display = display.none)
fill(zeroLine, thrsLine, sys == "BAT" ? thrs : buyLevel, 0.0, color.new(thrsColor, 60), na)