오픈 하이 클로즈 로우 브레이크오프 거래 전략

저자:차오장, 날짜: 2024-02-02 12:03:45
태그:

img

전반적인 설명

오픈 하이 클로즈 로우 브레이크아웃 트레이딩 전략은 트렌드를 따르는 전략이다. 촛불 차트에서 오픈 및 클로즈 가격 사이의 관계를 확인함으로써 단기 트렌드 방향을 파악한다. 트렌드가 시작되면 빠르게 추진력을 잡기 위해 긴 또는 짧은 포지션을 입력한다.

전략 논리

핵심 논리는 오픈 가격이 촛불의 최저 또는 최고 가격에 해당하는지 확인하는 것입니다. 오픈 가격이 최저에 해당할 때 긴 신호가 유발됩니다. 오픈 가격이 최고에 해당할 때 짧은 신호가 유발됩니다. 이것은 단기 트렌드를 암시하는 브레이크아웃을 잡는 것을 목표로합니다.

신호가 트리거되면 고정 사이즈 포지션이 즉시 열립니다. 스톱 손실은 시장 변동성을 추적하기 위해 ATR 지표에 따라 설정됩니다. 이윤 취득 수준은 엔트리 가격에서 스톱 손실 거리의 고정 RR 배수입니다. 가격이 스톱 손실 또는 이윤 취득에 도달하면 해당 포지션이 종료됩니다.

이 전략은 또한 모든 포지션을 사용자 정의 된 일일 절정 시간, 예를 들어 미국 시장 폐쇄 30 분 전에 평평화합니다. 이것은 하루 간 격차 위험을 피합니다.

이점 분석

주요 장점은 다음과 같습니다.

  1. 오픈/클로즈 가격을 사용하여 브레이크오웃 신호를 빠르게 식별합니다.

  2. 쉽게 실행할 수 있는 명확한 입력 신호.

  3. 적시에 손실을 멈추고 이익을 취해서 이익을 확보하고 손실을 제한합니다.

  4. 일일 절단점에서의 평평한 위치로 하루 간 격차 위험을 피합니다.

  5. 시장 중립, 외환, 주식, 암호화 등에 적용됩니다.

위험 분석

고려해야 할 몇 가지 위험:

  1. ATR의 빈번한 스톱 로스는 불안한 시장에서

  2. 추가 필터 없이 특정 악기와 세션에 과장

  3. 고정 취득 수준은 강한 추세에서 저조한 성과를 낼 수 있습니다.

  4. 평평화 시점의 잘못된 타이밍은 트렌드를 놓칠 수도 있고 불필요한 손실을 초래할 수도 있습니다.

개선 할 수 있는 분야

더 이상 최적화 할 수있는 몇 가지 방법:

  1. 다른 시장 조건에 따라 다양한 스톱 로스 기술을 실험합니다.

  2. 잘못된 신호를 피하기 위해 운동 지표 등을 사용하는 필터를 추가합니다.

  3. 시장의 변동성에 따라 수익률을 동적으로 조정합니다.

  4. 다양한 거래 도구 및 세션에 대한 일일 절단 시간을 최적화하십시오.

결론

오픈 하이 클로저 로브 브레이크아웃 전략은 트레이드 모멘텀을 만드는 간단한 방법을 제공합니다. 명확한 엔트리 및 출구 규칙은 구현 및 관리를 용이하게합니다. 그러나 스톱 로스, 영리, 필터와 같은 매개 변수에 대한 추가 최적화는 더 많은 시장 조건에서 안정성을 향상시킬 것입니다. 엄격한 테스트를 통해 시간이 지남에 따라 세밀하게 조정되면 강력한 위험 조정 수익을 얻을 수 있습니다.


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

//@version=5
// Open-High-Low strategy

strategy('Strategy: OLH', shorttitle="OLH", overlay=true)

// Inputs
slAtrLen = input.int(defval=14, title="ATR Period for placing SL", group="StopLoss settings")
showSLLines = input.bool(defval=false, title="Show SL lines in chart", tooltip="Show SL lines also as dotted lines in chart. Note: chart may look untidy.", group="Stolploss settings")
// Trade related
rrRatio = input.float(title='Risk:Reward', step=0.1, defval=2.0, group="Trade settings")
endOfDay = input.int(defval=1500, title="Close all trades, default is 3:00 PM, 1500 hours (integer)", group="Trade settings")
mktAlwaysOn = input.bool(defval=true, title="Markets that never closed (Crypto, Forex, Commodity)", tooltip="Some markers never closes. For those cases, make this checked.", group="Trade settings")
lotSize = input.int(title='Lot Size', step=1, defval=1, group="Trade settings")


// Utils
green(open, close) => close > open ? true : false
red(open, close) => close < open ? true : false
body(open, close) => math.abs(open - close)
lowerwick = green(open, close) ? open - low : close - low
upperwick = green(open, close) ? high - close : high - open
crange = high - low
crangep = high[1] - low[1] // previous candle's candle-range
bullish = close > open ? true : false
bearish = close < open ? true : false


// Trade signals
longCond = barstate.isconfirmed and (open == low)
shortCond = barstate.isconfirmed and (open == high)

// For SL calculation
atr = ta.atr(slAtrLen)
highestHigh = ta.highest(high, 7)
lowestLow = ta.lowest(low, 7)
longStop = showSLLines ? lowestLow - (atr * 1) : na
shortStop = showSLLines ? highestHigh + (atr * 1) : na
plot(longStop, title="Buy SL", color=color.green, style=plot.style_cross)
plot(shortStop, title="Sell SL", color=color.red, style=plot.style_cross)

// Trade execute
h = hour(time('1'), syminfo.timezone)
m = minute(time('1'), syminfo.timezone)
hourVal = h * 100 + m
totalTrades = strategy.opentrades + strategy.closedtrades
if (mktAlwaysOn or (hourVal < endOfDay))
    // Entry
    var float sl = na
    var float target = na
    if (longCond)
        strategy.entry("enter long", strategy.long, lotSize, limit=na, stop=na, comment="Enter Long")
        sl := longStop
        target := close + ((close - longStop) * rrRatio)
        alert('Buy:' + syminfo.ticker + ' ,SL:' + str.tostring(math.floor(sl)) + ', Target:' + str.tostring(target), alert.freq_once_per_bar)
    if (shortCond)
        strategy.entry("enter short", strategy.short, lotSize, limit=na, stop=na, comment="Enter Short")
        sl := shortStop
        target := close - ((shortStop - close) * rrRatio)
        alert('Sell:' + syminfo.ticker + ' ,SL:' + str.tostring(math.floor(sl)) + ', Target:' + str.tostring(target), alert.freq_once_per_bar)

    // Exit: target or SL
    if ((close >= target) or (close <= sl))
        strategy.close("enter long", comment=close < sl ? "Long SL hit" : "Long target hit")
    if ((close <= target) or (close >= sl))
        strategy.close("enter short", comment=close > sl ? "Short SL hit" : "Short target hit")
else if (not mktAlwaysOn)
    // Close all open position at the end if Day
    strategy.close_all(comment = "Close all entries at end of day.")



더 많은