123 반전점과 회전점의 조합 전략

저자:차오장, 날짜: 2024-01-16 15:48:44
태그:

img

전반적인 설명

이 전략은 123 역전 패턴 전략과 피보트 포인트 전략을 결합하여 높은 승률을 달성합니다. 123 역전 패턴 전략은 트렌드 역전 포인트를 식별하고, 피보트 포인트 전략은 주요 지원 및 저항 수준을 결정합니다. 둘을 결합함으로써 특정 진입 및 출입 가격을 식별하면서 트렌드를 포착 할 수 있습니다.

전략 논리

123 회전 패턴 전략

이 전략은 스토카스틱 오시레이터 지표를 사용하여 트렌드 반전 지점을 식별합니다. 구체적으로: 클로즈 가격이 2일 연속으로 이전 클로즈 가격보다 높고, 9일 연속으로 느린 STO가 50보다 낮을 때 긴 거래가 됩니다. 클로즈 가격이 2일 연속으로 이전 클로즈 가격보다 낮고, 9일 연속으로 빠른 STO가 50보다 높을 때 짧은 거래가 됩니다.

중추점 전략

이 전략은 전날의 높은 가격, 낮은 가격 및 닫힌 가격에 기초하여 3개의 지원 수준과 3개의 저항 수준을 계산합니다. 계산은 다음과 같습니다. 회전점 = (높은 + 낮은 + 닫는) / 3 지원 1 = 2피브 포인트 높음 저항 1 = 2중추점 낮은 지원 2 = 회전점 (저항 1 지원 1) 저항 2 = 회전점 + (저항 1 지원 1) 지원 3 = 낮은 2*(높은 회전점) 저항 3 = 높은 + 2* (추적점 낮은) 그 다음 지원과 저항 수준을 기준으로 진입과 출구를 식별합니다.

장점

  1. 더 높은 승률을 달성하기 위해 두 가지 다른 유형의 전략의 강점을 결합합니다.
  2. 123 패턴은 단기 트렌드 반전을 효과적으로 식별합니다.
  3. 피보트 포인트는 잘못된 브레이크를 필터링하기 위해 주요 S/R 레벨을 사용합니다.

리스크 및 헤지

  1. 이중 STO는 단기적 반전을 뒤쳐 놓을 수 있고 놓칠 수 있습니다.
  2. 회전점은 항상 유지되지 않을 수 있습니다, 파업은 계속 될 수 있습니다
  3. 매개 변수는 다른 지표와 조정하거나 결합하여 위험을 감수할 수 있습니다.

최적화 방향

  1. 다른 파라미터 세트의 시험 영향
  2. 성능을 향상시키기 위해 다른 지표/패턴과 결합
  3. 매개 변수를 동적으로 최적화하기 위해 기계 학습을 통합

요약

이 전략은 트렌드 식별과 주요 가격 수준을 기발하게 결합하여 신호를 필터하기 위해 S / R를 활용하면서 반전을 감지 할 수 있습니다. 파라미터 튜닝과 다른 전략과의 조합을 통해 추가 개선이 가능합니다. 양자 거래자에 의해 더 많은 연구와 응용을받을 자격이 있습니다.


/*backtest
start: 2023-12-16 00:00:00
end: 2024-01-15 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 21/04/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
// Pivot points simply took the high, low, and closing price from the previous period and 
// divided by 3 to find the pivot. From this pivot, traders would then base their 
// calculations for three support, and three resistance levels. The calculation for the most 
// basic flavor of pivot points, known as ‘floor-trader pivots’, along with their support and 
// resistance levels.
//
// 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


PP2(res,SellFrom,BuyFrom) =>
    pos = 0.0
    xHigh  = security(syminfo.tickerid,res, high)
    xLow   = security(syminfo.tickerid,res, low)
    xClose = security(syminfo.tickerid,res, close)
    vPP = (xHigh+xLow+xClose) / 3
    vS1 = 2*vPP - xHigh 
    vR1 = 2*vPP-xLow
    vS2 = vPP - (vR1 - vS1)
    vR2 = vPP + (vR1 - vS1)
    vS3 = xLow - 2 * (xHigh - vPP)
    vR3 = xHigh + 2 * (vPP - xLow) 
    S =  iff(BuyFrom == "S1", vS1, 
          iff(BuyFrom == "S2", vS2,
           iff(BuyFrom == "S3", vS3,0)))
    B =  iff(SellFrom == "R1", vR1, 
          iff(SellFrom == "R2", vR2,
           iff(SellFrom == "R3", vR3,0)))
    pos := iff(close > B, 1,
             iff(close < S, -1, nz(pos[1], 0))) 
    pos

strategy(title="Combo Backtest 123 Reversal & Pivot Point V2)", 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, "---- Pivot Point V2 ----")
res = input(title="Resolution", type=input.resolution, defval="D")
SellFrom = input(title="Sell from ", defval="R1", options=["R1", "R2", "R3"])
BuyFrom = input(title="Buy from ", defval="S1", options=["S1", "S2", "S3"])
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posPP2 = PP2(res,SellFrom,BuyFrom)
pos = iff(posReversal123 == 1 and posPP2 == 1 , 1,
	   iff(posReversal123 == -1 and posPP2 == -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 )

더 많은