market-session
v2.0.4
Published
Logic for financial-market sessions
Downloads
20
Readme
market-session
Logic for financial-market sessions
Note: all times assumed to be UTC
Install
npm install market-session
Use
import session from 'market-session'
console.log(session.fromString('D'))
//=> 1440
console.log(session.toString(1440))
//=> 1D
console.log(session(new Date('2019-01-01')))
//=> [ '5', '15', '30', '1H', '4H', '12H', '1D', '3D', '1M', '3M', '1Y' ]
console.log(session(new Date('2019-04-01'), ['3M']))
//=> ['3M']
console.log(session(new Date('2019-01-01')).map(session.fromString))
//=> [ 5, 15, 30, 60, 240, 720, 1440, 4320, 40320, 120960, 483840 ]