0bps

Strategy vault / Mean reversion

Enhanced Multi Indicator Trend Reversal Intelligence Strategy

This strategy is a trend reversal system based on multiple technical indicators, combining the advantages of trend following and reversal detection through the coordinated use of EMA, MACD, and RSI indicators. The…

Author
ChaoZhang
Complexity
Starter · 63 lines
Parameters
0
Backtest bar
1d · swing
Tested on
BTC/USDT · futures

IMG

Overview

This strategy is a trend reversal system based on multiple technical indicators, combining the advantages of trend following and reversal detection through the coordinated use of EMA, MACD, and RSI indicators. The strategy employs 20 and 50-period Exponential Moving Averages (EMA) to determine overall trend direction, uses MACD to capture trend reversal points, and incorporates RSI to filter false signals, forming a comprehensive trading decision system. A 1.5% profit target is set to protect trading profits.

Strategy Principle

The strategy employs a triple indicator filtering mechanism: First, it determines the market's main trend through the relative position of fast EMA (20-period) and slow EMA (50-period), identifying an uptrend when the fast line is above the slow line, and vice versa. Second, it uses a MACD indicator with short periods (6,13,5) to capture trend turning points, with MACD and signal line crossovers providing trading signals. Finally, RSI is introduced as auxiliary confirmation, with non-traditional levels of 40 and 60 as decision boundaries, generating more trading signals compared to traditional 30/70 levels. Buy conditions require simultaneous satisfaction of: MACD golden cross, EMA20 above EMA50, and RSI above 40; Sell conditions require: MACD death cross, EMA20 below EMA50, and RSI below 60.

Strategy Advantages

  1. Multiple indicators provide complementary verification, significantly improving signal reliability
  2. Short-period MACD settings increase strategy sensitivity
  3. Break through traditional RSI boundary settings to increase trading opportunities
  4. Clear visual feedback system facilitates quick decision-making
  5. Fixed take-profit positions effectively lock in trading profits
  6. Applicable to multiple trading instruments with good universality
  7. 30-minute timeframe balances signal frequency and reliability

Strategy Risks

  1. Multiple indicators may lead to signal lag
  2. Fixed take-profit positions may prematurely end profitable trends
  3. Relaxed RSI conditions may increase false signal risk
  4. Short-period MACD is susceptible to market noise
  5. Lack of dynamic stop-loss mechanism may face larger drawdown risks

Strategy Optimization Directions

  1. Introduce adaptive take-profit mechanism to dynamically adjust profit targets based on market volatility
  2. Add trend strength filter to avoid trading in weak trend markets
  3. Incorporate volume confirmation mechanism to improve signal reliability
  4. Develop dynamic stop-loss system for better risk control
  5. Optimize indicator parameters using adaptive periods to improve strategy adaptability
  6. Add time filter to avoid high volatility periods

Summary

This is a well-designed trend reversal strategy that provides frequent trading opportunities while maintaining reliability through the use of multiple technical indicators. The strategy's core advantages lie in its clear signal system and strict entry conditions, but attention must be paid to false signal risks and drawdown control. Through the suggested optimization directions, the strategy has the potential for improved performance. When implementing in live trading, it is recommended to adjust parameters according to specific market conditions and strictly implement risk control.

Source Pine Script

/*backtest
start: 2019-12-23 08:00:00
end: 2024-11-27 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy("Enhanced Trend Reversal Strategy with Take Profit", overlay=true)

// Параметры индикаторов
ema_fast = 20
ema_slow = 50
rsi_length = 14
macd_short = 6
macd_long = 13
macd_signal = 5

// Параметры тейк-профита
take_profit_percent = 1.5  // Тейк-профит на уровне 1.5% от цены входа

// Индикаторы EMA (ускоренные для более частых сигналов)
ema_20 = ta.ema(close, ema_fast)
ema_50 = ta.ema(close, ema_slow)

// MACD с более короткими периодами для большей чувствительности
[macd_line, signal_line, _] = ta.macd(close, macd_short, macd_long, macd_signal)

// Индикатор RSI с упрощенными уровнями для большего количества сигналов
rsi = ta.rsi(close, rsi_length)

// Сигналы на покупку и продажу с ослабленными условиями
buy_signal = ta.crossover(macd_line, signal_line) and ema_20 > ema_50 and rsi > 40
sell_signal = ta.crossunder(macd_line, signal_line) and ema_20 < ema_50 and rsi < 60

// Логика открытия сделок и расчет тейк-профита
var float take_profit_price = na  // переменная для хранения уровня тейк-профита

if (buy_signal)
    strategy.entry("Buy", strategy.long)
    take_profit_price := close * (1 + take_profit_percent / 100)  // уровень тейк-профита для покупки

if (sell_signal)
    strategy.entry("Sell", strategy.short)
    take_profit_price := close * (1 - take_profit_percent / 100)  // уровень тейк-профита для продажи

// Основная линия тренда, меняющая цвет в зависимости от тренда
trend_color = ema_20 > ema_50 ? color.green : color.red
plot(ema_20, title="Trend Line (EMA 20)", color=trend_color, linewidth=2)

// Визуализация тейк-профита синим цветом
plot(take_profit_price, title="Take Profit", color=color.blue, linewidth=1, style=plot.style_line)

// Дополнительная визуализация: EMA 50, MACD, и RSI уровни
plot(ema_50, title="EMA 50", color=color.blue, linewidth=1)
hline(60, "RSI Upper", color=color.red)
hline(40, "RSI Lower", color=color.green)
plot(rsi, title="RSI", color=color.blue, linewidth=1)
plot(macd_line, title="MACD Line", color=color.blue)
plot(signal_line, title="Signal Line", color=color.orange)

Published by ChaoZhang on the FMZ strategy square · last modified 2024-11-28. 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.

in Claude Code, Cursor, Codex & 4 more
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Enhanced-Multi-Indicator-Trend-Reversal-Intelligence-Strategy.md
  1. npx agenkit install engineering-kit in your project
  2. Paste the command into your agent and approve each phase
  3. 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

esc

Try , , or .

↑↓ move↵ open