Type/to search

Simple Pivot Reversal Algorithmic Trading Strategy

Common strategy
Created: 2024-01-17 15:37:33
Last modified: 3 years ago
1
Follow
1802
Followers

img

Overview

This strategy performs reversal trading based on pivot point breakouts. It calculates the pivot high and pivot low over a specified period to determine the pivot levels. It goes short when the price breaks above the pivot high, and goes long when the price breaks below the pivot low. This is a typical short-term mean reversion strategy.

Strategy Logic

The core logic of this strategy is to calculate the pivot high and low points. The formulas are:

Pivot High = Sum of highest high over the past N1 bars / N1

Pivot Low = Sum of lowest low over the past N2 bars / N2

Where N1 and N2 are parameters that define the number of bars used to calculate the pivot points.

After obtaining the pivot high/low levels, the trading rules are:

  1. Short when price breaks above pivot high
  2. Long when price breaks below pivot low
  3. Set stop loss after entry

So it realizes a short-term reversal strategy based on pivot point breakouts.

Advantage Analysis

The advantages of this simple strategy are:

  1. Simple logic, easy to understand and implement
  2. Suitable for high-frequency short-term trading
  3. Captures reversal after pivot breakouts
  4. Optimizable through parameter tuning

Risk Analysis

There are some risks:

  1. Failed reversal risk - The reversal after pivot breakout may fail and the trend continues
  2. Stop loss risk - The preset stop loss could be hit resulting in big loss
  3. Parameter risk - Inappropriate parameters greatly impacts results

These risks can be managed by parameter tuning, applying exit rules etc.

Optimization Directions

There is large room for optimization:

  1. Combine with other technical indicators to improve entry timing
  2. Add exit rules like trailing stop loss, profit-taking etc
  3. Dynamic adjustment of parameters to improve adaptiveness
  4. Parameter optimization to find the best parameter combinations

Summary

In summary, this is a very simple short-term pivot reversal strategy. Its advantages are simplicity and ability to capture reversals. But there are some risks that need to be addressed through optimization. Overall this serves as a good practice strategy for beginners and builds foundation for advanced strategies.

Source
Pine
/*backtest
start: 2023-12-01 00:00:00
end: 2023-12-31 23:59:59
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
strategy("Pivot Reversal Strategy - FIGS & DATES 2.0", overlay=true, pyramiding=0, initial_capital=10000, currency="USD", default_qty_type=strategy.percent_of_equity, default_qty_value=100.0, commission_value=0.075)

leftBars = input(4)
Strategy parameters
Strategy parameters
leftBars
rightBars
From Day
From Month
From Year
To Day
To Month
To Year
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)