chapaty 1.1.2

An event-driven Rust engine for building and evaluating quantitative trading agents. Features a Gym-style API for algorithmic backtesting and reinforcement learning.
// This file is @generated by prost-build.
/// DataBroker identifies the upstream system/provider that produced the data.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum DataBroker {
    /// Default/unknown broker.
    Unspecified = 0,
    /// Binance exchange.
    Binance = 1,
    /// NinjaTrader platform.
    NinjaTrader = 2,
    /// Investing.com data source.
    InvestingCom = 3,
}
impl DataBroker {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "DATA_BROKER_UNSPECIFIED",
            Self::Binance => "DATA_BROKER_BINANCE",
            Self::NinjaTrader => "DATA_BROKER_NINJA_TRADER",
            Self::InvestingCom => "DATA_BROKER_INVESTING_COM",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "DATA_BROKER_UNSPECIFIED" => Some(Self::Unspecified),
            "DATA_BROKER_BINANCE" => Some(Self::Binance),
            "DATA_BROKER_NINJA_TRADER" => Some(Self::NinjaTrader),
            "DATA_BROKER_INVESTING_COM" => Some(Self::InvestingCom),
            _ => None,
        }
    }
}
/// Batch of economic calendar events.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EconomicCalendarBatch {
    #[prost(message, repeated, tag = "1")]
    pub events: ::prost::alloc::vec::Vec<EconomicCalendarEvent>,
}
/// Single economic calendar event (e.g., Non-Farm Payrolls, CPI release).
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EconomicCalendarEvent {
    /// UTC timestamp of the event.
    /// Converted from local time zone, adjusted for daylight saving time if applicable.
    #[prost(message, optional, tag = "1")]
    pub event_timestamp: ::core::option::Option<::prost_types::Timestamp>,
    /// Data source (e.g., "investingcom", "fred")
    #[prost(string, tag = "2")]
    pub data_source: ::prost::alloc::string::String,
    /// Event category from the data source (e.g., investing.com classification).
    #[prost(string, tag = "3")]
    pub category: ::prost::alloc::string::String,
    /// Classified event type identifier (e.g., "NFP", "CPI", "FOMC").
    /// Empty string if classification was not performed or failed.
    /// Classification may be derived from:
    ///
    /// * Deterministic text rules (news_type_source = "rule")
    /// * ML/NLP models (news_type_source = "ml" or "nlp")
    /// * Manual curation (news_type_source = "manual")
    #[prost(string, tag = "4")]
    pub news_type: ::prost::alloc::string::String,
    /// Confidence score for news_type classification (0.0 to 1.0).
    /// Null if news_type is empty or unclassified.
    /// Deterministic rules typically use 1.0.
    /// ML/NLP models provide calibrated probability scores.
    #[prost(double, optional, tag = "5")]
    pub news_type_confidence: ::core::option::Option<f64>,
    /// Method used to derive news_type classification.
    /// Common values:
    /// "manual" - Manually labeled or curated by a human
    /// "rule"   - Deterministic text-matching or heuristic rules
    /// "ml"     - Machine learning classifier (e.g., BigQuery ML)
    /// "nlp"    - Natural language processing pipeline or LLM
    /// Empty string if news_type was not classified.
    #[prost(string, tag = "6")]
    pub news_type_source: ::prost::alloc::string::String,
    /// Reporting periodicity of the indicator.
    /// Describes the time period over which the metric is measured or compared.
    /// Common values:
    /// "mom" - Month-over-Month (e.g., monthly CPI growth)
    /// "qoq" - Quarter-over-Quarter (e.g., quarterly GDP growth)
    /// "yoy" - Year-over-Year (e.g., annual inflation rate)
    /// Empty string for non-recurring or irregular events.
    #[prost(string, tag = "7")]
    pub periodicity: ::prost::alloc::string::String,
    /// Full descriptive name of the event (e.g., "Non-Farm Payrolls Report").
    #[prost(string, tag = "8")]
    pub news_name: ::prost::alloc::string::String,
    /// ISO 3166-1 alpha-2 country code (e.g., "US", "GB", "JP").
    /// "EZ" is commonly used for Euro Zone.
    #[prost(string, tag = "9")]
    pub country_code: ::prost::alloc::string::String,
    /// ISO 4217 currency code (e.g., "USD", "EUR", "GBP").
    #[prost(string, tag = "10")]
    pub currency_code: ::prost::alloc::string::String,
    /// Importance level of the event.
    /// Typical scale: 1 = Low, 2 = Medium, 3 = High
    /// Zero if importance is not assigned or unknown.
    #[prost(int32, tag = "11")]
    pub importance: i32,
    /// Actual reported value of the economic indicator.
    /// Null if not yet released or not applicable.
    #[prost(double, optional, tag = "12")]
    pub actual: ::core::option::Option<f64>,
    /// Forecasted/expected value before release.
    /// Null if no forecast was published.
    #[prost(double, optional, tag = "13")]
    pub forecast: ::core::option::Option<f64>,
    /// Previously reported value (from prior release period).
    /// Null if not applicable or unavailable.
    #[prost(double, optional, tag = "14")]
    pub previous: ::core::option::Option<f64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OhlcvFutureBatch {
    #[prost(message, repeated, tag = "1")]
    pub events: ::prost::alloc::vec::Vec<OhlcvFutureEvent>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct OhlcvFutureEvent {
    #[prost(message, optional, tag = "1")]
    pub open_timestamp: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(double, tag = "2")]
    pub open: f64,
    #[prost(double, tag = "3")]
    pub high: f64,
    #[prost(double, tag = "4")]
    pub low: f64,
    #[prost(double, tag = "5")]
    pub close: f64,
    #[prost(double, tag = "6")]
    pub volume: f64,
    #[prost(message, optional, tag = "7")]
    pub close_timestamp: ::core::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OhlcvSpotBatch {
    #[prost(message, repeated, tag = "1")]
    pub events: ::prost::alloc::vec::Vec<OhlcvSpotEvent>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct OhlcvSpotEvent {
    #[prost(message, optional, tag = "1")]
    pub open_timestamp: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(double, tag = "2")]
    pub open: f64,
    #[prost(double, tag = "3")]
    pub high: f64,
    #[prost(double, tag = "4")]
    pub low: f64,
    #[prost(double, tag = "5")]
    pub close: f64,
    #[prost(double, tag = "6")]
    pub volume: f64,
    #[prost(message, optional, tag = "7")]
    pub close_timestamp: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(double, tag = "8")]
    pub quote_asset_volume: f64,
    #[prost(int64, tag = "9")]
    pub number_of_trades: i64,
    #[prost(double, tag = "10")]
    pub taker_buy_base_asset_volume: f64,
    #[prost(double, tag = "11")]
    pub taker_buy_quote_asset_volume: f64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TpoFutureBatch {
    #[prost(message, repeated, tag = "1")]
    pub events: ::prost::alloc::vec::Vec<TpoFutureEvent>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TpoFutureEvent {
    #[prost(message, optional, tag = "1")]
    pub window_start: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(message, optional, tag = "2")]
    pub window_end: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(double, tag = "3")]
    pub price_bin_start: f64,
    #[prost(double, tag = "4")]
    pub price_bin_end: f64,
    #[prost(int64, tag = "5")]
    pub time_slot_count: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TpoSpotBatch {
    #[prost(message, repeated, tag = "1")]
    pub events: ::prost::alloc::vec::Vec<TpoSpotEvent>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TpoSpotEvent {
    #[prost(message, optional, tag = "1")]
    pub window_start: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(message, optional, tag = "2")]
    pub window_end: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(double, tag = "3")]
    pub price_bin_start: f64,
    #[prost(double, tag = "4")]
    pub price_bin_end: f64,
    #[prost(int64, tag = "5")]
    pub time_slot_count: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TradesSpotBatch {
    #[prost(message, repeated, tag = "4")]
    pub events: ::prost::alloc::vec::Vec<TradesSpotEvent>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TradesSpotEvent {
    #[prost(int64, tag = "1")]
    pub trade_id: i64,
    #[prost(double, tag = "2")]
    pub price: f64,
    #[prost(double, tag = "3")]
    pub quantity: f64,
    #[prost(double, tag = "4")]
    pub quote_quantity: f64,
    #[prost(message, optional, tag = "5")]
    pub trade_timestamp: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(bool, tag = "6")]
    pub is_buyer_maker: bool,
    #[prost(bool, tag = "7")]
    pub is_best_match: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VolumeProfileSpotBatch {
    #[prost(message, repeated, tag = "1")]
    pub events: ::prost::alloc::vec::Vec<VolumeProfileSpotEvent>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct VolumeProfileSpotEvent {
    #[prost(message, optional, tag = "1")]
    pub window_start: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(message, optional, tag = "2")]
    pub window_end: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(double, tag = "3")]
    pub price_bin_start: f64,
    #[prost(double, tag = "4")]
    pub price_bin_end: f64,
    #[prost(double, tag = "5")]
    pub base_volume: f64,
    #[prost(double, tag = "6")]
    pub taker_buy_base_volume: f64,
    #[prost(double, tag = "7")]
    pub taker_sell_base_volume: f64,
    #[prost(double, tag = "8")]
    pub quote_volume: f64,
    #[prost(double, tag = "9")]
    pub taker_buy_quote_volume: f64,
    #[prost(double, tag = "10")]
    pub taker_sell_quote_volume: f64,
    #[prost(int64, tag = "11")]
    pub number_of_trades: i64,
    #[prost(int64, tag = "12")]
    pub number_of_buy_trades: i64,
    #[prost(int64, tag = "13")]
    pub number_of_sell_trades: i64,
}