如何表达,比如均线在N天内发生过金叉或者死叉,能生成一个函数最好!
以金叉举例
日线k线图
bool condition;
numeric count;
condition = crossover(ma1,ma2);
count = nthcon(condition,n);
count 就是返回n根日线bar内,最近的一根发生金叉到现在的bar数。
如果没有,就是无效值
所以count <>invalidnumeric 就表示n天内发生过金叉