I would like the following improvements to be done on the Plain Stochastic Divergence from tradingview:
Source Code: [login to view URL]
1-Remove Hidden Divergence (line 28 & 30, 38 & 39)
2-Add Divergence Lines on the Price Chart and an Arrow on the bar the divergence happens
3-Add ADX condition: if divergence happens and ADX < 40, then plot divergence
4-When divergence happens, plot on the Stop Loss and Take Profit. Calculation should be:
For Bullish Divergence: Stop Loss: Price - ATR 5; Take Profit: Price + (1.5 x ATR 5)
For Bearish Divergence: Stop Loss: Price + ATR 5; Take Profit: Price - (1.5 x ATR 5)
5-Combine the AlertCondition into 1. I don't want to create 2 Alerts in TradingView, 1 for Bullish and 1 for Bearish. Code should be smart to be able to do 1 AlertCondition.
See Attached screenshot for a sample of what I'm looking for.