Type/to search

A Momentum Tracking Mean Reversion Strategy

Cryptocurrency
Created: 2023-12-19 14:42:26
Last modified: 2 years ago
1
Follow
1779
Followers

img

Overview

This strategy uses multiple indicators including moving averages, Bollinger Bands, RSI and Stochastics across different timeframes to design a strategy that utilizes momentum indicators to determine market reversals.

How It Works

The core logic of this strategy is to track crosses of short-term and long-term moving averages to identify bottoms and tops, while referring to momentum indicators like RSI and Stochastics for additional confirmation of overbought and oversold conditions.

Specifically, it plots two moving averages with different parameters, a shorter one to determine the current trend and a longer one for the major trend. When the shorter moving average crosses above the longer moving average from below, it signals a reversal and generates a buy signal. When crossing down, it generates a sell signal.

In addition, the strategy also checks whether RSI has entered the oversold territory and if the Stochastics K line has entered the oversold area to confirm bottoming signals. The reverse logic is used to confirm topping signals.

On the exit side, the strategy uses take profit, stop loss and trailing stop mechanisms to manage positions.

Advantage Analysis

This is a strategy combining trend following and reversal identification, while also incorporating momentum indicators. The main advantages are:

  1. Crossovers of moving averages are simple yet effective ways to identify reversals. Dual moving average strategies are easy to implement and have good historical performance.

  2. Combining indicators like RSI adds reliability to reversal signals, avoiding false signals at non-bottoms or non-tops.

  3. Take profit, stop loss and trailing stop mechanisms help lock in profits and control risk.

Risk Analysis

Despite its advantages, some risks to note include:

  1. Dual moving average strategies can get whipsawed in ranging markets, frequently opening and closing positions when prices oscillate in sideways moves.

  2. Indicators like RSI cannot fully prevent incorrect signals. For example, quickly breaking previous highs could stop RSI from reaching overbought territory.

  3. Stop loss levels set too wide increase risk of larger losses. Stop loss percentages need to be adjusted based on the specifics of each market.

Optimization Directions

Some ways this strategy can be further optimized:

  1. Different types of moving averages can be tested to find the best fit for the strategy.

  2. More complementary indicators like MACD, KDJ, Bollinger Bands can be added to enrich the logic.

  3. Machine learning can be used to automatically optimize position sizing and profit taking/stopping parameters.

  4. Parameters can be separately optimized for different products based on their characteristics.

Conclusion

In summary, the Momentum Tracking Mean Reversion Strategy is a simple yet practical quant strategy. It uses moving average crossovers to determine reversal points, confirms signal reliability with momentum indicators, and manages positions intelligently to lock in profits and control risk. Easy to understand and implement, it is a good starting point for traders to learn algorithmic trading strategies.

Source
Pine
/*backtest
start: 2023-11-18 00:00:00
end: 2023-11-23 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
strategy("APEX - Tester - Buy/Sell Strategies - Basic - BACKTESTER", overlay = true)
//study("APEX - Tester - Buy/Sell Strategies - Basic ", overlay = true)
source_main             = close
Strategy parameters
Strategy parameters
APEX Tester Buy/Sell Basic v01
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
******** BUY STRATEGIES ********
⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻ MA ⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻
MA length - short
MA length - long
Check to turn ON Different Time Frame
MA - Different Time Frame
MA Type
Detector
Use Moving Average ? (On / Off)
⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻ BB ⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻
BB length
BB std
Check to turn ON Different Time Frame
BB - Time Frame
MA
Detector
Use BB ? (On / Off)
⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻ RSI ⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻
RSI length
Check to turn ON Different Time Frame
STOCH - Time Frame
RSI Oversold
Detector
Use RSI ? (On / Off)
⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻ STOCH ⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻
Check to turn ON Different Time Frame
STOCH - Time Frame
STOCH fast K
STOCH slow K
STOCH slow K
STOCH slow D
STOCH slow D
STOCH Oversold Treashold
Detector
Use STOCH ? (On / Off)
⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻ SRSI ⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻
Check to turn ON Different Time Frame
SRSI - Time Frame
RSI length
Time Period
Fast K
Slow D(or Fast)
STOCHRSI Oversold Treashold
Detector
Use STOCHRSI (On / Off)?
⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻ MACD ⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻
MACD fast
MACD slow
MACD signal
Check to turn ON Different Time Frame
MACD - Time Frame
Detector
Treshold
Use MACD (On / Off)?
⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻ CCI ⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻
CCI Length
CCI Treshold
Check to turn ON Different Time Frame
CCI - Time Frame
Detector
Use CCI (On / Off)?
⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻ VWAP ⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻
Check to turn ON Different Time Frame
VWAP - Time Frame
Detector
Use VWAP (On / Off)?
⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻Perc.Chan.⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻
Drop Percent
Check to turn ON Different Time Frame
Percent Change - Time Frame
Use Percent Change (On / Off)?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
******** SELL STRATEGIES ********
⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻ MA ⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻
MA length - short
MA length - long
Check to turn ON Different Time Frame
MA - Different Time Frame
MA Type
Detector
Use Moving Average ? (On / Off)
⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻ BB ⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻
BB length
BB std
Check to turn ON Different Time Frame
BB - Time Frame
MA
Detector
Use BB ? (On / Off)
⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻ RSI ⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻
RSI length
Check to turn ON Different Time Frame
STOCH - Time Frame
RSI Overbought
Detector
Use RSI ? (On / Off)
⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻ STOCH ⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻
Check to turn ON Different Time Frame
STOCH - Time Frame
STOCH fast K
STOCH slow K
STOCH slow K
STOCH slow D
STOCH slow D
STOCH Overbought Treashold
Detector
Use STOCH ? (On / Off)
⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻ SRSI ⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻
Check to turn ON Different Time Frame
SRSI - Time Frame
RSI length
Time Period
Fast K
Slow D(or Fast)
STOCHRSI Overbought Treashold
Detector
Use STOCHRSI (On / Off)?
⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻ MACD ⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻
MACD fast
MACD slow
MACD signal
Check to turn ON Different Time Frame
MACD - Time Frame
Detector
Treshold
Use MACD (On / Off)?
⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻ CCI ⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻
CCI Length
CCI Treshold
Check to turn ON Different Time Frame
CCI - Time Frame
Detector
Use CCI (On / Off)?
⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻ VWAP ⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻
Check to turn ON Different Time Frame
VWAP - Time Frame
Detector
Use VWAP (On / Off)?
⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻Perc.Chan.⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻
Rise Percent
Check to turn ON Different Time Frame
Percent Change - Time Frame
Use Percent Change (On / Off)?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
******** STRATEGY SETTINGS ********
Backtest Start Year
Backtest Start Month
Backtest Start Day
Trailing Stop
Trailing Stop (%)
Take Profit
Take Profit (%)
Trailing Profit (%)
Stop Loss
Stop Loss (%)
⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻ S/R Lines ⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻⎻
Show S/R Lines
VolumeMA
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)