
이 전략은 전날의 가격 간격 돌파와 지수 이동 평균 (EMA) 을 결합한 일일 거래 전략이다. 전략은 가격 돌파 전날의 최고점 또는 최저점 시점을 식별하여 빠르고 느린 EMA의 확인 신호와 결합하여 거래한다. 이 전략은 단기 가격 움직임을 포착하는 데 초점을 맞추고 있으며, 고정된 중지 손실 수와 리스크 수익률을 설정하여 위험을 관리한다.
전략의 핵심 논리는 다음과 같은 핵심 요소에 기초합니다.
이 전략은 가격 돌파구와 EMA의 트렌드 확인을 결합하는 방식으로 신뢰할 수 있는 일일 거래 시스템을 구현한다. 전략의 핵심 장점은 명확한 논리 구조와 완벽한 위험 관리 장치에 있다. 전략은 제안된 최적화 방향을 통해 안정성과 수익성을 더욱 향상시킬 수 있다. 실물 거래에서는 가짜 돌파구와 슬라이드 포인트 위험에 특히 주의를 기울이고 실제 시장 조건에 따라 파라미터를 조정해야 한다.
/*backtest
start: 2025-02-16 17:00:00
end: 2025-02-18 14:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Binance","currency":"SOL_USDT"}]
*/
//@version=5
strategy("GER40 Momentum Breakout Scalping", overlay=true, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=1)
//———— Input Parameters —————
stopLossPoints = input.int(30, title="Stop Loss (Pips)", minval=1) // Updated to 30 pips
riskReward = input.float(2.0, title="Risk Reward Ratio", step=0.1)
useTimeFilter = input.bool(false, title="Use Time Filter? (Sessions in SAST)")
// Define sessions (SAST) if needed
session1 = "0900-1030"
session2 = "1030-1200"
session3 = "1530-1730"
//———— Time Filter Function —————
inSession = true
if useTimeFilter
// TradingView's session function uses the chart's timezone.
// Adjust the session times if your chart timezone is not SAST.
inSession = time(timeframe.period, session1) or time(timeframe.period, session2) or time(timeframe.period, session3)
//———— Get Previous Day's High/Low —————
// Fetch the previous day's high/low using the daily timeframe. [1] refers to the previous completed day.
prevHigh = request.security(syminfo.tickerid, "D", high[1])
prevLow = request.security(syminfo.tickerid, "D", low[1])
//———— Calculate EMAs on the 1-minute chart —————
emaFast = ta.ema(close, 9)
emaSlow = ta.ema(close, 21)
//———— Define Breakout Conditions —————
longCondition = close > prevHigh and emaFast > emaSlow
shortCondition = close < prevLow and emaFast < emaSlow
//———— Entry & Exit Rules —————
if inSession
// Long breakout: Price breaks above previous day's high
if (longCondition)
strategy.entry("Long", strategy.long)
strategy.exit("Exit Long", "Long",
stop = strategy.position_avg_price - stopLossPoints * syminfo.mintick,
limit = strategy.position_avg_price + stopLossPoints * riskReward * syminfo.mintick)
// Short breakout: Price breaks below previous day's low
if (shortCondition)
strategy.entry("Short", strategy.short)
strategy.exit("Exit Short", "Short",
stop = strategy.position_avg_price + stopLossPoints * syminfo.mintick,
limit = strategy.position_avg_price - stopLossPoints * riskReward * syminfo.mintick)
//———— Plot Indicators & Levels —————
plot(emaFast, color=color.blue, title="EMA 9")
plot(emaSlow, color=color.red, title="EMA 21")
plot(prevHigh, color=color.green, style=plot.style_linebr, title="Prev Day High")
plot(prevLow, color=color.maroon, style=plot.style_linebr, title="Prev Day Low")