k线数据年限改为10年

master
钟海欣 5 years ago
parent 780759cf9a
commit b0b62021c1
  1. 4
      public/JsApi/Datafeed.js
  2. 20
      src/components/trade/TradingView.vue

@ -18,7 +18,7 @@ Datafeed.prototype.onReady = function(callback) {
// ], // ],
supports_search: false, supports_search: false,
supports_group_request: true, supports_group_request: true,
supported_resolutions: [1, 5, 15, 30, 60, 240, 720, 'D', '2D', 'W', 'M'], supported_resolutions: [1, 5, 15, 30, 60, 240, 720, 'D', 'W'],
supports_marks: true, supports_marks: true,
supports_timescale_marks: true, supports_timescale_marks: true,
supports_time: true, supports_time: true,
@ -94,7 +94,7 @@ Datafeed.prototype.calculateHistoryDepth = function(
localStorage.setItem('resolution', resolution); localStorage.setItem('resolution', resolution);
return { return {
resolutionBack: 'M', resolutionBack: 'M',
intervalBack: 24, intervalBack: 120,
}; };
}; };

@ -93,16 +93,24 @@ export default {
'240', '240',
'720', '720',
'D', 'D',
'2D',
'W', 'W',
'M',
], ],
has_seconds: false, // has_seconds: false, //
has_intraday: true, // has_intraday: true, //
has_daily: true, // has_daily: true, //
has_weekly_and_monthly: true, // has_weekly_and_monthly: true, //
seconds_multipliers: [], // seconds_multipliers: [], //
intraday_multipliers: ['1', '5', '15', '30', '60', '240', '720'], // intraday_multipliers: [
'1',
'5',
'15',
'30',
'60',
'240',
'720',
'D',
'W',
], //
has_empty_bars: true, has_empty_bars: true,
force_session_rebuild: false, force_session_rebuild: false,
has_no_volume: false, // has_no_volume: false, //
@ -489,6 +497,12 @@ export default {
res.data.length res.data.length
) { ) {
// fromK线 toK线 // fromK线 toK线
// console.log(from, to);
// console.log(
// res.data[0].timestamp,
// res.data[res.data.length - 1].timestamp
// );
if (from && to) { if (from && to) {
if ( if (
res.data[0].timestamp >= from * 1000 && res.data[0].timestamp >= from * 1000 &&

Loading…
Cancel
Save