0
Follow
5
Followers
KDJというよく使われる指標は,なぜTVとFMZが全く一致しないのかわかりませんが,おそらく2人の考えは一致しますが,具体的アルゴリズムは異なります.便利のため,私はTVの紹介に従って,手書きでこの指標を書き下ろし,比較すると,完全に一致します.
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?

