격리된 사이클 사이즈의 추진력 전략

저자:차오장, 날짜: 2023-09-20 14:59:37
태그:

전반적인 설명

이 전략의 핵심 아이디어는 사이클 사이에 포함된 촛불 패턴을 사용하여 트렌드 방향을 결정하고 입구 신호로 사용하는 것입니다. 이전 촛불을 포함하는 사이클 사이에 포함 된 패턴이 나타나면 트렌드가 역전되는 지점이라고 결론 지을 수 있습니다. 이 시점에서 우리는 이전 최고보다 높은 브레이크에 장기간에 갈 수 있습니다. 또는 적절한 스톱 손실 및 수익 설정과 함께 이전 최저 이하의 브레이크에 짧게 갈 수 있습니다.

전략 논리

  1. 사이클 사이에 포함 된 패턴이 발생하는지 확인하십시오. 구체적인 논리는: 현재 촛불의 높이는 이전 촛불의 높이에 비해 낮고 현재 촛불의 낮은 이전 촛불의 낮보다 높습니다.

  2. 이전 촛불이 상승세인지 하락세인지 결정합니다. 닫는 것이 개방보다 높다면 상승세였습니다. 닫는 것이 개방보다 낮다면 하락세였습니다.

  3. 이전 촛불이 상승세를 보였을 때 포착된 패턴이 나타나면 이전 촛불의 높이에 + 10%의 범위에서 구매 중지 명령을 내립니다.

  4. 만약 이전 촛불이 하락세를 보였고, 그 패턴이 나타난다면, 이전 촛불의 낮은 지점인 그 범위의 -10%에서 판매 중지 주문을 할 수 있습니다.

  5. 스톱 오더가 트리거되고 포지션이 열리면 스톱 로스를 설정하고 이윤을 취합니다. 스톱 로스와 이윤을 취하는 거리는 이전 촛불의 범위의 특정 비율입니다.

  6. 다른 내부 바 패턴이 형성되면 먼저 기존 포지션을 닫고 새로운 대기 주문을 배치합니다.

이점 분석

이 전략의 장점은 다음과 같습니다.

  1. 그것은 촛불의 내재적 논리를 활용하고 정확한 진입 시기를 제공합니다. 포함 된 패턴은 종종 다가오는 트렌드 반전 또는 가속을 암시합니다.

  2. 규칙은 간단하고 실제 거래에 따라하기 쉽습니다.

  3. 이전 촛불의 범위에 기반한 스톱 로스 및 수익을 취하는 것은 위험을 조절하는 데 도움이 됩니다.

  4. 새로운 대기 주문은 새로운 트렌드를 따라갈 수 있도록 자격 패턴이 나타날 때마다 배치됩니다.

위험 분석

또한 몇 가지 위험이 있습니다.

  1. 포함 된 패턴은 항상 트렌드 반전 또는 가속화로 이어지는 것은 아닙니다. 일부 잘못된 신호가 있습니다.

  2. 스톱 로스 거리는 시장의 큰 변동에 견딜 수 없을 정도로 작을 수 있습니다.

  3. 이윤 취득 목표가 너무 넓어서 적시에 이윤을 얻을 수 없습니다.

  4. 이 전략은 시장 트렌드에 더 의존합니다. 통합 기간 동안 수익 잠재력은 제한적입니다.

  5. 높은 거래 빈도는 큰 거래 비용을 초래합니다.

해결책:

  1. 신호를 확인하고 잘못된 신호를 줄이기 위해 다른 표시기를 추가합니다.

  2. 스톱 로스를 약간 넓히지만 이전 촛불의 범위의 50% 이상 넓히지 마십시오.

  3. 영업이익 목표를 이전 촛불 범위의 약 50%로 단축합니다.

  4. 자본 관리를 최적화하고, 다양한 시장에 대한 개별 포지션 크기를 줄입니다.

  5. 거래 빈도를 줄이기 위해 진입 기준을 완화하십시오.

최적화 방향

전략을 최적화하는 몇 가지 방법:

  1. 추세 방향을 결정하기 위해 MACD와 같은 트렌드 지표를 추가하여 통합 중에 위프스를 피합니다.

  2. 트레일링 스톱이나 이익 보호 스톱 손실과 같은 더 고급 스톱 손실 기술을 사용하십시오.

  3. 다른 스톱 로스를 테스트하고 최적의 매개 변수를 찾기 위해 수익 비율을 취하십시오.

  4. 재입구 논리를 추가하여 Stop Loss 이후 트렌드를 다시 캡처합니다.

  5. 시장의 변동성에 따라 포지션 크기를 최적화합니다.

  6. 고정 분자 위치 사이즈링과 같은 자본 관리를 최적화하십시오.

  7. 다른 제품과 시간 프레임에 전략을 테스트합니다.

결론

