0
Follow
5
Followers
KDJ这个常用的指标,不知道为何TV和FMZ完全不一致,也许2者思路是一致的,但具体算法不同,出于方便,我按TV中的介绍,手写了下这个指标,然后对比,就完全一致了,如果有需要的朋友可以复制过去,有定制开发策略的需求,也请联系我。laohuo1379
function KDJ(rds, n, smoothK, smoothD) {
var rsi = [];
for(var i in rds){
var rd = rds[i];
var lowest = rd.Low;
var highest = rd.High;
for(var j=i; j>i-n && j>=0; j--){
if(rds[j].Low < lowest) lowest = rds[j].Low;
if(rds[j].High > highest) highest = rds[j].High;
}
rsi[i] = 100*(rd.Close-lowest)/(highest-lowest);
}
var k = TA.MA(rsi, smoothK);
var d = TA.MA(k, smoothD);
return [k,d];
}
Related Recommendations
How to Specify Different Versions of Data for the Rented Strategy by Its Rental Code MetadataAdvanced Tutorial for FMZ Quant platform Strategy WritingElementary Tutorial for FMZ Quant platform Strategy WritingGet Started with FMZ Quant PlatformSECURITY BUGI keep getting error: Exchange_GetAccount: Invalid ContractTypeWe have an incredibly profitable market making algorithm for sideways markets on Bitmex - but need expert to help eliminate wait times during downward volatility in the marketError with deribitLimitations of the backtesting engineHow to install ta-lib on linux docker?

