Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including @hackape/tardis-dev with all npm packages installed. Try it out:

const { replayNormalized, streamNormalized, normalizeTrades, compute, computeTradeBars } = require('tardis-dev') const historicalMessages = replayNormalized( { exchange: 'bitmex', symbols: ['XBTUSD'], from: '2019-08-01', to: '2019-08-02' }, normalizeTrades ) const realTimeMessages = streamNormalized( { exchange: 'bitmex', symbols: ['XBTUSD'] }, normalizeTrades ) async function produceVolumeBasedTradeBars(messages) { // aggregate by 50k contracts volume const withVolumeTradeBars = compute(messages, computeTradeBars({ kind: 'volume', interval: 50 * 1000 })) for await (const message of withVolumeTradeBars) { if (message.type === 'trade_bar') { console.log(message.name, message) } } } await produceVolumeBasedTradeBars(historicalMessages) // or for real time data // await produceVolumeBasedTradeBars(realTimeMessages)

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@hackape/tardis-dev v12.4.2

Convenient access to tick-level historical and real-time cryptocurrency market data via Node.js

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free