다중 지표 조합 거래 전략

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

img

전반적인 설명

이 전략은 CCI, ADX 및 AO 지표를 결합하여 긴 및 짧은 포지션을위한 거래 신호를 생성합니다. CCI는 과반 구매 및 과반 판매 수준을 식별하고, ADX는 트렌드 강도와 방향을 결정하며, AO는 변동하는 시장을 지원합니다. 다중 지표 조합은 거래 시스템의 안정성과 효율성을 향상시킵니다.

전략 논리

  1. CCI는 100 이상의 과잉 구매와 -100 이하의 과잉 판매를 나타냅니다. CCI가 0 이하인 경우 이 전략은 길게 진행됩니다.

  2. ADX는 트렌드 강도를 측정합니다. DI+는 상승 트렌드 강도를 나타냅니다. DI-는 하락 트렌드 강도를 나타냅니다. ADX는 평균 트렌드 강도를 나타냅니다. 이 전략은 DI+가 25보다 낮을 때 길어집니다.

  3. AO는 빠른 SMA 빼기 느린 SMA입니다. 상승하는 AO는 상승 동력을 강화하고, 떨어지는 AO는 하락 동력을 강화하는 것을 나타냅니다. 이 전략은 AO가 0보다 낮을 때 길어집니다.

  4. 거래 규칙은: CCI < 0과 DI+ < 25과 AO < 0이 되면 긴 거래를 하고, DI+ > 25이 되면 긴 거래를 한다.

  5. 동적으로 명령의 크기를 자금으로 나누고 닫기 가격으로 종전하여 계산하여 계정 자금 변경에 따라 주문을 조정합니다.

  6. 긴 신호를 위해 전략.입구, 출구 신호를 위해 전략.결결을 사용하세요.

장점

  1. CCI는 다양한 시장의 잡음을 필터링하여 잘못된 신호를 줄입니다.

  2. ADX는 더 강한 경향을 일찍 파악합니다.

  3. AO는 불안한 시장에서 거래를 피합니다.

  4. 여러 지표가 신호를 확인해 신뢰성을 높여줍니다.

  5. 역동적인 위치 크기는 위험을 효과적으로 관리합니다.

  6. 단순하고 명확한 논리, 따라하기 쉽다.

위험성

  1. CCI는 vkosd 범위를 식별하는데 어려움을 겪습니다.

  2. ADX는 트렌드 전환에 지연하고 있습니다.

  3. AO는 불안한 통합에 어려움을 겪고 있습니다.

  4. 나쁜 지표 설정은 과도한 필터링과 놓친 거래를 초래합니다.

  5. 변동성과 시장에 따라 동적 크기가 결정됩니다.

  6. 큰 마취 가능성, 엄격한 위험 관리가 필요합니다.

개선

  1. 다양한 시장에 대한 CCI 매개 변수를 최적화합니다.

  2. ADX 매개 변수를 최적화하여 트렌드 변화를 감지합니다.

  3. 변동성 환경에 대한 AO 매개 변수를 조정합니다.

  4. 최적의 지표 가중치를 찾기 위한 테스트 조합

  5. 마감 제어에 스톱 손실을 추가하세요

  6. 가짜 탈출을 피하기 위해 부피를 포함합니다.

  7. 기기별로 고정된 위치 크기를 조정합니다.

결론

이 전략은 CCI, ADX 및 AO를 결합하여 상당히 신뢰할 수 있는 긴 신호를 생성합니다. 동적 사이즈링 및 위치 관리 위험 제어. 논리는 초보자가 따르기 위해 간단하고 명확합니다. 그러나 다른 시장에 필요한 상당한 최적화 잠재력으로 다양한 시장에서 어려움을 겪고 있습니다. 도구 및 환경 전반에 걸쳐 견고성을 위해 추가 테스트 및 조정이 필요합니다.


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

//@version=3
strategy("Strategy Niel", shorttitle="Strategy Niel", max_bars_back=2000, initial_capital=1000)

//Input variables
buywhenadxabove = input(25)
buywhendiplusbelow = input(10)
buywhenccibelow = input(0)
buywhenawesomeoscillatorbelow = input(0)
sellwhendiplusabove = input(25)

//CCI script
numberofbarsforcci = input(20)
CCI = cci(close,numberofbarsforcci)

//+DI and ADX
adxlen = input(14, title="ADX Smoothing")
dilen = input(14, title="DI Length")
dirmov(len) =>
	up = change(high)
	down = -change(low)
	truerange = rma(tr, len)
	plus = fixnan(100 * rma(up > down and up > 0 ? up : 0, len) / truerange)
	minus = fixnan(100 * rma(down > up and down > 0 ? down : 0, len) / truerange)
	[plus, minus]

adx(dilen, adxlen) => 
	[plus, minus] = dirmov(dilen)
	sum = plus + minus
	adx = 100 * rma(abs(plus - minus) / (sum == 0 ? 1 : sum), adxlen)
	[adx, plus, minus]

[sig, up, down] = adx(dilen, adxlen)

//plot(sig, color=red, title="ADX")
//plot(up, color=blue, title="+DI")
//plot(down, color=orange, title="-DI")


//Awesome Oscillator
nLengthSlow = input(34, minval=1, title="Length Slow")
nLengthFast = input(5, minval=1, title="Length Fast")
xSMA1_hl2 = sma(hl2, nLengthFast)
xSMA2_hl2 = sma(hl2, nLengthSlow)
xSMA1_SMA2 = xSMA1_hl2 - xSMA2_hl2
cClr = xSMA1_SMA2 > xSMA1_SMA2[1] ? blue : red
//plot(xSMA1_SMA2, style=histogram, linewidth=1, color=cClr)

buy = sig > buywhenadxabove and up < buywhendiplusbelow  and CCI < buywhenccibelow and xSMA1_SMA2 < buywhenawesomeoscillatorbelow 

ordersize=floor(strategy.equity/close) // Floor returns largest integer, strategy.equity gives total equity remaining - allows to dynamically calculate the order size as the account equity increases or decreases.
strategy.entry("long",strategy.long,ordersize,when= buy) //strategy.entry let's you enter the market variables id ("long"), strategy.long (long position entry), size of the order and when the order should happen
bought = strategy.position_size[0] > strategy.position_size[1]
entry_price = valuewhen(bought, open, 0)
sell = up > sellwhendiplusabove 
strategy.close("long", when=sell ) //strategy.close let's you close your position with variables id ('long') and when this should happen




더 많은