import type { AuxSeriesKind, BacktestContextOptions, BacktestContextResult, Bar, MaValues, OiOhlc, ParamValue, PendingOrder, Position, PositionOptions, Strategy, TradingEnv } from "../types"; export declare class StrategyRuntimeContext implements TradingEnv { private positionById; private nextPositionId; private commissionByPositionId; private displayByPositionId; private fundingByPositionId; private balance; private tradeList; private equityList; private barHistory; private currentBarIndex; private currentBar; private pendingOrderList; private nextOrderId; private readonly commission; private totalCommission; private totalFunding; private readonly fundingRateList; private fundingIndex; private readonly applyFundingCost; private readonly params; private readonly rawConfig; private strategy; private eventList; private readonly auxSeriesData; private readonly auxHistoryByKind; private readonly oiOhlcHistory; private readonly oiOhlcByTime; private readonly oiProvider; private readonly timeframeStoreByRes; private readonly maValuesByResolution; private readonly volume24hByResolution; private mainResolution; constructor(initialBalance: number, options?: BacktestContextOptions); setStrategy(strategy: Strategy): void; setMainResolution(resolution: string): void; /** * Inject one open-interest OHLC candle (coins) for a bar time. Used by live/paper * runners that receive open interest incrementally per closed bar; must be called * before `processBar` for that bar so `getOiOhlc()/getOiOhlcHistory()` see it. */ setOiOhlc(time: number, oiBar: OiOhlc): void; setMaValuesForResolution(resolution: string, mapByTime: Map): void; setVolume24hForResolution(resolution: string, mapByTime: Map): void; getVolume24h(resolution?: string): number | null; openLong(sizeUsd: number, options?: PositionOptions): void; openShort(sizeUsd: number, options?: PositionOptions): void; closeLong(): void; closeShort(): void; placeLimitOrder(side: "buy" | "sell", price: number, amountUsd: number): string; cancelOrder(orderId: string): boolean; cancelAllOrders(): void; modifyOrderPrice(orderId: string, newPrice: number): boolean; getPendingOrderList(): PendingOrder[]; getPosition(positionId?: string): Position | null; getPositionList(): Position[]; closePosition(positionId?: string, exitReason?: string): void; closeAllPositions(exitReason?: string): void; setStopLoss(positionIdOrPrice: string | number, price?: number, reason?: string): void; setTakeProfit(positionId: string, price: number, reason?: string): void; getBalance(): number; getBarIndex(): number; getCurrentBar(): Bar; getHistory(count: number, resolution?: string): Bar[]; getOiClose(resolution?: string): number | null; getOiOhlc(resolution?: string): OiOhlc | null; getOiOhlcHistory(count: number, resolution?: string): Array; getLiqLongUsd(resolution?: string): number | null; getLiqShortUsd(resolution?: string): number | null; getLongShortRatio(resolution?: string): number | null; getCurrentFundingRate(): number | null; getRecentFundingRates(count: number): number[]; getAuxHistory(series: AuxSeriesKind, count: number, resolution?: string): Array; getMaValues(resolution: string): MaValues; getParam(key: string, defaultValue: T): T; getConfig(): Record; emitEvent(type: string, data: Record): void; setPositionTag(positionId: string, tag: string): void; setPositionDisplay(positionId: string, data: Record): void; processBar(bar: Bar, _maValues?: MaValues): void; private advanceTimeframeStores; forceCloseAll(): void; getResult(): BacktestContextResult; private updateRunningBest; private getAuxMapByKind; private lookupAuxOnCurrentBar; private lookupAuxForResolution; private requireTimeframeStore; private pushAuxHistoryFor; private getPositionById; private tryTriggerStopLoss; private checkStopLoss; private checkEntryBarStopLoss; private checkPendingOrders; private fillOrder; private applyFunding; private openPositionAtMarket; private closeBySignal; private calcPnl; private closePositionById; private getEffectiveBalance; } //# sourceMappingURL=strategy-runtime-context.d.ts.map