Enhanced Divergence Indicator / Strategy (many oscillators)Hi, Guys!
So, I am publishing a divergence script, with the ability to choose from many indicators, which is equipped to serve either as a strategy or an indicator (or both).
In my opinion, trading with indicators is not something that can consistently bring you profit. But one of the most effective ways to use an indicator is precisely divergence, since it also contains information about imbalance in the price action. This is still one of the main tasks of technical analysis of price movements.
That is why I decided to make a script public, which I myself use with some additional functions, and here I am publishing the main ones. Most of its elements can be found in other community scripts, but not quite collected in one, and not all. The main difference is that here I provide an opportunity to refine the divergences, by using a filter for the minimum price difference in the two extremes, the minimum difference in the extremes of the indicator and something else that you will not find anywhere in free code. As far as I can, I have also made a filter for the minimum reverse movement of the indicator between its two extremes, which make up the divergence. In the settings, I have called it "Minimum Oscillator Pullback".
I'm not a programmer, so my script is crude and inelegant, but overall it does the job.
I added the ability to use a few more widespread filters, but with some small additional options. For example, you can display a fast and slow moving average, but the good thing is that among them there is also T3 - one of the best MAs for showing a trend. You should keep in mind, however, that this way of using a trend is not very good when using divergences.
I also added an underestimated indicator as a filter, which could be quite effective here. It is the Stochastic Momentum Index. I have given the option to use a different timeframe for it. Usually, in oscillators, overbought and oversold zones are searched for, but here its more effective use is rather the opposite. It actually shows the strength of the trend. That's why I made an option for its reversed use, and in addition, its limit levels are also variable.
There is also a filter for eliminating trading days and/or trading hours.
To make the code more informative, I have provided an opportunity to test the strategy with leverage.
There is an option to use TP and SL.
Regarding closing a position, there are also several options. I have not seen anyone else use it, but with a lot of testing, I have found that the SMI mentioned and used as a filter is a very good indicator for exiting a position. This is one thing. But something even better that I have found and put in the code is the use of standard deviation. Most algo-traders use Average True Range for exit. Well, I have personally found with a lot of historical data that Standard Deviation is actually much more effective for this.
For variety, and also because such trading systems exist, I have added the option to close after a certain number of candles. Here I have also added an additional functionality - closing on a candle in the opposite direction of the open position, after the specified number of candles have passed.
Apart from this, there is also an option to use VWAP for exit.
You will see that there are more than a dozen indicators to choose from for divergence. I have tested dozens, maybe hundreds of others, which at first glance seem very suitable for this. But in practice I have found that they do not really add anything.
Keep in mind that in different timeframes, in different market conditions, and different assets behave differently. For some, some indicators are better, but in another timeframe they are weak.
In addition, the filters for improving divergence sometimes behave strangely (for example, for an oscillator it may be good to accept a negative and very large value for the minimum movement between its extremes). This is because they are not standardized and have different scales. But if you play around with the options enough, you will understand what works for you.
Now I can't think of anything more to say, inside the options things should be relatively clear. If there are adequate questions that I am able to answer (I remind you that I am an amateur), I will write in the comments. I am sure that this code will be useful for many, but do not rely too much on it and do not take risks without testing - both with historical data and paper trading. As you know, in any case, nothing is guaranteed in the future.
I think I missed something important.
When you use the script as an indicator, a line will always appear when there is a divergence. It may seem strange to you on the price movement, but keep in mind that it shows exactly where the extremes of the oscillator, which is not visible on the chart, are. A sign will appear on this line when the divergence meets your other conditions - the filters and enhancements included.
In addition, there are options to limit the divergence indication to a number of candles. In practice, this is necessary and improves the results. It is very important to understand that in order for the script to indicate the last extreme, which we will use to open a position, it must first have determined that we have already gone in the opposite direction. Therefore, the options specify candles to the left, but also candles to the right after the peak, to verify that this is really a peak (or bottom). Many believe that this makes divergences bad for trading, since the signal is actually received later. Well, this is not entirely true and you can check it yourself. You can safely set the right candles to 0 and you will see that there are many false signals. Usually it is best to use 2 candles on the right for a signal and if the divergence is good, they still give a good entry. In certain conditions it is good with just one candle.
Divergence
Bullish Divergence Short-term Long Trade FinderThis script is a Bullish divergence trade finder built to find small periods where Bitcoin will likely rise from. It looks for bullish divergence followed by a higher low as long as the hour RSI value is below the 40 mark, if then it will enter an long. It marks out Buy signals on the RSI if the value dips below 'RSI Bull Condition Minimum' (Default 40) on the current time frame in view. It also marks out Sell signals found when the RSI is above the 'RSI Bearish Condition Minimum' (Default 50). The sell signals are bearish divergence that has occurred recently on the RSI. When a long is in play it will sell if it finds bearish divergence or the time frame in view reaches RSI value higher than the 'RSI Sell Value'(Default 75). You can set your stop loss value with the 'Stop loss Percentage' (default 5).
Available inputs:
RSI Period: relative strength measurement length(Typically 14)
RSI Oversold Level: the bottom bar of the RSI (Typically 30)
RSI Overbought Level: the top bar of the RSI (Typically 70)
RSI Bearish Condition Minimum: The minimum value the script will use to look for a pivot high that starts the Bearish condition to Sell (Default 50)
RSI Bearish Condition Sell Min: the minimum value the script will accept a bearish condition (Default 60)
RSI Bull Condition Minimum: the minimum value it will consider a pivot low value in the RSI to find a divergence buy (Default 40)
Look Back this many candles: the amount of candles thee script will look back to find a low value in the RSI (Default 25)
RSI Sell Value: The RSI value of the exit condition for a long when value is reached (Default 75)
Stop loss Percentage: Percentage value for amount to lose (Default 5)
The formula to enter a long is stated below:
If price finds a lower low and there is a higher low found following a lower low and price has just made another dip and price closes lower than the last divergence and Relative strength index hour value is less than 40 enter a long.
The formula to exit a long is stated below:
If the value drops below the stop loss percentage OR (the RSI value is greater than the value of the parameter 'RSI Sell Value' or bearish divergence is found greater than the parameter 'RSI Bearish Condition Minimum' )
This script was built from much strategy testing on BTC but works with alts (occasionally) also. It is most successful to my knowledge using the 15 min and 7 min time frames with default values. Hope it helps! Follow for further possible updates to this script or other entry or exit strategies.
snapshot:
I only have a Pro trading view account so I cannot share a larger data set about this script because the buy signals happen pretty rarely. The most amount that I could find within a view for me was 40 trades within a viewable time. The suggested/default parameters that I have do not occur very often so it limits the data set. Adjustments can be made to the parameters so that trades can be entered more often. The scripts success is dependent on the values of the parameters set by the user. This script was written to be used for BTC/USD or BTC/USDT trading. I am unable to share a larger dataset without putting out results that are intended to fail or having a premium account so reaching the 100 trade minimum is not possible with my account.
Co-relation and St-deviation Strategy - BNB/USDT 15minThis indicator based on statistical analysis. it uses standard deviation and its co-relation to price action to generate signals. and following indicators has been used to calculate standard deviation and its co-relation values. finally it is capable to identify market changes in bottoms to pic most suitable points.
1. Parabolic SAR (parabolic stop and reverse)
2. Supertrend
3. Relative strength index (RSI)
4. Money flow index (MFI)
5. Balance of Power
6. Chande Momentum Oscillator
7. Center of Gravity (COG)
8. Directional Movement Index (DMI)
9. Stochastic
10. Symmetrically weighted moving average with fixed length
11. True strength index (TSI)
12. Williams %R
13. Accumulation/distribution index
14. Intraday Intensity Index
15. Negative Volume Index
16. Positive Volume Index
17. On Balance Volume
18. Price-Volume Trend
19. True range
20. Volume-weighted average price
21. Williams Accumulation/Distribution
22. Williams Variable Accumulation/Distribution
23. Simple Moving Average
24. Exponential Moving Average
25. CCI (commodity channel index)
26. Chop Zone
27. Ease of Movement
28. Detrended Price Oscillator
29. Advance Decline Line
30. Bull Bear Power
Divergence for Many Indicators v4 STHello Traders.
This is the Strategy version of Divergence for Many Indicators v4, an easy and comfortable indicator.
- - - -
*It's been modified a little bit from the original.
*I got permission from the original author.
*I'm not good at English, I'm sorry.
- - - -
< 4 things to check >
1. Since repainting is not performed, the first imprinted signal can be accurately seen.
2. It does not respond to continuous diversions.
3. If the opposite diversity is not imprinted, caution is required as it is designed not to indicate liquidation. Be careful when reading the figures shown in the strategy tester.
4. Added stop loss and take propirane.
< What changed? >
1. pivot period 5 - > 9
2. Money Flow index and Chaikin Money Flow are released.
- - - -
KOR SUB
< 4가지 확인 사항 >
1. 리페인팅이 없으므로 첫 번째로 각인된 신호를 정확히 볼 수 있습니다.
2. 연속된 다이버젼스에 대해서는 반응하지 않습니다.
3. 반대의 다이버젼스가 각인되지 않으면 청산 표시를 하지 않도록 설계되어 있으므로 주의를 요합니다.
4. 스탑 로스와 테이크 프로핏 항목을 추가하였습니다.
< 무엇이 변경되었나? >
1. 피봇 페리어드 값이 조금 수정되었습니다.
2. MFI & CMF 가 체크 해제된 상태입니다.
THANK YOU ^^
EMA Cross + Divergence strategy (Div. signals by The Divergent)A sample strategy demonstrating the usage of The Divergent divergence indicator and The Divergent Library .
The Divergent is an advanced divergence indicator which you can easily incorporate into your own strategies.
In order to use this strategy (and to use the signals in your own strategy), you need to have the Pro version of The Divergent applied to your chart.
For more information, please see the comments inlined in the code.
RSI Overbought Oversold Divergence Strategy w/ Buy/Sell SignalsThis indicator is a copy of my RSI Overbought/Oversold Divergence Indicator with-Alerts
Only difference is that the alerts are disabled, instead it uses tradingviews strategy tester signals
If you want alerts just use the other indicator
Macd Divergence + MTF EMA MACD Divergence + Multi Time Frame EMA
This Strategy uses 3 indicators: the Macd and two emas in different time frames
The configuration of the strategy is:
Macd standar configuration (12, 26, 9) in 1H resolution
10 periods ema, in 1H resolution
5 periods ema, in 15 minutes resolution
We use the two emas to filter for long and short positions.
If 15 minutes ema is above 1H ema, we look for long positions
If 15 minutes ema is below 1H ema, we look for short positions
We can use an aditional filter using a 100 days ema, so when the 15' and 1H emas are above the daily ema we take long positions
Using this filter improves the strategy
We wait for Macd indicator to form a divergence between histogram and price
If we have a bullish divergence, and 15 minutes ema is above 1H ema, we wait for macd line to cross above signal line and we open a long position
If we have a bearish divergence, and 15 minutes ema is below 1H ema, we wait for macd line to cross below signal line and we open a short position
We close both position after a cross in the oposite direction of macd line and signal line
Also we can configure a Take profit parameter and a trailing stop loss
MA Divergences StrategyThis is the Strategy version of the Study I published. It is a Moving Average that can be applied to any plot to plot divergences on any oscillator, as well as perform backtesting. You'll need a REALLY good oscillator to perform live trades using this alone, but I think it is a valuable tool and had the Strategy hanging around and for some reason didn't upload it yet.
So here it is.
Turn Length to 1 to follow the oscillator without lag. Turn Length up if you are getting too many false signals or tweak the original oscillator settings.
RSI Divergence Indicator strategyThis strategy is based on RSI divergence indicator.
RSI period setting 5
Go Long when Bull or Hidden Bull is shown
Exit when RSI goes above 75 OR when bear condition appears
[STRATEGY][UL]Price Divergence Strategy v1.0Created by Request: This is a trend trading strategy that uses Price Divergence detection signals that are confirmed by the "Murrey's Math Oscillator" (Donchanin Channel based).
Strategy Code Based on:
Price Divergence Detector V2 by RicardoSantos
UCS_Murrey's Math Oscillator by Ucsgears
Strategy Risk Management Based on:
Strategy Code Example by JayRogers
Information on Divergence Trading:
- www.babypips.com
*** USE AT YOUR OWN RISK ***
MACD+STOCHASTICA simple strategy that use MACD and STOCHASTIC to give buy/sell signal. Use fractals to put stop loss
MACD + RSI TSA simple strategy that use EMAs convergence/divergence and RSI peeks to take position. Fractals are really useful to positioning your stop loss.
It works well on commodities and forex markets.