布林通道值的正确顺序



我正在尝试使用官方Highcharts文档中的布林通道演示:

$.getJSON('https://www.highcharts.com/samples/data/aapl-ohlc.json', function (data) {
Highcharts.stockChart('container', {
rangeSelector: {
selected: 2
},
title: {
text: 'AAPL Stock Price'
},
legend: {
enabled: true
},
plotOptions: {
series: {
showInLegend: true
}
},
series: [{
type: 'ohlc',
id: 'aapl',
name: 'AAPL Stock Price',
data: data
}, {
type: 'bb',
linkedTo: 'aapl'
}]
});
});

当我访问提供的 JSON 链接 (https://www.highcharts.com/samples/data/aapl-ohlc.json( 时,我看到以下格式的数据:

[
[
1467984600000,
96.49,
96.89,
96.05,
96.68,
],
[
1468243800000,
96.75,
97.65,
96.73,
96.98,
],   
...
]

我感到困惑的是这些价值观代表什么,顺序。第一个肯定是时间戳;第二个应该是运行平均值...那么接下来的三个,按顺序是什么?请注意,我了解布林通道背后的想法并进行了必要的计算,但我认为我没有得到一个通道,因为我不确定顺序。

提前感谢!

OHLC 系列的数据在 API 中定义,但本质上您看到的格式如下:

具有 5 或 4 个值的数组数组。在这种情况下,这些值对应于x,open,high,low,close.

或者你可以用对象来做:

{
x: 1,
open: 3,
high: 4,
low: 5,
close: 2,
name: "Point name"
}

然后,当您包括indicators.js后跟bollinger-bands.js时,您应该通过将bb序列链接到ohlc序列来计算和显示布林带,而无需实际为布林带本身提供任何其他数据。

布林通道存在一些额外的plotOptions,如 API 所示。

最新更新