0bps

Strategy vault / Breakout

Woodie Pivot Points Backtest Strategy

This strategy uses Woodie model to calculate pivots and trade breakouts for backtest. It is a classic pivot breakout strategy.

Author
ChaoZhang
Complexity
Starter · 37 lines
Parameters
2
Backtest bar
1d · swing
Tested on
BTC/USDT · futures

Overview

This strategy uses Woodie model to calculate pivots and trade breakouts for backtest. It is a classic pivot breakout strategy.

Strategy Logic

  1. Calculate current period pivot and bands using previous period high, low and close.

  2. Go long if price breaks above pivot from below.

  3. Go short if price breaks below pivot from above.

  4. Option to trade reverse signals.

  5. Color code different trade signals.

Advantages

  1. Woodie model calculation is simple and intuitive.

  2. Trading pivot breakouts is a common technique.

  3. Visualized pivots and signal markings.

  4. Simple and practical default parameters.

  5. Code is easy to understand and modify.

Risks

  1. Risks of false breakouts after initial breakout.

  2. No effective way to set stops and exits.

  3. Incorrect model and parameters negatively affect performance.

  4. Fails to differentiate trends and ranges.

  5. Signals may not be timely.

Enhancement

  1. Test different period parameters for optimum values.

  2. Add trend filter for additional validation.

  3. Incorporate stop loss and take profit for risk control.

  4. Assess pullbacks after breakouts for continuing signals.

  5. Research ways to gauge the strength of breakouts.

  6. Consider combining with other factors for confirmation.

Conclusion

This strategy trades Woodie pivot breakouts. Optimizing parameters, adding stops and exits can improve stability for a reliable short-term system.

Parameters

NameDefaultWhat it controls
v_input_12width
v_input_2falseTrade reverse

Source Pine Script

/*backtest
start: 2022-09-13 00:00:00
end: 2023-02-22 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=2
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 22/08/2018
// Simply input the vales of the high, low and closing price of the previous 
// period to calculate the Woodie pivot point and the associated resistance 
// and support levels for the present period.
//
// You can change long to short in the Input Settings
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
strategy(title="Woodie Pivot Points Backtest", overlay = true)
width = input(2, minval=1)
xHigh  = security(syminfo.tickerid,"D", high[1])
xLow   = security(syminfo.tickerid,"D", low[1])
xClose = security(syminfo.tickerid,"D", close[1])
reverse = input(false, title="Trade reverse")
xPP = (xHigh+xLow+(xClose*2)) / 4
pos = iff(close[1] < xPP[1] and close > xPP, 1,
       iff(close < xPP, -1, nz(pos[1], 0))) 
possig = iff(reverse and pos == 1, -1,
          iff(reverse and pos == -1, 1, pos))       
if (possig == 1) 
    strategy.entry("Long", strategy.long)
if (possig == -1)
    strategy.entry("Short", strategy.short)	   	    
barcolor(possig == -1 ? red: possig == 1 ? green : blue ) 
plot(xPP, color=blue, title="WPP", style = circles, linewidth = width)

Published by ChaoZhang on the FMZ strategy square · last modified 2023-09-20. 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/Woodie-Pivot-Points-Backtest-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