OPEN-SOURCE SCRIPT

MACD & RSI Long/Short Indicator

206
This indicator generates momentum and trend-reversal alerts by combining standard MACD crossovers with RSI extreme zone breakouts. It relies on an internal state machine and an adjustable signal cooldown timer to filter out market noise and prevent rapid, repetitive entries on lower timeframes.

Core Logic & Indicators

RSI (Relative Strength Index): Triggers LE when crossing above the user-defined oversold line and Short signals when crossing below the overbought line.

MACD: Triggers LE and SE alerts based on the crossover of the MACD line and the Signal line.

EMAs: Plots customizable Moving Averages (9, 21, 50, 100, 200) strictly for visual trend context. EMAs do not dictate trade entries or exits.

Key Features

Modular Signal Routing: Independently toggle RSI or MACD Alerts. When both are enabled, the script executes based on whichever indicator fires first.

Signal Cooldown: A customizable bar delay limits how quickly a new signal can trigger after a previous execution, minimizing false Alerts in choppy conditions.

State Machine Guardrails: Enforces a strict 1-LE / 1-SE alternation rule to prevent multiple overlapping orders in the same direction.

Risk Management: Includes native percentage-based Stop Loss (SL) and Take Profit (TP) parameters.

Date Range Filter: Allows users to restrict execution to specific calendar periods.

How to Use
Select your preferred signal source (RSI, MACD, or both) in the settings panel. Adjust the "Signal Cooldown" parameter based on your specific chart timeframe to filter out immediate whipsaws (higher timeframes may require shorter cooldowns). Use the Enable LE/SE checkboxes to test directional bias independently, and calibrate the percentage inputs to establish your SL/TP risk framework.

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.