Early Detection
The Trigger Sensitivity input controls the 2nd peak's right side sensitivity and by extension how quickly a peak is detected. Lower values means sooner detection of divergence, but more false positives on short swings.
Divergence Lookback
Divergence is detected between two swings. The study is limited in how many peaks it can look back through for divergence through the Divergence Lookback Number of Peaks input. If there are multiple peaks that divert in the lookback it selects one according to the Divergence Lookback Use Nearest/Furthest Peak input.
Filters
Filter for Bars/Oscillator Crossing Divergence Line
Filter
Inputs
Input name | Description |
---|---|
Bullish Divergence Price Reference | Reference to the input data for detecting Swing Lows |
Bearish Divergence Price Reference | Reference to the input data for detecting Swing Highs |
Oscillator Reference | Reference to the subgraph we want to detect divergence with |
Draw Divergence Lines | Select whether to draw the actual divergence lines on the main price panel and/or the oscillator region |
Oscillator Graph Region | The graph region of the oscillator |
Swing Sensitivity | Number of bars sensitivity for detecting swings (see Sensitivity Settings) |
Sensitivity 2nd Peak Left | Number of bars sensitivity on the left hand side of the right peak |
Sensitivity 2nd Peak Right | Number of bars sensitivity on the right hand side of the right peak |
On Bar Close | Should the divergence be detected on bar close or intrabar |
Arrow Offset | Visual offset in ticks of the arrow from the bar |
Mode | Select between Regular and Hidden Divergence |
Subgraphs
Subgraph | Description |
---|---|
Bullish Divergence Detected | An up arrow by default, below the bar |
Bearish Divergence Detected | A down arrow by default, above the bar |
- Note that the detection uses swing points. That means that the right side swing must form in order for the divergence to be drawn. Depending the "Sensitivity 2nd Peak Right" setting, there will be that much delay in detection because we have to wait for the swing to form (Its a classic trade off between waiting for a full price pattern to form vs. earlier detection with patterns that have not fully formed). The arrows will appear on the bar where the divergence was detected. If you look at a historical chart, the arrow shows you when you would have been alerted to the divergence.
Performance and Tuning
To deal with long load times and sluggishness
- Reduce the number of days loaded
- Turn the drawings off
Setting up Alerts
Using the SC built-in alerts, add the alert condition below to the study Alerts Tab
Alert condition: or(SG1<>0, SG2<>0)
More