다중 요인 융합 반전 추적 전략


생성 날짜: 2023-09-15 14:31:15 마지막으로 수정됨: 2023-12-01 14:59:14
복사: 0 클릭수: 636
avatar of ChaoZhang ChaoZhang
1
집중하다
1617
수행원

전략 개요

다인자 융합 반전 추적 전략은 가격 반전 형태와 과매매 과매매 지표를 통합하여 시장 진출과 출출의 의사 결정 신호를 생성합니다. 이 전략은 시장 구조의 높고 낮은 지점을 판단하는 여러 가지 요인을 통합하여 반전 지점에서 거래 신호를 생성하여 중간 단선 가격의 반전 기회를 잡습니다.

전략 원칙

이 전략은 크게 두 가지로 구성되어 있습니다.

1,123 역형모형 모듈

  • 2일 가격 혁신이 높지만 3일에는 하락하는 경우, 잠재적인 단기 최고점으로 간주하고, 공백을 다.

  • 2일 가격 혁신이 낮지만 3일에는 반등이 발생하면 잠재적인 단기 하락점으로 간주하여 더 많이 할 수 있습니다.

2 RSI 역설계 모듈

  • RSI의 오버 바이 오버 소이드 라인을 동적으로 조정하여 반전 지점을 판단하십시오.

  • RSI가 조정된 오버 바이 라인보다 높을 때, RSI가 조정된 오버 세일 라인보다 낮을 때, RSI가 조정된 오버 바이 라인보다 높을 때, RSI가 조정된 오버 세일 라인보다 낮을 때, RSI가 조정된 오버 세일 라인보다 높을 때, RSI가 조정된 오버 세일 라인보다 낮을 때, RSI가 조정된 오버 세일 라인보다 낮을 때, RSI가 조정된 오버 세일 라인보다 낮을 때, RSI가 조정된 오버 세일 라인보다 낮을 때, RSI가 조정된 오버 세일 라인보다 낮을 때.

마지막으로, 두 모듈의 신호가 일치할 때 실제 거래 명령이 생성된다.

이 전략의 가장 큰 장점은 여러 요소를 통합하여 시장의 구조적 고저를 판단하고, 단일 요소의 일부에 의한 가짜 신호를 필터링하여 실제 거래의 승률을 높일 수 있다는 것입니다.

전략적 이점

  • 여러 요소의 조합, 시장의 상승과 하락에 대한 종합적인 판단

  • 역동성과 과매매 지표의 결합

  • 가짜 역전 신호를 효과적으로 필터링하여 정확도를 향상시킵니다.

  • 응답 매개 변수는 시장에 맞게 최적화할 수 있습니다.

  • 실행의 난이도가 낮고, 거래를 빠르게 복제할 수 있다.

위험 경고

  • 반전 신호가 지연될 수 있으며, 매개 변수가 제때 업데이트되어야 합니다.

  • 과도한 거래를 막기 위해 거래 비용을 높여야 합니다.

  • 개인 주식의 기본상황에 주의해야 합니다.

  • 반전 전략은 지수와 인기 주식에 더 적합합니다.

요약하다

다인자 융합 역추적 전략은 수량적 도구의 장점과 인공 분석의 경험을 완벽하게 결합하여 여러 각도를 고려하여 거래 신호를 결정한다. 단일 지표 전략에 비해 실제 거래의 안정성과 승률을 크게 향상시킬 수 있다. 이 전략은 우선적으로 피드백에서 검증 최적화를 수행한 다음 단계적으로 실장에 적용하는 것이 가치가 있으며 매우 중요한 실용적 가치가 있다.

전략 소스 코드
/*backtest
start: 2023-08-15 00:00:00
end: 2023-09-14 00:00:00
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 15/06/2021
// 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
// The related article is copyrighted material from
// Stocks & Commodities.
//
// 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


RE_RSI(Value,WildPer) =>
    pos = 0.0
    AUC = 0.0
    ADC = 0.0
    ExpPer = 2 * WildPer - 1
    K = 2 / (ExpPer + 1)
    AUC := iff(close > close[1], K * (close - close[1]) + (1 - K) * nz(AUC[1], 1), (1-K) * nz(AUC[1], 1))
    ADC := iff(close > close[1], (1-K) * nz(ADC[1], 1), K * (close[1] - close) + (1 - K) * nz(ADC[1], 1))
    nVal = (WildPer - 1) * (ADC * Value / (100 - Value) - AUC)
    nRes = iff(nVal >= 0, close + nVal, close + nVal * (100 - Value) / Value)
    pos:= iff(nRes > close, -1,
    	   iff(nRes < close, 1, nz(pos[1], 0))) 
    pos

strategy(title="Combo Backtest 123 Reversal & Reverse Engineering RSI, by Giorgos Siligardos", shorttitle="Combo", overlay = true)
line1 = input(true, "---- 123 Reversal ----")
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
line2 = input(true, "---- Reverse Engineering RSI ----")
Value = input(50, minval=1)
WildPer = input(14,minval=1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posRE_RSI = RE_RSI(Value,WildPer)
pos = iff(posReversal123 == 1 and posRE_RSI == 1 , 1,
	   iff(posReversal123 == -1 and posRE_RSI == -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 )