var macd = TA.MACD(records, 12, 26, 9);
var M1 = macd[2][macd[2].length-2];
var M2 = macd[2][macd[2].length-3];
// 金叉
if(M2<0 && M1>0){
return 1;
}
// 死叉
if (M2>0 && M1<0) {
return 2;
}
13981928026How do you do that with Python?
Inventors quantify - small dreamsThere is a _Cross function in the API documentation that can be used to determine the cross.