down_cross_count

czsc.signals.utils.down_cross_count(x1: Union[List, array], x2: Union[List, array]) int[source]

输入两个序列,计算 x1 下穿 x2 的次数

Parameters:
  • x1 – list

  • x2 – list

Returns:

int

example:

>>> x1 = [1, 1, 3, 4, 5, 12, 9, 8]
>>> x2 = [2, 2, 1, 5, 8, 9, 10, 10]
>>> print("x1 下穿 x2 的次数:{}".format(down_cross_count(x1, x2)))
>>> print("x1 上穿 x2 的次数:{}".format(down_cross_count(x2, x1)))