Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,276 changes: 338 additions & 1,938 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,13 @@
"astring": "^1.9.0"
},
"devDependencies": {
"typescript": "~5.9.3",
"@rollup/plugin-commonjs": "^29.0.0",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^16.0.3",
"@types/react": "^19.2.10",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^5.1.2",
"@vitest/coverage-v8": "^2.0.0",
"@vitest/coverage-v8": "^4.1.0",
"autoprefixer": "^10.4.23",
"badgen": "^3.2.3",
"cross-env": "^7.0.3",
Expand All @@ -99,9 +98,10 @@
"rollup-plugin-typescript-paths": "^1.5.0",
"tailwindcss": "^4.1.18",
"tsx": "^4.21.0",
"typescript": "~5.9.3",
"vite": "^7.3.1",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^2.0.0"
"vitest": "^4.1.0"
},
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions src/PineTS.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ export class PineTS {
const _ohlc4 = marketData.map((d) => (d.high + d.low + d.open + d.close) / 4);
const _hlcc4 = marketData.map((d) => (d.high + d.low + d.close + d.close) / 4);
const _openTime = marketData.map((d) => d.openTime);
// Providers should supply closeTime in TV convention (= next bar open).
// Providers should supply closeTime as session close time (TV convention).
// Safety-net for array-based data or providers that omit closeTime:
// estimate as openTime + timeframe duration.
// estimate as openTime + timeframe duration (accurate for 24/7 crypto).
const tfDurationMs = getTimeframeDurationMs(this.timeframe);
const _closeTime = marketData.map((d) =>
d.closeTime != null ? d.closeTime : d.openTime + tfDurationMs
Expand Down
12 changes: 12 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,16 @@ import { Provider } from './marketData/Provider.class';
import { Indicator } from './Indicator';
import { PineRuntimeError } from './errors/PineRuntimeError';

// Provider classes for direct instantiation
export { BaseProvider } from './marketData/BaseProvider';
export { BinanceProvider } from './marketData/Binance/BinanceProvider.class';
export { FMPProvider } from './marketData/FMP/FMPProvider.class';
export { AlpacaProvider } from './marketData/Alpaca/AlpacaProvider.class';

// Provider types
export type { IProvider, ISymbolInfo, BaseProviderConfig, ApiKeyProviderConfig } from './marketData/IProvider';
export type { Kline, PeriodType } from './marketData/types';
export { computeNextPeriodStart, localTimeToUTC, computeSessionClose, TIMEFRAME_SECONDS, TIMEFRAME_PERIOD_INFO } from './marketData/types';
export { aggregateCandles, selectSubTimeframe, getAggregationRatio } from './marketData/aggregation';

export { PineTS, Context, Provider, Indicator, PineRuntimeError };
Loading
Loading