Type: Package
Title: True Range-Weighted Average Price ('TrueWAP')
Version: 0.1.0
Author: Joshua Callaway [aut, cre]
Maintainer: Joshua Callaway <Callaway@roar-analytics.com>
Description: This groundbreaking technical indicator directly integrates volatility into price averaging by weighting median range-bound prices using the True Range. Unlike conventional metrics such as TWAP (Time-Weighted Average Price), which focuses solely on time, or VWAP (Volume-Weighted Average Price), which emphasizes volume, 'TrueWAP' captures fluctuating market behavior by reflecting true price movement within high/low performance boundaries.
License: GPL-2 | GPL-3 [expanded from: GPL (≥ 2)]
URL: https://github.com/CallawayCross/TrueWAP
BugReports: https://github.com/CallawayCross/TrueWAP/issues
Depends: R (≥ 4.3.2)
Imports: zoo (≥ 1.8-14), TTR (≥ 0.24.4)
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.2
Suggests: knitr, rmarkdown, testthat (≥ 3.0.0)
VignetteBuilder: knitr
Config/testthat/edition: 3
NeedsCompilation: no
Packaged: 2025-07-02 17:33:57 UTC; snow_
Repository: CRAN
Date/Publication: 2025-07-07 09:20:06 UTC

Title TWAP

Description

Calculates Time-Weighted Average Price (TWAP)

Usage

TWAP(OHLC, period)

Arguments

OHLC

Data frame object with Open, High, Low, & Close fields

period

Rolling window length

Value

Vector of TWAP values

Examples

data(nikkei)
TWAP(nikkei$OHLC, 50)

Title TrueWAP

Description

Calculates True Range-Weighted Average Price (TrueWAP)

Usage

TrueWAP(high, low, close, true_range, period)

Arguments

high

Vector of High Values

low

Vector of Low Values

close

Vector of Close Values

true_range

Vector of True Range Values

period

Rolling window length

Value

Vector of TrueWAP values

Examples

data(nikkei)
TrueWAP(
high = nikkei$High
, low = nikkei$Low
, close = nikkei$Close
, true_range = nikkei$tr
, period = 50)

Title VWAP

Description

Calculates Volume-Weighted Average Price (VWAP)

Usage

VWAP(HLC3, volume, period)

Arguments

HLC3

Vector of High, Low, Close Average Values

volume

Vector of Volume values

period

Rolling window length

Value

Vector of VWAP values

Examples

data(nikkei)
VWAP(nikkei$HLC3, nikkei$Volume, 50)

Title anchoredTWAP

Description

Calculates Anchored Time-Weighted Average Price (TWAP)

Usage

anchoredTWAP(OHLC, period)

Arguments

OHLC

Data frame object with Open, High, Low, & Close fields

period

Vector of bars since start of fixed period

Value

Vector of Anchored TWAP values

Examples

data(nikkei)
anchoredTWAP(
OHLC = nikkei$OHLC
, period = nikkei$bars_since_segment
)

Title anchoredTrueWAP

Description

Calculates Anchored True Range-Weighted Average Price (TrueWAP)

Usage

anchoredTrueWAP(high, low, close, true_range, period)

Arguments

high

Vector of High Values

low

Vector of Low Values

close

Vector of Close Values

true_range

Vector of True Range Values

period

Vector of bars since start of fixed period

Value

Vector of Anchored TrueWAP values

Examples

data(nikkei)
anchoredTrueWAP(
high = nikkei$High
, low = nikkei$Low
, close = nikkei$Close
, true_range = nikkei$tr
, period = nikkei$bars_since_segment
)

Title anchoredVWAP

Description

Calculates Anchored Volume-Weighted Average Price (VWAP)

Usage

anchoredVWAP(HLC3, volume, period)

Arguments

HLC3

Vector of High, Low, Close Average Values

volume

Vector of Volume values

period

Vector of bars since start of fixed period

Value

Vector of Anchored VWAP values

Examples

data(nikkei)
anchoredVWAP(
HLC3 = nikkei$HLC3
, volume = nikkei$Volume
, period = nikkei$bars_since_segment
)

nikkei

Description

An example data set of OHLCV data for Nikkei 225 (Osaka), Active Daily Continuation

Usage

data("nikkei")

Format

A data frame with 4411 observations on the following 27 variables.

Open

a numeric vector

High

a numeric vector

Low

a numeric vector

Close

a numeric vector

Volume

a numeric vector

Adjusted

a numeric vector

OHLC

a numeric vector

HLC3

a numeric vector

tr

a numeric vector

atr

a numeric vector

trueHigh

a numeric vector

trueLow

a numeric vector

segment

a Date

Date

a Date

FirstRowNumSegment

a numeric vector

RowNum

a numeric vector

bars_since_segment

a numeric vector

current_std

a numeric vector

Mature_Days

a numeric vector

Mature_STD

a numeric vector

lags_mature_days

a numeric vector

lags_mature_std

a numeric vector

current_sma

a numeric vector

current_adiv

a numeric vector

Mature_ADIV

a numeric vector

Current_IV

a numeric vector

lags_mature_adiv

a numeric vector

Examples

data(nikkei)
## maybe str(nikkei) ; plot(nikkei) ...