/** * Build initial DslState from position.opened event and resolved preset. */ import type { DslCreatedTriggerReason, DslPluginConfig, DslState, PositionOpenedEvent } from "../../types/dsl/index.js"; /** * The announced-stop state carried over from the state being rebuilt * (increase / decrease / resize / adopt). All three fields move together and are * omitted together — they are one logical unit describing "what the user has * already been told about this stop", and carrying a subset is worse than * carrying none: a floor without its latch re-announces breakeven on the next * raise, and a floor without its timestamp re-opens the cooldown. * * Omitted for a fresh open, and for a direction FLIP — the favorable polarity * inverts, so an old LONG floor is meaningless to a new SHORT, and the flip is a * different trade whose breakeven has not been crossed yet. */ export interface NotifiedStopCarry { /** Last ANNOUNCED stop floor; suppresses a re-announce after a retreat. */ lastNotifiedStopFloor?: number; /** Wall-clock of the last announcement; anchors the trail cooldown. */ lastNotifiedStopAtMs?: number; /** Breakeven latch; once true the "you can no longer lose" push is spent. */ stopBreakevenAnnounced?: boolean; } export declare function phase1FloorFromPreset(entryPrice: number, direction: string, maxLossPct: number, leverage: number): number; export declare function buildInitialState(event: PositionOpenedEvent, preset: DslPluginConfig["presets"][string], phase1Floor: number, triggerReason: DslCreatedTriggerReason, carry?: NotifiedStopCarry): DslState; //# sourceMappingURL=initial-state.d.ts.map