The seven candlestick oscillation breakthrough strategy detects the persistence up and down candlestick patterns formed by seven K-lines to determine market oscillation trends and make breakthrough operations at fixed times to profit.
The core logic of this strategy is based on two indicators:
When sevenReds is detected, go long; when sevenGreens is detected, go short.
In addition, the strategy also closes positions at fixed times (important US data release times) every day to lock in profits.
The seven candlestick oscillation breakthrough strategy has the following advantages:
The seven candlestick oscillation breakthrough strategy also has some risks:
Corresponding solutions:
The seven candlestick oscillation breakthrough strategy can be optimized in the following aspects:
The seven candlestick oscillation breakthrough strategy profits by capturing short-term oscillation trends in the market, while using timed execution to avoid major risks and taking profits to lock in gains. The strategy can be enhanced via multi-asset rotation, machine learning etc. It is a typical medium-frequency quantitative trading strategy.
/*backtest start: 2023-12-07 00:00:00 end: 2023-12-14 00:00:00 period: 10m basePeriod: 1m exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // © Eliza123123 //@version=5 strategy("Breakeven Line Demo", overlay=true) // Generic signal (not a viable strategy don't use, just some code I wrote quick for demo purposes only) red = open > close, green = open < close sevenReds = red and red[1] and red[2] and red[3] and red[4] and red[5] and red[6] sevenGreens = green and green[1] and green[2] and green[3] and green[4] and green[5] and green[6] if sevenReds strategy.entry('Buy', direction=strategy.long) if sevenGreens strategy.entry('Sell', direction=strategy.short) if (hour == 5 and minute == 0 ) or (hour == 11 and minute == 0) or (hour == 17 and minute == 0 ) or (hour == 23 and minute == 0) strategy.close_all("Close") // Breakeven line for visualising breakeven price on stacked orders. var breakEvenLine = 0.0 if strategy.opentrades > 0 breakEvenLine := strategy.position_avg_price else breakEvenLine := 0.0 color breakEvenLineColor = na if strategy.position_size > 0 breakEvenLineColor := #15FF00 if strategy.position_size < 0 breakEvenLineColor := #FF000D plot(breakEvenLine, color = breakEvenLine and breakEvenLine[1] > 0 ? breakEvenLineColor : na, linewidth = 2, style = plot.style_circles)