0bps

Strategy vault / Breakout

Breakthrough Tracking Strategy

This strategy is designed for 5-minute K-lines of bank indices and indices to track breakthroughs. It can generate signals when breakthroughs occur for buy or sell operations.

Author
ChaoZhang
Complexity
Starter · 39 lines
Parameters
4
Backtest bar
1h · intraday
Tested on
BTC/USDT · futures

IMG

Overview

This strategy is designed for 5-minute K-lines of bank indices and indices to track breakthroughs. It can generate signals when breakthroughs occur for buy or sell operations.

Strategy Principle

This strategy calculates the highest and lowest price indicators to judge if the price breaks through the highest and lowest price range. If the price breaks through this range, it will generate buy or sell signals. To filter out some noise, it also uses auxiliary indicators for confirmation.

Advantage Analysis:

  1. This strategy responds quickly and can enter the market immediately when a breakthrough occurs.
  2. By double filtering through the high and low price range and auxiliary indicators, some false breakthroughs can be avoided.
  3. This strategy has no lagging as it has non-repetitive indicators.

Risk Analysis:

  1. If there is a huge swing in the market, this strategy may generate reverse signals, leading to losses.
  2. Simple breakthrough strategies are easy to fall into traps and need to be wary of breakthrough failures.

Optimization Directions:

  1. Trend indicators can be combined to avoid reverse operations.
  2. A stop-loss mechanism can be added to control single losses.

Summary

This strategy looks for trading opportunities by judging whether prices break through the high and low price range. It responds quickly and avoids lagging but also faces risks such as breakthrough failures and traps. Through optimization, this strategy can achieve better performance in trending markets.

Parameters

NameDefaultWhat it controls
v_input_1_close0price: close | high | low | open | hl2 | hlc3 | hlcc4 | ohlc4
v_input_226LookBack
v_input_310length
v_input_4truelength2

Source Pine Script

/*backtest
start: 2023-12-01 00:00:00
end: 2023-12-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
strategy(title="MARKET DYNAMICS HH LL BREAKOUT", shorttitle="BREAKOUT STRATEGY", overlay=true)

////


//Higher High or Lower Low Entry Inputs
price = input(close)
LookBack = input(26)
Highest = highest(LookBack)
Lowest = lowest(LookBack)

long = price > Highest[1] 
short = price < Lowest[1]




//Safety Confirmation Inputs - Helps to thin out false breakouts or break downs
length = input(10)
High_Guard = highest(length)
Low_Guard = lowest(length)
length2 = input(1)

long1 = long == 1 and Highest[1] > High_Guard[length2]
short1 = short == 1 and Lowest[1] < Low_Guard[length2]


strategy.entry("Long", strategy.long, when=long1)
strategy.entry("Short", strategy.short, when=short1)

Published by ChaoZhang on the FMZ strategy square · last modified 2024-01-05. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.

Build this with AgenKit

A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.

in Claude Code, Cursor, Codex & 4 more
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Breakthrough-Tracking-Strategy.md
  1. npx agenkit install engineering-kit in your project
  2. Paste the command into your agent and approve each phase
  3. Get tests, backtest, risk controls and a paper-trading switch

Understand it first

Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.

Related specs

esc

Try , , or .

↑↓ move↵ open