Price-Volume Divergence

A divergence between the price of a security and its trade volume is often used as buy or sell signal. For example, when the price is rising on low volume this can suggest the market is overbought and due a correction.

In this example, we’ll explain how to create an indicator to detect price rising on falling volume.

To begin, go the Indicator Builder then add a Gradient operator. Set the input to median price.

Card image cap

Gradient to detect rising price

Next click the top row to select it. Then click the plus symbol in the toolbar to add a new row above. Set this to a Greater Than operator.

Card image cap

Add Greater Than

This logic will be true on any chart bar where the price is rising, according to the gradient function. By default, the length of the gradient is 10 bars. To increase or decrease this, just click the cogs icon on that row and set the value as required. Click the spyglass icon to preview the result.

Card image cap

Using And operator

Select the top row again, and add a new row. This time, set the new row to And. Set the second input of And to a Less Than operator.

Card image cap

Adding relative volume

Now set the input of Less Than to Gradient of Relative Volume. The builder should now look like the image above. Again you can adjust the length of the second gradient from the configuration tab.

Card image cap

Preview result so far

To preview any row, just click the spyglass icon. Previewing the top row (And) should look something like the chart above. The appearance of the chart can be adjusted from the configuration page. Each bar in the above shows where price is rising but volume is falling. This is the logic that we need for the price-volume divergence.

Card image cap

Second And operator

In this example, we want to detect overbought levels. For this we can use the Max function. Click the top row again and add a new And operator. Then add another row and set that to Sell.

Card image cap

Max operator to detect overbought levels

The logic will now create a sell on bars where price is rising, volume is falling and the price has broken a new high over the last 30 bars.

Card image cap

We can test the end result by clicking preview in the top row. To save the indicator, click the disk icon from the toolbar and provide a name.

Use this Indicator

Risk Disclosure: Information given on this website is for general purposes only and should not be construed as investment advice. Certain instruments shown here are complex and may come with a high risk of losing money rapidly due to leverage. You should consider whether you understand how these instruments work and whether you can afford to take the high risk of losing your money. Market data displayed is indicative and is not a solicitation to buy or sell.