Skip to main content

RawSignal

Enum RawSignal 

Source
pub enum RawSignal {
Show 18 variants Entry { ts: NaiveDateTime, symbol: String, side: Side, order_type: OrderType, price: Option<f64>, risk_multiplier: f64, stoploss: Option<f64>, targets: Vec<f64>, group: Option<String>, trade_id: Option<TradeId>, }, Close { ts: NaiveDateTime, position: PositionRef, }, ClosePartial { ts: NaiveDateTime, position: PositionRef, ratio: f64, }, ModifyStoploss { ts: NaiveDateTime, position: PositionRef, price: f64, }, MoveStoplossToEntry { ts: NaiveDateTime, position: PositionRef, }, AddTarget { ts: NaiveDateTime, position: PositionRef, price: f64, close_ratio: f64, }, RemoveTarget { ts: NaiveDateTime, position: PositionRef, price: f64, }, ModifyTarget { ts: NaiveDateTime, position: PositionRef, old_price: f64, new_price: f64, }, AddRule { ts: NaiveDateTime, position: PositionRef, rule: RuleConfigDef, }, RemoveRule { ts: NaiveDateTime, position: PositionRef, rule_name: String, }, ScaleIn { ts: NaiveDateTime, position: PositionRef, price: Option<f64>, size: f64, }, CancelPending { ts: NaiveDateTime, position: PositionRef, }, CloseAllOf { ts: NaiveDateTime, symbol: String, }, CloseAll { ts: NaiveDateTime, }, CancelAllPending { ts: NaiveDateTime, }, ModifyAllStoploss { ts: NaiveDateTime, symbol: String, price: f64, }, CloseAllInGroup { ts: NaiveDateTime, group_id: GroupId, }, ModifyAllStoplossInGroup { ts: NaiveDateTime, group_id: GroupId, price: f64, },
}
Expand description

A raw signal from an external source — entry or management.

Covers both entry signals (which can be profile-transformed) and management signals (which pass through to the engine as-is after position resolution).

Variants§

§

Entry

Fields

§symbol: String
§side: Side
§order_type: OrderType
§price: Option<f64>
§risk_multiplier: f64
§stoploss: Option<f64>
§targets: Vec<f64>
§trade_id: Option<TradeId>

Application-defined trade identity. Required for ByTradeId resolution. Older JSONL without this field is still accepted.

§

Close

Fields

§position: PositionRef
§

ClosePartial

Fields

§position: PositionRef
§ratio: f64
§

ModifyStoploss

Fields

§position: PositionRef
§price: f64
§

MoveStoplossToEntry

Fields

§position: PositionRef
§

AddTarget

Fields

§position: PositionRef
§price: f64
§close_ratio: f64
§

RemoveTarget

Fields

§position: PositionRef
§price: f64
§

ModifyTarget

Fields

§position: PositionRef
§old_price: f64
§new_price: f64
§

AddRule

§

RemoveRule

Fields

§position: PositionRef
§rule_name: String
§

ScaleIn

Fields

§position: PositionRef
§price: Option<f64>
§size: f64
§

CancelPending

Fields

§position: PositionRef
§

CloseAllOf

Fields

§symbol: String
§

CloseAll

Fields

§

CancelAllPending

Fields

§

ModifyAllStoploss

Fields

§symbol: String
§price: f64
§

CloseAllInGroup

Fields

§group_id: GroupId
§

ModifyAllStoplossInGroup

Fields

§group_id: GroupId
§price: f64

Implementations§

Source§

impl RawSignal

Source

pub fn ts(&self) -> NaiveDateTime

Extract the timestamp from any signal variant.

Source

pub fn is_entry(&self) -> bool

Returns true if this is an Entry variant.

Trait Implementations§

Source§

impl Clone for RawSignal

Source§

fn clone(&self) -> RawSignal

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RawSignal

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for RawSignal

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for RawSignal

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V