
이 전략은 여러 주요 가격 수준을 기반으로 하는 돌파적 거래 시스템입니다. 주로 6가지 핵심 포인트를 추적합니다. 일중 최고가(HOD), 일중 최저가(LOD), 장전 최고가(PMH), 장전 최저가(PML), 전일 최고가(PDH), 전일 최저가(PDL). 가격 가격이 이러한 수준을 돌파하면 거래 신호가 생성됩니다. 이 전략은 주요 수준의 가격 변동에 따라 매수 및 매도 작업을 실행하는 자동화된 거래를 사용합니다.
전략의 핵심 논리는 다음과 같은 핵심 부분으로 구성됩니다.
이 전략은 여러 주요 가격 수준을 모니터링하고 활용하여 시장 기회를 포착하며, 명확한 논리와 높은 수준의 자동화를 갖추고 있습니다. 하지만 기술적 지표 필터링을 추가하고 위험 관리 메커니즘을 개선하는 등 최적화가 필요한 특정 위험도 있습니다. 이 전략의 핵심적인 장점은 다차원적 가격 참조 시스템에 있으며, 이를 통해 시장 동향을 보다 잘 파악할 수 있지만, 실제 적용에서는 다양한 시장 환경에 따라 타겟팅된 매개변수 조정이 필요합니다.
/*backtest
start: 2024-12-06 00:00:00
end: 2025-01-04 08:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © tradingbauhaus
//@version=6
strategy("HOD/LOD/PMH/PML/PDH/PDL Strategy by tradingbauhaus ", shorttitle="HOD/LOD Strategy", overlay=true)
// Daily high and low
dailyhigh = request.security(syminfo.tickerid, 'D', high)
dailylow = request.security(syminfo.tickerid, 'D', low)
// Previous day high and low
var float previousdayhigh = na
var float previousdaylow = na
high1 = request.security(syminfo.tickerid, 'D', high[1])
low1 = request.security(syminfo.tickerid, 'D', low[1])
high0 = request.security(syminfo.tickerid, 'D', high[0])
low0 = request.security(syminfo.tickerid, 'D', low[0])
// Yesterday high and low
if (hour == 9 and minute > 30) or hour > 10
previousdayhigh := high1
previousdaylow := low1
else
previousdayhigh := high0
previousdaylow := low0
// Premarket high and low
t = time("1440", "0000-0930") // 1440 is the number of minutes in a whole day.
is_first = na(t[1]) and not na(t) or t[1] < t
ending_hour = 9
ending_minute = 30
var float pm_high = na
var float pm_low = na
if is_first and barstate.isnew and ((hour < ending_hour or hour >= 16) or (hour == ending_hour and minute < ending_minute))
pm_high := high
pm_low := low
else
pm_high := pm_high[1]
pm_low := pm_low[1]
if high > pm_high and ((hour < ending_hour or hour >= 16) or (hour == ending_hour and minute < ending_minute))
pm_high := high
if low < pm_low and ((hour < ending_hour or hour >= 16) or (hour == ending_hour and minute < ending_minute))
pm_low := low
// Plotting levels
plot(dailyhigh, style=plot.style_line, title="Daily high", color=color.white, linewidth=1, trackprice=true)
plot(dailylow, style=plot.style_line, title="Daily low", color=color.purple, linewidth=1, trackprice=true)
plot(previousdayhigh, style=plot.style_line, title="Previous Day high", color=color.orange, linewidth=1, trackprice=true)
plot(previousdaylow, style=plot.style_line, title="Previous Day low", color=color.blue, linewidth=1, trackprice=true)
plot(pm_high, style=plot.style_line, title="Premarket high", color=color.green, linewidth=1, trackprice=true)
plot(pm_low, style=plot.style_line, title="Premarket low", color=color.red, linewidth=1, trackprice=true)
// Strategy logic
// Long entry: Price crosses above PMH or PDH
if (ta.crossover(close, pm_high) or ta.crossover(close, previousdayhigh)) and strategy.opentrades == 0
strategy.entry("Long", strategy.long)
// Short entry: Price crosses below PML or PDL
if (ta.crossunder(close, pm_low) or ta.crossunder(close, previousdaylow)) and strategy.opentrades == 0
strategy.entry("Short", strategy.short)
// Exit long: Price reaches HOD
if strategy.position_size > 0 and ta.crossover(close, dailyhigh)
strategy.close("Long")
// Exit short: Price reaches LOD
if strategy.position_size < 0 and ta.crossunder(close, dailylow)
strategy.close("Short")