Dual Thrust Strategy
The dual thrust strategy sets upper and lower bands based on the opening price and previous day's range, going long on upside breakouts and short on downside breakouts. It aims to capture trend trading opportunities…
Overview
The dual thrust strategy sets upper and lower bands based on the opening price and previous day's range, going long on upside breakouts and short on downside breakouts. It aims to capture trend trading opportunities formed by the breakouts.
Strategy Principle
Calculate the highest high HH and lowest low LL over the recent N bars.
Calculate the highest close HC and lowest close LC of the previous day.
The previous day's range Range is the larger of HH-LC and HC-LL.
The upper band BuyLine is opening price plus k1*Range.
The lower band SellLine is opening price minus k2*Range.
Go long when close breaks above BuyLine. Go short when close breaks below SellLine.
Advantage Analysis
Main advantages of this strategy:
Captures trend formed by breakouts around the opening price.
Bands are set automatically based on historical volatility, avoiding subjectivity.
Customizable k values suit products with different volatility.
Breakout signals have relatively high quality.
Flexible holding periods to capture trends on different timeframes.
Risk Analysis
Main risks of this strategy:
Difficulty determining reasonable range for the bands, overfit risks.
Breakouts may turn out to be false signals, need stop loss.
Fixed holding period cannot adapt dynamically to market.
Insufficient backtest data leads to curve fitting.
Difficulty implementing long and short trading together.
Solutions:
Optimize k values on larger dataset to avoid overfitting.
Set proper stop loss to limit loss per trade.
Add trend filter to avoid countertrend trading.
Consider reducing holding period to intraday.
Live validation with gradual position sizing.
Optimization Directions
Some ways to improve the strategy:
Dynamically adjust k values for the bands.
Add volume filter to confirm breakout signals.
Use moving stop loss to protect profits.
Assess breakout strength for position sizing.
Distinguish between trend and range to decompose strategy.
Summary
The dual thrust strategy can capture trend trading opportunities around the opening price. But parameter settings and holding period optimizations have large room for improvements considering risk control. For live trading, start with conservative parameters and size up positions gradually.
Parameters
| Name | Default | What it controls |
|---|---|---|
| v_input_1 | 0.67 | k1 |
| v_input_2 | 0.62 | k2 |
| v_input_3 | 240 | TimeFrame |
| v_input_4 | 20 | len |
Source Pine Script
/*backtest
start: 2023-09-11 00:00:00
end: 2023-09-18 00:00:00
period: 10m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=3
strategy("Dual Thrust Strategy",overlay=true,initial_capital=1000)
k1=input(0.67,type=float,step=0.01)
k2=input(0.62,type=float,step=0.01)
TimeFrame=input('240')
len=input(20)
HH=security(syminfo.tickerid,TimeFrame,highest(high,len),barmerge.lookahead_off)
LC=security(syminfo.tickerid,TimeFrame,lowest(close,len),barmerge.lookahead_off)
HC=security(syminfo.tickerid,TimeFrame,highest(close,len),barmerge.lookahead_off)
LL=security(syminfo.tickerid,TimeFrame,lowest(low,len),barmerge.lookahead_off)
Range=max(HH-LC,HC-LL)
BuyLine=security(syminfo.tickerid,"D",open,barmerge.lookahead_off)+k1*Range
SellLine=security(syminfo.tickerid,"D",open,barmerge.lookahead_off)-k2*Range
plot(BuyLine,color=blue,linewidth=2,offset=1,transp=70)
plot(SellLine,color=red,linewidth=2,offset=1,transp=70)
LongCondition=crossover(close,BuyLine)
ShortCondition=crossunder(close,SellLine)
strategy.entry("enter long",true,1,when=LongCondition)
strategy.entry("enter short",false,1,when=ShortCondition)
plotshape(LongCondition and strategy.position_size<0?low:na,style=shape.labelup,location=location.absolute,color=blue,text="Long",textcolor=white,size=size.small)
plotshape(ShortCondition and strategy.position_size>0?high:na,style=shape.labeldown,location=location.absolute,color=red,text="Short",textcolor=white,size=size.small)
alertcondition(LongCondition and strategy.position_size<0,title='Long_DT')
alertcondition(ShortCondition and strategy.position_size>0,title='Short_DT')Published by ChaoZhang on the FMZ strategy square · last modified 2023-09-19. 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.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Dual-Thrust-Strategy.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- 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
- Adaptive Multi Period Trading Strategy Based on Wave Trend Momentum BreakoutPine Script · Breakout · 2h
- Advanced Multi Pattern Breakout Trading StrategyPine Script · Breakout · 1d
- Dynamic Bollinger Bands Breakout Quantitative Trading StrategyPine Script · Breakout · 2d
- Dynamic Dual Moving Average Breakthrough Trading System Dynamic Dual Moving Average Breakthrough Trading SystemPine Script · Breakout · 1d
- Flexible Long Short Trading Strategy Based on Keltner ChannelsPine Script · Breakout · 1d
- Mean Reversion Trend Following Strategy Based on HA Momentum BreakoutPine Script · Breakout · 45m