Skip to main content

decide_from_signals

Function decide_from_signals 

Source
pub fn decide_from_signals(
    signal_summary: &SignalSummary,
    playbook: &Playbook,
    current_position_side: Option<&str>,
    current_entry_price: Option<f64>,
    current_price: Option<f64>,
) -> RuleDecision
Expand description

Produce a deterministic order decision from evaluated signals.

Logic:

  1. Collect all triggered rules with their actions.
  2. Count buy vs sell votes.
  3. Majority wins. Ties → hold.
  4. Check stop-loss / take-profit if position exists.