Ta

API Reference

1. ta.accdist

DescriptionType

Accumulation/distribution index.

series float

2. ta.iii

DescriptionType

Intraday Intensity Index.

series float

Example:

//@version=5
indicator("Intraday Intensity Index")
plot(ta.iii, color=color.yellow)

// the same on pine
f_iii() =>
    (2 * close - high - low) / ((high - low) * volume)
plot(f_iii())

3. ta.nvi

DescriptionType

Negative Volume Index.

series float

Example:

//@version=5
indicator("Negative Volume Index")
plot(ta.nvi, color=color.yellow)

// the same on pine
f_nvi() =>
    float ta_nvi = 1.0
    float prevNvi = (nz(ta_nvi[1], 0.0) == 0.0)  ? 1.0: ta_nvi[1]
    if nz(close, 0.0) == 0.0 or nz(close[1], 0.0) == 0.0
        ta_nvi := prevNvi
    else
        ta_nvi := (volume < nz(volume[1], 0.0)) ? prevNvi + ((close - close[1]) / close[1]) * prevNvi : prevNvi
    result = ta_nvi
plot(f_nvi())

4. ta.obv

DescriptionType

On Balance Volume.

series float

Example:

//@version=5
indicator("On Balance Volume")
plot(ta.obv, color=color.yellow)

// the same on pine
f_obv() =>
    ta.cum(math.sign(ta.change(close)) * volume)
plot(f_obv())

5. ta.pvi

DescriptionType

Positive Volume Index.

series float

Example:

//@version=5
indicator("Positive Volume Index")
plot(ta.pvi, color=color.yellow)

// the same on pine
f_pvi() =>
    float ta_pvi = 1.0
    float prevPvi = (nz(ta_pvi[1], 0.0) == 0.0)  ? 1.0: ta_pvi[1]
    if nz(close, 0.0) == 0.0 or nz(close[1], 0.0) == 0.0
        ta_pvi := prevPvi
    else
        ta_pvi := (volume > nz(volume[1], 0.0)) ? prevPvi + ((close - close[1]) / close[1]) * prevPvi : prevPvi
    result = ta_pvi
plot(f_pvi())

6. ta.pvt

DescriptionType

Price-Volume Trend.

series float

Example:

//@version=5
indicator("Price-Volume Trend")
plot(ta.pvt, color=color.yellow)

// the same on pine
f_pvt() =>
    ta.cum((ta.change(close) / close[1]) * volume)
plot(f_pvt())

7. ta.tr

DescriptionType

True range. It is max(high - low, abs(high - close[1]), abs(low - close[1]))

series float

8. ta.vwap

DescriptionType

Volume Weighted Average Price. It uses hlc3 as its source series.

series float

9. ta.wad

DescriptionType

Williams Accumulation/Distribution.

series float

Example:

//@version=5
indicator("Williams Accumulation/Distribution")
plot(ta.wad, color=color.yellow)

// the same on pine
f_wad() =>
    trueHigh = math.max(high, close[1])
    trueLow = math.min(low, close[1])
    mom = ta.change(close)
    gain = (mom > 0) ? close - trueLow : (mom < 0) ? close - trueHigh : 0
    ta.cum(gain)
plot(f_wad())

10. ta.wvad

DescriptionType

Williams Variable Accumulation/Distribution.

series float

Example:

//@version=5
indicator("Williams Variable Accumulation/Distribution")
plot(ta.wvad, color=color.yellow)

// the same on pine
f_wvad() =>
    (close - open) / (high - low) * volume
plot(f_wvad())

11. ta.tr

DescriptionType

True range. Same as tr(false). It is max(high - low, abs(high - close[1]), abs(low - close[1]))

series float

12. ta.vwap

DescriptionType

Volume Weighted Average Price. It uses hlc3 as its source series.

series float

13. ta.wad

DescriptionType

Williams Accumulation/Distribution.

series float

Example:

//@version=5
indicator("Williams Accumulation/Distribution")
plot(ta.wad, color=color.yellow)

// the same on pine
f_wad() =>
    trueHigh = math.max(high, close[1])
    trueLow = math.min(low, close[1])
    mom = ta.change(close)
    gain = (mom > 0) ? close - trueLow : (mom < 0) ? close - trueHigh : 0
    ta.cum(gain)
plot(f_wad())

14. ta.wvad

DescriptionType

Williams Variable Accumulation/Distribution.

series float

Example:

//@version=5
indicator("Williams Variable Accumulation/Distribution")
plot(ta.wvad, color=color.yellow)

// the same on pine
f_wvad() =>
    (close - open) / (high - low) * volume
plot(f_wvad())

Last updated