Skip to main content

Class: Htf

Another timeframe and/or symbol (request.timeframe, request.security). Every member is a Series indexed in that context's bars: [0] is the DEVELOPING bar (it repaints until the bar closes), [1] is the last CLOSED bar. Use [1] for signals. Indicators accept these directly: ta.ema(ctx.close, 200) runs over the context's bars. Indicators without a source run on the context through its methods: ctx.atr(14), ctx.dmi(14, 14). ta.atr(14) itself always runs on the chart.

Constructors​

Constructor​

new Htf(handle): Htf

Parameters​

handle​

i32

Returns​

Htf

Properties​

close​

readonly close: Series


high​

readonly high: Series


hl2​

readonly hl2: Series


hlc3​

readonly hlc3: Series


hlcc4​

readonly hlcc4: Series


low​

readonly low: Series


ohlc4​

readonly ohlc4: Series


open​

readonly open: Series


time​

readonly time: Series


volume​

readonly volume: Series

Methods​

accdist()​

accdist(): Series

Accumulation/distribution over context bars.

Returns​

Series


atr()​

atr(length): Series

Average true range (Wilder) over context bars.

Parameters​

length​

i32

Returns​

Series


cci()​

cci(length): Series

Commodity Channel Index over context bars.

Parameters​

length​

i32

Returns​

Series


dmi()​

dmi(length, adxSmoothing): Dmi

Directional movement index over context bars.

Parameters​

length​

i32

adxSmoothing​

i32

Returns​

Dmi


iii()​

iii(): Series

Intraday intensity index over context bars.

Returns​

Series


sar()​

sar(start?, inc?, max?): Series

Parabolic SAR over context bars.

Parameters​

start?​

f64 = 0.02

inc?​

f64 = 0.02

max?​

f64 = 0.2

Returns​

Series


series()​

series(): Series

A user series indexed in this context's bars. Call at module top level. Write s[0] = v every chart bar: the value written on the last confirmed chart bar of a context bar is kept as that bar's value, so s[1] and ta.*(s, n) work in context bars.

Returns​

Series


stochK()​

stochK(length): Series

Stochastic %K over context bars.

Parameters​

length​

i32

Returns​

Series


supertrend()​

supertrend(atrLength, factor): Supertrend

Supertrend over context bars.

Parameters​

atrLength​

i32

factor​

f64

Returns​

Supertrend


tr()​

tr(): Series

True range of each context bar.

Returns​

Series


wpr()​

wpr(length): Series

Williams %R over context bars, -100..0.

Parameters​

length​

i32

Returns​

Series