Strategy vault / Mean reversion
Momentum Reversal Trading Strategy
This is a very simple short-term trading strategy that is mainly suitable for index futures daily trading. It only goes long when the index is in a long-term uptrend channel and there is a short-term reversal signal.

Overview
This is a very simple short-term trading strategy that is mainly suitable for index futures daily trading. It only goes long when the index is in a long-term uptrend channel and there is a short-term reversal signal.
Principles
The strategy mainly uses moving averages and RSI indicators to determine trends and overbought/oversold conditions. The specific trading signals are: the index closing price rebounds from the long-term 200-day moving average and remains above it as the long-term trend judgment; the closing price breaks below the 10-day moving average as the short-term adjustment signal; RSI3 less than 30 as the oversold signal. When the above three conditions are met, it is believed that the probability of a short-term reversal is relatively large, so go long.
After taking a position, exits are based on stop loss, take profit and short-term trend judgments. If the closing price stands back above the 10-day MA, judging that the short-term adjustment has ended, take profit actively; if the closing price hits a new low, stop out with a loss; take profit when the closing price rises 10%.
Advantage Analysis
The strategy has the following advantages:
- Simple logic, easy to understand and implement, suitable for beginners;
- Make full use of the long-term uptrend of the index to avoid trading against the trend;
- Use the RSI indicator to determine the short-term reversal point to increase the profit probability;
- There are stop loss and take profit mechanisms to control risks;
- Low data requirements, daily data is enough, suitable for zero-cost implementation.
Risk Analysis
The strategy also has some risks:
- Sustained declines in bear markets will lead to losses;
- Failed reversals can cause significant losses;
- Improper parameter settings can also affect results, such as incorrect moving average periods;
- Trading frequency may be low, unable to capture all adjustments;
- Limited profit upside, not much higher than market index returns.
In response to the above risks, methods such as optimizing cycle parameters, adjusting stop-loss ratios, adding other indicator judgments, etc. can be used to improve the strategy.
Optimization Directions
The strategy can be optimized in the following aspects:
- Increase multifactor judgments of long-term and short-term trends, such as MACD and KD to improve judgment accuracy;
- Add trading volume analysis, such as going long when trading volume surges;
- Optimize parameter settings through Walk Forward Analysis and other methods to find the best parameters;
- Combine more reversal factors,such as Fibonacci retracement levels, support and resistance levels to determine the reversal levels;
- Comprehensively consider profit ratio optimization, such as adjusting positions and stop-loss ratios to achieve higher returns.
Summary
In summary, this is a very simple and practical short-term trading strategy. It combines the long-term uptrend and short-term pullback reversal of the index to obtain excess returns while controlling risks. By continuously optimizing and parameter tuning, better results can be achieved.
Parameters
| Name | Default | What it controls |
|---|---|---|
| v_input_int_1 | 200 | (?パラメータ)Long-term moving averageBASE200/period of long term sma |
| v_input_int_2 | 10 | Long-term moving averageBASE10/period of short term sma |
| v_input_int_3 | 5 | Stop loss ratio%/stoploss percentages |
| v_input_int_4 | 20 | Take profit ratio%/take profit percentages |
| v_input_1 | timestamp(01 Jan 2000 13:30 +0000) | (?(Period) Start date for backtesting/start trade day |
| v_input_2 | timestamp(1 Jan 2099 19:30 +0000) | バックテスをFinal day/finish date day |
Source Pine Script
/*backtest
start: 2023-01-11 00:00:00
end: 2024-01-17 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © tsujimoto0403
//@version=5
strategy("simple pull back", overlay=true,default_qty_type=strategy.percent_of_equity,
default_qty_value=100)
//input value
malongperiod=input.int(200,"Long-term moving averageBASE200/period of long term sma",group = "パラメータ")
mashortperiod=input.int(10,"Long-term moving averageBASE10/period of short term sma",group = "パラメータ")
stoprate=input.int(5,title = "Stop loss ratio%/stoploss percentages",group = "パラメータ")
profit=input.int(20,title = "Take profit ratio%/take profit percentages",group = "パラメータ")
startday=input(title="バックテストをThe day to open/start trade day", defval=timestamp("01 Jan 2000 13:30 +0000"), group="period")
endday=input(title="バックテスをFinish date day", defval=timestamp("1 Jan 2099 19:30 +0000"), group="Period")
//polt indicators that we use
malong=ta.sma(close,malongperiod)
mashort=ta.sma(close,mashortperiod)
plot(malong,color=color.aqua,linewidth = 2)
plot(mashort,color=color.yellow,linewidth = 2)
//date range
datefilter = true
//open conditions
if close>malong and close<mashort and strategy.position_size == 0 and datefilter and ta.rsi(close,3)<30
strategy.entry(id="long", direction=strategy.long)
//sell conditions
strategy.exit(id="cut",from_entry="long",stop=(1-0.01*stoprate)*strategy.position_avg_price,limit=(1+0.01*profit)*strategy.position_avg_price)
if close>mashort and close<low[1] and strategy.position_size>0
strategy.close(id ="long")
Published by ChaoZhang on the FMZ strategy square · last modified 2024-01-18. 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/Momentum-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
- Advanced 15 Minute Chart Trading Signal StrategyPine Script · Mean reversion · 3h
- BONK Multi Factor Trading StrategyPine Script · Mean reversion · 1d
- Customizable Non Repainting HTF MACD MFI Scalable Bot StrategyPine Script · Mean reversion · 1d
- Dynamic Adaptive Multi Timeframe Trend Following and Range Reversal Hybrid StrategyPine Script · Mean reversion · 2d
- MACD Cross Period Trading StrategyPine Script · Mean reversion · 1d
- MACD Long Reversal StrategyPine Script · Mean reversion · 1d