Skip to content
All library documents

A Swing Trading Strategy Combining Moving Average Crosses and RSI-MACD Signals

Article Strategy library · Author: alejandrocardona64

Summary

This Pine Script strategy combines trend and momentum signals for long entries. It uses a short and long simple moving average crossover as a bullish reversal signal, or alternatively enters when RSI is oversold and MACD crosses above its signal line. Exits can follow a bearish moving average crossover or an overbought RSI condition paired with a downward MACD crossover. The script also plots the averages, reversal markers, and pullback markers.

Risk controls use a percentage stop and target based on entry price, with exits and discretionary signal closes deferred until the minimum holding period has elapsed. Although the code defines a pullback threshold and identifies pullbacks, that condition does not trigger trades. The document supplies no backtest results or market-specific evaluation, so it does not establish performance; its default settings and holding-period logic may also need review for the chart timeframe used.

Key ideas

  • Long entries trigger on a bullish moving average crossover or an oversold RSI reading paired with an upward MACD crossover.
  • Exit signals combine bearish moving average crosses with overbought RSI and downward MACD crosses.
  • The code delays signal-based closes and percentage stop or target placement until the minimum holding period passes.
  • Pullbacks are plotted using a lookback threshold, but they do not affect trade entries.
  • No empirical performance results are provided.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.