mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-10 08:48:07 +00:00
29 lines
726 B
JavaScript
29 lines
726 B
JavaScript
'use strict';
|
|
|
|
const ccxt = require ('ccxt');
|
|
|
|
console.log ('CCXT Version:', ccxt.version)
|
|
|
|
async function watchTrades (exchange, symbol) {
|
|
|
|
while (true) {
|
|
try {
|
|
const trades = await exchange.watchTrades (symbol)
|
|
console.log (new Date (), exchange.id, symbol, trades.length, 'trades')
|
|
} catch (e) {
|
|
console.log (symbol, e)
|
|
}
|
|
}
|
|
}
|
|
|
|
async function main () {
|
|
const symbols = [ 'USDT/THB', 'BTC/THB', 'ETH/THB' ]
|
|
const exchange = new ccxt.pro.zipmex({
|
|
'newUpdates': true
|
|
})
|
|
const markets = await exchange.loadMarkets ()
|
|
exchange.verbose = true
|
|
await Promise.all (symbols.map ((symbol) => watchTrades (exchange, symbol)))
|
|
}
|
|
|
|
main() |