79624900

Date: 2025-05-16 09:39:42
Score: 0.5
Natty:
Report link

Here's how to adapt Quandl data for Highstock:

  1. Basic Conversion (simple approach):
// Assuming Quandl returns data in format: [[date, open, high, low, close, volume],...]
const formattedData = quandlData.dataset.data.map(item => ({
    x: new Date(item[0]).getTime(), // Convert date to timestamp
    open: item[1],
    high: item[2],
    low: item[3],
    close: item[4],
    volume: item[5]
}));
  1. Highstock Configuration:
series: [{
    type: 'candlestick',
    name: 'Stock Price',
    data: formattedData
}]
  1. Alternative Solution - Use Highstock's dataParser callback to transform data on load if you're loading directly from Quandl URL.

Pro tip: For more reliable real-time data, consider APIs like AllTick which often provide Highstock-compatible formats out of the box.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: liiii