pub struct ManagementProfile {
pub name: String,
pub target_selection: Option<TargetSelection>,
pub use_targets: Vec<usize>,
pub close_ratios: Vec<f64>,
pub stoploss_mode: StoplossMode,
pub rules: Vec<RuleConfigDef>,
pub group_override: Option<String>,
pub let_remainder_run: bool,
}Expand description
A named management profile that resolves raw entry signals before sizing.
Fields§
§name: StringProfile name (e.g. “conservative”, “aggressive”, “runner”).
target_selection: Option<TargetSelection>Explicit current target selection. When present, this takes precedence
over use_targets for Self::apply_entry_signal. When omitted,
compatibility decoding derives the prior behavior from use_targets: an empty vector means
TargetSelection::None, otherwise it means TargetSelection::Selected.
use_targets: Vec<usize>Compatibility target selection (1-indexed), retained so existing serialized profiles remain readable.
close_ratios: Vec<f64>Close ratio for each selected target. In current application, an empty vector assigns equal weights to all selected targets; otherwise its length must match the effective target selection.
stoploss_mode: StoplossModeHow to handle the stoploss from the signal.
rules: Vec<RuleConfigDef>Additional rules to attach to every position opened with this profile.
group_override: Option<String>If set, override the signal’s group tag with this value.
let_remainder_run: boolWhen true and ratios sum < 1.0, the remainder rides with just SL/rules.
Implementations§
Source§impl ManagementProfile
impl ManagementProfile
Sourcepub fn effective_target_selection(&self) -> TargetSelection
pub fn effective_target_selection(&self) -> TargetSelection
Return the target selection used by current application.
The explicit target_selection field wins when present. Otherwise this
preserves existing profile behavior by deriving None/Selected from
use_targets.
Sourcepub fn validate(&self) -> Result<(), ProfileValidationError>
pub fn validate(&self) -> Result<(), ProfileValidationError>
Validate this profile’s configuration.
Sourcepub fn apply_entry_signal(
&self,
signal: &RawSignal,
) -> Result<Option<ResolvedEntry>, ProfileApplicationError>
pub fn apply_entry_signal( &self, signal: &RawSignal, ) -> Result<Option<ResolvedEntry>, ProfileApplicationError>
Transform a RawSignal::Entry while retaining target-resolution metadata.
This canonical path rejects malformed numeric values, target selections,
geometry, and weights. An explicit target_selection takes precedence; when it is
omitted, an empty use_targets means TargetSelection::None and non-empty
use_targets means TargetSelection::Selected. When targets are selected and
close_ratios is empty, equal 1 / N weights are synthesized.
Trait Implementations§
Source§impl Clone for ManagementProfile
impl Clone for ManagementProfile
Source§fn clone(&self) -> ManagementProfile
fn clone(&self) -> ManagementProfile
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more