typesex-candlestick
v1.0.0
Published
Standardized candlestick for TypeScript
Downloads
3
Readme
Candlestick Type for TypeScript
Standardized Candlestick
type for TypeScript.
npm install typesex-candlestick
| Property | Type | Description |
|-----------|--------|-------------|
| timestamp | number
| The timestamp of the candlestick, represented as a POSIX timestamp. |
| open | number
| The opening price of the candlestick. |
| high | number
| The highest price reached during the candlestick's time period. |
| low | number
| The lowest price reached during the candlestick's time period. |
| close | number
| The closing price of the candlestick. |
| volume | number
| The total quantity of the asset traded during the candlestick's time period. |
| turnover | number
| The 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
};