Type/to search
17
Follow
35
Followers
Apakah fungsionalitas Highstock terbatas?
Help
Created 2019-05-30 09:15:08  
 10
 2094

Tekanhighstock"Saya tidak tahu apa-apa tentang itu.
Tidak ada gambar langsung.Jam tangan

var ObjChart = null var preBarTime = 0 var chart = { __isStock: true, extension: { layout: 'single', // 不参于分组,单独显示, 默认为分组 'group' height: 600, // 指定高度 // 指定宽度占的单元值, 总值 为12 }, plotOptions: { candlestick: { color: '#d75442', upColor: '#6ba583' } }, rangeSelector: { buttons: [{ type: 'hour', count: 1, text: '1h' }, { type: 'hour', count: 3, text: '3h' }, { type: 'hour', count: 8, text: '8h' }, { type: 'all', text: 'All' }], selected: 2, inputEnabled: true }, legend: { enabled: true, }, tooltip: {xDateFormat: '%Y-%m-%d %H:%M:%S, %A'}, // 缩放工具 title : { text : '双坐标折线'}, // 标题 rangeSelector: { // 选择范围 buttons: [{type: 'hour',count: 1, text: '1h'}, {type: 'hour',count: 3, text: '3h'}, {type: 'hour', count: 8, text: '8h'}, {type: 'all',text: 'All'}], selected: 3, inputEnabled: true }, xAxis: { type: 'datetime'}, // 坐标轴横轴 即:x轴, 当前设置的类型是 :时间 yAxis : [{ // Primary yAxis // 坐标轴纵轴 即:y轴, 默认数值随数据大小调整。 labels: { format: '{value}', }, title: { text: 'BTC/USDT', }, showInLegend: true, opposite: false }], series: [{ type: 'candlestick', name: 'BTC', id: 'btc', zIndex: 2, data: [] }, { type: 'column', name: 'Volume', id: 'volume', data: [], yAxis: 1 }, { type: 'vbp', linkedTo: 'btc', params: { volumeSeriesID: 'volume' }, dataLabels: { enabled: false }, zoneLines: { enabled: false } } ] }; function main() { ObjChart = Chart(chart) ObjChart.reset(); LogReset() LogVacuum() while(1){ var records = exchange.GetRecords() if(records == null || typeof(records) === 'undefined' || records.length == 0) { } else { for(var index = 0; index < records.length; index++) { if(records[i].Time > preBarTime){ ObjChart.add(0, [records[i].Time, records[i].Open, records[i].High, records[i].Low, records[i].Close]) ObjChart.add(1, [records[i].Time, records[i].Volume]) } } if(typeof(records[records.length - 1].Time) !== 'undefined') { preBarTime = records[records.length - 1].Time } } Sleep(1000 * 60) } }
Related Recommendations
Comment
All comments (10)

    测试了
    删除 series 里面的

    { type: 'column', name: 'Volume', id: 'volume', data: [], yAxis: 1 }

    就可以显示出来了, highstock 这个库,没有量柱吧。

    7 years ago

    我的还是没能显示出来呀?
    量柱 API

    7 years ago

    series 只留第一个 ,剩下的都删除应该可以显示了,先回测试下 看看。

    7 years ago

    梦总,我的目的就是测试highstock中的指标呀,vbp
    highstock不仅仅是现在k线,还有其它指标,如sma,ema

    7 years ago

    给您写了个范例,您看有帮助没:

    var chart = { __isStock: true, plotOptions: { series: { // general options for all series }, ema: { // shared options for all ema series } }, xAxis: { type: 'datetime'}, series : [ {type: 'ema', data : [1,2,3,4,5,6,7,8,8]}, ] }; function main() { var obj = Chart(chart) obj.reset() var i = 10000 var j = 1 while(1) { obj.add(0, [i++, j++]); Sleep(1000) } }

    img

    7 years ago

    谢谢. 可惜我唯独对VbP 情有独钟 :(
    还是谢谢梦总细心解读

    7 years ago

    O__O "… VbP 是啥? 指标么 ?

    7 years ago

    volume by price

    7 years ago

    好的 ,研究下highstocks 文档。

    7 years ago

    梦总,有结论吗?

    7 years ago
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)