Impulse Breakout Bot [TradeIQ] — Strategy by Tradeiqofficial

By Tradeiqofficial

Performance Metrics

Description

WHAT IT DOESA trend-following strategy with one entry rule, one fixed stop and no profit target. It buys (or sells) after an unusually large candle closes through the recent range, risks a small fixed share of the account, and holds the trade until a large candle prints in the other direction. Most trades are small losses. The result depends on a minority of trades that catch a long trend.HOW IT WORKS1. Momentum candle. On a closed candle, all three must be true for a long: - the candle's high-low range is at least 2 x the ATR(14) of the previous candle; - the close is in the top quarter of the candle's range; - the close is above the highest high of the previous 20 candles. A short is the mirror image (bottom quarter, below the lowest low of the previous 20 candles).2. Entry. A market order at the next candle's open.3. Stop. Signal close minus (for a short: plus) a multiple of the signal candle's ATR(14). This distance is 1R. The stop is a resting order from the entry candle on and it never moves.4. Exit. A momentum candle in the other direction closes the trade at the next open. No filter is applied to this exit signal. There is no target, no trailing stop, no break-even and no time stop.5. One position at a time. A signal in the direction of the open trade is ignored. On the 1h preset, an opposite signal that passes the filters reverses the position at the same open.6. Size. The position is sized so that 1R costs the chosen share of equity (default 0.5 %), capped at a maximum position size (default 100 % of equity, no leverage).PRESETSThe input "Preset" selects the rule set that was researched for each chart timeframe. "Auto" picks it from the chart (15m, 1h or 4h; any other timeframe gets the nearest one, and the dashboard says which).- 4h: stop 1.5 ATR, long only, signal close above the EMA 200.- 1h: stop 3 ATR, long and short, signal close on the right side of the daily EMA 50, volume above 1.5 x its 20-candle average, entry Monday to Friday (UTC).- 15m: stop 6 ATR, long only, signal close above the 4h EMA 50.- Custom: every setting from its own input.OPTIONAL EXTRAS (ALL OFF BY DEFAULT)Three switches from a second research round of 264 variants. They are off in the tested presets and are less proven than the presets: with that many tries, a few small improvements are expected by chance.- Break-even after +1R: once a candle closes at +1R or better, the stop moves to the entry price, live from the next candle. On the 4h preset it lowered the backtest drawdown (18 % against 26 % at 0.5 % risk on ten markets) for about the same profit, and the win rate fell from 22 % to 16 % because scratched trades count as losses. It made the 1h and 15m presets worse.- Body filter: entries only when the signal candle's body is at least 60 % of its range. The exit signal is not filtered. A small gain on 4h and 15m, none on 1h.- Pause after a loss: no new entry for 20 candles after a losing trade closes. A small gain on 4h, close to none on 1h, worse on 15m.RISK AND ACCOUNT RULESRisk per trade was the setting that mattered most in our tests. On a 4h portfolio of ten markets the worst drawdown was about 14 % at 0.25 % risk, 26 % at 0.5 %, 45 % at 1 % and 70 % at 2 %. Rules that stop trading after losses made it worse: a cap of three open positions, or pausing the whole bot after three losses in a row, skipped signals that included the large winners. Halving the risk after a loss gave the same result as a lower fixed risk. The default is 0.5 % per trade with no pause.Why these parts: the large candle through the 20-candle range is the entry trigger; the trend filters keep entries on the side of the larger trend; the stop multiple grows on lower timeframes because trading costs take a larger share of a tight stop there; the opposite-candle exit is slow on purpose, so that a trend is held for as long as nothing comparable prints against it.WHAT IS ORIGINAL- The rule set is TradeIQ's own and is built only from TradingView built-ins (ATR, EMA, SMA, highest / lowest, request.security). No third-party code is reused.- Three presets from one research process, with the 15m preset labelled as marginal instead of being left out.- Risk-based position sizing with a position cap and an optional rule that halves the risk in a drawdown.- Chart layer: the signal candle, the breakout level it closed through, a risk zone from entry to stop, a result zone that follows the trade, entry and stop lines, an entry label (side, stop, 1R in %), and the result of each closed trade in R after fees.- Dashboard: preset and filters in use, open position with its live R, closed trades, win rate, profit factor in R, average winner and loser, total R, longest losing streak, risk per trade.- Alert messages on every order (plain text or JSON) for use with {{strategy.order.alert_message}}.REPAINTINGSignals are evaluated on closed candles only and orders fill at the next open. The higher-timeframe EMA is requested as ta.ema(close, 50)[1] with lookahead on, which returns the value of the last completed higher-timeframe candle and does not change afterwards. The script does not recalculate on every tick or after order fills.STRATEGY PROPERTIES (DEFAULTS USED FOR THE PUBLISHED REPORT)- Initial capital 10,000 USD.- Order size: set by the script from "Risk per trade" (0.5 % of equity at the stop), capped at 100 % of equity. The script uses 98 % of the cap to leave room for the fee and the gap to the next open. The Properties tab's "10 % of equity" is only a fallback and is not used by the entries.- Commission 0.05 % per order and slippage 3 ticks.- Margin 100 % for longs and shorts (no leverage).- Pyramiding 0.WHICH CHART TO LOAD- Use a liquid crypto pair with a long history. The 4h preset trades rarely (about 10 trades a year per market in our tests), so a 4h report needs the full history of an old symbol, or Deep Backtesting, to reach 100 trades. The 1h preset made about 40 to 50 trades a year per market, so a 1h chart of BTC with several years of data gives a larger sample.- Markets that held up best in our tests: 4h Bitcoin, Ethereum, BNB and gold; 1h Bitcoin, Solana, BNB and Chainlink.- Not recommended: EUR/USD, GBP/USD, USD/JPY and Dogecoin on 4h (they lost in our tests), and forex and stock indices on 15m.OUR BACKTEST AND ITS WEAK SPOTSTested outside TradingView on 14 markets, January 2021 to October 2026, with fees, spread, slippage and financing. The rules were chosen on five markets using 2021-2024 only, then checked once on 2025-2026 and on nine markets not used in the design. Profit factor (PF) is measured in R.- 4h: PF 3.81 on the design data, 2.52 on the new data, 1.78 on the unseen markets. About 21 % of trades won.- 1h: PF 1.44, 1.83 and 1.19. About 30-37 % of trades won. The margin is thin: 1.09 on the unseen markets with costs doubled.- 15m: PF 1.26, 1.24 and 1.18. It passed our check narrowly. With costs doubled the PF is close to 1.1, and without its best 1 % of trades it is at or below 1.0. Treat this preset as marginal.Weak spots, stated plainly:- The 4h preset lost money in 2022 (PF 0.43 on the selected markets).- Losing streaks are long: 19 losses in a row on one market, 28 across a 4h portfolio of ten markets.- A few trades make most of the profit. On the 4h portfolio the five best trades were 42 % of it. On the 4h new data, the result without the five best trades was a loss.- There is no trailing stop. A trade can give back a large open profit before an opposite candle closes it, or fall back to the original stop.- The test period (2021-2026) favoured longs in crypto, gold and US indices.- The coins tested are today's large caps (survivorship).- Forex as a group lost on 4h and 15m.WHY THE TRADINGVIEW REPORT WILL DIFFER FROM THESE FIGURES- Costs: this script uses a percentage commission and tick slippage. Our test used a cost per side by market plus financing while a trade is open.- Size: the report compounds on one chart and caps the position at 100 % of equity. When the cap applies, the cash at risk is smaller than the chosen %.- Candles: our 4h and daily candles are built on UTC boundaries. TradingView builds forex, gold and index candles from the session open, so signals on those markets fall on different candles. Crypto charts use UTC and should line up closely.- Volume: the 1h preset's volume filter depends on the data feed. Our forex, gold and index volume was tick volume from one provider.- History: an exchange symbol with a different start date gives a different list of trades.The Pine rules were replayed outside TradingView against the research trades and matched; the script itself was not compared trade by trade with a TradingView chart before publication.LIMITATIONS- Trend following loses in sideways and falling markets, sometimes for a year or longer.- The stop is placed from the signal close and the order fills at the next open. After a gap the real risk differs from 1R.- On symbols quoted in a currency other than the account currency, the position size is approximate.- Backtests do not include funding rates, exchange outages or order rejections.This script is for education. It is not financial advice. Past results do not guarantee future results.

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView