Stock data helpers

Helpers for loading, validating, and normalizing OHLCV data.

Import
import { loadOHLCVFromCSV } from "@sixtyfold/stock";

Use the public entry point shown above.

loadOHLCVFromCSV

Loads an OHLCV CSV file and returns aligned typed-array columns.

Import @sixtyfold/stockfunction

loadOHLCVFromCSV: (url: string, onProgress?: (progress: number) => void) => Promise<OHLCVData>

Throws:

  • Error when the request returns a non-successful HTTP status.

normalizeOHLCVData

Validates OHLCV columns and normalizes descending timestamps to ascending order.

Import @sixtyfold/stockfunction

normalizeOHLCVData: (data: OHLCVData) => OHLCVData