OPEN-SOURCE SCRIPT
ที่อัปเดต:

MACD + RSI with Trade Signals

75 744
This indicator by default comes with the MACD shown but can be switched to show the RSI instead. Settings for each indicator can also be customized as well as Buy/Sell signals given based on pull back crossovers that follow the 200 EMA of the price Chart. There's an above/below middle fill option you can use but I tend not to but I know some traders like to see when an oscillator is above/below the middle and use it as a trend diretion. By the way, the fourth setting for the MACD (which is 2 by default) is the size of the histogram.

Buy Signal = Price is above the 200 EMA. Current or previous MACD or RSI line is/was below middle line and now crossed above the signal line.
Sell Signal = Price is below the 200 EMA. Current or previous MACD or RSI line is/was above middle line and now crossed below the signal line.

There are alerts for each signal as well (MACD and RSI, both buy and sell).
Feel free to leave a comment regarding issues or suggestions for this indicator or ideas for the next one I should do :)
Release Note
- Took out a line an option that wasn't being utilized
- Updated the picture to show some 2:1 Risk to Reward ration trades that did very well with this strategy. Today is Saturday, July 23, 2022. These were taken from pre-market Friday, July 22, 2022 on the S&P 500 Mini Futures (same chart as micros as well)
Release Note
Updated some small things, most notable TradingView decided invisible plots now need to be shown so it made the indicators zoom way out. I've fixed that mostly by plotting much closer to the graph.
Release Note
Minor Changes:
- Signals can now be shown on both MACD and RSI
- Took out Signal Bars as it disrupts other indicators on the chart from changing the color of bars. Namely as it doesn't work with my "Ultimate Indicator"
Release Note
Minor Update:
- Fixed the indicator from drawing stupidly zoomed out by limiting the top and bottom to 95 and 5 instead of +- 1000
Release Note
Updated the script quite a bit:
- Added the Stochastic Oscillator as an option (There's a checkbox for Stochastic RSI if you'd rather use that, simply select Stochastic from the drop down menu then check the checkbox for Stochastic RSI)
- Added color changing option for the oscillator and signal lines directly on the Inputs page
- Added option to fill between the oscillator and signal line (These color options will remain on the Style tab)
- Changed the names of some variables and added a few to get the above functions working
Release Note
Added stochastics and CCI
Release Note
Now added an option to highlight enable/disable highlighting when the ranging oscillators are overbought and oversold. The code for this was already in here but it was disabled with no way to enable it. I've now made it a checkmark at the bottom of the settings to enable it.
Release Note
Added an option for "Alternate Colors" which is just a checkbox next to the line colors at the top. When enabled, this will make the leading line turn green if it is above the mid line and red if it is below the mid line. It will also make the signal/lagging line invisible. The point of this is to look at it more of a "above mid is up and below mid is down" type of way.

Added an option for "Divergence" which is a checkbox at the bottom. This one will for Bull / Bear divergences (not hidden divergences) and plot those lines on the indicator as well as labels + lines on the chart at those locations.
Release Note
Added in the Atermis Oscillator or otherwise called the Directional Range Momentum (DRM) oscillator as an option.
Credits to a_jabbaroff for this one

I sort of like this more than RSI. Instead of measuring green candles vs all candles like the RSI, it is supposed to measure range (high and low) expansions.
His version also adds in a few further things but I didn't find them super useful. I do like his Volume Pressure option which takes a long and short MFI calculaiton, blends them together and plots on the same oscillator. It shows volume balance to compare with oscillator and is supposed to show whether the movement is backed by buyers/sellers. I've added that here as well but made it a checbox you can enable/disable on any of the oscillators. It should automatically adjust the size to ft inside the Overbought/Oversold areas nicely.

Heads up, the default values for this to line up with his would be 14 length, 1 smoothing, 7 signal length, 80 overbought, 20 oversold.


Outside of that, I've done some cleanup in the code. Nothing you should really notice on the indicator but it should quicken some things up when you make changes or add it to the chart and then the code makes a little more sense here and there. It's still a work in progress and can be a bit messy at times.
Release Note
Added in the Atermis Oscillator or otherwise called the Directional Range Momentum (DRM) oscillator as an option.
Credits to a_jabbaroff for this one

I sort of like this more than RSI. Instead of measuring green candles vs all candles like the RSI, it is supposed to measure range (high and low) expansions.
His version also adds in a few further things but I didn't find them super useful. I do like his Volume Pressure option which takes a long and short MFI calculaiton, blends them together and plots on the same oscillator. It shows volume balance to compare with oscillator and is supposed to show whether the movement is backed by buyers/sellers. I have added it here as an additional checkbox you can enable. Doesn't work on MACD, I'll look into this, but for now it does work on all the other oscillators.

Heads up, the default values for this to line up with his would be 14 length, 1 smoothing, 7 signal length, 80 overbought, 20 oversold.



I've cleaned up a few of my higher timeframe calls (which I already have disabled, they remain in the code incase someone takes it and wants to enable them).

I've updated the way that the signals are generated when you turn on the Trend option (whether you set it to 200 EMA, VWAP, or Range setting).

Before, it went as follows for all oscillators besides MACD:
Buy Signal = Oscillator is in the oversold area, if oscillator comes up from the extreme oversold back to regular oversold OR if oscillator comes up from oversold into non-oversold area, trigger a buy signal (green highlight). If you set the Trend option to 200 EMA or VWAP, price must be above the trend line. Ranging will show even if it doesn't agree with long term trend. Sell signals work in the same way but for overbought area, respectively.

Now it goes as follows for all oscillators besides MACD:
Oscillator is in the oversold area, if oscillator crosses over signal line OR if oscillator comes up from extreme oversold back to regular oversold OR if oscillator comes up from oversold into non-oversold area, trigger a buy signal (green highlight).

On top of adding the signal line cross as a signal generator, there is now a cooldown period of 5 candles and 10 candles explained here:
If a buy signal occurs for either the signal line crossing or going from extreme oversold to regular oversold, another signal will not be drawn for at least 5 more candles.
Buy signals that occur from crossing from oversold into non-oversold area can only happen if no other buy signal has occured in the past 10 candles.

Trend / Range still works the same way. Sell signals work the same way but for overbought area, respectively.


This may seem complicated but the purpose of the cooldown is so you don't get signal overload. I want a signal to occur and stick with it, I don't need to see 3+ signals within 5 candles, that's silly. The reason for the 10 candle requirement on crossing from overbought/oversold into non-extended area is based on pesronal experience: usually, if the oscillator has crossed back from extreme or crossed its own signal line, it more than likely will cross back into non-extended area shortly. In the cases where it does not do it within 10 candles, it usually isn't a reliable signal, that's the reason this has a 10 candle cooldown. Just go look for yourself and you'll see what I'm talking about. Find a spot where the oscillator is overbought or oversold, then it crossed it's own signal line but stayed overbought or oversold for about 5+ candles, it's almost always a bad setup by that time or the move has already happened you were trying to catch.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน