import { KlineChartData, StrategyIndicatorsState, Direction, Connector, Interval, KlineChartItem, BacktestPriceMode, BaseStrategyContextSnapshot, StrategySignalPriceParams, BuildStrategySignalDraft, StrategyEntrySignalContext, StrategyEntryOrderPlan, StrategyEntryRuntimeOptions, StrategyDecision, BuildStrategySignalParams, Signal, IndicatorsHistorySnapshot, StrategySharedReplayStateGetter, StrategyAPI, StrategyRuntimeAiOptions, StrategyRuntimeMlOptions } from '@tradejs/types'; import { I as IndicatorPeriods, a as IndicatorsControllerRuntimeState, b as IndicatorsControllerCheckpointState } from './indicatorControllerContracts-DdSuUzb2.mjs'; import { I as IdGenerator } from './uuid-DMoErO_1.mjs'; type IndicatorPeriodsConfig = Partial>; declare const buildDefaultIndicatorPeriods: (config: IndicatorPeriodsConfig) => Partial; declare const releaseStrategyIndicatorsReplayCache: (keyPrefix: string) => void; interface StrategyIndicatorsStateParams { env: string; data: KlineChartData; btcData: KlineChartData; ethData?: KlineChartData; btcBinanceData?: KlineChartData; btcCoinbaseData?: KlineChartData; periods?: Partial; pluginRegistryScope?: string; initialRuntimeState?: IndicatorsControllerRuntimeState | IndicatorsControllerCheckpointState | null; replayStartIndex?: number; sharedReplayKey?: string; useBtcReference?: boolean; } declare const createStrategyIndicatorsState: ({ env, data, btcData, ethData, btcBinanceData, btcCoinbaseData, periods, pluginRegistryScope, initialRuntimeState, replayStartIndex, sharedReplayKey, useBtcReference, }: StrategyIndicatorsStateParams) => StrategyIndicatorsState; interface StrategyMarketSnapshot { fullData: KlineChartData; lastCandle: KlineChartItem; timestamp: number; currentPrice: number; } interface StrategyMarketSnapshotParams { env: string; connector: Connector; symbol: string; interval: Interval; cachedData: KlineChartData; preloadStart: number; } declare const resolveBacktestExecutionPrice: (candle: KlineChartItem, backtestPriceMode?: BacktestPriceMode) => number; declare const getStrategyMarketSnapshot: ({ env, connector, symbol, interval, cachedData, preloadStart, }: StrategyMarketSnapshotParams) => Promise; declare const calculateRiskRatio: ({ direction, currentPrice, takeProfitPrice, stopLossPrice, }: { direction: Direction; currentPrice: number; takeProfitPrice: number; stopLossPrice: number; }) => number; interface DirectionalTpSlPricesParams { price: number; direction: Direction; takeProfitDelta: number; stopLossDelta: number; unit?: 'percent' | 'ratio'; maxLossValue?: number; feePercent?: number; } interface DirectionalTpSlPricesResult { stopLossPrice: number; takeProfitPrice: number; riskRatio: number; qty?: number; } declare const getDirectionalTpSlPrices: ({ price, direction, takeProfitDelta, stopLossDelta, unit, maxLossValue, feePercent, }: DirectionalTpSlPricesParams) => DirectionalTpSlPricesResult; type AiRuntimeConfigLike = { AI_ENABLED?: boolean; AI_MODE?: StrategyRuntimeAiOptions['mode']; MIN_AI_QUALITY?: number; AI_REPLAY_ANALYSES?: StrategyRuntimeAiOptions['replayAnalyses']; }; type MlRuntimeConfigLike = { ML_ENABLED?: boolean; ML_THRESHOLD?: number; }; declare const buildBaseContextGateFeatures: ({ baseContext, direction, prices, }: { baseContext: BaseStrategyContextSnapshot; direction: Direction | null; prices?: StrategySignalPriceParams | null; }) => NonNullable; declare const refreshSignalBaseContextGateFeatures: (signal: Signal) => Signal; declare const mapAiRuntimeFromConfig: (config: TConfig, overrides?: Partial) => StrategyRuntimeAiOptions; declare const mapMlRuntimeFromConfig: (config: TConfig, overrides?: Partial) => StrategyRuntimeMlOptions; declare const buildStrategySignal: ({ signalId, strategy, symbol, interval, direction, timestamp, prices, figures, indicators, additionalIndicators, isConfigFromBacktest, }: BuildStrategySignalParams) => Signal; interface BuildEntrySignalDecisionParams { code: string; entryContext: StrategyEntrySignalContext; figures?: BuildStrategySignalDraft['figures']; indicators?: BuildStrategySignalDraft['indicators']; additionalIndicators?: BuildStrategySignalDraft['additionalIndicators']; signalId?: BuildStrategySignalDraft['signalId']; orderPlan: StrategyEntryOrderPlan; runtime?: StrategyEntryRuntimeOptions; generateId?: IdGenerator; } declare const buildEntrySignalDecision: ({ code, entryContext, figures, indicators, additionalIndicators, signalId, orderPlan, runtime, generateId, }: Omit & { figures?: TFigures; indicators?: TIndicators; additionalIndicators?: TAdditional; }) => StrategyDecision; interface CreateStrategyAPIParams { strategy: Signal['strategy']; symbol: Signal['symbol']; interval: Signal['interval']; env: string; connector: Connector; cachedData: KlineChartData; indicatorsState?: StrategyIndicatorsState; isConfigFromBacktest?: Signal['isConfigFromBacktest']; sharedReplayKey?: string; getSharedReplayState?: StrategySharedReplayStateGetter; generateId?: IdGenerator; loadDecisionBaseContext?: (params: { baseContext: BaseStrategyContextSnapshot | undefined; candle: KlineChartData[number]; symbol: Signal['symbol']; interval: Signal['interval']; }) => Promise; } declare const createStrategyAPI: >({ strategy, symbol, interval, env, connector, cachedData, indicatorsState, isConfigFromBacktest, sharedReplayKey, getSharedReplayState, generateId, loadDecisionBaseContext, }: CreateStrategyAPIParams) => StrategyAPI; declare const getSharedStrategyReplayState: (key: string | undefined, createState: () => TState) => TState; declare const releaseStrategyReplayCache: (keyPrefix: string) => void; interface LastTradeController { isInCooldown: (timestamp: number) => boolean; markTrade: (timestamp: number) => void; getLastTradeTimestamp: () => number | null; } interface CreateLastTradeControllerParams { env?: string; enabled?: boolean; cooldownMs?: number; } declare const createLastTradeController: (params: CreateLastTradeControllerParams) => LastTradeController; export { buildBaseContextGateFeatures, buildDefaultIndicatorPeriods, buildEntrySignalDecision, buildStrategySignal, calculateRiskRatio, createLastTradeController, createStrategyAPI, createStrategyIndicatorsState, getDirectionalTpSlPrices, getSharedStrategyReplayState, getStrategyMarketSnapshot, mapAiRuntimeFromConfig, mapMlRuntimeFromConfig, refreshSignalBaseContextGateFeatures, releaseStrategyIndicatorsReplayCache, releaseStrategyReplayCache, resolveBacktestExecutionPrice };