Historical Market Prices

node v10.23.1
version: 2.0.0
endpointsharetweet
const Web3Data = require("web3data-js@0.6.1") const w3d = new Web3Data(process.env.API_KEY) // Initialize parameters const BASE = 'eth' const QUOTE = 'usd' const endDate = +new Date() const startDate = +new Date() - (86400000) // Get historical pricing data for the pair 'eth/usd' // We can adjust the window using the 'startDate' & 'endDate' parameters // We'll use this data for backtesting const histPrices = await w3d.market.getPrices("eth", { startDate, endDate }) // you can iterate over this array of historical prices to backtest assumptions
Loading…

no comments

    sign in to comment