다양한 지표를 기반으로 한 단기 양적 거래 전략


생성 날짜: 2023-09-14 19:46:55 마지막으로 수정됨: 2023-09-14 19:46:55
복사: 1 클릭수: 785
avatar of ChaoZhang ChaoZhang
1
집중하다
1617
수행원

이 문서에서는 다중 지표의 조합으로 이루어진 단선 양적 거래 전략에 대해 자세히 설명할 것이다. 이 전략은 강력한 기술 지표의 집합을 사용하여 낮은 시간 주기 (예: 15 분) 에서 거래 신호를 생성한다.

1 전략

이 전략의 핵심은 다음과 같은 다양한 지표의 조합을 사용하는 것입니다.

(1) 쌍평선 시스템: 두 개의 Hull 이동 평균을 계산하여 트렌드 방향을 결정합니다.

(2) 이치모쿠 시스템: 전환선, 기준선 등을 계산하고, 클라우드 그래프 형태 판단 경향과 지원 저항을 결합한다.

(3) Donchian Channel: 최고 가격과 최저 가격을 통해 채널을 구축하고, 가격 돌파구를 판단한다.

(4) MACD: MACD와 신호선을 계산하고 그 교차에 따라 동작한다.

이러한 지표들이 트렌드 판단에 동의할 때, 더 신뢰할 수 있는 거래 신호가 생성된다. 구체적인 논리는 다음과 같다:

빠른 Hull MA, AND Ichimoku 선에서 클라우드 그래프를 통과하고 DONCHIAN 통로를 뚫고 MACD에서 신호선을 통과할 때, 더 많은 것을 수행합니다. 반대로 판단은 공백입니다.

또한, 매일 K선 종식 가격의 변화를 보조 판단으로 사용하여, 반전되는 것을 피하십시오.

또한, 전략에는 단 하나의 거래의 위험과 수익을 통제할 수 있는 중지 손실 및 중지 논리가 포함되어 있습니다.

2 전략적 장점

이 전략의 가장 큰 장점은 지표의 조합이 상호 보완되어 신호의 질을 향상시킬 수 있다는 것입니다. 다양한 지표는 여러 관점에서 트렌드를 판단하고, 단 하나의 지표의 한계를 피하기 위해 합의된 신호만 생성됩니다.

둘째, 다중 시간 주기의 조합도 큰 장점이다. 매일 클라인의 보조 판단은 단기 LOW 주기의 꽂힌 위험을 필터링 할 수 있다.

마지막으로, 전략에는 스톱로스 스 메커니즘이 포함되어 있으며, 이는 각 거래의 위험을 통제할 수 있도록 합니다.

  1. 잠재적인 위험

이 전략은 합리적으로 설계되었지만 거래에는 다음과 같은 위험도 있습니다.

첫째, 다중 지표 조합은 파라미터를 최적화하기 어렵게 만들며, 잘못 설정하면 과대 최적화로 이어질 수 있다.

두 번째, 강세를 보인 경우, 스톱로드는 파격으로 인해 손실이 발생할 수 있습니다.

마지막으로, 다중 시간 주기 판단에도 complexesignals를 판단하기 어려운 상황이 있다.

전체적으로, 이 전략은 overall 조합 논리 과학, 매개 변수 테스트를 통해 지속적으로 최적화, 효과적인 단선 계량화 전략이 된다.

네 가지 내용

이 문서에서는 여러 지표의 조합을 가진 단선 양적 거래 전략에 대해 자세히 소개한다. 이 전략은 쌍평등선, 이치모쿠, 돈치안 채널, 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