Strategy vault / Mean reversion
Pivot Point Reversal Trading Strategy
This strategy identifies price reversals around pivot point areas to generate signals for trend trading. It buys on pullbacks in uptrend and sells on bounces in downtrend, aiming to ride significant moves.
Overview
This strategy identifies price reversals around pivot point areas to generate signals for trend trading. It buys on pullbacks in uptrend and sells on bounces in downtrend, aiming to ride significant moves.
Strategy Logic
Calculate pivot points using high/low of previous n bars.
When price breaks above upper pivot point then drops, buy signal is generated.
When price breaks below lower pivot point then rebounds, sell signal is generated.
Pivot point break judges trend reversal, and reversal confirmation forms trade signals.
Set stop loss to control risks.
Advantage Analysis
High probability of significant moves when reversal occurs around pivot areas.
Breakout confirmation filters out false breakouts effectively.
Easy to adjust parameters for different products.
Reasonable stop loss controls single trade loss.
Simple and intuitive logic, relatively easy to implement for live trading.
Risk Analysis
Need to properly determine pivot parameters to avoid missing opportunities.
Unable to distinguish normal oscillations and trend reversals.
No limit on number of consecutive trades, risks amplified losses.
No take profit defined, unable to lock in profits.
Improvement Directions
Test different pivot parameters on different products.
Add indicators to judge the authenticity of breakouts.
Define take profit or trailing stop to lock in profits.
Assess pivot point strength to avoid premature reverse entries.
Limit maximum number of consecutive reversal trades.
Optimize capital management for better position sizing.
Summary
This strategy identifies trading opportunities from pivot area reversals with a simple and reasonable framework. It has large room for custom optimization and improvements. Some expansions on indicator applications can enrich entry filters. Profit taking and risk control mechanisms are also needed to improve stability. Overall, this strategy has good potential for enhancements.
Parameters
| Name | Default | What it controls |
|---|---|---|
| v_input_1 | 4 | leftBars |
| v_input_2 | 2 | rightBars |
Source Pine Script
/*backtest
start: 2023-09-12 00:00:00
end: 2023-09-19 00:00:00
period: 15m
basePeriod: 5m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("KVFX Pivot Reversal Strategy", overlay=true)
leftBars = input(4)
rightBars = input(2)
swh = ta.pivothigh(leftBars, rightBars)
swl = ta.pivotlow(leftBars, rightBars)
swh_cond = not na(swh)
hprice = 0.0
hprice := swh_cond ? swh : hprice[1]
le = false
le := swh_cond ? true : (le[1] and high > hprice ? false : le[1])
if (le)
strategy.entry("PivRevLE", strategy.long, comment="PivRevLE", stop=hprice + syminfo.mintick)
swl_cond = not na(swl)
lprice = 0.0
lprice := swl_cond ? swl : lprice[1]
se = false
se := swl_cond ? true : (se[1] and low < lprice ? false : se[1])
if (se)
strategy.entry("PivRevSE", strategy.short, comment="PivRevSE", stop=lprice - syminfo.mintick)
//plot(strategy.equity, title="equity", color=color.red, linewidth=2, style=plot.style_areabr)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/Pivot-Point-Reversal-Trading-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
- A Trend Reversal Strategy Based on Moving Averages Price Patterns and VolumePine Script · Mean reversion · 1d
- Adaptive Trading Strategy Combining Dynamic Trend Reversal and Stochastic IndicatorPine Script · Mean reversion · 1d
- Advanced Fibonacci Retracement Trend Following and Reversal Trading StrategyPine Script · Mean reversion · 3h
- Advanced Momentum EMA Trend Following with RSI Overbought Oversold Trading StrategyPine Script · Mean reversion · 1d
- Advanced Quantitative Trading Strategy Combining RSI Divergence and Moving AveragesPine Script · Mean reversion · 1h
- Dual factor Cycle Trading StrategyPine Script · Mean reversion · 1h