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.
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:
Risk Analysis:
Optimization Directions:
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.
/*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)