The daily breakout strategy is a simple trend following strategy based on daily candlestick charts. It generates trading signals by observing the relationship between the previous day’s opening and closing prices to determine market momentum.
The core logic of this strategy is:
If the previous day’s candlestick body is green (closing price higher than opening price), it indicates an upward trend on that day. The strategy will go long at the next day’s opening. If the previous day’s candlestick body is red (closing price lower than opening price), it indicates a downward trend. The strategy will go short at the next day’s opening.
By this simple way, the strategy can identify the market momentum within the recent one candlestick cycle and make trades accordingly. This allows the strategy to follow the latest market trend.
Specifically, the strategy generates trading signals as follows:
Through this logic, the strategy can capitalize on short-term price trends.
The main advantages of this strategy include:
Some risks and improvement areas:
The daily breakout strategy identifies market momentum through simple and effective comparison of daily candlesticks, allowing it to trade in the direction of shorter-term trends. While simple and easy to implement, it has whipsaw risks. Further optimizations on parameters and additional indicators can enhance strategy reliability.
/*backtest start: 2022-12-26 00:00:00 end: 2023-08-30 00:00:00 period: 1d basePeriod: 1h exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=5 strategy("Daily Candle Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=0.0) // Input parameters initialCapital = 10000 riskFactor = 3500 // Calculate the opening and closing values for the last day's candle lastDayOpen = request.security(syminfo.tickerid, "D", open[1], lookahead=barmerge.lookahead_on) lastDayClose = request.security(syminfo.tickerid, "D", close[1], lookahead=barmerge.lookahead_on) // Determine the color of the last day's candle lastDayColor = lastDayOpen < lastDayClose ? color.green : color.red // Plot the last day's candle on the chart plotshape(series=na, color=lastDayColor, style=shape.triangledown, location=location.abovebar) // Calculate trade size based on available capital at last day's closing availableCapital = strategy.equity tradeSize = availableCapital / riskFactor // Trading conditions buyCondition = lastDayColor == color.green sellCondition = lastDayColor == color.red // Execute strategy orders with calculated trade size strategy.entry("Buy", strategy.long, qty=tradeSize, when=buyCondition) strategy.entry("Sell", strategy.short, qty=tradeSize, when=sellCondition) // Exit strategy stopLoss = 0.001 * lastDayOpen * tradeSize strategy.exit("StopLoss/Profit", from_entry="Buy", loss=stopLoss) strategy.exit("StopLoss/Profit", from_entry="Sell", loss=stopLoss) // Plot stop loss level on the chart plot(stopLoss, color=color.red, linewidth=2, title="Stop Loss")