https://doc.shinnytech.com/tqsdk/latest/reference/tqsdk.tafunc.html?highlight=cross#tqsdk.tafunc.crossdown
tqsdk.tafunc.
<span class="highlighted">cross</span>up
(a, b)
向上穿越: 表当a从下方向上穿过b, 成立返回1, 否则返回0
Example:
from tqsdk import TqApi, TqSim, tafunc
api = TqApi(TqSim())
klines = api.get_kline_serial(“CFFEX.IF1908”, 24 * 60 * 60)
crossup = tafunc.crossup(tafunc.ma(klines.close, 5), tafunc.ma(klines.close, 10))
print(list(crossup))
运行后出现错误提示:
Task was destroyed but it is pending!