Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

tardis-dev combining historical market data from multiple exchanges

node v12.22.12
version: 1.0.0
endpointsharetweet
const { replayNormalized, normalizeTrades, combine } = require('tardis-dev') async function replayCombined() { const bitmexMessages = replayNormalized( { exchange: 'bitmex', symbols: ['XBTUSD'], from: '2019-05-01', to: '2019-05-02' }, normalizeTrades ) const deribitMessages = replayNormalized( { exchange: 'deribit', symbols: ['BTC-PERPETUAL'], from: '2019-05-01', to: '2019-05-02' }, normalizeTrades ) const combinedStream = combine(bitmexMessages, deribitMessages) // order at which messages have historically arrived is preserved for await (const message of combinedStream) { if (message.exchange === 'deribit') { // process deribit trades console.log(message) } if (message.exchange === 'bitmex') { // process bitmex trades console.log(message) } } } replayCombined()
Loading…

no comments

    sign in to comment