简体   繁体   English

如何解释TA-LIB结果数组? (技术分析库)

[英]How to interpret TA-LIB result arrays? (Technical Analysis Library)

I'm developing a financial technical analysis algortithm with node-talib, a wrapper of TALIB (Technical Analysis Library). 我正在使用node-talib(TALIB(技术分析库)的包装)开发一种财务技术分析算法。

Giving a marketdata array of 400 positions, I execute an ADX and I get an array of 384 positions. 给定一个包含400个头寸的marketdata数组,我执行ADX,得到一个384个头寸的数组。 What does it mean? 这是什么意思? What that array represent? 该数组代表什么?

I add an example of the code: 我添加一个示例代码:

const talib = require("node-talib")
// Load market data
var marketContents = fs.readFileSync('examples/marketdata.json','utf8'); 
var marketData = JSON.parse(marketContents);

// execute ADX indicator function with time period 9
talib.execute({
    name: "ADX",
    startIdx: 0,
    endIdx: marketData.close.length - 1,
    high: marketData.high,
    low: marketData.low,
    close: marketData.close,
    optInTimePeriod: 9
}, function (err, result) {

    // Show the result array
    console.log("ADX Function Results:");
    console.log(result);

});


where marketdata is an object of arrays like this: 

{
   "open": [
        448.36,
        448.45,
        447.49,
        (...) ],
  "close": [
        448.36,
        448.45,
        447.49,
        (...) ],
   "min": [
        448.36,
        448.45,
        447.49,
        (...) ],
   "max": [
        448.36,
        448.45,
        447.49,
        (...) ],
  "volume": [
        448.36,
        448.45,
        447.49,
        (...) ]
   }

And the result is an array of floats (always less than marketdata.open/close/min/max length). 结果是一个浮点数数组(总是小于marketdata.open/close/min/max长度)。

Thanks 谢谢

You'd better to read official c++ docs In a nutshell result array is always same size or less than input array. 最好阅读官方的c ++文档 。简而言之,结果数组的大小始终等于或小于输入数组。 It is less, for example, for 5-day average. 例如,少于5天平均值。 If you apply it to 60 days input data you'll get only 56 results. 如果将其应用于60天的输入数据,则只会得到56个结果。 Because 5-day average require 5 values to be calculated and for first 4 days it's undefined. 由于5天的平均值需要计算5个值,而对于前4天而言,它是不确定的。 So result array contain data corresponding to last n input values where n <= input array size depending on indicator you apply. 因此,结果数组包含对应于最后n输入值的数据,其中n <= input array size取决于您应用的指标。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM