pub struct AccountConfig {Show 14 fields
pub id: String,
pub name: String,
pub exchange: String,
pub exchange_account_id: String,
pub token_env_var: String,
pub desired_allocation: HashMap<String, Decimal>,
pub allocation_mode: AllocationMode,
pub balance_interval_secs: u64,
pub order_delay_ms: u64,
pub margin: MarginConfig,
pub market_closure_behavior: MarketClosureBehavior,
pub min_profit_percent_for_close: Option<Decimal>,
pub min_trade_percent: Decimal,
pub tolerance_percent: Decimal,
}Expand description
Configuration for a single trading account.
Fields§
§id: StringUnique account identifier.
name: StringHuman-readable account name.
exchange: StringExchange/broker identifier.
exchange_account_id: StringExchange account ID (from broker).
token_env_var: StringAPI token environment variable name (not the actual token).
desired_allocation: HashMap<String, Decimal>Desired wallet allocation.
allocation_mode: AllocationModeAllocation mode.
balance_interval_secs: u64Rebalancing interval in seconds.
order_delay_ms: u64Delay between orders in milliseconds.
margin: MarginConfigMargin trading configuration.
market_closure_behavior: MarketClosureBehaviorBehavior when market is closed.
min_profit_percent_for_close: Option<Decimal>Minimum profit percentage for closing positions.
min_trade_percent: DecimalMinimum trade percentage threshold.
tolerance_percent: DecimalTolerance for considering allocation balanced.
Implementations§
Source§impl AccountConfig
impl AccountConfig
Sourcepub fn to_desired_allocation(&self) -> DesiredAllocation
pub fn to_desired_allocation(&self) -> DesiredAllocation
Converts the desired allocation to a DesiredAllocation instance.
Sourcepub fn to_balancer_config(&self) -> BalancerConfig
pub fn to_balancer_config(&self) -> BalancerConfig
Converts to a BalancerConfig.
Trait Implementations§
Source§impl Clone for AccountConfig
impl Clone for AccountConfig
Source§impl Debug for AccountConfig
impl Debug for AccountConfig
Source§impl<'de> Deserialize<'de> for AccountConfig
impl<'de> Deserialize<'de> for AccountConfig
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 Forget for AccountConfig
impl Freeze for AccountConfig
impl Move for AccountConfig
impl RefUnwindSafe for AccountConfig
impl Send for AccountConfig
impl Sync for AccountConfig
impl Unpin for AccountConfig
impl UnsafeUnpin for AccountConfig
impl UnwindSafe for AccountConfig
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