import { KlineChartItem, DerivativesRow, DerivativesInterval, Direction, DerivativesContext, Candle, MlCandleIndicatorsSnapshot, IndicatorSnapshot, IndicatorsHistorySnapshot, IndicatorPluginRenderer, Indicator, IndicatorPluginEntry, TrendLine, TrendLineOptions } from '@tradejs/types'; import { I as IndicatorPeriods, a as IndicatorsControllerRuntimeState, b as IndicatorsControllerCheckpointState } from './indicatorControllerContracts-DdSuUzb2.mjs'; export { c as IndicatorRuntimeState, P as PricePoint, S as SpreadSmootherState, d as alignSpreadRows, e as coinbaseProductFromSymbol, f as createSerializableSpreadSmoother, g as createSpreadSmoother, i as intervalToMs, r as rollingMeanStd, s as smoothSpreadSeries } from './indicatorControllerContracts-DdSuUzb2.mjs'; import { KLineData } from 'klinecharts'; /** * Выравнивает два отсортированных массива свечей по timestamp. * Оставляет только те свечи, которые есть в обоих массивах. */ declare const alignSortedCandlesByTimestamp: (coinCandles: KlineChartItem[], btcCandles: KlineChartItem[]) => { alignedCoinCandles: KlineChartItem[]; alignedBtcCandles: KlineChartItem[]; }; /** Строим массив доходностей по close: (close[i] - close[i-1]) / close[i-1] */ declare const buildReturnsFromCandles: (candles: KlineChartItem[]) => number[]; /** Корреляция Пирсона между двумя числовыми рядами одинаковой длины */ declare const calculatePearsonCorrelation: (firstSeries: number[], secondSeries: number[]) => number | null; /** * Полный пайплайн: * 1) выравниваем свечи монеты и BTC по timestamp * 2) считаем доходности * 3) считаем корреляцию доходностей */ declare const calculateCoinBtcCorrelation: (coinCandles: KlineChartItem[], btcCandles: KlineChartItem[]) => { correlation: number | null; alignedCoinCandles: KlineChartItem[]; alignedBtcCandles: KlineChartItem[]; coinReturns: number[]; btcReturns: number[]; }; type CoinalyzePoint = { symbol: string; ts: number; openInterest?: number | null; fundingRate?: number | null; liqLong?: number | null; liqShort?: number | null; liqTotal?: number | null; }; declare const COINALYZE_MIN_INTRADAY_RETENTION_POINTS = 1500; declare const getLastClosedDerivativesBarStartMs: (timestamp: number, interval: DerivativesInterval) => number; declare const resolveCoinalyzeConfirmedIntradayCoverage: (params: { interval: DerivativesInterval; fromMs: number; toMs: number; nowMs?: number; }) => { fromMs: number; toMs: number; } | null; declare const normalizeCoinalyzeSymbols: (input: unknown) => string[]; declare const normalizeDerivativesIntervals: (input: unknown) => DerivativesInterval[]; declare const toCoinalyzeTimestampMs: (value: unknown) => number | null; declare const toFiniteNumber: (value: unknown) => number | null; declare const toArrayData: (value: unknown) => T[]; declare const mergeCoinalyzeMetrics: (params: { symbol: string; oiRaw: unknown; fundingRaw: unknown; liqRaw: unknown; }) => CoinalyzePoint[]; declare const coinalyzePointsToRows: (points: CoinalyzePoint[], interval: DerivativesInterval, source: string) => DerivativesRow[]; declare const deriveCoinalyzeHourlyRowsFrom15m: (rows: DerivativesRow[] | undefined) => DerivativesRow[]; declare const deriveCoinalyzeRollingHourlyRowsFrom15m: (rows: DerivativesRow[] | undefined) => DerivativesRow[]; declare const buildCoinalyzeHourlyRowsWithFallback: (params: { rows15m: DerivativesRow[] | undefined; fallbackRows1h: DerivativesRow[] | undefined; }) => DerivativesRow[]; declare const buildDerivativesContext: (params: { symbol: string; direction: Direction; timestamp: number; rowsByInterval: Partial>; priceChangePct1h?: number | null; intervals?: DerivativesInterval[]; staleAfterMsByInterval?: Partial>; }) => DerivativesContext; declare const buildMlCandleIndicators: (candles: Candle[], btcCandles: Candle[]) => MlCandleIndicatorsSnapshot; type IndicatorValue = number | null | undefined; type TrendlineIndicatorHistoryPush = (key: string, value: number | null | undefined) => void; declare const getRequiredControllerSeedWindow: (periods?: Partial) => number; type TrendlineIndicators = { maFast: IndicatorValue; maMedium: IndicatorValue; maSlow: IndicatorValue; atr: IndicatorValue; atrPct: IndicatorValue; bbUpper: IndicatorValue; bbMiddle: IndicatorValue; bbLower: IndicatorValue; obv: IndicatorValue; smaObv: IndicatorValue; macd: IndicatorValue; macdSignal: IndicatorValue; macdHistogram: IndicatorValue; price24hPcnt: IndicatorValue; price1hPcnt: IndicatorValue; highPrice1h: IndicatorValue; lowPrice1h: IndicatorValue; volume1h: IndicatorValue; highPrice24h: IndicatorValue; lowPrice24h: IndicatorValue; volume24h: IndicatorValue; highLevel: IndicatorValue; lowLevel: IndicatorValue; prevClose: IndicatorValue; correlation: IndicatorValue; spread: IndicatorValue; }; type CreateIndicatorsOptions = { includeMlPayload?: boolean; runtimeOnly?: boolean; ethData?: Candle[]; btcBinanceData?: Candle[]; btcCoinbaseData?: Candle[]; pluginRegistryScope?: string; initialRuntimeState?: IndicatorsControllerRuntimeState | IndicatorsControllerCheckpointState; }; declare const COMPACT_INDICATORS_SNAPSHOT_SYMBOL: unique symbol; declare const COMPACT_INDICATORS_SNAPSHOT_KEY = "__tradejsCompactIndicatorsSnapshot"; declare const applyIndicatorsToHistory: (indicators: TrendlineIndicators, pushIndicator: TrendlineIndicatorHistoryPush) => void; declare const createIndicators: (data: Candle[], btcData?: Candle[], options?: CreateIndicatorsOptions & { periods?: Partial; }) => { next: (candle: Candle, btcCandle?: Candle, ethCandle?: Candle) => IndicatorSnapshot | null; updateReferenceData: ({ btcBinanceData, btcCoinbaseData, }: { btcBinanceData?: Candle[]; btcCoinbaseData?: Candle[]; }) => void; snapshot: (options?: { compact?: boolean; limit?: number; }) => IndicatorsHistorySnapshot; checkpointRuntimeState: () => IndicatorsControllerCheckpointState; latestSnapshot: () => IndicatorSnapshot | null; runtimeState: () => IndicatorsControllerRuntimeState; latestNumber: (key: string) => number | undefined; latestNumbers: (key: string, count: number) => number[]; result: () => IndicatorsHistorySnapshot; }; declare const buildMlTimeframeIndicators: (candles: Candle[], periods?: Partial) => Record; declare const registerIndicatorEntries: (entries: readonly IndicatorPluginEntry[], source: string, scope?: string) => void; declare const getRegisteredIndicatorEntries: (scope?: string) => IndicatorPluginEntry[]; declare const getPluginIndicatorCatalog: (scope?: string) => Indicator[]; type IndicatorRendererDescriptor = { indicatorId: string; renderer: IndicatorPluginRenderer; }; declare const getPluginIndicatorRenderers: (scope?: string) => IndicatorRendererDescriptor[]; declare const resetIndicatorRegistryCache: (scope?: string) => void; type Level = { id: string; price: number; }; /** находим локальные минимумы (поддержка) и максимумы (сопротивление) */ declare const detectRawSupportResistance: (data: KLineData[], lookAround?: number) => { supports: number[]; resistances: number[]; }; /** итоговый вывод (поддержка/сопротивление) с id */ declare const getSupportResistanceLevels: (data: KLineData[]) => { supportLevels: Level[]; resistanceLevels: Level[]; }; type TrendlineEngine = { next: (candle: KLineData) => TrendLine[]; nextMany: (candles: KLineData[]) => TrendLine[]; reset: () => void; getLines: () => TrendLine[]; }; declare const createTrendlineEngine: (initialCandles: KLineData[], options: TrendLineOptions) => TrendlineEngine; export { COINALYZE_MIN_INTRADAY_RETENTION_POINTS, COMPACT_INDICATORS_SNAPSHOT_KEY, COMPACT_INDICATORS_SNAPSHOT_SYMBOL, type CoinalyzePoint, IndicatorPeriods, type IndicatorRendererDescriptor, IndicatorsControllerCheckpointState, IndicatorsControllerRuntimeState, type TrendlineEngine, alignSortedCandlesByTimestamp, applyIndicatorsToHistory, buildCoinalyzeHourlyRowsWithFallback, buildDerivativesContext, buildMlCandleIndicators, buildMlTimeframeIndicators, buildReturnsFromCandles, calculateCoinBtcCorrelation, calculatePearsonCorrelation, coinalyzePointsToRows, createIndicators, createTrendlineEngine, deriveCoinalyzeHourlyRowsFrom15m, deriveCoinalyzeRollingHourlyRowsFrom15m, detectRawSupportResistance, getLastClosedDerivativesBarStartMs, getPluginIndicatorCatalog, getPluginIndicatorRenderers, getRegisteredIndicatorEntries, getRequiredControllerSeedWindow, getSupportResistanceLevels, mergeCoinalyzeMetrics, normalizeCoinalyzeSymbols, normalizeDerivativesIntervals, registerIndicatorEntries, resetIndicatorRegistryCache, resolveCoinalyzeConfirmedIntradayCoverage, toArrayData, toCoinalyzeTimestampMs, toFiniteNumber };