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.
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.
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.
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.
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.
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.
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.
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.
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.