pub struct PortfolioConfigBuilder<S: State = Empty> { /* private fields */ }Expand description
Use builder syntax to set the inputs and finish with build_inner().
Implementations§
Source§impl<S: State> PortfolioConfigBuilder<S>
impl<S: State> PortfolioConfigBuilder<S>
Sourcepub fn use_mark_prices(
self,
value: bool,
) -> PortfolioConfigBuilder<SetUseMarkPrices<S>>where
S::UseMarkPrices: IsUnset,
pub fn use_mark_prices(
self,
value: bool,
) -> PortfolioConfigBuilder<SetUseMarkPrices<S>>where
S::UseMarkPrices: IsUnset,
Optional (Some / Option setters).
Default: true.
The type of prices used for portfolio calculations, such as unrealized PnLs.
If true (default), prefers mark prices when available, then falls back to quote,
last trade, or bar prices when bar_updates is true. If false, skips mark prices
and uses the fallback chain.
Sourcepub fn maybe_use_mark_prices(
self,
value: Option<bool>,
) -> PortfolioConfigBuilder<SetUseMarkPrices<S>>where
S::UseMarkPrices: IsUnset,
pub fn maybe_use_mark_prices(
self,
value: Option<bool>,
) -> PortfolioConfigBuilder<SetUseMarkPrices<S>>where
S::UseMarkPrices: IsUnset,
Optional (Some / Option setters).
Default: true.
The type of prices used for portfolio calculations, such as unrealized PnLs.
If true (default), prefers mark prices when available, then falls back to quote,
last trade, or bar prices when bar_updates is true. If false, skips mark prices
and uses the fallback chain.
Sourcepub fn use_mark_xrates(
self,
value: bool,
) -> PortfolioConfigBuilder<SetUseMarkXrates<S>>where
S::UseMarkXrates: IsUnset,
pub fn use_mark_xrates(
self,
value: bool,
) -> PortfolioConfigBuilder<SetUseMarkXrates<S>>where
S::UseMarkXrates: IsUnset,
Sourcepub fn maybe_use_mark_xrates(
self,
value: Option<bool>,
) -> PortfolioConfigBuilder<SetUseMarkXrates<S>>where
S::UseMarkXrates: IsUnset,
pub fn maybe_use_mark_xrates(
self,
value: Option<bool>,
) -> PortfolioConfigBuilder<SetUseMarkXrates<S>>where
S::UseMarkXrates: IsUnset,
Sourcepub fn bar_updates(
self,
value: bool,
) -> PortfolioConfigBuilder<SetBarUpdates<S>>where
S::BarUpdates: IsUnset,
pub fn bar_updates(
self,
value: bool,
) -> PortfolioConfigBuilder<SetBarUpdates<S>>where
S::BarUpdates: IsUnset,
Sourcepub fn maybe_bar_updates(
self,
value: Option<bool>,
) -> PortfolioConfigBuilder<SetBarUpdates<S>>where
S::BarUpdates: IsUnset,
pub fn maybe_bar_updates(
self,
value: Option<bool>,
) -> PortfolioConfigBuilder<SetBarUpdates<S>>where
S::BarUpdates: IsUnset,
Sourcepub fn convert_to_account_base_currency(
self,
value: bool,
) -> PortfolioConfigBuilder<SetConvertToAccountBaseCurrency<S>>where
S::ConvertToAccountBaseCurrency: IsUnset,
pub fn convert_to_account_base_currency(
self,
value: bool,
) -> PortfolioConfigBuilder<SetConvertToAccountBaseCurrency<S>>where
S::ConvertToAccountBaseCurrency: IsUnset,
Sourcepub fn maybe_convert_to_account_base_currency(
self,
value: Option<bool>,
) -> PortfolioConfigBuilder<SetConvertToAccountBaseCurrency<S>>where
S::ConvertToAccountBaseCurrency: IsUnset,
pub fn maybe_convert_to_account_base_currency(
self,
value: Option<bool>,
) -> PortfolioConfigBuilder<SetConvertToAccountBaseCurrency<S>>where
S::ConvertToAccountBaseCurrency: IsUnset,
Sourcepub fn equity_curve(
self,
value: bool,
) -> PortfolioConfigBuilder<SetEquityCurve<S>>where
S::EquityCurve: IsUnset,
pub fn equity_curve(
self,
value: bool,
) -> PortfolioConfigBuilder<SetEquityCurve<S>>where
S::EquityCurve: IsUnset,
Optional (Some / Option setters).
Default: true.
If mark-to-market equity snapshots should be recorded and published for every account.
Enabled by default. Records at account registration, every UTC midnight including
while flat, and shutdown. Disable for workloads such as optimizer runs that do not
consume an equity curve. This does not affect on-demand equity calculations or the
opt-in fine-grained snapshot_interval_ms stream.
Sourcepub fn maybe_equity_curve(
self,
value: Option<bool>,
) -> PortfolioConfigBuilder<SetEquityCurve<S>>where
S::EquityCurve: IsUnset,
pub fn maybe_equity_curve(
self,
value: Option<bool>,
) -> PortfolioConfigBuilder<SetEquityCurve<S>>where
S::EquityCurve: IsUnset,
Optional (Some / Option setters).
Default: true.
If mark-to-market equity snapshots should be recorded and published for every account.
Enabled by default. Records at account registration, every UTC midnight including
while flat, and shutdown. Disable for workloads such as optimizer runs that do not
consume an equity curve. This does not affect on-demand equity calculations or the
opt-in fine-grained snapshot_interval_ms stream.
Sourcepub fn min_account_state_logging_interval_ms(
self,
value: u64,
) -> PortfolioConfigBuilder<SetMinAccountStateLoggingIntervalMs<S>>where
S::MinAccountStateLoggingIntervalMs: IsUnset,
pub fn min_account_state_logging_interval_ms(
self,
value: u64,
) -> PortfolioConfigBuilder<SetMinAccountStateLoggingIntervalMs<S>>where
S::MinAccountStateLoggingIntervalMs: IsUnset,
Optional (Some / Option setters). The minimum interval (milliseconds) between logging account state events for the same account. When set, account state updates will only be logged if this much time has passed since the last log. Useful for HFT deployments to prevent excessive logging when account states change rapidly.
Sourcepub fn maybe_min_account_state_logging_interval_ms(
self,
value: Option<u64>,
) -> PortfolioConfigBuilder<SetMinAccountStateLoggingIntervalMs<S>>where
S::MinAccountStateLoggingIntervalMs: IsUnset,
pub fn maybe_min_account_state_logging_interval_ms(
self,
value: Option<u64>,
) -> PortfolioConfigBuilder<SetMinAccountStateLoggingIntervalMs<S>>where
S::MinAccountStateLoggingIntervalMs: IsUnset,
Optional (Some / Option setters). The minimum interval (milliseconds) between logging account state events for the same account. When set, account state updates will only be logged if this much time has passed since the last log. Useful for HFT deployments to prevent excessive logging when account states change rapidly.
Sourcepub fn snapshot_interval_ms(
self,
value: u64,
) -> PortfolioConfigBuilder<SetSnapshotIntervalMs<S>>where
S::SnapshotIntervalMs: IsUnset,
pub fn snapshot_interval_ms(
self,
value: u64,
) -> PortfolioConfigBuilder<SetSnapshotIntervalMs<S>>where
S::SnapshotIntervalMs: IsUnset,
Optional (Some / Option setters).
The interval (milliseconds) between portfolio snapshot emissions per account.
When set, a PortfolioSnapshot is emitted at this cadence while the
account holds at least one open position, carrying continuous
mark-to-market equity. When None (the default), no fine-grained snapshots
are emitted; the equity_curve setting still controls daily snapshots.
Sourcepub fn maybe_snapshot_interval_ms(
self,
value: Option<u64>,
) -> PortfolioConfigBuilder<SetSnapshotIntervalMs<S>>where
S::SnapshotIntervalMs: IsUnset,
pub fn maybe_snapshot_interval_ms(
self,
value: Option<u64>,
) -> PortfolioConfigBuilder<SetSnapshotIntervalMs<S>>where
S::SnapshotIntervalMs: IsUnset,
Optional (Some / Option setters).
The interval (milliseconds) between portfolio snapshot emissions per account.
When set, a PortfolioSnapshot is emitted at this cadence while the
account holds at least one open position, carrying continuous
mark-to-market equity. When None (the default), no fine-grained snapshots
are emitted; the equity_curve setting still controls daily snapshots.
Sourcepub fn debug(self, value: bool) -> PortfolioConfigBuilder<SetDebug<S>>where
S::Debug: IsUnset,
pub fn debug(self, value: bool) -> PortfolioConfigBuilder<SetDebug<S>>where
S::Debug: IsUnset,
Sourcepub fn maybe_debug(
self,
value: Option<bool>,
) -> PortfolioConfigBuilder<SetDebug<S>>where
S::Debug: IsUnset,
pub fn maybe_debug(
self,
value: Option<bool>,
) -> PortfolioConfigBuilder<SetDebug<S>>where
S::Debug: IsUnset,
Source§impl<S: IsComplete> PortfolioConfigBuilder<S>
impl<S: IsComplete> PortfolioConfigBuilder<S>
Sourcepub fn build(self) -> ConfigResult<PortfolioConfig>
pub fn build(self) -> ConfigResult<PortfolioConfig>
Validates and builds the PortfolioConfig.
§Errors
Returns a [ConfigError] if any field fails validation
(see PortfolioConfig::validate).