이 전략은 트렌드 방향과 오버 바이 오버 셀 영역을 식별하기 위해 여러 가지 기술 지표를 통합하여 거래 신호를 생성합니다.
주요 지표는 다음과 같습니다.
평균 방향 지수 ((ADX): 트렌드 강도를 판단
비교적 약한 지표 (RSI): 과매매에 대한 판단
밀도 평균 (SMA): 단기 트렌드를 판단하기
급격한 SAR 지표: 장기간 추세를 판단하는 방법
통로 개척: 트렌드 개척
구체적인 거래 논리:
ADX는 동향이 존재하고 충분히 강하다고 판단했습니다.
SAR는 단기 및 장기 동향이 일치된다고 판단했습니다.
RSI는 오버 바이 오버 소드 영역을 식별합니다.
가격의 SMA 평균선을 뚫을 때 입점
가격이 통로를 뚫고 들어갑니다.
다양한 지표들이 서로 검증되어 판단의 정확도를 높이고, 다양한 전략들이 조합되어 체계적인 거래 시스템을 형성한다.
다중 지표 조합, 신호 품질 향상
다양한 전략의 조합, 체계적인 입원
ADX가 트렌드를 확인하고 RSI가 과매매를 판단합니다.
SAR는 트렌드를 잡았고 SMA와 채널은 진입했다.
다중 변수 설정, 반복 테스트 최적화
복합 조건의 빈도가 낮다
지표가 충돌 신호를 발생시키면 처리하기 어렵습니다.
이 전략은 다양한 지표의 장점을 최대한 활용하여 안정적인 거래 시스템을 구축합니다. 그러나 거래 빈도가 합리적으로 보장되도록 최적화 파라미터를 설정해야합니다. 전체적으로, 전략은 강력한 추세를 식별하고 효율적인 입장을 통합합니다.
/*backtest
start: 2023-09-12 00:00:00
end: 2023-09-13 00:00:00
period: 45m
basePeriod: 5m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
// strategy("Combined Strategy", overlay=true, default_qty_value=100, initial_capital=1000, margin_long=0.1)
adxlen = input(7, title="ADX Smoothing")
dilen = input(7, title="DI Length")
dirmov(len) =>
up = ta.change(high)
down = -ta.change(low)
plusDM = na(up) ? na : (up > down and up > 0 ? up : 0)
minusDM = na(down) ? na : (down > up and down > 0 ? down : 0)
truerange = ta.rma(ta.tr, len)
plus = fixnan(100 * ta.rma(plusDM, len) / truerange)
minus = fixnan(100 * ta.rma(minusDM, len) / truerange)
[plus, minus]
adx(dilen, adxlen) =>
[plus, minus] = dirmov(dilen)
sum = plus + minus
adx = 100 * ta.rma(math.abs(plus - minus) / (sum == 0 ? 1 : sum), adxlen)
sig = adx(dilen, adxlen)
// The same on Pine Script™
pine_supertrend(factor, atrPeriod) =>
src = hl2
atr = ta.atr(atrPeriod)
upperBand = src + factor * atr
lowerBand = src - factor * atr
prevLowerBand = nz(lowerBand[1])
prevUpperBand = nz(upperBand[1])
lowerBand := lowerBand > prevLowerBand or close[1] < prevLowerBand ? lowerBand : prevLowerBand
upperBand := upperBand < prevUpperBand or close[1] > prevUpperBand ? upperBand : prevUpperBand
int direction = na
float superTrend = na
prevSuperTrend = superTrend[1]
if na(atr[1]) and ta.rsi(close, 21) < 66 and ta.rsi(close,3) > 80 and ta.rsi(close, 28) > 49 and sig > 20
direction := 1
else if prevSuperTrend == prevUpperBand
direction := close > upperBand ? -1 : 1
else
direction := close < lowerBand ? 1 : -1
superTrend := direction == -1 ? lowerBand : upperBand
[superTrend, direction]
[pineSupertrend, pineDirection] = pine_supertrend(3, 10)
upTrend = pineDirection < 0
downTrend = pineDirection > 0
// Define the 20-period SMA
sma20 = ta.sma(close, 20)
a = ta.rsi(close,14)
OB = input(70)
OS = input(30)
os = a > OB
ob = a < OS
if upTrend and close > pineSupertrend and close > sma20 and os
strategy.entry("Buy", strategy.long)
if ta.crossunder(close, sma20) or ob
strategy.close_all()
//define when to breakout of channel
//("ChannelBreakOutStrategy", overlay=true)
length = input.int(title="Length", minval=1, maxval=1000, defval=5)
upBound = ta.highest(high, length)
downBound = ta.lowest(low, length)
if (not na(close[length]))
strategy.entry("ChBrkLE", strategy.long, stop=upBound + syminfo.mintick, comment="ChBrkLE")
strategy.entry("ChBrkSE", strategy.short, stop=downBound - syminfo.mintick, comment="ChBrkSE")