Sign in

    vectie/moonfish/domain does not have a README file

    RunId

    type RunId = String

    SourceId

    type SourceId = String

    StrategyFile

    type StrategyFile = String

    Symbol

    type Symbol = String

    Timeframe

    type Timeframe = String

    AnalysisRecord

    pub(all) struct AnalysisRecord {
    run_id : String
    snapshot : KlineSnapshot
    stage1 : Stage1Diagnosis?
    stage2 : Stage2Decision?
    validation : Array[ValidationReport]
    status : RoutineStatus
    } derive(Eq, ToJson,
    Debug
    ,
    FromJson
    )

    AnalysisRecord::persisted

    AnalysisRecord::with_stage1

    fn AnalysisRecord::with_stage1(self : AnalysisRecord, stage1 : Stage1Diagnosis) -> AnalysisRecord

    AnalysisRecord::with_stage2

    fn AnalysisRecord::with_stage2(self : AnalysisRecord, stage2 : Stage2Decision) -> AnalysisRecord

    AnalysisRecord::with_validation

    fn AnalysisRecord::with_validation(self : AnalysisRecord, report : ValidationReport) -> AnalysisRecord

    CyclePosition

    pub(all) enum CyclePosition {
    Spike
    MicroChannel
    TightChannel
    NormalChannel
    BroadChannel
    TrendingRange
    TradingRange
    ExtremeRange
    UnknownCycle
    } derive(Eq, ToJson,
    Debug
    ,
    FromJson
    )

    DataSource

    pub(all) enum DataSource {
    TradingView
    Mt5
    Yfinance
    AkShare
    Fixture
    } derive(Eq, ToJson,
    Debug
    ,
    FromJson
    )

    DecisionAction

    pub(all) enum DecisionAction {
    NoOrder
    Wait
    LimitOrder
    BreakoutOrder
    MarketOrder
    } derive(Eq, ToJson,
    Debug
    ,
    FromJson
    )

    Direction

    pub(all) enum Direction {
    Bullish
    Bearish
    Neutral
    } derive(Eq, ToJson,
    Debug
    ,
    FromJson
    )

    KlineBar

    pub(all) struct KlineBar {
    seq : Int
    open : Double
    high : Double
    low : Double
    close : Double
    volume : Double
    closed : Bool
    } derive(Eq, ToJson,
    Debug
    ,
    FromJson
    )

    KlineSnapshot

    pub(all) struct KlineSnapshot {
    source_id : String
    data_source : DataSource
    symbol : String
    timeframe : String
    captured_at_ms : Int64
    bars : Array[KlineBar]
    } derive(Eq, ToJson,
    Debug
    ,
    FromJson
    )

    KlineSnapshot::closed_bar_count

    fn KlineSnapshot::closed_bar_count(self : KlineSnapshot) -> Int

    MarketFeatureFrame

    pub(all) struct MarketFeatureFrame {
    source_id : String
    closed_bar_count : Int
    atr : Double?
    ema_fast : Double?
    ema_slow : Double?
    warmup_complete : Bool
    } derive(Eq, ToJson,
    Debug
    ,
    FromJson
    )

    MarketPhase

    pub(all) enum MarketPhase {
    Stable
    Transitioning
    } derive(Eq, ToJson,
    Debug
    ,
    FromJson
    )

    PatternTag

    pub(all) enum PatternTag {
    Wedge
    ReversalAttempt
    MajorTrendReversal
    FinalFlag
    H1
    H2
    L1
    L2
    BreakoutTest
    BreakoutPullback
    BreakoutFailure
    AlwaysIn
    Barbwire
    Overlap
    MiddleRange
    FailedSignal
    Triangle
    DoubleTopBottom
    MeasuredMove
    UnknownPattern(String)
    } derive(Eq, ToJson,
    Debug
    ,
    FromJson
    )

    RoutineStatus

    pub(all) enum RoutineStatus {
    Planned
    AwaitingModel
    Validating
    Persisted
    Failed(String)
    } derive(Eq, ToJson,
    Debug
    ,
    FromJson
    )

    Stage1Diagnosis

    pub(all) struct Stage1Diagnosis {
    cycle_position : CyclePosition
    direction : Direction
    confidence : Int
    market_phase : MarketPhase
    patterns : Array[PatternTag]
    key_signals : Array[String]
    strategy_files_needed : Array[String]
    } derive(Eq, ToJson,
    Debug
    ,
    FromJson
    )

    Stage1FeatureHints

    pub(all) struct Stage1FeatureHints {
    cycle_bias : CyclePosition
    direction_bias : Direction
    pattern_hints : Array[PatternTag]
    notes : Array[String]
    } derive(Eq, ToJson,
    Debug
    ,
    FromJson
    )

    Stage2Decision

    pub(all) struct Stage2Decision {
    action : DecisionAction
    confidence : Int
    rationale : String
    risk_notes : Array[String]
    } derive(Eq, ToJson,
    Debug
    ,
    FromJson
    )

    StructureLevel

    pub(all) struct StructureLevel {
    kind : StructureLevelKind
    price : Double
    touches : Int
    latest_seq : Int
    label : String
    } derive(Eq, ToJson,
    Debug
    ,
    FromJson
    )

    StructureLevelFrame

    pub(all) struct StructureLevelFrame {
    source_id : String
    support_levels : Array[StructureLevel]
    resistance_levels : Array[StructureLevel]
    midline : StructureLevel?
    summary : String
    } derive(Eq, ToJson,
    Debug
    ,
    FromJson
    )

    StructureLevelKind

    pub(all) enum StructureLevelKind {
    SupportLevel
    ResistanceLevel
    MidlineLevel
    } derive(Eq, ToJson,
    Debug
    ,
    FromJson
    )

    ValidationIssue

    pub(all) struct ValidationIssue {
    severity : ValidationSeverity
    path : String
    message : String
    } derive(Eq, ToJson,
    Debug
    ,
    FromJson
    )

    ValidationReport

    pub(all) struct ValidationReport {
    ok : Bool
    issues : Array[ValidationIssue]
    } derive(Eq, ToJson,
    Debug
    ,
    FromJson
    )

    ValidationSeverity

    pub(all) enum ValidationSeverity {
    Info
    Warning
    Error
    } derive(Eq, ToJson,
    Debug
    ,
    FromJson
    )

    empty_analysis_record

    fn empty_analysis_record(run_id : String, snapshot : KlineSnapshot) -> AnalysisRecord

    kline_bar

    fn kline_bar(seq : Int, open : Double, high : Double, low : Double, close : Double, volume? : Double, closed? : Bool) -> KlineBar

    kline_snapshot

    fn kline_snapshot(source_id : String, data_source : DataSource, symbol : String, timeframe : String, captured_at_ms : Int64, bars : Array[KlineBar]) -> KlineSnapshot

    market_feature_frame

    fn market_feature_frame(source_id : String, closed_bar_count : Int, atr : Double?, ema_fast : Double?, ema_slow : Double?, warmup_complete? : Bool) -> MarketFeatureFrame

    stage1_diagnosis

    fn stage1_diagnosis(cycle_position : CyclePosition, direction : Direction, confidence : Int, market_phase : MarketPhase, patterns : Array[PatternTag], key_signals? : Array[String], strategy_files_needed? : Array[String]) -> Stage1Diagnosis

    stage1_feature_hints

    fn stage1_feature_hints(cycle_bias : CyclePosition, direction_bias : Direction, pattern_hints : Array[PatternTag], notes? : Array[String]) -> Stage1FeatureHints

    stage2_decision

    fn stage2_decision(action : DecisionAction, confidence : Int, rationale : String, risk_notes? : Array[String]) -> Stage2Decision

    structure_level

    fn structure_level(kind : StructureLevelKind, price : Double, touches : Int, latest_seq : Int, label : String) -> StructureLevel

    structure_level_frame

    fn structure_level_frame(source_id : String, support_levels : Array[StructureLevel], resistance_levels : Array[StructureLevel], midline? : StructureLevel, summary? : String) -> StructureLevelFrame

    validation_error

    fn validation_error(path : String, message : String) -> ValidationReport

    validation_issue

    fn validation_issue(severity : ValidationSeverity, path : String, message : String) -> ValidationIssue

    validation_ok

    fn validation_ok() -> ValidationReport