0bps

Strategy vault / Mean reversion

RSI Fibonacci 5 Minute Trading Strategy

This strategy utilizes the Relative Strength Index (RSI) and Fibonacci retracement levels to generate trading signals for the EUR/USD currency pair in the 5-minute timeframe. It combines a technical indicator and key…

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

IMG

Overview

This strategy utilizes the Relative Strength Index (RSI) and Fibonacci retracement levels to generate trading signals for the EUR/USD currency pair in the 5-minute timeframe. It combines a technical indicator and key price levels to capture reversal opportunities within intermediate-term trends.

Strategy Logic

The strategy uses a 14-period RSI as the primary trend indicator. When the RSI crosses above 30, it is viewed as an oversold signal and generates a buy signal; when the RSI crosses below 70, it is viewed as an overbought signal and generates a sell signal.

Additionally, the strategy calculates the 61.8% Fibonacci retracement level of the daily price range. If the closing price is above that Fibonacci level and the RSI crosses above 30 at the same time, a buy signal is generated; if the closing price is below that Fibonacci level and the RSI crosses below 70, a sell signal is generated.

By considering both technical indicators and key price levels, some false signals can be filtered out and the trading signals become more reliable.

Advantages

The biggest advantage of this strategy is the combination of the RSI indicator and Fibonacci theory, making the trading signals more accurate and reliable. The RSI indicator can determine trend direction and reversal points, while the Fibonacci levels can further validate important support and resistance levels of price fluctuations.

Compared with using RSI alone or relying solely on price patterns, this hybrid strategy can greatly reduce trading errors. Meanwhile, the 5-minute timeframe allows it to capture short-term pullback opportunities within intermediate-term strong trends.

Risk Analysis

The main risk of this strategy is that the RSI indicator may give false signals or prices may fail to reverse after hitting the Fibonacci target levels. This would result in trading profit/loss consequences that are contrary to expectations.

In addition, if violent price fluctuations occur, stop-loss orders could be taken out, bringing relatively large losses to the account. It is advisable to use techniques like trailing stop or money management to control risks.

Optimization Directions

This strategy can be optimized from the following aspects:

  1. Test different parameter combinations such as RSI periods, overbought/oversold levels, Fibonacci coefficients, etc. to find the optimal parameters;

  2. Add filtering conditions like trading volumes to further verify the reliability of trading signals;

  3. Incorporate other indicators like moving averages to make the signals more accurate;

  4. Add trend determination rules to avoid trading against the trend;

  5. Use machine learning algorithms to automatically optimize strategy parameters and rules.

Conclusion

This strategy uses the RSI indicator together with Fibonacci key levels to generate trading signals for EUR/USD within a 5-minute timeframe. Compared to single indicators, this hybrid strategy can increase signal accuracy and reduce erroneous trades. Through parameter optimization, adding filters and other means, the strategy's performance can be further improved. It is suitable for capturing short-term reversal opportunities within significant intermediate-term trends.

Parameters

NameDefaultWhat it controls
v_input_114RSI Length
v_input_270Overbought Level
v_input_330Oversold Level
v_input_40.618Fibonacci Level

Source Pine Script

/*backtest
start: 2023-01-10 00:00:00
end: 2024-01-16 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy("RSI & Fibonacci Strategy - EUR/USD 5min", overlay=true)

// Parámetros RSI
rsi_length = input(14, title="RSI Length")
overbought = input(70, title="Overbought Level")
oversold = input(30, title="Oversold Level")

// Parámetros Fibonacci
fib_level = input(0.618, title="Fibonacci Level")

// RSI
rsi = ta.rsi(close, rsi_length)

// Fibonacci retracement
high_price = request.security("FX:EURUSD", "5", high)
low_price = request.security("FX:EURUSD", "5", low)
price_range = high_price - low_price
fibonacci_level = low_price + fib_level * price_range

// Condiciones de compra y venta
longCondition = ta.crossover(rsi, oversold) and close > fibonacci_level
shortCondition = ta.crossunder(rsi, overbought) and close < fibonacci_level

// Ejecutar órdenes de compra y venta
if (longCondition)
    strategy.entry("Buy", strategy.long)
if (shortCondition)
    strategy.entry("Sell", strategy.short)

Published by ChaoZhang on the FMZ strategy square · last modified 2024-01-17. 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/RSI-Fibonacci-5-Minute-Trading-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