다중 요인 전략 조합

저자:차오장, 날짜: 2023-10-26 15:18:34
태그:

img

이 글은 당신이 제공한 거래 전략 코드에 기초하여 작성한 자세한 전략 분석입니다.

전반적인 설명

이 전략은 여러 요인을 결합하여 포괄적인 거래 전략을 형성합니다. 다음과 같은 다양한 요인의 장점을 활용하는 것을 목표로합니다.

  1. 주식.RSI - 주식적 RSI
  2. RSI - 상대적 강도 지수
  3. 이중 전략 - 스토카스틱과 RSI의 조합
  4. CM 윌리엄스 빅스 픽스 - 시장 바닥을 찾습니다
  5. DMI - 방향 이동 지수

여러 가지 요인을 결합함으로써 각 요인의 장점을 활용하고 하나의 요인에 의존하는 것과 관련된 위험을 줄이려고합니다.

전략 논리

이 전략에서 사용되는 주요 기술 지표는 다음과 같습니다.

  1. Stoch.RSI- 가격보다는 RSI 값에 적용되는 스토카스틱 오시레이터. 과잉 구매/ 과잉 판매 수준을 식별합니다.

  2. RSI- 상대적 강도 지수, 과잉 구매/ 과잉 판매 조건 측정기 70 이상 과잉 구매, 30 이하 과잉 판매입니다.

  3. 이중 전략- 거래 신호를 위해 스토카스틱과 RSI를 결합합니다. 스토카스틱 %K가 %D 이하로 넘어가고 RSI가 과잉 판매 수준을 넘어가면 구매합니다. 반대로 발생하면 판매합니다.

  4. CM 윌리엄스 빅스 픽스- 리크백 기간 동안 가격 변동의 퍼센틸 범위를 계산합니다. 문턱이 넘어가면 잠재적 인 반전을 신호합니다.

  5. DMI- 방향 움직임 지표. 트렌드 방향/강도를 결정하기 위해 +DI/-DI 미분자를 사용합니다.

이러한 지표의 신호를 통합함으로써 전략은 추세와 전환점을 식별하는 더 탄탄한 시스템을 제공합니다.

장점

  • 여러 요인을 통해 다양화, 개별적인 약점을 보완
  • 트렌드를 따르는 신호와 평균 역전 신호를 모두 제공합니다.
  • 과잉 구매/ 과잉 판매 극단점과 반전을 식별합니다.
  • 다양한 시장 체제에 맞춘 최적화된 매개 변수
  • 트렌드 방향/강도 필터를 포함합니다.

위험성

  • 복수 요인 시스템의 전반적인 안정성은 아직 입증되지 않았습니다.
  • 일부 지표 사이의 잠재적 인 과잉
  • 상반된 신호들 사이의 명확하지 않은 우선 순위
  • 매개 변수 조정에는 엄격한 역 테스트가 필요합니다.
  • 장기간 보유 기간은 저효율이 발생할 수 있습니다.

강화

  • 추가 필터/지표 세트를 최적화
  • 목표 시장에 맞게 세밀하게 조정된 매개 변수
  • 명확한 입국/출국 규칙을 설정
  • 스톱 로스, 이윤 취득을 포함해서 리스크를 제어합니다.
  • 유지 기간의 성능에 대한 테스트 영향

요약

이 전략은 Stoch.RSI, RSI, 이중 전략, CM 윌리엄스 비크스 픽스 및 DMI의 강점을 결합합니다. 더 포괄적인 신호를 제공하지만 매개 변수 최적화를 복잡하게 만듭니다. 매개 변수 최적화, 고유 한 요소 필터링 및 거래 규칙을 정의하는 주변의 추가 개선은 견고성을 향상시킬 수 있습니다. 장기적 생존성과 견고성은 여전히 엄격한 검증을 필요로합니다. 전반적으로 학습 가치가있는 다중 요소 시스템의 좋은 예를 제공합니다.


