pub struct Account {
pub id: String,
pub name: String,
pub exchange_account_id: String,
pub allocation: Allocation,
pub balance_interval_secs: u64,
pub order_delay_ms: u64,
pub min_trade_percent: Decimal,
pub tolerance_percent: Decimal,
}Expand description
Configuration for a trading account.
Fields§
§id: StringUnique account identifier within the user.
name: StringHuman-readable account name.
exchange_account_id: StringExchange account ID (from broker’s system).
allocation: AllocationTarget portfolio allocation for this account.
balance_interval_secs: u64Rebalancing interval in seconds.
order_delay_ms: u64Delay between orders in milliseconds.
min_trade_percent: DecimalMinimum trade percentage threshold.
tolerance_percent: DecimalTolerance for considering allocation balanced.
Implementations§
Source§impl Account
impl Account
Sourcepub fn new(id: impl Into<String>, allocation: Allocation) -> Self
pub fn new(id: impl Into<String>, allocation: Allocation) -> Self
Creates a new account with the given ID and allocation.
Sourcepub fn with_exchange_id(self, id: impl Into<String>) -> Self
pub fn with_exchange_id(self, id: impl Into<String>) -> Self
Sets the exchange account ID.
Sourcepub fn with_balance_interval(self, secs: u64) -> Self
pub fn with_balance_interval(self, secs: u64) -> Self
Sets the balance interval.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Account
impl<'de> Deserialize<'de> for Account
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 Account
impl Freeze for Account
impl Move for Account
impl RefUnwindSafe for Account
impl Send for Account
impl Sync for Account
impl Unpin for Account
impl UnsafeUnpin for Account
impl UnwindSafe for Account
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