【问题标题】:MACD + High chart Graph plotting issueMACD + 高位图表 图表绘制问题
【发布时间】:2014-05-07 08:40:42
【问题描述】:

我卡在高图中的 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
                     }
                    ]
        });
    });

【问题讨论】:

    标签: javascript highcharts highstock indicator


    【解决方案1】:

    根据代码:https://rawgit.com/laff/technical-indicators/master/technical-indicators.src.js 看起来句点是硬编码的,所以这就是为什么你的 macd 没有被计算的原因。你你积分不够。

    【讨论】:

    • 我已更新jsfiddle。现在我已经粘贴时间并将期间设置为 1。但问题仍然存在。
    • 所以请联系这个插件的作者,因为它是由第三方开发者准备的。
    猜你喜欢
    • 2023-03-30
    • 1970-01-01
    • 1970-01-01
    • 2016-06-22
    • 2017-04-26
    • 2011-03-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多