pybroker.vect module
Contains vectorized utility functions.
- cross(a: ndarray[Any, dtype[float64]], b: ndarray[Any, dtype[float64]]) ndarray[Any, dtype[bool_]] [source]
Checks for crossover of
a
aboveb
.- Parameters:
a –
numpy.ndarray
of data.b –
numpy.ndarray
of data.
- Returns:
numpy.ndarray
containing values of1
whena
crosses aboveb
, otherwise values of0
.
- highv(array: ndarray[Any, dtype[float64]], n: int) ndarray[Any, dtype[float64]] [source]
Calculates the highest values for every
n
period inarray
.- Parameters:
array –
numpy.ndarray
of data.n – Length of period.
- Returns:
numpy.ndarray
of the highest values for everyn
period inarray
.
- lowv(array: ndarray[Any, dtype[float64]], n: int) ndarray[Any, dtype[float64]] [source]
Calculates the lowest values for every
n
period inarray
.- Parameters:
array –
numpy.ndarray
of data.n – Length of period.
- Returns:
numpy.ndarray
of the lowest values for everyn
period inarray
.