pub enum RawSignalMsg {
Show 18 variants
Entry {
ts: String,
symbol: String,
side: String,
order_type: String,
price: Option<f64>,
risk: f64,
stoploss: Option<f64>,
targets: Vec<f64>,
group: Option<String>,
trade_id: Option<String>,
entry_class: Option<String>,
},
Close {
ts: String,
position: PositionRefMsg,
},
ClosePartial {
ts: String,
position: PositionRefMsg,
ratio: f64,
},
ModifyStoploss {
ts: String,
position: PositionRefMsg,
price: f64,
},
MoveStoplossToEntry {
ts: String,
position: PositionRefMsg,
},
AddTarget {
ts: String,
position: PositionRefMsg,
price: f64,
close_ratio: f64,
},
RemoveTarget {
ts: String,
position: PositionRefMsg,
price: f64,
},
ModifyTarget {
ts: String,
position: PositionRefMsg,
old_price: f64,
new_price: f64,
},
AddRule {
ts: String,
position: PositionRefMsg,
rule: RuleConfigDefMsg,
},
RemoveRule {
ts: String,
position: PositionRefMsg,
rule_name: String,
},
ScaleIn {
ts: String,
position: PositionRefMsg,
price: Option<f64>,
size: f64,
},
CancelPending {
ts: String,
position: PositionRefMsg,
},
CloseAllOf {
ts: String,
symbol: String,
},
CloseAll {
ts: String,
},
CancelAllPending {
ts: String,
},
ModifyAllStoploss {
ts: String,
symbol: String,
price: f64,
},
CloseAllInGroup {
ts: String,
group_id: String,
},
ModifyAllStoplossInGroup {
ts: String,
group_id: String,
price: f64,
},
}Expand description
Wire-safe signal that can represent any action, not just entries.
Uses #[serde(tag = "action")] so each variant is distinguished by an
"action" field in the JSON/Bincode representation.
Variants§
Entry
Open a new position (same semantics as RawSignalEntryMsg).
Fields
Close
Close position(s) at market.
ClosePartial
Close a fraction of position(s).
ModifyStoploss
Set or replace the stoploss price.
MoveStoplossToEntry
Move stoploss to the average entry price.
AddTarget
Add a take-profit level.
RemoveTarget
Remove a take-profit level at a specific price.
ModifyTarget
Atomically change an existing take-profit price while retaining its ratio.
AddRule
Attach a management rule.
RemoveRule
Remove a management rule by name.
ScaleIn
Scale into an existing position.
CancelPending
Cancel a pending order.
CloseAllOf
Close all open positions on a symbol.
CloseAll
Close all open positions.
CancelAllPending
Cancel all pending orders.
ModifyAllStoploss
Modify stoploss for all open positions on a symbol.
CloseAllInGroup
Close all open positions in a group.
ModifyAllStoplossInGroup
Modify stoploss for all open positions in a group.
Implementations§
Trait Implementations§
Source§impl Clone for RawSignalMsg
impl Clone for RawSignalMsg
Source§fn clone(&self) -> RawSignalMsg
fn clone(&self) -> RawSignalMsg
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RawSignalMsg
impl Debug for RawSignalMsg
Source§impl<'de> Deserialize<'de> for RawSignalMsg
impl<'de> Deserialize<'de> for RawSignalMsg
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RawSignalMsg, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RawSignalMsg, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for RawSignalMsg
impl Serialize for RawSignalMsg
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for RawSignalMsg
impl RefUnwindSafe for RawSignalMsg
impl Send for RawSignalMsg
impl Sync for RawSignalMsg
impl Unpin for RawSignalMsg
impl UnsafeUnpin for RawSignalMsg
impl UnwindSafe for RawSignalMsg
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more