contango.stream.indicators.state.vwap_state
contango.stream.indicators.state.vwap_state
VWAPState
Bases: Enum
The current price location relative to VWAP.
Attributes:
| Name | Type | Description |
|---|---|---|
BELOW_LOWER |
The price is below the lower band. |
|
BETWEEN_LOWER_AND_MIDDLE |
The price is between the lower & VWAP band. |
|
ABOVE_MIDDLE |
The price is above the VWAP band. |
get_state
classmethod
get_state(price: float, snapshot: VWAPSnapshot) -> VWAPState
Returns the zone of the price relative to the VWAP bands.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
price
|
float
|
The close price for the current bar. |
required |
snapshot
|
VWAPSnapshot
|
The VWAP snapshot for the current bar. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
VWAPState |
VWAPState
|
The price relative to the VWAP snapshot. |
Source code in src\contango\stream\indicators\state\vwap_state.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | |