我在海图中停留在MACD绘图上。

我不明白我在哪里做错了。请点击jsfiddle链接,并尝试仅针对MACD求解和绘制图形。

$(function () {
        $('#container').highcharts({
            chart: {
                type: 'column'
            },
            xAxis: {
               type: 'datetime',
            },
            yAxis:  [{ // Primary yAxis for volume
                title: {
                    text: 'volume',
                    style: {
                        color: 'blue'
                    }
                },
                height: '60%',

            },{ // Secondary yAxis for Return
                     height: '60%',
                     opposite: true
            },{
                labels: {
                    align: 'left',
                    x: -3
                },
                title: {
                    text: 'MACD'
                },
                top: '65%',
                height: '35%',
                opposite: true
            }],
               plotOptions: {
                column: {
                    pointPadding: 0.2,
                    borderWidth: 0
                }
            },
            series: [ { color: "blue",
                        data: [0.06694678963061322,0.22184874961635637,1,1.031408464251624,0.6989700043360187,1e-7,0.47712125471966244,1e-7,0.17609125905568124,0.6989700043360187,1e-7,1e-7,1e-7,0.47712125471966244,1e-7,0.47712125471966244,0.0791812460476248],
                        id: "left_bar",
                        name: "Sentiment",
                       type: "column",
                      },{
                        color: "#F09413",
                        data: [50,49.805,50.024142,51.9900907806,54.0333013483,56.1568100913,58.3637727279,60.5991052233,62.7140139956,65.2100317526,68.5422643752,72.0447740848,75.7262620405,80.3758545298,85.3109319979,89.457043293,3.9835696837],
                        id: "right_bar",
                        name: "Price",
                        type: "line",
                        yAxis: 1
                      },{
                        algorithm: "MACD",
                        linkedTo: "right_bar",
                        name: "MACD",
                        showInLegend: true,
                        type: "trendline",
                        yAxis: 1
                     }
                    ]
        });
    });

最佳答案

根据代码:看来句点是硬编码的,因此这是未计算macd的原因。你你没有足够的分数。

关于javascript - MACD + Highcharts 图绘制问题,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23512866/

10-10 01:20