요약하자면, 이것은 트렌드 전환점을 결정하고 트렌드 반전을 포착하기 위해 미루어있는 주문을 배치하기 위해 사이클 사이에 포함 된 패턴을 사용하는 전략입니다. 명확한 엔트리 신호, 간단한 규칙 및 제어 가능한 위험의 장점이 있지만 일부 잘못된 신호 위험과 최적화 여지가 있습니다. 우리는 트렌드 필터, 최적화 스톱, 포지션 크기를 조정하는 등을 결합하여 안정성과 수익성을 더욱 향상시킬 수 있습니다. 트렌드 시장에 더 적합하며 실제 사용 전에 다양한 시장 조건에 최적화 및 테스트해야합니다.


/*backtest
start: 2023-01-01 00:00:00
end: 2023-03-10 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3

// Inside Bar Momentum Strategy
// As defined on Babypips.com
// https://www.babypips.com/trading/forex-inside-bar-20170113

// strategy("Babypips: Inside Bar Momentum Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=5)

From_Year  = input(defval = 2018, title = "From Year")
From_Month = input(defval = 1, title = "From Month", minval = 1, maxval = 12)
From_Day   = input(defval = 1, title = "From Day", minval = 1, maxval = 31)
To_Year    = input(defval = 9999, title = "To Year")
To_Month   = input(defval = 1, title = "To Month", minval = 1, maxval = 12)
To_Day     = input(defval = 1, title = "To Day", minval = 1, maxval = 31)
Start  = timestamp(From_Year, From_Month, From_Day, 00, 00)  // backtest start window
Finish = timestamp(To_Year, To_Month, To_Day, 23, 59)        // backtest finish window
Window = true

Stop_Buy_Perc  = input(10, "Stop Buy Order Percentage From Previous Candle's Range")/100
Stop_Loss_Perc = input(20, "Stop Loss Distance from High/Low of Previous Candle")/100
Take_Prof_Perc = input(80, "Take Profit Distance from High/Low of Previous Candle")/100

Risk = input(2, "Percentage Of EQUITY to risk per trade", step=0.1, minval=0, maxval=100)/100

Inside_Bar = high[1] > high[0] and low[1] < low[0]
Prev_Range = high[1] - low[1]
Bullish = open[1] < close[1]
Bearish = open[1] > close[1]

// Get Key Levels 
Long_Stop_Buy_Level   = high[1] + (Prev_Range * Stop_Buy_Perc)
Short_Stop_Buy_Level  = low[1]  - (Prev_Range * Stop_Buy_Perc)
Long_Stop_Loss_Level  = high[1] - (Prev_Range * Stop_Loss_Perc)
Short_Stop_Loss_Level = low[1]  + (Prev_Range * Stop_Loss_Perc)
Long_Take_Prof_Level  = high[1] + (Prev_Range * Take_Prof_Perc)
Short_Take_Prof_Level = low[1]  - (Prev_Range * Take_Prof_Perc)

// Position Sizing
long_qty = floor((strategy.equity * Risk) / (Long_Stop_Buy_Level - Long_Stop_Loss_Level))
short_qty = floor((strategy.equity * Risk) / (Short_Stop_Loss_Level - Short_Stop_Buy_Level))

// -------------------------- LONG CONDITIONS --------------------------------//
// The first candlestick must be bullish (green or white) and if the second 
// candlestick is completely contained by the first, set a buy stop order at 
// the first candle’s high plus 10% of its range (high minus low).

// Place the stop loss at the first candle’s high minus 20% of its range 
// and set the target at the first candle’s high plus 80% of its range

// If another inside bar pattern forms, the current position should be closed 
// or the pending buy/sell order must be canceled and entry orders must be 
// updated to the latest candles.

Long_Condition = Window and Inside_Bar and Bullish
if (Long_Condition)
    // Incase we still have a buy stop order in the market
    strategy.cancel_all()
    // Close any existing positions according to the rules
    strategy.close_all()
    strategy.entry("Bullish IB", strategy.long, stop=Long_Stop_Buy_Level)
    strategy.exit("Bullish Exit","Bullish IB", stop=Long_Stop_Loss_Level, limit=Long_Take_Prof_Level)
    
// -------------------------- SHORT CONDITIONS -------------------------------//
// The first candlestick must be bearish (red or black) and if the second 
// candlestick is completely contained by the first, set a sell stop order at 
// the first candle’s low minus 10% of its range (high minus low).

// Place the stop loss at the first candle’s low plus 20% of its range and 
// set the target at the first candle’s low minus 80% of its range.

// If another inside bar pattern forms, the current position should be closed 
// or the pending buy/sell order must be canceled and entry orders must be 
// updated to the latest candles.

Short_Condition = Window and Inside_Bar and Bearish
if (Short_Condition)
    // Incase we still have a buy stop order in the market
    strategy.cancel_all()
    // Close any existing positions according to the rules
    strategy.close_all()
    strategy.entry("Bearish IB", strategy.short, stop=Short_Stop_Buy_Level)
    strategy.exit("Bearish Exit","Bearish IB", stop=Short_Stop_Loss_Level, limit=Short_Take_Prof_Level)
    
// ----------------------------- PLOTTING ------------------------------------//
plotshape(Inside_Bar, style=shape.arrowdown, location=location.abovebar, color=purple)


더 많은