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.
Overview
This strategy uses Woodie model to calculate pivots and trade breakouts for backtest. It is a classic pivot breakout strategy.
Strategy Logic
Calculate current period pivot and bands using previous period high, low and close.
Go long if price breaks above pivot from below.
Go short if price breaks below pivot from above.
Option to trade reverse signals.
Color code different trade signals.
Advantages
Woodie model calculation is simple and intuitive.
Trading pivot breakouts is a common technique.
Visualized pivots and signal markings.
Simple and practical default parameters.
Code is easy to understand and modify.
Risks
Risks of false breakouts after initial breakout.
No effective way to set stops and exits.
Incorrect model and parameters negatively affect performance.
Fails to differentiate trends and ranges.
Signals may not be timely.
Enhancement
Test different period parameters for optimum values.
Add trend filter for additional validation.
Incorporate stop loss and take profit for risk control.
Assess pullbacks after breakouts for continuing signals.
Research ways to gauge the strength of breakouts.
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
| Name | Default | What it controls |
|---|---|---|
| v_input_1 | 2 | width |
| v_input_2 | false | Trade 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.
/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- 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
- Bollinger Bands Breakout Trading StrategyPine Script · Breakout · 1h
- Bollinger Bands Dynamic Breakout StrategyPine Script · Breakout · 1h
- Cross period Value Area Breakout StrategyPine Script · Breakout · 1d
- Donchian Channel Breakout Strategy 442842Pine Script · Breakout · 4h
- Dynamic Support Resistance Breakout Moving Average Crossover StrategyPine Script · Breakout · 1d
- Dynamic Support and Resistance Adaptive Pivot Trading StrategyPine Script · Breakout · 1d