统计k线上穿均线的次数

10天内k线上穿或者下穿均线ma30>2怎样表达,怎样用count

谢谢,是我想要的

回复:不客气,互帮互助

Vars Series<Numeric> Ma30; Series<Bool> ConOver; Series<Bool> ConUnder; Bool ResOver; Bool ResUnder; Events OnBar(ArrayRef<Integer> indexs){ Ma30 = AverageFC(Close, 30); ConOver = CrossOver(Close[1], Ma30[1]); ConUnder = CrossUnder(Close[1], Ma30[1]); ResOver = NthCon(ConOver, 2) < 10; ResUnder = NthCon(ConUnder, 2) < 10; PlotNumeric(\"Ma30\", Ma30); If(ResOver) PlotBool(\"ResOver\", !ResOver, High); If(ResUnder) PlotBool(\"ConUnder\", ConUnder, Low); }不知道这个是不是你想要的效果?

nthcon函数试试