@request-sdk/stock
v0.0.11
Published
stock request sdk.
Downloads
2
Readme
stock
stock request sdk.
Usage
const Api = require('@request-sdk/stock')
const logger = console
const api = new Api({
logger
})
const ret = await api.get('http://t.com/api/xxx', {
a: 'b'
}, {
responseType: 'json'
})
const ret2 = await api.post('http://t.com/api/xxx', {
a: 'b'
}, {
responseType: 'json'
})
methods
- get
api.get('http://t.com/api/xxx', {
a: 'b'
}, {
responseType: 'json'
})
- post
api.post('http://t.com/api/xxx', {
a: 'b'
}, {
responseType: 'json'
})
- getCurrentInfo
api.getCurrentInfo('600900')
- loadHistoryData
api.loadHistoryData({
code: '600900', dataLen: 11, scale: 240
})
- loadDataFromPrevNDays
api.loadDataFromPrevNDays('600900', 11)
- loadMaData
api.loadMaData({
code: '600900', limit: 11, deflate: x => x.close
})
- loadMdData
api.loadMdData({
code: '600900', limit: 11, deflate: x => x.close
})
- loadCciData
api.loadCciData({
code: '600900', limit: 14, coefficient: 0.015
})
- loadRsiData
api.loadRsiData({
code: '600900', limit: 12, deflate: x => x.close
})