
첫 브레이크-스트로스 또는 클로즈 자동 평지 전략은 거래일 첫 라인의 높고 낮은 점을 기반으로 잠재적인 입문 신호를 식별하는 일간 거래 전략이다. 이 전략은 가격이 첫 라인 범위를 돌파했을 때의 동력을 포착하여 하루가 끝나기 전에 또는 스톱 손실을 만질 때 평지를 설정하여 단기 파동 수익을 달성합니다. 전략은 간결하게 설계되어 있으며, 일간 가격 움직임의 초기 방향성 돌파에 초점을 맞추고 있으며, 명확한 스톱 및 평화 포지션 규칙을 설정하여 위험을 효과적으로 제어합니다.
이 전략의 핵심 원칙은 거래일의 초기 단계의 가격 운동과 돌파 신호를 사용하여 후속 움직임을 예측하는 것입니다. 구체적인 운영 과정은 다음과 같습니다:
변수를 통해 전략tradeTaken하루에 한 번만 거래할 수 있도록tradeDirection현재 거래 방향에 대한 기록 ((1은 더 많은 것을 의미하며, -1은 더 적은 것을 의미하며), 거래 상태를 효과적으로 관리하고 스톱 손실 조건을 적용한다.
첫 번째 브레이크-손실 또는 종결 자동 평정 전략은 시장 개장 후 방향적 돌파구를 포착하여 이익을 얻는 간결하고 효율적인 일일 거래 방법입니다. 이 전략의 주요 장점은 작동이 간단하고, 위험이 통제 가능하며, 일일 거래자에 적합합니다. 그러나, 전략에는 가짜 돌파구 위험과 단일 기준점의 한계가 있습니다. 필터링 조건을 추가하고, 손실을 막는 장치를 최적화하고, 시장 환경 분석과 같은 방법을 결합하여 전략의 안정성과 수익성을 크게 향상시킬 수 있습니다.
/*backtest
start: 2025-03-28 00:00:00
end: 2025-03-31 00:00:00
period: 1m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("First Candle Breakout - Close on SL or EOD", overlay=true)
// User Inputs
startHour = input(9, "Start Hour (Exchange Time)")
startMinute = input(15, "Start Minute (Exchange Time)")
endHour = input(15, "End Hour (Exchange Time)") // Market closing hour
endMinute = input(30, "End Minute (Exchange Time)")
// Variables to store the first candle's high & low
var float firstCandleHigh = na
var float firstCandleLow = na
var bool tradeTaken = false // Ensures only one trade per day
var int tradeDirection = 0 // 1 for long, -1 for short
// Identify first candle's high & low
if (hour == startHour and minute == startMinute and bar_index > 1)
firstCandleHigh := high
firstCandleLow := low
tradeTaken := false // Reset trade flag at start of day
tradeDirection := 0 // Reset trade direction
// Buy condition: Close above first candle high AFTER the first candle closes
longCondition = not na(firstCandleHigh) and close > firstCandleHigh and not tradeTaken and hour > startHour
if (longCondition)
strategy.entry("Buy", strategy.long, comment="Buy")
tradeTaken := true // Mark trade as taken
tradeDirection := 1 // Mark trade as long
// Sell condition: Close below first candle low AFTER the first candle closes
shortCondition = not na(firstCandleLow) and close < firstCandleLow and not tradeTaken and hour > startHour
if (shortCondition)
strategy.entry("Sell", strategy.short, comment="Sell")
tradeTaken := true // Mark trade as taken
tradeDirection := -1 // Mark trade as short
// Stop loss for long trades (first candle low)
if (tradeDirection == 1 and close <= firstCandleLow)
strategy.close("Buy", comment="SL Hit")
// Stop loss for short trades (first candle high)
if (tradeDirection == -1 and close >= firstCandleHigh)
strategy.close("Sell", comment="SL Hit")
// Close trade at end of day if still open
if (tradeTaken and hour == endHour and minute == endMinute)
strategy.close_all(comment="EOD Close")