weak_volume_dependency

Syntax

declare weak_volume_dependency;

Description

Places a study on the volume subgraph when at least one volume value is used.

Example (Keltner Channels)

declare weak_volume_dependency;

input factor = 1.5;
input length = 20;
input price = close;

def shift = factor * AvgTrueRange(high, close, low, length);
def average = Average(price, length);

plot Avg = average;
plot Upper_Band = average + shift;
plot Lower_Band = average - shift;

Consider you are analyzing data that contains both volume and base subgraph related values using the code provided above. You want to display the plot on the base subgraph except for cases when you use at least one volume value. For the latter case, you would like to use the volume subgraph. In order to implement the logics, you use the weak_volume_declaration. If you use the close price input in the code, the study will be displayed on the base subgraph. If you use the volume price input, then there is a weak volume dependency and the study will be displayed on the volume subgraph.