/*backtest
start: 2023-10-18 00:00:00
end: 2023-10-25 00:00:00
period: 1m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/


     //////////////////////////////////////////////////////////////////////
    ////  STOCHASTIC_RSI+RSI+DOUBLE_STRATEGY+CM_WILLIAMS_VIX_FIX+DMI  ////
   //////////////////////////////////////////////////////////////////////


//  This is a simple combination of integrated and published scripts, useful 
//  if you don't have a PRO account and want to bypass the 3 indicator limit. 
//  It includes:
//  1) Stoch.RSI
//  2) Relative strenght index
//  3) Stochastic + RSI, Double Strategy (by ChartArt)
//  4) CM_Williams_Vix_Fix Finds Market Bottoms (by ChrisMoody)
//  5) Directional Movement Index (DMI)
//  For more details about 3) and 4) check the original scripts.


//@version=3

strategy(title="Stoch.RSI+RSI+DoubleStrategy+CMWilliamsVixFix+DMI", shorttitle="Stoch.RSI+RSI+DoubleStrategy+CMWilliamsVixFix+DMI")


///STOCH.RSI///
smoothK = input(3, minval=1, title="Stochastic %K Smoothing")
smoothD = input(3, minval=1, title="Stochastic %K Moving Average")
lengthRSI = input(14, minval=1, title="RSI Lenght")
lengthStoch = input(14, minval=1, title="Stochastic Lenght")
RSIprice = close
rsi1 = rsi(RSIprice, lengthRSI)
k = sma(stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK)
d = sma(k, smoothD)
plot(k, color=blue, linewidth=2)
plot(d, color=silver, linewidth=2)
h0 = hline(80)
h1 = hline(20)
fill(h0, h1, color=purple, transp=78)


///RSI///
up = rma(max(change(RSIprice), 0), lengthRSI)
down = rma(-min(change(RSIprice), 0), lengthRSI)
rsi2 = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
plot(rsi2, color=fuchsia, linewidth=2)
// band0 = hline(70, linestyle=dotted)
// band1 = hline(30, linestyle=dotted)
// fill(band0, band1, color=purple, transp=100)


///OVERBOUGHT-OVERSOLD STRATEGY///
StochOverBought = input(80, title="Stochastic overbought condition")
StochOverSold = input(20, title="Stochastic oversold condition")
ks = sma(stoch(close, high, low, lengthStoch), smoothK)
ds = sma(k, smoothD)
RSIOverBought = input( 70  , title="RSI overbought condition")
RSIOverSold = input( 30  , title="RSI oversold condition")
vrsi = rsi(RSIprice, lengthRSI)
if (not na(ks) and not na(ds))
    if (crossover(ks,ds) and k < StochOverSold)
        if (not na(vrsi)) and (crossover(vrsi, RSIOverSold))
            strategy.entry("LONG", strategy.long, comment="LONG")
if (crossunder(ks,ds) and ks > StochOverBought)
    if (crossunder(vrsi, RSIOverBought))
        strategy.entry("SHORT", strategy.short, comment="SHORT")
 
 
///CM WILLIAMS VIX FIX///
pd = input(22, title="LookBack Period Standard Deviation High")
bbl = input(20, title="Bollinger Band Length")
mult = input(2.0    , minval=1, maxval=5, title="Bollinger Band Standard Devaition Up")
lb = input(50  , title="Look Back Period Percentile High")
ph = input(.85, title="Highest Percentile - 0.90=90%, 0.95=95%, 0.99=99%")
pl = input(1.01, title="Lowest Percentile - 1.10=90%, 1.05=95%, 1.01=99%")
hp = input(false, title="Show High Range (Based on Percentile and LookBack Period)?")
sd = input(false, title="Show Standard Deviation Line?")
wvf = ((highest(close, pd)-low)/(highest(close, pd)))*100
sDev = mult * stdev(wvf, bbl)
midLine = sma(wvf, bbl)
lowerBand = midLine - sDev
upperBand = midLine + sDev
rangeHigh = (highest(wvf, lb)) * ph
rangeLow = (lowest(wvf, lb)) * pl
col = wvf >= upperBand or wvf >= rangeHigh ? lime : gray
plot(hp and rangeHigh ? rangeHigh : na, title="Range High Percentile", style=line, linewidth=4, color=orange)
plot(hp and rangeLow ? rangeLow : na, title="Range High Percentile", style=line, linewidth=4, color=orange)
plot(wvf, title="Williams Vix Fix", style=columns, linewidth = 4, color=col, transp=85)
plot(sd and upperBand ? upperBand : na, title="Upper Band", style=line, linewidth = 3, color=aqua)


///DIRECTIONAL MOVEMENT INDEX///
len3 = input(14, minval=1, title="DI Length")
lensig3 = input(14, title="ADX Smoothing", minval=1, maxval=50)
up3 = change(high)
down3 = -change(low)
plusDM3 = na(up3) ? na : (up3 > down3 and up3 > 0 ? up3 : 0)
minusDM3 = na(down3) ? na : (down3 > up3 and down3 > 0 ? down3 : 0)
trur3 = rma(tr, len3)
plus3 = fixnan(100 * rma(plusDM3, len3) / trur3)
minus3 = fixnan(100 * rma(minusDM3, len3) / trur3)
sum3 = plus3 + minus3
adx3 = 100 * rma(abs(plus3 - minus3) / (sum3 == 0 ? 1 : sum3), lensig3)
plot(plus3, color=green, style=circles, linewidth=2, title="+DI")
plot(minus3, color=red, style=circles, linewidth=2, title="-DI")
plot(adx3, color=aqua, style=circles, linewidth=3, title="ADX")

더 많은