envelopes

forge.tafunctionSince Forge API 1
Functionpython
forge.ta.envelopes(source: ArrayLike,period: int = 14,deviation: float = 0.1,method: str = 'sma',mode: str = 'percent') -> dict[str, np.ndarray]

A moving average with a band above and below it.

Parameters

NameTypeDefault
sourceArrayLike
periodint14
deviationfloat0.1
methodstr'sma'
modestr'percent'

Indicator: Envelopes

middle is the moving average named by method. In percent mode the bands are middle * (1 + deviation / 100) and middle * (1 - deviation / 100); in fixed mode they are middle + deviation and middle - deviation in price units.

Classpython
forge.ta.Envelopes(**inputs: Any) -> None

A moving average with a band a set distance above and below it.

Inputs

NameTypeDefaultRange
sourcesourceclose
periodint141 to 5000
deviationfloat0.10 to 100
methodma_methodsma
modechoicepercent

middle = the moving average named by method

percent: upper = middle * (1 + deviation / 100), lower = middle * (1 - deviation / 100)

fixed: upper = middle + deviation, lower = middle - deviation