ericsolan

MACD crossover while RSI Oversold/Overbought

This indicator draws signals on the chart when a Bullish MACD Crossover occurs at the same time RSI is "oversold", and also when Bearish MACD Crossover occurs at the same time RSI is "overbought"


Indicators are drawn on the chart in the following scenarios:

1. Bullish signal
a. MACD bullish crossover occurs on a single bar
b. RSI was below the Oversold threshold (29 by default) within the prior 5 bars

2. Bearish signal
a. MACD bearish crossover occurs on a singnle bar
b. RSI was above the Overbought threshold (71 by default) within the prior 5 bars
Release Notes: Removed other distractions off sample chart to give a better idea of the overlay indicators
Remove from Favorite Scripts Add to Favorite Scripts

Comments

This is great!
Reply
Does this repaint ?
Reply
Is there a strategy test for this?
Reply
Bunghole GarethSA
@GarethSA ,

1. Make a copy of the script.
2. on line 1, change code to " strategy(title="MACD crossover while RSI Oversold/Overbought", overlay=true, shorttitle="MACD Cross + RSI Oversold Overbought") "
3. add this to the end of the script,

strategy.entry("buy", true, when = crossoverBull and wasOversold)
strategy.close("buy", when = crossoverBear and wasOverbought)
+6 Reply
GarethSA Bunghole
@Bunghole, WOW thanks for the help
Reply
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter
Profile Profile Settings Account and Billing Referred friends Coins My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out