Pivot Reversal Based Quantitative Trading Strategy
Overview
This is a quantitative trading strategy that utilizes pivot points as entry signals. It calculates rising pivot points and falling pivot points. Once the price breaks through these pivot points, it will initiate long or short positions.
Strategy Principle
This strategy is mainly based on the pivot reversal theory. It first calculates the pivot points based on the left N bars and right M bars. Then it monitors in real time whether the price breaks through these pivot points.
When the price breaks through the rising pivot point, it means the upward momentum is no longer enough to continue pushing up the price. At this time, going short can yield good returns. When the price breaks through the falling pivot point, it means that the downward momentum has been exhausted. At this time, going long can obtain good returns.
Specifically, this strategy calculates the rising pivot points and falling pivot points through the ta.pivothigh and ta.pivotlow functions. Then it compares whether the current highest price breaks through the rising pivot point and whether the lowest price breaks through the falling pivot point. If there is a breakthrough, the corresponding long or short strategy will be initiated.
In addition, this strategy also uses stop loss to control risks. Specifically, when the price breaks through the pivot point, it immediately places an order while setting the stop loss at the other side of the pivot point. This can minimize the loss caused by a failed signal.
Advantage Analysis
This pivot reversal based strategy has the following advantages:
- The pivot reversal signal is quite reliable with a high winning rate
- The risk is well controlled with reasonable stop loss setting
- It's easy to implement with concise code
- It is applicable to different products with good flexibility
Risk Analysis
This strategy also has some risks to note:
- The pivot points may fail, resulting in incorrect signals
- There could be pullback after breaking the pivot point, causing stop loss triggering
- The trading frequency may be high, incurring implicit trading cost
- The performance relies on product selection and parameter tuning
To reduce risks, the following aspects can be considered:
- Optimize the number of left and right bars to ensure reliable pivot point calculation
- Loose the stop loss to some extent to avoid over-tightness
- Set minimum profit target to reduce frequent round-trip trading
- Test on different products and parameters to find the optimal configuration
Optimization Directions
There is room for further optimization of this strategy:
- Incorporate other indicators to judge the reliability of pivot breakthroughs
- Add machine learning models to determine price trends
- Use high-frequency data to improve signal sensitivity
- Introduce position sizing module to dynamically adjust positions
- Connect detailed account module to calculate real trading cost
These optimizations could improve the win rate, profitability, and stability of the strategy.
Conclusion
In summary, this is a quantitative trading strategy based on the pivot reversal theory. It uses price breakthrough pivot points as trading signals while adopting stop loss to control risks. This strategy is easy to implement and widely applicable, making it a practical quantitative trading strategy. But it also bears some risks and needs further testing and optimization to find the optimal configuration in real trading.
/*backtest
start: 2022-12-05 00:00:00
end: 2023-12-11 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy('Weekly Returns with Benchmark', overlay=true,
default_qty_type=strategy.percent_of_equity, default_qty_value=25,
commission_type=strategy.commission.percent, commission_value=0.1)- 1

