
Es handelt sich um eine Handelsstrategie, die auf dem Durchbruch der Höhen und Tiefen eines Tages basiert und die Stop-Loss- und Gewinnziele in Kombination mit dem ATR-Indikator dynamisch anpasst. Die Strategie verfolgt die Höchst- und Tiefstpreise des vorherigen Handelstages und des aktuellen Handelstages, um zu handeln, wenn der Preis diese kritischen Niveaus überschreitet. Die Strategie führt auch das Konzept der Bufferzone ein, um falsche Signale zu reduzieren, und verwendet die ATR-Multiplizierte, um dynamische Risikomanagementparameter einzurichten.
Die Kernlogik der Strategie basiert auf den Höhen und Tiefen vor dem Preisbruch.
Es handelt sich hierbei um eine vernünftige, logisch klare und durchdachte Handelsstrategie. Durch die Kombination von ATR-Indikatoren und der Konzeption von Bufferzonen werden Handelschancen und Risikokontrollen effektiv ausgeglichen. Die Strategie ist hochgradig visualisiert und automatisiert und eignet sich für den Einsatz von Day Tradern.
/*backtest
start: 2025-02-13 00:00:00
end: 2025-02-14 01:00:00
period: 1m
basePeriod: 1m
exchanges: [{"eid":"Binance","currency":"BTC_USDT"}]
*/
//@version=6
strategy("Previous/Current Day High-Low Breakout Strategy", overlay=true)
// === INPUTS ===
buffer = input(10, title="Buffer Points Above/Below Day High/Low") // 0-10 point buffer
atrMultiplier = input.float(1.5, title="ATR Multiplier for SL/TP") // ATR-based SL & TP
// === DETECT A NEW DAY CORRECTLY ===
dayChange = ta.change(time("D")) != 0 // Returns true when a new day starts
// === FETCH PREVIOUS DAY HIGH & LOW CORRECTLY ===
var float prevDayHigh = na
var float prevDayLow = na
if dayChange
prevDayHigh := high[1] // Store previous day's high
prevDayLow := low[1] // Store previous day's low
// === TRACK CURRENT DAY HIGH & LOW ===
todayHigh = ta.highest(high, ta.barssince(dayChange)) // Highest price so far today
todayLow = ta.lowest(low, ta.barssince(dayChange)) // Lowest price so far today
// === FINAL HIGH/LOW SELECTION (Whichever Happens First) ===
finalHigh = math.max(prevDayHigh, todayHigh) // Use the highest value
finalLow = math.min(prevDayLow, todayLow) // Use the lowest value
// === ENTRY CONDITIONS ===
// 🔹 BUY (LONG) Condition: Closes below final low - buffer
longCondition = close <= (finalLow - buffer)
// 🔻 SELL (SHORT) Condition: Closes above final high + buffer
shortCondition = close >= (finalHigh + buffer)
// === ATR STOP-LOSS & TAKE-PROFIT ===
atr = ta.atr(14)
longSL = close - (atr * atrMultiplier) // Stop-Loss for Long
longTP = close + (atr * atrMultiplier * 2) // Take-Profit for Long
shortSL = close + (atr * atrMultiplier) // Stop-Loss for Short
shortTP = close - (atr * atrMultiplier * 2) // Take-Profit for Short
// === EXECUTE LONG (BUY) TRADE ===
if longCondition
strategy.entry("BUY", strategy.long, comment="🔹 BUY Signal")
strategy.exit("SELL TP", from_entry="BUY", stop=longSL, limit=longTP)
// === EXECUTE SHORT (SELL) TRADE ===
if shortCondition
strategy.entry("SELL", strategy.short, comment="🔻 SELL Signal")
strategy.exit("BUY TP", from_entry="SELL", stop=shortSL, limit=shortTP)
// === PLOT LINES FOR VISUALIZATION ===
plot(finalHigh, title="Breakout High (Prev/Today)", color=color.new(color.blue, 60), linewidth=2, style=plot.style_stepline)
plot(finalLow, title="Breakout Low (Prev/Today)", color=color.new(color.red, 60), linewidth=2, style=plot.style_stepline)
// === ALERT CONDITIONS ===
alertcondition(longCondition, title="🔔 Buy Signal", message="BUY triggered 🚀")
alertcondition(shortCondition, title="🔔 Sell Signal", message="SELL triggered 📉")