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
| Name | Type | Default |
|---|---|---|
| source | ArrayLike | |
| period | int | 14 |
| deviation | float | 0.1 |
| method | str | 'sma' |
| mode | str | 'percent' |
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) -> NoneA moving average with a band a set distance above and below it.
Inputs
| Name | Type | Default | Range |
|---|---|---|---|
| source | source | close | |
| period | int | 14 | 1 to 5000 |
| deviation | float | 0.1 | 0 to 100 |
| method | ma_method | sma | |
| mode | choice | percent |
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