find_local_peaks_within_window
描述
查找时间序列中价格在指定时间窗口内为局部最大值的点。
函数签名
find_local_peaks_within_window(times, prices, window) -> None
参数
times
(array_like)
时间戳数组(单位:秒)
prices
(array_like)
价格数组
window
(float)
时间窗口大小(单位:秒)
返回值
numpy.ndarray 布尔数组,True表示该点的价格大于指定时间窗口内的所有价格
Python调用示例: ```python import numpy as np from rust_pyfunc import find_local_peaks_within_window
创建示例数据
times = np.array([0.0, 10.0, 20.0, 30.0, 40.0]) # 时间戳(秒) prices = np.array([1.0, 3.0, 2.0, 1.5, 1.0]) # 价格 window = 100.0 # 时间窗口大小(秒)
查找局部最大值点
peaks = find_local_peaks_within_window(times, prices, window)
获取满足条件的数据
result_times = times[peaks] result_prices = prices[peaks] ```
示例
暂无示例
Python使用示例
import numpy as np
from rust_pyfunc import find_local_peaks_within_window
# 使用示例
# 请参考文档中的参数说明使用此函数