This is a high-frequency trading strategy based on 1-minute candlestick close direction. The strategy determines market trends by analyzing the relationship between closing and opening prices, taking long positions after bullish candles and short positions after bearish candles. It employs fixed holding periods, closes positions at the next candlestick’s close, and limits daily trading frequency to control risk.
The core logic relies on candlestick close direction to judge short-term market trends:
This strategy is a high-frequency trading system based on candlestick close direction, capturing short-term market opportunities through simple price action analysis. Its strengths lie in simple logic, short holding periods, and controllable risk, while facing challenges like high transaction costs and false breakouts. Through the introduction of additional technical indicators and optimization measures, the strategy’s stability and profitability can be further enhanced. For investors seeking short-term trading opportunities, this is a trading strategy worth testing and improving.
/*backtest start: 2024-01-01 00:00:00 end: 2024-12-10 08:00:00 period: 2d basePeriod: 2d exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=5 strategy("Candle Close Strategy", overlay=true) // Define conditions for bullish and bearish candlesticks isBullish = close > open isBearish = close < open // Track the number of bars since the trade was opened and the number of trades per day var int barsSinceTrade = na var int tradesToday = 0 // Define a fixed position size for testing fixedPositionSize = 1 // Entry condition: buy after the close of a bullish candlestick if (isBullish and tradesToday < 200) // Limit to 200 trades per day strategy.entry("Buy", strategy.long, qty=fixedPositionSize) barsSinceTrade := 0 tradesToday := tradesToday + 1 // Entry condition: sell after the close of a bearish candlestick if (isBearish and tradesToday < 200) // Limit to 200 trades per day strategy.entry("Sell", strategy.short, qty=fixedPositionSize) barsSinceTrade := 0 tradesToday := tradesToday + 1 // Update barsSinceTrade if a trade is open if (strategy.opentrades > 0) barsSinceTrade := nz(barsSinceTrade) + 1 // Reset tradesToday at the start of a new day if (dayofmonth != dayofmonth[1]) tradesToday := 0 // Exit condition: close the trade after the next candlestick closes if (barsSinceTrade == 2) strategy.close("Buy") strategy.close("Sell") // Plot bullish and bearish conditions plotshape(series=isBullish, location=location.belowbar, color=color.green, style=shape.labelup, text="BUY") plotshape(series=isBearish, location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL") // Plot the candlesticks plotcandle(open, high, low, close, title="Candlesticks")