pub struct ManagementProfile {
pub name: String,
pub target_selection: Option<TargetSelection>,
pub use_targets: Vec<usize>,
pub close_ratios: Vec<f64>,
pub target_source: TargetSource,
pub stoploss_mode: StoplossMode,
pub rules: Vec<RuleConfigDef>,
pub group_override: Option<String>,
pub let_remainder_run: bool,
pub entry_geometry: EntryGeometryPolicy,
}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.
target_source: TargetSourceSource used to select or generate initial targets.
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.
entry_geometry: EntryGeometryPolicyDirectional geometry policy for the signal stoploss and targets when they are validated against the execution price. Profile rule levels and numeric validation are always strict.
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 an Entry using compatibility behavior for signal-backed levels.
Sourcepub fn apply_entry_signal_with_context(
&self,
signal: &RawSignal,
context: EntryResolutionContext,
) -> Result<Option<ResolvedEntry>, ProfileApplicationError>
pub fn apply_entry_signal_with_context( &self, signal: &RawSignal, context: EntryResolutionContext, ) -> Result<Option<ResolvedEntry>, ProfileApplicationError>
Transform an Entry with the instrument price grid required by generated levels.
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