양적 역전 및 부피 조합 전략

저자:차오장, 날짜: 2023-09-21 21:07:09
태그:

전반적인 설명

이 전략은 더 정확하고 신뢰할 수있는 거래 신호를 생성하기 위해 두 가지 양적 거래 전략을 결합합니다. 첫 번째 전략은 가격 반전을 기반으로하고 두 번째는 볼륨 분석을 기반으로합니다. 결합 된 신호는 수익성을 효과적으로 향상시킬 수 있습니다.

전략 논리

이 전략은 두 부분으로 구성됩니다.

  1. 반전 전략

반전 신호를 위해 STO 지표를 사용합니다. 클로즈가 2 일 동안 상승하고 STO 슬로우 라인이 50 이하일 때 길어집니다. 클로즈가 2 일 동안 떨어지고 STO 빠른 라인이 50 이상일 때 짧습니다.

  1. 규모 전략

이동 평균 평형과 함께 방향을 결정하기 위해 기간 동안 가격-용량 관계를 분석합니다.

양쪽 전략이 긴 신호를 보내면 긴 신호가 되고 양쪽 전략이 짧은 신호를 보내면 짧은 신호가 됩니다.

이 조합은 양쪽 전략에서 잘못된 신호를 크게 줄임으로써 신호 품질을 향상시킵니다.

장점

  • 두 가지 독립적인 전략을 결합하여 정확도를 향상시킵니다.
  • 회전 포획 회전 기회, 부피 예측 미래 방향
  • 서로 다른 전략 유형은 서로 확인하여 잘못된 신호를 줄입니다.
  • 간단한 직접 조합, 쉽게 구현
  • 각 전략의 매개 변수는 개별적으로 최적화 될 수 있습니다.

위험성

  • 엄격한 탈퇴 규칙이 없는 위험 회환
  • 부피 분석이 늦어질 수 있습니다.
  • 순전히 지표에 기반하고 기술 분석이 필요합니다.
  • 이동 평균에 필요한 더 긴 데이터 시리즈
  • 매개 변수는 모든 제품에서 보편적이지 않을 수 있습니다.

위험은 다음과 같이 감소 할 수 있습니다.

  • STO를 최적화하여 더 나은 반전 감지
  • 부피 분포를 확인하기 위한 지표를 추가합니다.
  • 이동 평균 기간 최적화
  • 추가 차트 패턴 분석
  • 제품별로 별도의 매개 변수 테스트

개선 방향

이 전략은 다음과 같이 개선될 수 있습니다.

  1. STO 매개 변수 최적화

    가장 좋은 조합을 위한 미세 조정 K, D 값

  2. 부피 중단의 2차 확인

    MACD, BOLL 등과 같은 지표로

  3. 이동 평균 기간 최적화

    보다 안정적인 신호를 위한 다양한 기간 테스트

  4. 차트 패턴 추가

    콤보 신호 외에도 패턴을 입력

  5. 제품별 매개 변수 테스트

    매개 변수는 다른 제품마다 다를 수 있습니다.

요약

이 전략은 신호 품질과 정확성을 향상시키기 위해 역전 및 볼륨 전략을 결합합니다. 그러나 매개 변수 최적화, 추가 기술 지표 등은 성능을 더욱 정제 할 수 있습니다. 우리는 백테스트 결과를 기반으로 지속적으로 조정하고 실시간 거래에서 검증하여 진정으로 견고한 콤보 전략을 얻을 수 있습니다. 이것은 엄청난 시간과 노력이 필요하지만 보상이 또한 중요합니다.


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

//@version=4
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 21/10/2020
// This is combo strategies for get a cumulative signal. 
//
// First strategy
// This System was created from the Book "How I Tripled My Money In The 
// Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
// The strategy buys at market, if close price is higher than the previous close 
// during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50. 
// The strategy sells at market, if close price is lower than the previous close price 
// during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
//
// Second strategy
// This is another version of FVE indicator that we have posted earlier 
// in this forum.
// This version has an important enhancement to the previous one that`s 
// especially useful with intraday minute charts.
// Due to the volatility had not been taken into account to avoid the extra 
// complication in the formula, the previous formula has some drawbacks:
// The main drawback is that the constant cutoff coefficient will overestimate 
// price changes in minute charts and underestimate corresponding changes in 
// weekly or monthly charts.
// And now the indicator uses adaptive cutoff coefficient which will adjust to 
// all time frames automatically.
//
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
Reversal123(Length, KSmoothing, DLength, Level) =>
    vFast = sma(stoch(close, high, low, Length), KSmoothing) 
    vSlow = sma(vFast, DLength)
    pos = 0.0
    pos := iff(close[2] < close[1] and close > close[1] and vFast < vSlow and vFast > Level, 1,
	         iff(close[2] > close[1] and close < close[1] and vFast > vSlow and vFast < Level, -1, nz(pos[1], 0))) 
	pos


FVI(Samples,Perma,Cintra,Cinter) =>
    pos = 0
    xhl2 = hl2
    xhlc3 = hlc3
    xClose = close
    xIntra = log(high) - log(low)
    xInter = log(xhlc3) - log(xhlc3[1])
    xStDevIntra = stdev(sma(xIntra, Samples) , Samples)
    xStDevInter = stdev(sma(xInter, Samples) , Samples)
    xVolume = volume
    TP = xhlc3
    TP1 = xhlc3[1]
    Intra = xIntra
    Vintra = xStDevIntra
    Inter = xInter
    Vinter = xStDevInter
    CutOff = Cintra * Vintra + Cinter * Vinter
    MF = xClose - xhl2 + TP - TP1
    FveFactor =  iff(MF > CutOff * xClose, 1, 
                  iff(MF < -1 * CutOff * xClose, -1,  0))
    xVolumePlusMinus = xVolume * FveFactor
    Fvesum = sum(xVolumePlusMinus, Samples)
    VolSum = sum(xVolume, Samples)
    xFVE = (Fvesum / VolSum) * 100
    xEMAFVE = ema(xFVE, Perma)
    pos :=iff(xFVE > xEMAFVE, 1,
    	   iff(xFVE < xEMAFVE, -1, nz(pos[1], 0))) 
    pos

strategy(title="Combo Backtest 123 Reversal & Volatility Finite Volume Elements", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
Samples = input(22, minval=1)
Perma = input(40, minval=1)
Cintra = input(0.1)
Cinter = input(0.1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posFVI = FVI(Samples,Perma,Cintra,Cinter)
pos = iff(posReversal123 == 1 and posFVI == 1 , 1,
	   iff(posReversal123 == -1 and posFVI == -1, -1, 0)) 
possig = iff(reverse and pos == 1, -1,
          iff(reverse and pos == -1 , 1, pos))	   
if (possig == 1) 
    strategy.entry("Long", strategy.long)
if (possig == -1)
    strategy.entry("Short", strategy.short)	 
if (possig == 0) 
    strategy.close_all()
barcolor(possig == -1 ? #b50404: possig == 1 ? #079605 : #0536b3 )

더 많은