두 가지 요인 양적 반전 추적 전략

저자:차오장, 날짜: 2023-12-20 17:26:38
태그:

img

전반적인 설명

이 전략은 123 반전 패턴과 어wes 이스칠레이터 지표를 결합하여 듀얼 팩터 양적 반전 추적 거래를 구현합니다. 기본 아이디어는 더 정확한 입시 타이밍을 달성하기 위해 어wes 이스칠레이터에서 신호를 결합하면서 시장 반전을 결정하는 것입니다.

이 전략은 주로 중단기 반전 거래에 적합합니다. 다중 요인 확인을 통해 잘못된 반전을 효과적으로 필터링하고 신호 품질을 향상시킬 수 있습니다.

전략 원칙

  1. 123 반전 패턴

    지난 두 날의 종료 가격과 현재 종료 가격의 관계를 판단하여, 가능한 반전 신호를 나타내는 high-high-low 또는 low-low-high 패턴을 형성합니다.

    동시에, 역전 신호를 추가로 확인하고 거짓 역전 신호를 필터링하기 위해 스토카스틱 지표가 과소 구매 또는 과소 판매 영역에 있어야 합니다.

  2. 멋진 오시레이터

    멋진 오시일레이터는 중장기 이동 평균과 단기 이동 평균의 차이를 기반으로 만들어진 모멘텀 지표입니다. 빠른 선이 느린 선을 아래로 넘으면 판매 신호이며, 상승하면 구매 신호입니다.

    이 전략은 구매 및 판매 지점을 결정하기 위해 상승 또는 하락 상태에 대한 지표의 판단을 채택합니다.

  3. 두 가지 요인 확인

    123 반전 패턴과 멋진 오시일레이터의 이중 확인을 통해 거짓 반전을 효과적으로 필터링하고 입력 타이밍의 정확성을 향상시킬 수 있습니다.

전략 의 장점

  1. 반전점을 결정하기 위해 이중 요인을 사용하면 잘못된 반전 신호를 효과적으로 필터링할 수 있습니다.

  2. 운동량 지표로서, 멋진 오시레이터는 입력 시기의 정확성을 향상시킬 수 있습니다.

  3. 스토카스틱 지표가 추가되면 피크에서 구매하고 바닥에서 판매하는 위험을 피할 수 있습니다.

  4. 역전 전략 자체는 높은 승률과 위험/이익 비율로 장점이 있습니다.

전략 의 위험

  1. 반전 실패의 위험은 여전히 존재합니다. 이중 인자를 사용하면 확률을 줄일 수 있지만이 위험을 완전히 피할 수 없습니다.

  2. 과도한 최적화 위험: 과도한 최적화를 방지하기 위해 다른 시장에 대한 지표 매개 변수를 테스트하고 최적화해야합니다.

  3. 시장 추세에 반대되는 거래의 위험. 강한 트렌딩 시장에서 역전 전략은 역전적 손실에 취약합니다. 위험 통제를 위해 스톱 로스를 설정할 수 있습니다.

최적화 방향

  1. 견고성을 높이기 위해 지표 매개 변수 조합을 테스트하고 최적화합니다.

  2. 단일 손실을 통제하기 위해 스톱 로스 전략을 추가합니다.

  3. 부적절한 채집을 피하기 위해 산업과 부문의 선택을 결합하십시오.

  4. 블라인드 트렌드를 방지하기 위해 유지 기간을 최적화하십시오.

  5. 보조 조건으로 다른 이동 평균 시스템을 테스트합니다.

결론

요약하자면, 이 두 가지 요인 양적 반전 추적 전략은 특정 수익 확률과 리스크-어워드 비율을 보장하면서 Awesome 오시레이터를 입시 타이밍 도구로 사용하고 스토카스틱 지표를 통해 피크에서 구매하는 것을 피합니다. 이는 반전 거래의 위험을 효과적으로 제어 할 수 있으며 강력한 실용성을 가지고 있습니다.

그러나, 역전 전략의 본질적인 위험은 무시할 수 없다. 여전히 위험 통제를 위해 지표 매개 변수를 최적화하고 스톱 로스 조건을 설정하는 것이 필요하다. 올바르게 사용되면, 이 전략은 투자자들에게 안정적인 초과 수익을 가져다 줄 수 있다.


/*backtest
start: 2023-12-12 00:00:00
end: 2023-12-14 05:00:00
period: 20m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 12/08/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
//    This indicator is based on Bill Williams` recommendations from his book 
//    "New Trading Dimensions". We recommend this book to you as most useful reading.
//    The wisdom, technical expertise, and skillful teaching style of Williams make 
//    it a truly revolutionary-level source. A must-have new book for stock and 
//    commodity traders.
//    The 1st 2 chapters are somewhat of ramble where the author describes the 
//    "metaphysics" of trading. Still some good ideas are offered. The book references 
//    chaos theory, and leaves it up to the reader to believe whether "supercomputers" 
//    were used in formulating the various trading methods (the author wants to come across 
//    as an applied mathemetician, but he sure looks like a stock trader). There isn't any 
//    obvious connection with Chaos Theory - despite of the weak link between the title and 
//    content, the trading methodologies do work. Most readers think the author's systems to 
//    be a perfect filter and trigger for a short term trading system. He states a goal of 
//    10%/month, but when these filters & axioms are correctly combined with a good momentum 
//    system, much more is a probable result.
//    There's better written & more informative books out there for less money, but this author 
//    does have the "Holy Grail" of stock trading. A set of filters, axioms, and methods which are 
//    the "missing link" for any trading system which is based upon conventional indicators.
//    This indicator plots the oscillator as a histogram where periods fit for buying are marked 
//    as blue, and periods fit for selling as red. If the current value of AC (Awesome Oscillator) 
//    is over the previous, the period is deemed fit for buying and the indicator is marked blue. 
//    If the AC values is not over the previous, the period is deemed fir for selling and the indicator 
//    is marked red.
//
// 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


BWAO(nLengthSlow,nLengthFast) =>
    pos = 0.0
    xSMA1_hl2 = sma(hl2, nLengthFast)
    xSMA2_hl2 = sma(hl2, nLengthSlow)
    xSMA1_SMA2 = xSMA1_hl2 - xSMA2_hl2
    pos := iff(xSMA1_SMA2 > xSMA1_SMA2[1], 1,
    	      iff(xSMA1_SMA2 < xSMA1_SMA2[1], -1, nz(pos[1], 0)))   
    pos

strategy(title="Combo Backtest 123 Reversal & Awesome Oscillator (AO)", 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, "---- Awesome Oscillator (AO) ----")
nLengthSlow = input(34, minval=1, title="Length Slow")
nLengthFast = input(5, minval=1, title="Length Fast")
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posBWAO = BWAO(nLengthSlow,nLengthFast)
pos = iff(posReversal123 == 1 and posBWAO == 1 , 1,
	   iff(posReversal123 == -1 and posBWAO == -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 )

더 많은