다중 지표 단기 알고리즘 거래 전략

저자:차오장, 날짜: 2023-09-14 19:46:55
태그:

이 문서에서는 여러 지표를 결합한 단기 알고리즘 거래 전략을 자세히 소개합니다. 15 분 차트와 같은 낮은 시간 프레임에서 거래 신호를 생성하기 위해 강력한 기술 지표를 사용합니다.

I. 전략 논리

이 전략의 핵심은 여러 지표의 조합을 이용하는 것입니다. 주로 다음을 포함합니다.

(1) 이중 이동 평균 시스템: 한 개의 빠른 및 한 개의 느린 헬 이동 평균을 계산하고 트렌드를 크로스 오버에 따라 판단합니다.

(2) 이치모쿠 시스템: 이치모쿠 클라우드를 기반으로 전환과 기본선을 계산하고 트렌드 및 지원/저항 수준을 결정합니다.

(3) 돈치안 채널: 가장 높은 가격과 가장 낮은 가격을 사용하여 가격 파장을 식별하는 채널을 구성합니다.

(4) MACD: MACD와 신호선을 계산하여 교차에 따라 거래를 합니다.

이러한 지표가 트렌드 판단에 대한 합의에 도달 할 때만 신뢰할 수있는 거래 신호가 생성됩니다.

빠른 Hull MA가 느린 Hull MA 위에 넘어가고 Ichimoku 라인이 구름 위에 넘어가고 Donchian 채널이 깨지고 MACD가 신호 라인의 위에 넘어가면 긴 포지션을 취합니다. 짧은 거래에 대한 역 조건.

매일 바 폐쇄 가격도 포함되어 반전에 갇히지 않도록합니다.

또한, 전략은 각 거래에 대한 위험과 보상을 제어하기 위해 스톱 로스 및 수익 논리를 포함합니다.

II. 전략의 장점

이 전략의 가장 큰 장점은 신호 품질을 향상시키는 지표 조합의 상호 보완성입니다. 다른 지표가 여러 각도에서 경향을 판단하여 단일 지표의 한계를 피하는 신호를 생성하는 데 만장일치로 동의합니다.

둘째, 다중 시간 프레임 조합 또한 중요한 장점입니다. 일간 바에서 보조 판단은 단기 주기에 갇히는 위험을 필터링 할 수 있습니다.

마지막으로, 스톱 로스 및 영리 메커니즘은 거래당 통제 가능한 리스크를 보장합니다.

III. 잠재적 위험

건전한 전략 설계에도 불구하고, 거래 위험도 주목해야 합니다:

첫째, 다중 지표 조합은 최적화 어려움을 증가시킵니다. 부적절한 조정은 과장 조정으로 이어질 수 있습니다.

두 번째로, 스톱 손실은 강한 트렌드 움직임에 의해 타격을 받을 수 있으며 불필요한 손실로 이어질 수 있습니다.

마지막으로, 여러 시간 프레임 판단은 또한 해석하기 어려운 혼란스러운 상황을 가져올 수 있습니다.

전체적으로, 전략은 과학적으로 지표를 결합하고, 매개 변수 테스트와 최적화를 통해 효과적인 단기 알고리즘 거래 시스템이 될 수 있습니다.

IV. 요약

요약하자면, 이 기사는 여러 지표를 결합한 단기 알고리즘 거래 전략을 상세히 소개했습니다. 이치는 이치모쿠, 돈치안 채널, MACD 및 더 많은 이중 이동 평균의 조합을 사용하여 신호 품질을 향상시킵니다. 또한 리스크를 제어하기 위해 멀티 타임프레임 분석과 스톱 로스/프로프트 로직을 사용합니다. 최적화로이 전략은 단기 체계적인 거래를위한 효율적인 시스템이 될 수 있습니다.


/*backtest
start: 2023-08-14 00:00:00
end: 2023-09-13 00:00:00
period: 4h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=2
// Any timeFrame ok but good on 15 minute & 60 minute , Ichimoku + Daily-Candle_cross(DT) + HULL-MA_cross + MacD combination 420 special blend
strategy("Custom 15m strat",overlay=true)
keh=input(title="Double HullMA",defval=14, minval=1)
dt = input(defval=0.0010, title="Decision Threshold (0.001)", step=0.0001)`
SL = input(defval=-500.00, title="Stop Loss in $", step=1)
TP = input(defval=25000.00, title="Target Point in $", step=1)
ot=1
n2ma=2*wma(close,round(keh/2))
nma=wma(close,keh)
diff=n2ma-nma
sqn=round(sqrt(keh))
n2ma1=2*wma(close[1],round(keh/2))
nma1=wma(close[1],keh)
diff1=n2ma1-nma1
sqn1=round(sqrt(keh))
n1=wma(diff,sqn)
n2=wma(diff1,sqn)
b=n1>n2?lime:red
c=n1>n2?green:red
d=n1>n2?red:green
confidence=(security(syminfo.tickerid, 'D', close)-security(syminfo.tickerid, 'D', close[1]))/security(syminfo.tickerid, 'D', close[1])
conversionPeriods = input(9, minval=1, title="Conversion Line Periods")
basePeriods = input(26, minval=1, title="Base Line Periods")
laggingSpan2Periods = input(52, minval=1, title="Lagging Span 2 Periods")
displacement = input(26, minval=1, title="Displacement")
donchian(len) => avg(lowest(len), highest(len))
conversionLine = donchian(conversionPeriods)
baseLine = donchian(basePeriods)
leadLine1 = avg(conversionLine, baseLine)
leadLine2 = donchian(laggingSpan2Periods)
LS=close, offset = -displacement
MACD_Length = input(9)
MACD_fastLength = input(12)
MACD_slowLength = input(26)
MACD = ema(close, MACD_fastLength) - ema(close, MACD_slowLength) //macd
aMACD = ema(MACD, MACD_Length) //signal
closelong = n1<n2 and close<n2 and confidence<dt or strategy.openprofit<SL or strategy.openprofit>TP
if (closelong)
    strategy.close("Long")
closeshort = n1>n2 and close>n2 and confidence>dt or strategy.openprofit<SL or strategy.openprofit>TP
if (closeshort)
    strategy.close("Short")
longCondition = n1>n2 and strategy.opentrades<ot and confidence>dt and close>n2 and leadLine1>leadLine2 and open<LS and MACD>aMACD
if (longCondition)
    strategy.entry("Long",strategy.long)
shortCondition = n1<n2 and strategy.opentrades<ot and confidence<dt and close<n2 and leadLine1<leadLine2 and open>LS and MACD<aMACD
if (shortCondition)
    strategy.entry("Short",strategy.short)

a1=plot(n1,color=c)
a2=plot(n2,color=c)
plot(cross(n1, n2) ? n1 : na, style = circles, color=b, linewidth = 4)
plot(cross(n1, n2) ? n1 : na, style = line, color=d, linewidth = 4)
plot(conversionLine, color=#0496ff, title="Conversion Line")
plot(baseLine, color=#991515, title="Base Line")
//plot(longCondition == true ? 4000:4100,title="long")
plot(close, offset = -displacement, color=#459915, title="Lagging Span")
p1=plot (leadLine1, offset = displacement, color=green,  title="Lead 1")
p2=plot (leadLine2, offset = displacement, color=red,  title="Lead 2")
fill(p1, p2, color = leadLine1 > leadLine2 ? green : red)
// remove the "//" from before the plot script if want to see the indicators on chart

더 많은