|
@ -48,15 +48,11 @@ FeedBase.prototype.resolveSymbol = function(symbolName, onResolve, onError) { |
|
|
"has_intraday": true, |
|
|
"has_intraday": true, |
|
|
"seconds_multipliers":['1', '5', '15', '30', '60', '1D', '1W','1M'], |
|
|
"seconds_multipliers":['1', '5', '15', '30', '60', '1D', '1W','1M'], |
|
|
"intraday_multipliers": ['1', '5', '15', '30', '60', '1D', '1W','1M'], |
|
|
"intraday_multipliers": ['1', '5', '15', '30', '60', '1D', '1W','1M'], |
|
|
"supports_search": false, |
|
|
"has_seconds":true, |
|
|
"supports_group_request": false, |
|
|
|
|
|
"supported_resolutions": ['1', '5', '15', '30', '60', '1D', '1W','1M'], // 时间
|
|
|
|
|
|
|
|
|
|
|
|
"has_seconds":false, |
|
|
|
|
|
"supports_marks": true, |
|
|
"supports_marks": true, |
|
|
"supports_timescale_marks": true, |
|
|
"supports_timescale_marks": true, |
|
|
"supported_time": true, |
|
|
"supported_time": true, |
|
|
"has_weekly_and_monthly": false, |
|
|
"has_weekly_and_monthly": true, |
|
|
"has_no_volume": true, |
|
|
"has_no_volume": true, |
|
|
"regular_session": "24x7", |
|
|
"regular_session": "24x7", |
|
|
|
|
|
|
|
@ -74,7 +70,7 @@ FeedBase.prototype.resolveSymbol = function(symbolName, onResolve, onError) { |
|
|
const resolutionFormat = (resolution, name, to) => { |
|
|
const resolutionFormat = (resolution, name, to) => { |
|
|
let req = `market.${name}.kline.${resolution}min`; |
|
|
let req = `market.${name}.kline.${resolution}min`; |
|
|
let minutes = resolution; |
|
|
let minutes = resolution; |
|
|
console.log(resolution) |
|
|
//console.log(resolution)
|
|
|
if (resolution.includes('D')) { |
|
|
if (resolution.includes('D')) { |
|
|
if (resolution.length < 2) resolution = '1' + resolution; |
|
|
if (resolution.length < 2) resolution = '1' + resolution; |
|
|
req = `market.${name}.kline.${parseInt(resolution)}day`; |
|
|
req = `market.${name}.kline.${parseInt(resolution)}day`; |
|
@ -99,7 +95,8 @@ const resolutionFormat = (resolution, name, to) => { |
|
|
if (resolution.includes('M') || resolution.includes('W')) { // 周线月线控制条数,时间超出火币规定范围, ws报错
|
|
|
if (resolution.includes('M') || resolution.includes('W')) { // 周线月线控制条数,时间超出火币规定范围, ws报错
|
|
|
from = to - 50 * minutes * 500; |
|
|
from = to - 50 * minutes * 500; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return { |
|
|
return { |
|
|
minutes, |
|
|
minutes, |
|
|
req, |
|
|
req, |
|
@ -109,12 +106,11 @@ const resolutionFormat = (resolution, name, to) => { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
FeedBase.prototype.getBars = function(symbolInfo, resolution, periodParams, onHistoryCallback, onErrorCallback) { |
|
|
FeedBase.prototype.getBars = function(symbolInfo, resolution, periodParams, onHistoryCallback, onErrorCallback) { |
|
|
console.log("获取历史数据",periodParams) |
|
|
//console.log("获取历史数据",periodParams)
|
|
|
// 切换产品周期 或者 切换产品 会执行这个函数
|
|
|
// 切换产品周期 或者 切换产品 会执行这个函数
|
|
|
let reso = resolutionFormat(resolution, symbolInfo.name, periodParams.to) |
|
|
let reso = resolutionFormat(resolution, symbolInfo.name, periodParams.to > detafeed_historyTime ? periodParams |
|
|
// if (resolution.includes('M') || resolution.includes('W')|| resolution.includes('D')) { // 周线月线控制条数,时间超出火币规定范围, ws报错
|
|
|
.to : |
|
|
// reso = resolutionFormat(resolution, symbolInfo.name, periodParams.to)
|
|
|
detafeed_historyTime) |
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// 是历史数据
|
|
|
// 是历史数据
|
|
|
var history = true |
|
|
var history = true |
|
@ -166,7 +162,7 @@ FeedBase.prototype.getBars = function(symbolInfo, resolution, periodParams, onHi |
|
|
datas.push(i) |
|
|
datas.push(i) |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
console.log('进来') |
|
|
//console.log('进来')
|
|
|
meta = { |
|
|
meta = { |
|
|
noData: 'no_data', |
|
|
noData: 'no_data', |
|
|
nextTime: detafeed_historyTime |
|
|
nextTime: detafeed_historyTime |
|
|