Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Overview

The study works by detecting divergence between swings on the chart and swings on an oscillator. Swings in this context are synonymous to peaks or pivots.

The image to the right highlights different types of swings

A few definitions:

  1. The 1st peak refers to the swing that is on the left hand side of the chart.
  2. The 2nd peak refers to the swing that is on the right.
  3. A divergence is when the peaks of the price go in a different direction from the oscillator. Price increasing Vs. oscillator decreasing, or vice versa.
  4. A bearish divergence (shown in red) looks for a series of diverging "swing high"s.
  5. A bullish divergence (shown in green) looks for a series of diverging "swing low"s.

A line is drawn between the two swings once a divergence is confirmed.

Sensitivity Settings




2nd Peak and Early Detection

The 2nd peak actually has 2 sensitivity values: 2nd peak left and 2nd peak right. The reason for that is to allow for a mix of detecting peaks that have advanced enough in one direction but to get an early alert without having to wait for the full pattern to form (see the images below for an example.


Inputs

Input nameDescription
OscillatorReference to the subgraph we want to detect divergence with
Draw Divergence Lines OnSelect whether to draw the actual divergence lines on the main price panel and/or the oscillator region
Oscillator Graph RegionThe graph region of the oscillator
Sensitivity 1st PeakNumber of bars sensitivity for the left side swing (see more below)
Sensitivity 2nd Peak LeftNumber of bars sensitivity on the left hand side of the right peak
Sensitivity 2nd Peak RightNumber of bars sensitivity on the right hand side of the right peak
On Bar CloseShould the divergence be detected on bar close or intrabar
Arrow OffsetVisual offset in ticks of the arrow from the bar
ModeSelect between Regular and Hidden Divergence

Subgraphs

SubgraphDescription
Bullish Divergence DetectedAn up arrow by default, below the bar
Bearish Divergence DetectedA 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


  • No labels