pub struct Signal {
pub id: u64,
pub strategy_id: String,
pub timestamp: u64,
pub instrument_id: InstrumentId,
pub signal_type: SignalType,
pub confidence: f64,
pub metadata: Option<String>,
}Expand description
Represents a trading signal generated by a strategy.
Fields§
§id: u64Unique signal identifier
strategy_id: StringStrategy that generated this signal
timestamp: u64Timestamp when the signal was generated (nanosecond precision)
instrument_id: InstrumentIdInstrument this signal applies to
signal_type: SignalTypeType of the signal
confidence: f64Confidence level (0.0 to 1.0)
metadata: Option<String>Additional metadata about the signal
Implementations§
Source§impl Signal
impl Signal
Sourcepub fn new(
id: u64,
strategy_id: String,
instrument_id: InstrumentId,
signal_type: SignalType,
confidence: f64,
metadata: Option<String>,
) -> Self
pub fn new( id: u64, strategy_id: String, instrument_id: InstrumentId, signal_type: SignalType, confidence: f64, metadata: Option<String>, ) -> Self
Creates a new signal with the current timestamp
Sourcepub const fn with_timestamp(
id: u64,
strategy_id: String,
timestamp: u64,
instrument_id: InstrumentId,
signal_type: SignalType,
confidence: f64,
metadata: Option<String>,
) -> Self
pub const fn with_timestamp( id: u64, strategy_id: String, timestamp: u64, instrument_id: InstrumentId, signal_type: SignalType, confidence: f64, metadata: Option<String>, ) -> Self
Creates a new signal with a specified timestamp
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Signal
impl RefUnwindSafe for Signal
impl Send for Signal
impl Sync for Signal
impl Unpin for Signal
impl UnwindSafe for Signal
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