pub struct RiskPlan {
pub entry: f64,
pub stop_loss: f64,
pub target_1: f64,
pub target_2: f64,
pub risk_reward_ratio: f64,
}Fields§
§entry: f64§stop_loss: f64§target_1: f64§target_2: f64§risk_reward_ratio: f64Implementations§
Source§impl RiskPlan
impl RiskPlan
Sourcepub fn rounded_to(&self, instrument: &InstrumentMeta) -> Self
pub fn rounded_to(&self, instrument: &InstrumentMeta) -> Self
Rounds entry/stop_loss/target_1/target_2 to instrument’s tick size and
recomputes risk_reward_ratio from the rounded prices, so a plan built from raw
ATR-derived math becomes tradable at the instrument’s actual price granularity.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RiskPlan
impl<'de> Deserialize<'de> for RiskPlan
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
impl StructuralPartialEq for RiskPlan
Auto Trait Implementations§
impl Freeze for RiskPlan
impl RefUnwindSafe for RiskPlan
impl Send for RiskPlan
impl Sync for RiskPlan
impl Unpin for RiskPlan
impl UnsafeUnpin for RiskPlan
impl UnwindSafe for RiskPlan
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