Use HL tracer by default, seems to be faster?
parent
373dd8eb98
commit
5c7d1a8776
|
@ -155,7 +155,7 @@ def downsample(
|
||||||
|
|
||||||
def ohlc_flatten(
|
def ohlc_flatten(
|
||||||
ohlc: np.ndarray,
|
ohlc: np.ndarray,
|
||||||
use_mxmn: bool = False,
|
use_mxmn: bool = True,
|
||||||
|
|
||||||
) -> tuple[np.ndarray, np.ndarray]:
|
) -> tuple[np.ndarray, np.ndarray]:
|
||||||
'''
|
'''
|
||||||
|
@ -167,7 +167,11 @@ def ohlc_flatten(
|
||||||
index = ohlc['index']
|
index = ohlc['index']
|
||||||
|
|
||||||
if use_mxmn:
|
if use_mxmn:
|
||||||
|
# traces a line optimally over highs to lows
|
||||||
|
# using numba. NOTE: pretty sure this is faster
|
||||||
|
# and looks about the same as the below output.
|
||||||
flat, x = hl2mxmn(ohlc)
|
flat, x = hl2mxmn(ohlc)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
flat = rfn.structured_to_unstructured(
|
flat = rfn.structured_to_unstructured(
|
||||||
ohlc[['open', 'high', 'low', 'close']]
|
ohlc[['open', 'high', 'low', 'close']]
|
||||||
|
|
Loading…
Reference in New Issue