TradingView
Trading_Paradise
14 מאי 2023 09:13

RSI, SRSI, MACD and DMI cross - Open source code 

Bitcoin / US DollarBinance

תיאור

Hello,

I'm a passionate trader who has spent years studying technical analysis and exploring different trading strategies. Through my research, I've come to realize that certain indicators are essential tools for conducting accurate market analysis and identifying profitable trading opportunities. In particular, I've found that the RSI, SRSI, MACD cross, and Di cross indicators are crucial for my trading success.

Detailed explanation:
The RSI is a momentum indicator that measures the strength of price movements. It is calculated by comparing the average of gains and losses over a certain period of time. In this indicator, the RSI is calculated based on the close price with a length of 14 periods.

The Stochastic RSI is a combination of the Stochastic Oscillator and the RSI. It is used to identify overbought and oversold conditions of the market. In this indicator, the Stochastic RSI is calculated based on the RSI with a length of 14 periods.

The MACD is a trend-following momentum indicator that shows the relationship between two moving averages of prices. It consists of two lines, the MACD line and the signal line, which are used to generate buy and sell signals. In this indicator, the MACD is calculated based on the close price with fast and slow lengths of 12 and 26 periods, respectively, and a signal length of 9 periods.

The DMI is a trend-following indicator that measures the strength of directional movement in the market. It consists of three lines, the Positive Directional Indicator (+DI), the Negative Directional Indicator (-DI), and the Average Directional Index (ADX), which are used to generate buy and sell signals. In this indicator, the DMI is calculated with a length of 14 periods and an ADX smoothing of 14 periods.

The indicator generates buy signals when certain conditions are met for each of these indicators.

1) For the RSI, a buy signal is generated when the RSI is below or equal to 35 and the Stochastic RSI %K is below or equal to 15, or when the RSI is below or equal to 28 the Stochastic RSI %K is below or equal to 15 or when the RSI is below or equal to 25 and the Stochastic RSI %K is below or equal to 10 or when the RSI is below or equal to 28.

2) For the MACD, a buy signal is generated when the MACD line is below 0, there is a change in the histogram from negative to positive, the MACD line and histogram are negative in the previous period, and the current histogram value is greater than 0.

3) For the DMI, a buy signal is generated when the Positive Directional Indicator (+DI) crosses above the Negative Directional Indicator (-DI), and the -DI is less than the +DI.

The indicator generates sell signals when certain conditions are met for each of these indicators:

1) For the RSI, a sell signal is generated when the RSI is above or equal to 75 and the Stochastic RSI %K is above or equal to 85, or when the RSI is above or equal to 80 and the Stochastic RSI %K is above or equal to 85, or when the RSI is above or equal to 85 and the Stochastic RSI %K is above or equal to 90 or when the RSI is above or equal to 82.

2)For the MACD, a sell signal is generated when the MACD line is above 0, there is a change in the histogram from positive to negative, the MACD line and histogram are positive in the previous period, and the current histogram value is less than the previous histogram value. On the other hand, a buy signal is generated when the MACD line is below 0, there is a change in the histogram from negative to positive, the MACD line and histogram are negative in the previous period, and the current histogram value is greater than the previous histogram value.

3)For the DMI a bearish signal is generated when plusDI crosses above minusDI, indicating that bulls are losing strength and bears are taking control.

The indicator uses a combination of these four indicators to generate potential buy and sell signals. The buy signals are generated when RSI and SRSI values are in oversold conditions, while sell signals are generated when RSI and SRSI values are in overbought conditions. The indicator also uses MACD crossovers and DMI crossovers to generate additional buy and sell signals.

When a signal is strong?
The use of multiple signals within a specific timeframe can increase the accuracy and reliability of the signals generated by this indicator. It is recommended to look for at least two signals within a range of 5-8 candles in order to increase the probability of a successful trade.

Why it's original?
1) There is no indicator in the library that combine all of these indicators and give you a 360 view
2)The combination of the RSI, Stochastic RSI, MACD, and DMI indicators in a single script it's unique and not available in the libray.
3)The specific parameters and conditions used to calculate the signals may be unique and not found in other scripts or libraries.
4)The use of plotshape() to plot the signals as shapes on the chart may be unique compared to other scripts that simply plot lines or bars to indicate signals.
5)The use of alertcondition() to trigger alerts based on the signals may be unique compared to other scripts that do not have custom alert functionality.

Keep attention!
It is important to note that no trading indicator or strategy is foolproof, and there is always a risk of losses in trading. While this indicator may provide useful information for making conclusions, it should not be used as the sole basis for making trading decisions. Traders should always use proper risk management techniques and consider multiple factors when making trading decisions.

Support me:)
If you find this new indicator helpful in your trading analysis, I would greatly appreciate your support! Please consider giving it a like, leaving feedback, or sharing it with your trading network. Your engagement will not only help me improve this tool but will also help other traders discover it and benefit from its features. Thank you for your support!
תגובות
AtWitsEnd
Hello, I have found this is an extremely helpful indicator. I am using it on a 1m timeframe and have found that there are too many alerts/labels for my liking (noisy).
Is it possible to limit them by adding or having an option to add conditions?
I looked at the script and it is far beyond my skills to edit correctly.

*I would like to be able to limit the 'Stoch crossup' alert/label, can you please have an option to only alert/label when the 20ema is above the 50ema, also vice versa for 'Stoch crossdown'.
**If you could also add another condition for D+/-? : ONLY 'DMI crossdown' label/alert when candle 'crosses' down (not closes) below 100ema and vice versa for D+.
***And for the MACD entry labels/alerts to only fire when above or below 200ema similar to: 'MACD Crossover Trend Indicator' by mastixmc. (All other alerts are weak in my opinion.)

Because I like the addition of the other alerts in your script, I would prefer to use yours. I believe these changes/additions will make this indicator one of the best. Especially for scalping.
If these additions are too complex I understand.
If you or anyone else knows how to add these I would greatly appreciate any help thanks.
GusHendo
H, thanks for making this available. In my experience and in back-testing this indicator, the strong signals are often given when RSI is at it's most extreme- which is not often when the market will turn. This usually happens when some RSI divergence develops and RSI makes a lower high. At this time the SRSI may or may not again hit over-sold/ bought levels but either way, usually shows some divergence. (From an EW perspective, this divergence of both indicators almost always is to be expected and confirms a final 5th wave (if the instrument is in a 5 wave sequence rather than a correction). (I don't use MACD but am investigating DMI.)
There are indicators that pick up RSI divergence, I don't know how difficult it would be to give another strong sell signal based on RSI divergence and SRSI turning down?
I play with the source code a bit myself and may try to do this but am just learning.
Cheers.
Trading_Paradise
@GusHendo, Thank you for your comment, feel free to explore any strategy you would like. Check also our free and open source indicator on the RSI Divergences it could be helpful too:)
MikeAnnArbor
Can this be used on different time frames
Like 15 minutes or 30 minutes? Or must be used on 1 day time frame!
Many thanks in advance
Trading_Paradise
@MikeAnnArbor, Hello yes it can be used also in low timeframes. The advice is to keep only incredible buy and incredible sell signals so you remove some noise and labels. If you want other more peculiar advice write to us. You find contacts in our profile.
עוד