Type/to search
0
Follow
0
Followers
我可以这么判断金叉死叉么?
FAQ
Created 2018-09-13 14:49:12  
 2
 2276

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;
}

Related Recommendations
Comment
All comments (2)

    用python的哈 怎么做到了?

    8 years ago

    可以的 在 API 文档 中 有个 _Cross 函数 可以用来判断 交叉。

    8 years ago
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)