pub struct AgentState {Show 23 fields
pub agent_id: String,
pub last_tick: Option<DateTime<Utc>>,
pub trades_today: u32,
pub trades_day: Option<NaiveDate>,
pub open_positions: HashMap<String, TrackedPosition>,
pub last_actions: Vec<AgentAction>,
pub pending_order_ids: Vec<String>,
pub pending_orders: Vec<PendingOrder>,
pub tick_count: u64,
pub last_llm_review_tick: Option<u64>,
pub llm_review_count: u64,
pub last_llm_summary: Option<Value>,
pub last_session: Option<String>,
pub regular_tick_count: u64,
pub last_overnight_digest_at: Option<DateTime<Utc>>,
pub open_playbook: Option<Value>,
pub last_market_open: Option<bool>,
pub last_auth_reminder_level: Option<String>,
pub last_auth_reminder_at: Option<DateTime<Utc>>,
pub last_telegram_llm_at: Option<DateTime<Utc>>,
pub last_telegram_llm_digest_key: Option<String>,
pub sim: Option<SimLedger>,
pub redeploy_signal: Option<RedeploySignal>,
}Fields§
§agent_id: String§last_tick: Option<DateTime<Utc>>§trades_today: u32§trades_day: Option<NaiveDate>§open_positions: HashMap<String, TrackedPosition>§last_actions: Vec<AgentAction>§pending_order_ids: Vec<String>§pending_orders: Vec<PendingOrder>§tick_count: u64§last_llm_review_tick: Option<u64>§llm_review_count: u64§last_llm_summary: Option<Value>§last_session: Option<String>§regular_tick_count: u64§last_overnight_digest_at: Option<DateTime<Utc>>§open_playbook: Option<Value>§last_market_open: Option<bool>Last EQO regular-session open flag from agent tick (Schwab hours).
last_auth_reminder_level: Option<String>§last_auth_reminder_at: Option<DateTime<Utc>>§last_telegram_llm_at: Option<DateTime<Utc>>Last LLM review pushed to Telegram (for digest dedup).
last_telegram_llm_digest_key: Option<String>§sim: Option<SimLedger>Paper-trading ledger when running with –simulate (separate state file).
redeploy_signal: Option<RedeploySignal>Set after a thesis-driven exit — prioritizes redeploy scan on this underlying.
Implementations§
Source§impl AgentState
impl AgentState
pub fn reset_daily_if_needed(&mut self, today: NaiveDate)
pub fn record_action(&mut self, action: &str, detail: Value)
pub fn count_open_for_strategy( &self, account_hash: &str, strategy: StrategyKind, ) -> u32
pub fn pending_entry_count(&self) -> u32
pub fn pending_count(&self) -> usize
pub fn trades_capacity_used(&self) -> u32
pub fn open_risk_usd(&self) -> f64
pub fn pending_entry_risk_usd(&self) -> f64
pub fn reserved_risk_usd(&self) -> f64
pub fn has_pending_position(&self, position_id: &str) -> bool
pub fn add_pending_order(&mut self, pending: PendingOrder)
pub fn remove_pending_order(&mut self, order_id: &str) -> Option<PendingOrder>
pub fn clear_legacy_pending_ids(&mut self)
pub fn total_contracts(&self) -> u32
Trait Implementations§
Source§impl Clone for AgentState
impl Clone for AgentState
Source§fn clone(&self) -> AgentState
fn clone(&self) -> AgentState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AgentState
impl Debug for AgentState
Source§impl Default for AgentState
impl Default for AgentState
Source§fn default() -> AgentState
fn default() -> AgentState
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AgentState
impl<'de> Deserialize<'de> for AgentState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AgentState
impl RefUnwindSafe for AgentState
impl Send for AgentState
impl Sync for AgentState
impl Unpin for AgentState
impl UnsafeUnpin for AgentState
impl UnwindSafe for AgentState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more