Function getPreviousDailyBar

  • Parameters

    • args: DailyBarArgs
      async function main() {
      const stockBar = await getPreviousDailyBar({
      symbol: 'AAPL',
      })

      console.log(JSON.stringify(stockBar, null, 2))

      const cryptoBar = await getPreviousDailyBar({
      symbol: 'BTC/USD',
      exchanges: ['CBSE'],
      })

      console.log(JSON.stringify(cryptoBar, null, 2))
      }

      Results:

      {
      "t": "2022-07-18T04:00:00.000Z",
      "o": 150.74,
      "h": 151.57,
      "l": 146.7,
      "c": 147.07,
      "v": 81446408,
      "n": 620456,
      "vw": 149.030641,
      "S": "AAPL"
      }
      {
      "t": "2022-07-18T05:00:00.000Z",
      "x": "CBSE",
      "o": 21295,
      "h": 22961.04,
      "l": 21289.14,
      "c": 21892.11,
      "v": 36065.88615974,
      "n": 635956,
      "vw": 22112.0871344817,
      "S": "BTCUSD"
      }

    Returns Promise<undefined | Bar>

Generated using TypeDoc