1.0.0 • Published 1 year ago

typesex-candlestick v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Candlestick Type for TypeScript

Standardized Candlestick type for TypeScript.

npm install typesex-candlestick
PropertyTypeDescription
timestampnumberThe timestamp of the candlestick, represented as a POSIX timestamp.
opennumberThe opening price of the candlestick.
highnumberThe highest price reached during the candlestick's time period.
lownumberThe lowest price reached during the candlestick's time period.
closenumberThe closing price of the candlestick.
volumenumberThe total quantity of the asset traded during the candlestick's time period.
turnovernumberThe total value of the asset traded shares during the candlestick's time period.

Note: This package uses JavaScript's number type for all numeric values. Please be aware that the number type can lead to precision issues in financial calculations due to floating-point arithmetic. If high precision is required, consider using a library like decimal.js or BigNumber.js.

Usage

import Candlestick from 'typesex-candlestick';

const candlestick: Candlestick = {
  timestamp: 1617187200, // POSIX timestamp
  open: 58730.13,
  high: 59712.31,
  low: 58600.01,
  close: 59000.00,
  volume: 103.345,
  turnover: 6123456.78
};
1.0.0

1 year ago