pub mod nanobook
pub mod nanobook::backtest_bridge
pub struct nanobook::backtest_bridge::BacktestBridgeOptions
pub nanobook::backtest_bridge::BacktestBridgeOptions::stop_cfg: core::option::Option<nanobook::backtest_bridge::BacktestStopConfig>
pub struct nanobook::backtest_bridge::BacktestBridgeResult
pub nanobook::backtest_bridge::BacktestBridgeResult::equity_curve: alloc::vec::Vec<i64>
pub nanobook::backtest_bridge::BacktestBridgeResult::final_cash: i64
pub nanobook::backtest_bridge::BacktestBridgeResult::holdings: alloc::vec::Vec<alloc::vec::Vec<(nanobook::Symbol, f64)>>
pub nanobook::backtest_bridge::BacktestBridgeResult::metrics: core::option::Option<nanobook::portfolio::metrics::Metrics>
pub nanobook::backtest_bridge::BacktestBridgeResult::returns: alloc::vec::Vec<f64>
pub nanobook::backtest_bridge::BacktestBridgeResult::stop_events: alloc::vec::Vec<nanobook::backtest_bridge::BacktestStopEvent>
pub nanobook::backtest_bridge::BacktestBridgeResult::symbol_returns: alloc::vec::Vec<alloc::vec::Vec<(nanobook::Symbol, f64)>>
pub struct nanobook::backtest_bridge::BacktestStopConfig
pub nanobook::backtest_bridge::BacktestStopConfig::atr_multiple: core::option::Option<f64>
pub nanobook::backtest_bridge::BacktestStopConfig::atr_period: usize
pub nanobook::backtest_bridge::BacktestStopConfig::fixed_stop_pct: core::option::Option<f64>
pub nanobook::backtest_bridge::BacktestStopConfig::trailing_stop_pct: core::option::Option<f64>
pub struct nanobook::backtest_bridge::BacktestStopEvent
pub nanobook::backtest_bridge::BacktestStopEvent::exit_price: i64
pub nanobook::backtest_bridge::BacktestStopEvent::period_index: usize
pub nanobook::backtest_bridge::BacktestStopEvent::reason: &'static str
pub nanobook::backtest_bridge::BacktestStopEvent::symbol: nanobook::Symbol
pub nanobook::backtest_bridge::BacktestStopEvent::trigger_price: i64
pub fn nanobook::backtest_bridge::backtest_weights(weight_schedule: &[alloc::vec::Vec<(nanobook::Symbol, f64)>], price_schedule: &[alloc::vec::Vec<(nanobook::Symbol, i64)>], initial_cash_cents: i64, cost_bps: u32, periods_per_year: f64, risk_free: f64) -> nanobook::backtest_bridge::BacktestBridgeResult
pub fn nanobook::backtest_bridge::backtest_weights_with_options(weight_schedule: &[alloc::vec::Vec<(nanobook::Symbol, f64)>], price_schedule: &[alloc::vec::Vec<(nanobook::Symbol, i64)>], initial_cash_cents: i64, cost_bps: u32, periods_per_year: f64, risk_free: f64, options: nanobook::backtest_bridge::BacktestBridgeOptions) -> nanobook::backtest_bridge::BacktestBridgeResult
pub mod nanobook::cv
pub fn nanobook::cv::time_series_split(n_samples: usize, n_splits: usize) -> alloc::vec::Vec<(alloc::vec::Vec<usize>, alloc::vec::Vec<usize>)>
pub mod nanobook::garch
pub fn nanobook::garch::garch_ewma_forecast(returns: &[f64], p: usize, q: usize, mean: &str) -> f64
pub mod nanobook::indicators
pub fn nanobook::indicators::atr(high: &[f64], low: &[f64], close: &[f64], period: usize) -> alloc::vec::Vec<f64>
pub fn nanobook::indicators::bbands(close: &[f64], period: usize, num_std_up: f64, num_std_dn: f64) -> (alloc::vec::Vec<f64>, alloc::vec::Vec<f64>, alloc::vec::Vec<f64>)
pub fn nanobook::indicators::macd(close: &[f64], fast_period: usize, slow_period: usize, signal_period: usize) -> (alloc::vec::Vec<f64>, alloc::vec::Vec<f64>, alloc::vec::Vec<f64>)
pub fn nanobook::indicators::rsi(close: &[f64], period: usize) -> alloc::vec::Vec<f64>
pub mod nanobook::itch
pub enum nanobook::itch::ItchMessage
pub nanobook::itch::ItchMessage::AddOrder
pub nanobook::itch::ItchMessage::AddOrder::order_ref: u64
pub nanobook::itch::ItchMessage::AddOrder::price: u32
pub nanobook::itch::ItchMessage::AddOrder::shares: u32
pub nanobook::itch::ItchMessage::AddOrder::side: nanobook::Side
pub nanobook::itch::ItchMessage::AddOrder::stock: alloc::string::String
pub nanobook::itch::ItchMessage::AddOrder::timestamp: u64
pub nanobook::itch::ItchMessage::OrderCancel
pub nanobook::itch::ItchMessage::OrderCancel::order_ref: u64
pub nanobook::itch::ItchMessage::OrderCancel::shares: u32
pub nanobook::itch::ItchMessage::OrderCancel::timestamp: u64
pub nanobook::itch::ItchMessage::OrderDelete
pub nanobook::itch::ItchMessage::OrderDelete::order_ref: u64
pub nanobook::itch::ItchMessage::OrderDelete::timestamp: u64
pub nanobook::itch::ItchMessage::OrderExecuted
pub nanobook::itch::ItchMessage::OrderExecuted::match_number: u64
pub nanobook::itch::ItchMessage::OrderExecuted::order_ref: u64
pub nanobook::itch::ItchMessage::OrderExecuted::shares: u32
pub nanobook::itch::ItchMessage::OrderExecuted::timestamp: u64
pub nanobook::itch::ItchMessage::OrderExecutedWithPrice
pub nanobook::itch::ItchMessage::OrderExecutedWithPrice::match_number: u64
pub nanobook::itch::ItchMessage::OrderExecutedWithPrice::order_ref: u64
pub nanobook::itch::ItchMessage::OrderExecutedWithPrice::price: u32
pub nanobook::itch::ItchMessage::OrderExecutedWithPrice::printable: bool
pub nanobook::itch::ItchMessage::OrderExecutedWithPrice::shares: u32
pub nanobook::itch::ItchMessage::OrderExecutedWithPrice::timestamp: u64
pub nanobook::itch::ItchMessage::OrderReplace
pub nanobook::itch::ItchMessage::OrderReplace::new_order_ref: u64
pub nanobook::itch::ItchMessage::OrderReplace::old_order_ref: u64
pub nanobook::itch::ItchMessage::OrderReplace::price: u32
pub nanobook::itch::ItchMessage::OrderReplace::shares: u32
pub nanobook::itch::ItchMessage::OrderReplace::timestamp: u64
pub nanobook::itch::ItchMessage::Other(char)
pub nanobook::itch::ItchMessage::StockDirectory
pub nanobook::itch::ItchMessage::StockDirectory::locate: u16
pub nanobook::itch::ItchMessage::StockDirectory::stock: alloc::string::String
pub nanobook::itch::ItchMessage::Trade
pub nanobook::itch::ItchMessage::Trade::match_number: u64
pub nanobook::itch::ItchMessage::Trade::price: u32
pub nanobook::itch::ItchMessage::Trade::shares: u32
pub nanobook::itch::ItchMessage::Trade::side: nanobook::Side
pub nanobook::itch::ItchMessage::Trade::stock: alloc::string::String
pub nanobook::itch::ItchMessage::Trade::timestamp: u64
pub struct nanobook::itch::ItchParser<R: std::io::Read>
impl<R: std::io::Read> nanobook::itch::ItchParser<R>
pub fn nanobook::itch::ItchParser<R>::new(reader: R) -> Self
pub fn nanobook::itch::ItchParser<R>::next_message(&mut self) -> std::io::error::Result<core::option::Option<nanobook::itch::ItchMessage>>
pub fn nanobook::itch::itch_to_event(msg: nanobook::itch::ItchMessage) -> core::option::Option<(alloc::string::String, nanobook::Event)>
pub mod nanobook::multi_exchange
pub struct nanobook::multi_exchange::MultiExchange
impl nanobook::multi_exchange::MultiExchange
pub fn nanobook::multi_exchange::MultiExchange::best_prices(&self) -> alloc::vec::Vec<(nanobook::Symbol, core::option::Option<nanobook::Price>, core::option::Option<nanobook::Price>)>
pub fn nanobook::multi_exchange::MultiExchange::get(&self, symbol: &nanobook::Symbol) -> core::option::Option<&nanobook::Exchange>
pub fn nanobook::multi_exchange::MultiExchange::get_mut(&mut self, symbol: &nanobook::Symbol) -> core::option::Option<&mut nanobook::Exchange>
pub fn nanobook::multi_exchange::MultiExchange::get_or_create(&mut self, symbol: &nanobook::Symbol) -> &mut nanobook::Exchange
pub fn nanobook::multi_exchange::MultiExchange::is_empty(&self) -> bool
pub fn nanobook::multi_exchange::MultiExchange::len(&self) -> usize
pub fn nanobook::multi_exchange::MultiExchange::new() -> Self
pub fn nanobook::multi_exchange::MultiExchange::symbols(&self) -> impl core::iter::traits::iterator::Iterator<Item = &nanobook::Symbol>
pub mod nanobook::optimize
pub enum nanobook::optimize::OptimizeError
pub nanobook::optimize::OptimizeError::DegenerateProjection
pub nanobook::optimize::OptimizeError::EmptyInput
impl core::error::Error for nanobook::optimize::OptimizeError
impl core::fmt::Display for nanobook::optimize::OptimizeError
pub fn nanobook::optimize::OptimizeError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
pub struct nanobook::optimize::OptimizerOptions
pub nanobook::optimize::OptimizerOptions::max_iters: usize
pub nanobook::optimize::OptimizerOptions::tol: f64
impl core::default::Default for nanobook::optimize::OptimizerOptions
pub fn nanobook::optimize::OptimizerOptions::default() -> Self
pub struct nanobook::optimize::OptimizerResult
pub nanobook::optimize::OptimizerResult::converged: bool
pub nanobook::optimize::OptimizerResult::final_step_squared: f64
pub nanobook::optimize::OptimizerResult::iters: usize
pub nanobook::optimize::OptimizerResult::weights: alloc::vec::Vec<f64>
pub fn nanobook::optimize::inverse_cdar_weights(returns: &[alloc::vec::Vec<f64>], alpha: f64) -> alloc::vec::Vec<f64>
pub fn nanobook::optimize::inverse_cvar_weights(returns: &[alloc::vec::Vec<f64>], alpha: f64) -> alloc::vec::Vec<f64>
pub fn nanobook::optimize::optimize_max_sharpe(returns: &[alloc::vec::Vec<f64>], risk_free: f64) -> alloc::vec::Vec<f64>
pub fn nanobook::optimize::optimize_min_variance(returns: &[alloc::vec::Vec<f64>]) -> alloc::vec::Vec<f64>
pub fn nanobook::optimize::optimize_min_variance_ex(returns: &[alloc::vec::Vec<f64>], options: nanobook::optimize::OptimizerOptions) -> nanobook::optimize::OptimizerResult
pub fn nanobook::optimize::optimize_risk_parity(returns: &[alloc::vec::Vec<f64>]) -> alloc::vec::Vec<f64>
pub fn nanobook::optimize::project_simplex(v: &[f64]) -> core::result::Result<alloc::vec::Vec<f64>, nanobook::optimize::OptimizeError>
pub mod nanobook::persistence
pub fn nanobook::persistence::load_events(path: &std::path::Path) -> std::io::error::Result<alloc::vec::Vec<nanobook::Event>>
pub fn nanobook::persistence::save_events(events: &[nanobook::Event], path: &std::path::Path) -> std::io::error::Result<()>
pub mod nanobook::portfolio
pub mod nanobook::portfolio::cost_model
pub struct nanobook::portfolio::cost_model::CostModel
pub nanobook::portfolio::cost_model::CostModel::commission_bps: u32
pub nanobook::portfolio::cost_model::CostModel::min_trade_fee: i64
pub nanobook::portfolio::cost_model::CostModel::slippage_bps: u32
impl nanobook::portfolio::cost_model::CostModel
pub fn nanobook::portfolio::cost_model::CostModel::compute_cost(&self, notional: i64) -> i64
pub fn nanobook::portfolio::cost_model::CostModel::zero() -> Self
impl core::default::Default for nanobook::portfolio::cost_model::CostModel
pub fn nanobook::portfolio::cost_model::CostModel::default() -> Self
pub mod nanobook::portfolio::metrics
pub enum nanobook::portfolio::metrics::CVaRMethod
pub nanobook::portfolio::metrics::CVaRMethod::Historical
pub nanobook::portfolio::metrics::CVaRMethod::ParametricNormal
pub struct nanobook::portfolio::metrics::Metrics
pub nanobook::portfolio::metrics::Metrics::cagr: f64
pub nanobook::portfolio::metrics::Metrics::calmar: f64
pub nanobook::portfolio::metrics::Metrics::cvar_95: f64
pub nanobook::portfolio::metrics::Metrics::kelly: f64
pub nanobook::portfolio::metrics::Metrics::losing_periods: usize
pub nanobook::portfolio::metrics::Metrics::max_drawdown: f64
pub nanobook::portfolio::metrics::Metrics::num_periods: usize
pub nanobook::portfolio::metrics::Metrics::payoff_ratio: f64
pub nanobook::portfolio::metrics::Metrics::profit_factor: f64
pub nanobook::portfolio::metrics::Metrics::sharpe: f64
pub nanobook::portfolio::metrics::Metrics::sortino: f64
pub nanobook::portfolio::metrics::Metrics::total_return: f64
pub nanobook::portfolio::metrics::Metrics::volatility: f64
pub nanobook::portfolio::metrics::Metrics::win_rate: f64
pub nanobook::portfolio::metrics::Metrics::winning_periods: usize
impl core::fmt::Display for nanobook::portfolio::metrics::Metrics
pub fn nanobook::portfolio::metrics::Metrics::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
pub fn nanobook::portfolio::metrics::compute_metrics(returns: &[f64], periods_per_year: f64, risk_free: f64) -> core::option::Option<nanobook::portfolio::metrics::Metrics>
pub fn nanobook::portfolio::metrics::cvar(returns: &[f64], alpha: f64, method: nanobook::portfolio::metrics::CVaRMethod) -> f64
pub fn nanobook::portfolio::metrics::rolling_sharpe(returns: &[f64], window: usize, periods_per_year: usize) -> alloc::vec::Vec<f64>
pub fn nanobook::portfolio::metrics::rolling_volatility(returns: &[f64], window: usize, periods_per_year: usize) -> alloc::vec::Vec<f64>
pub fn nanobook::portfolio::metrics::sortino(returns: &[f64], risk_free: f64, periods_per_year: f64, ddof: u32) -> f64
pub mod nanobook::portfolio::position
pub struct nanobook::portfolio::position::Position
pub nanobook::portfolio::position::Position::avg_entry_price: i64
pub nanobook::portfolio::position::Position::quantity: i64
pub nanobook::portfolio::position::Position::realized_pnl: i64
pub nanobook::portfolio::position::Position::symbol: nanobook::Symbol
pub nanobook::portfolio::position::Position::total_cost: i64
impl nanobook::portfolio::position::Position
pub fn nanobook::portfolio::position::Position::apply_fill(&mut self, qty: i64, price: i64)
pub fn nanobook::portfolio::position::Position::is_flat(&self) -> bool
pub fn nanobook::portfolio::position::Position::market_value(&self, price: i64) -> i64
pub fn nanobook::portfolio::position::Position::new(symbol: nanobook::Symbol) -> Self
pub fn nanobook::portfolio::position::Position::unrealized_pnl(&self, price: i64) -> i64
pub mod nanobook::portfolio::strategy
pub struct nanobook::portfolio::strategy::BacktestResult
pub nanobook::portfolio::strategy::BacktestResult::metrics: core::option::Option<nanobook::portfolio::metrics::Metrics>
pub nanobook::portfolio::strategy::BacktestResult::portfolio: nanobook::portfolio::Portfolio
pub struct nanobook::portfolio::strategy::EqualWeight
impl nanobook::portfolio::strategy::Strategy for nanobook::portfolio::strategy::EqualWeight
pub fn nanobook::portfolio::strategy::EqualWeight::compute_weights(&self, _bar_index: usize, prices: &[(nanobook::Symbol, i64)], _portfolio: &nanobook::portfolio::Portfolio) -> alloc::vec::Vec<(nanobook::Symbol, f64)>
pub trait nanobook::portfolio::strategy::Strategy
pub fn nanobook::portfolio::strategy::Strategy::compute_weights(&self, bar_index: usize, prices: &[(nanobook::Symbol, i64)], portfolio: &nanobook::portfolio::Portfolio) -> alloc::vec::Vec<(nanobook::Symbol, f64)>
impl nanobook::portfolio::strategy::Strategy for nanobook::portfolio::strategy::EqualWeight
pub fn nanobook::portfolio::strategy::EqualWeight::compute_weights(&self, _bar_index: usize, prices: &[(nanobook::Symbol, i64)], _portfolio: &nanobook::portfolio::Portfolio) -> alloc::vec::Vec<(nanobook::Symbol, f64)>
pub fn nanobook::portfolio::strategy::run_backtest<S: nanobook::portfolio::strategy::Strategy>(strategy: &S, price_series: &[alloc::vec::Vec<(nanobook::Symbol, i64)>], initial_cash: i64, cost_model: nanobook::portfolio::cost_model::CostModel, periods_per_year: f64, risk_free: f64) -> nanobook::portfolio::strategy::BacktestResult
pub mod nanobook::portfolio::sweep
pub fn nanobook::portfolio::sweep::sweep<F, P>(params: &[P], periods_per_year: f64, risk_free: f64, run_fn: F) -> alloc::vec::Vec<core::option::Option<nanobook::portfolio::metrics::Metrics>> where F: core::ops::function::Fn(&P) -> alloc::vec::Vec<f64> + core::marker::Sync, P: core::marker::Sync
pub fn nanobook::portfolio::sweep::sweep_strategy<F, P, S>(params: &[P], price_series: &[alloc::vec::Vec<(nanobook::Symbol, i64)>], initial_cash: i64, cost_model: nanobook::portfolio::cost_model::CostModel, periods_per_year: f64, risk_free: f64, make_strategy: F) -> alloc::vec::Vec<nanobook::portfolio::strategy::BacktestResult> where F: core::ops::function::Fn(&P) -> S + core::marker::Sync, P: core::marker::Sync, S: nanobook::portfolio::strategy::Strategy
pub struct nanobook::portfolio::BacktestResult
pub nanobook::portfolio::BacktestResult::metrics: core::option::Option<nanobook::portfolio::metrics::Metrics>
pub nanobook::portfolio::BacktestResult::portfolio: nanobook::portfolio::Portfolio
pub struct nanobook::portfolio::CostModel
pub nanobook::portfolio::CostModel::commission_bps: u32
pub nanobook::portfolio::CostModel::min_trade_fee: i64
pub nanobook::portfolio::CostModel::slippage_bps: u32
impl nanobook::portfolio::cost_model::CostModel
pub fn nanobook::portfolio::cost_model::CostModel::compute_cost(&self, notional: i64) -> i64
pub fn nanobook::portfolio::cost_model::CostModel::zero() -> Self
impl core::default::Default for nanobook::portfolio::cost_model::CostModel
pub fn nanobook::portfolio::cost_model::CostModel::default() -> Self
pub struct nanobook::portfolio::EqualWeight
impl nanobook::portfolio::strategy::Strategy for nanobook::portfolio::strategy::EqualWeight
pub fn nanobook::portfolio::strategy::EqualWeight::compute_weights(&self, _bar_index: usize, prices: &[(nanobook::Symbol, i64)], _portfolio: &nanobook::portfolio::Portfolio) -> alloc::vec::Vec<(nanobook::Symbol, f64)>
pub struct nanobook::portfolio::Metrics
pub nanobook::portfolio::Metrics::cagr: f64
pub nanobook::portfolio::Metrics::calmar: f64
pub nanobook::portfolio::Metrics::cvar_95: f64
pub nanobook::portfolio::Metrics::kelly: f64
pub nanobook::portfolio::Metrics::losing_periods: usize
pub nanobook::portfolio::Metrics::max_drawdown: f64
pub nanobook::portfolio::Metrics::num_periods: usize
pub nanobook::portfolio::Metrics::payoff_ratio: f64
pub nanobook::portfolio::Metrics::profit_factor: f64
pub nanobook::portfolio::Metrics::sharpe: f64
pub nanobook::portfolio::Metrics::sortino: f64
pub nanobook::portfolio::Metrics::total_return: f64
pub nanobook::portfolio::Metrics::volatility: f64
pub nanobook::portfolio::Metrics::win_rate: f64
pub nanobook::portfolio::Metrics::winning_periods: usize
impl core::fmt::Display for nanobook::portfolio::metrics::Metrics
pub fn nanobook::portfolio::metrics::Metrics::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
pub struct nanobook::portfolio::Portfolio
impl nanobook::portfolio::Portfolio
pub fn nanobook::portfolio::Portfolio::cash(&self) -> i64
pub fn nanobook::portfolio::Portfolio::close_position_at(&mut self, symbol: nanobook::Symbol, price: i64) -> bool
pub fn nanobook::portfolio::Portfolio::cost_model(&self) -> &nanobook::portfolio::cost_model::CostModel
pub fn nanobook::portfolio::Portfolio::current_weights(&self, prices: &[(nanobook::Symbol, i64)]) -> alloc::vec::Vec<(nanobook::Symbol, f64)>
pub fn nanobook::portfolio::Portfolio::equity_curve(&self) -> &[i64]
pub fn nanobook::portfolio::Portfolio::load_json(path: &std::path::Path) -> std::io::error::Result<Self>
pub fn nanobook::portfolio::Portfolio::new(initial_cash: i64, cost_model: nanobook::portfolio::cost_model::CostModel) -> Self
pub fn nanobook::portfolio::Portfolio::position(&self, symbol: &nanobook::Symbol) -> core::option::Option<&nanobook::portfolio::position::Position>
pub fn nanobook::portfolio::Portfolio::positions(&self) -> impl core::iter::traits::iterator::Iterator<Item = (&nanobook::Symbol, &nanobook::portfolio::position::Position)>
pub fn nanobook::portfolio::Portfolio::rebalance_lob(&mut self, targets: &[(nanobook::Symbol, f64)], exchanges: &mut nanobook::multi_exchange::MultiExchange)
pub fn nanobook::portfolio::Portfolio::rebalance_simple(&mut self, targets: &[(nanobook::Symbol, f64)], prices: &[(nanobook::Symbol, i64)])
pub fn nanobook::portfolio::Portfolio::record_return(&mut self, prices: &[(nanobook::Symbol, i64)])
pub fn nanobook::portfolio::Portfolio::returns(&self) -> &[f64]
pub fn nanobook::portfolio::Portfolio::save_json(&self, path: &std::path::Path) -> std::io::error::Result<()>
pub fn nanobook::portfolio::Portfolio::snapshot(&self, prices: &[(nanobook::Symbol, i64)]) -> nanobook::portfolio::PortfolioSnapshot
pub fn nanobook::portfolio::Portfolio::total_equity(&self, prices: &[(nanobook::Symbol, i64)]) -> i64
pub struct nanobook::portfolio::PortfolioSnapshot
pub nanobook::portfolio::PortfolioSnapshot::cash: i64
pub nanobook::portfolio::PortfolioSnapshot::equity: i64
pub nanobook::portfolio::PortfolioSnapshot::num_positions: usize
pub nanobook::portfolio::PortfolioSnapshot::total_realized_pnl: i64
pub nanobook::portfolio::PortfolioSnapshot::weights: alloc::vec::Vec<(nanobook::Symbol, f64)>
pub struct nanobook::portfolio::Position
pub nanobook::portfolio::Position::avg_entry_price: i64
pub nanobook::portfolio::Position::quantity: i64
pub nanobook::portfolio::Position::realized_pnl: i64
pub nanobook::portfolio::Position::symbol: nanobook::Symbol
pub nanobook::portfolio::Position::total_cost: i64
impl nanobook::portfolio::position::Position
pub fn nanobook::portfolio::position::Position::apply_fill(&mut self, qty: i64, price: i64)
pub fn nanobook::portfolio::position::Position::is_flat(&self) -> bool
pub fn nanobook::portfolio::position::Position::market_value(&self, price: i64) -> i64
pub fn nanobook::portfolio::position::Position::new(symbol: nanobook::Symbol) -> Self
pub fn nanobook::portfolio::position::Position::unrealized_pnl(&self, price: i64) -> i64
pub trait nanobook::portfolio::Strategy
pub fn nanobook::portfolio::Strategy::compute_weights(&self, bar_index: usize, prices: &[(nanobook::Symbol, i64)], portfolio: &nanobook::portfolio::Portfolio) -> alloc::vec::Vec<(nanobook::Symbol, f64)>
impl nanobook::portfolio::strategy::Strategy for nanobook::portfolio::strategy::EqualWeight
pub fn nanobook::portfolio::strategy::EqualWeight::compute_weights(&self, _bar_index: usize, prices: &[(nanobook::Symbol, i64)], _portfolio: &nanobook::portfolio::Portfolio) -> alloc::vec::Vec<(nanobook::Symbol, f64)>
pub fn nanobook::portfolio::compute_metrics(returns: &[f64], periods_per_year: f64, risk_free: f64) -> core::option::Option<nanobook::portfolio::metrics::Metrics>
pub fn nanobook::portfolio::run_backtest<S: nanobook::portfolio::strategy::Strategy>(strategy: &S, price_series: &[alloc::vec::Vec<(nanobook::Symbol, i64)>], initial_cash: i64, cost_model: nanobook::portfolio::cost_model::CostModel, periods_per_year: f64, risk_free: f64) -> nanobook::portfolio::strategy::BacktestResult
pub mod nanobook::stats
pub fn nanobook::stats::quintile_spread(scores: &[f64], returns: &[f64], n_quantiles: usize) -> f64
pub fn nanobook::stats::spearman(x: &[f64], y: &[f64]) -> (f64, f64)
pub mod nanobook::stop
pub enum nanobook::stop::StopStatus
pub nanobook::stop::StopStatus::Cancelled
pub nanobook::stop::StopStatus::Pending
pub nanobook::stop::StopStatus::Triggered
pub enum nanobook::stop::TrailMethod
pub nanobook::stop::TrailMethod::Fixed(i64)
pub nanobook::stop::TrailMethod::Percentage(f64)
pub nanobook::stop::TrailMethod::SmaAbsChange
pub nanobook::stop::TrailMethod::SmaAbsChange::multiplier: f64
pub nanobook::stop::TrailMethod::SmaAbsChange::period: usize
pub struct nanobook::stop::StopBook
impl nanobook::stop::StopBook
pub fn nanobook::stop::StopBook::cancel(&mut self, order_id: nanobook::OrderId) -> bool
pub fn nanobook::stop::StopBook::clear_history(&mut self)
pub fn nanobook::stop::StopBook::collect_triggered(&mut self, trade_price: nanobook::Price) -> alloc::vec::Vec<nanobook::stop::StopOrder>
pub fn nanobook::stop::StopBook::contains_pending(&self, order_id: nanobook::OrderId) -> bool
pub fn nanobook::stop::StopBook::get(&self, order_id: nanobook::OrderId) -> core::option::Option<&nanobook::stop::StopOrder>
pub fn nanobook::stop::StopBook::insert(&mut self, order: nanobook::stop::StopOrder)
pub fn nanobook::stop::StopBook::is_empty(&self) -> bool
pub fn nanobook::stop::StopBook::new() -> Self
pub fn nanobook::stop::StopBook::pending_count(&self) -> usize
pub fn nanobook::stop::StopBook::update_trailing_stops(&mut self, trade_price: nanobook::Price)
pub struct nanobook::stop::StopOrder
pub nanobook::stop::StopOrder::id: nanobook::OrderId
pub nanobook::stop::StopOrder::limit_price: core::option::Option<nanobook::Price>
pub nanobook::stop::StopOrder::quantity: nanobook::Quantity
pub nanobook::stop::StopOrder::side: nanobook::Side
pub nanobook::stop::StopOrder::status: nanobook::stop::StopStatus
pub nanobook::stop::StopOrder::stop_price: nanobook::Price
pub nanobook::stop::StopOrder::time_in_force: nanobook::TimeInForce
pub nanobook::stop::StopOrder::timestamp: nanobook::Timestamp
pub nanobook::stop::StopOrder::trail_method: core::option::Option<nanobook::stop::TrailMethod>
pub nanobook::stop::StopOrder::watermark: core::option::Option<nanobook::Price>
pub enum nanobook::CancelError
pub nanobook::CancelError::OrderNotActive
pub nanobook::CancelError::OrderNotFound
pub enum nanobook::Event
pub nanobook::Event::Cancel
pub nanobook::Event::Cancel::order_id: nanobook::OrderId
pub nanobook::Event::Modify
pub nanobook::Event::Modify::new_price: nanobook::Price
pub nanobook::Event::Modify::new_quantity: nanobook::Quantity
pub nanobook::Event::Modify::order_id: nanobook::OrderId
pub nanobook::Event::SubmitLimit
pub nanobook::Event::SubmitLimit::price: nanobook::Price
pub nanobook::Event::SubmitLimit::quantity: nanobook::Quantity
pub nanobook::Event::SubmitLimit::side: nanobook::Side
pub nanobook::Event::SubmitLimit::time_in_force: nanobook::TimeInForce
pub nanobook::Event::SubmitMarket
pub nanobook::Event::SubmitMarket::quantity: nanobook::Quantity
pub nanobook::Event::SubmitMarket::side: nanobook::Side
pub nanobook::Event::SubmitStopLimit
pub nanobook::Event::SubmitStopLimit::limit_price: nanobook::Price
pub nanobook::Event::SubmitStopLimit::quantity: nanobook::Quantity
pub nanobook::Event::SubmitStopLimit::side: nanobook::Side
pub nanobook::Event::SubmitStopLimit::stop_price: nanobook::Price
pub nanobook::Event::SubmitStopLimit::time_in_force: nanobook::TimeInForce
pub nanobook::Event::SubmitStopMarket
pub nanobook::Event::SubmitStopMarket::quantity: nanobook::Quantity
pub nanobook::Event::SubmitStopMarket::side: nanobook::Side
pub nanobook::Event::SubmitStopMarket::stop_price: nanobook::Price
pub nanobook::Event::SubmitTrailingStopLimit
pub nanobook::Event::SubmitTrailingStopLimit::limit_price: nanobook::Price
pub nanobook::Event::SubmitTrailingStopLimit::quantity: nanobook::Quantity
pub nanobook::Event::SubmitTrailingStopLimit::side: nanobook::Side
pub nanobook::Event::SubmitTrailingStopLimit::stop_price: nanobook::Price
pub nanobook::Event::SubmitTrailingStopLimit::time_in_force: nanobook::TimeInForce
pub nanobook::Event::SubmitTrailingStopLimit::trail_method: nanobook::stop::TrailMethod
pub nanobook::Event::SubmitTrailingStopMarket
pub nanobook::Event::SubmitTrailingStopMarket::quantity: nanobook::Quantity
pub nanobook::Event::SubmitTrailingStopMarket::side: nanobook::Side
pub nanobook::Event::SubmitTrailingStopMarket::stop_price: nanobook::Price
pub nanobook::Event::SubmitTrailingStopMarket::trail_method: nanobook::stop::TrailMethod
impl nanobook::Event
pub fn nanobook::Event::cancel(order_id: nanobook::OrderId) -> Self
pub fn nanobook::Event::modify(order_id: nanobook::OrderId, new_price: nanobook::Price, new_quantity: nanobook::Quantity) -> Self
pub fn nanobook::Event::submit_limit(side: nanobook::Side, price: nanobook::Price, quantity: nanobook::Quantity, time_in_force: nanobook::TimeInForce) -> Self
pub fn nanobook::Event::submit_market(side: nanobook::Side, quantity: nanobook::Quantity) -> Self
pub fn nanobook::Event::submit_stop_limit(side: nanobook::Side, stop_price: nanobook::Price, limit_price: nanobook::Price, quantity: nanobook::Quantity, time_in_force: nanobook::TimeInForce) -> Self
pub fn nanobook::Event::submit_stop_market(side: nanobook::Side, stop_price: nanobook::Price, quantity: nanobook::Quantity) -> Self
pub fn nanobook::Event::submit_trailing_stop_limit(side: nanobook::Side, stop_price: nanobook::Price, limit_price: nanobook::Price, quantity: nanobook::Quantity, time_in_force: nanobook::TimeInForce, trail_method: nanobook::stop::TrailMethod) -> Self
pub fn nanobook::Event::submit_trailing_stop_market(side: nanobook::Side, stop_price: nanobook::Price, quantity: nanobook::Quantity, trail_method: nanobook::stop::TrailMethod) -> Self
pub enum nanobook::ModifyError
pub nanobook::ModifyError::InvalidQuantity
pub nanobook::ModifyError::OrderNotActive
pub nanobook::ModifyError::OrderNotFound
pub enum nanobook::OrderStatus
pub nanobook::OrderStatus::Cancelled
pub nanobook::OrderStatus::Filled
pub nanobook::OrderStatus::New
pub nanobook::OrderStatus::PartiallyFilled
impl nanobook::OrderStatus
pub fn nanobook::OrderStatus::is_active(self) -> bool
pub fn nanobook::OrderStatus::is_terminal(self) -> bool
pub enum nanobook::Side
pub nanobook::Side::Buy
pub nanobook::Side::Sell
impl nanobook::Side
pub fn nanobook::Side::opposite(self) -> Self
impl core::fmt::Display for nanobook::Side
pub fn nanobook::Side::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
pub enum nanobook::StopStatus
pub nanobook::StopStatus::Cancelled
pub nanobook::StopStatus::Pending
pub nanobook::StopStatus::Triggered
pub enum nanobook::StpPolicy
pub nanobook::StpPolicy::CancelNewest
pub nanobook::StpPolicy::CancelOldest
pub nanobook::StpPolicy::DecrementAndCancel
pub nanobook::StpPolicy::Off
pub enum nanobook::TimeInForce
pub nanobook::TimeInForce::FOK
pub nanobook::TimeInForce::GTC
pub nanobook::TimeInForce::IOC
impl nanobook::TimeInForce
pub fn nanobook::TimeInForce::allows_partial(self) -> bool
pub fn nanobook::TimeInForce::can_rest(self) -> bool
impl core::fmt::Display for nanobook::TimeInForce
pub fn nanobook::TimeInForce::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
pub enum nanobook::TrailMethod
pub nanobook::TrailMethod::Fixed(i64)
pub nanobook::TrailMethod::Percentage(f64)
pub nanobook::TrailMethod::SmaAbsChange
pub nanobook::TrailMethod::SmaAbsChange::multiplier: f64
pub nanobook::TrailMethod::SmaAbsChange::period: usize
pub enum nanobook::ValidationError
pub nanobook::ValidationError::NotionalOverflow
pub nanobook::ValidationError::NotionalOverflow::price: i64
pub nanobook::ValidationError::NotionalOverflow::quantity: u64
pub nanobook::ValidationError::ZeroPrice
pub nanobook::ValidationError::ZeroQuantity
impl core::error::Error for nanobook::ValidationError
impl core::fmt::Display for nanobook::ValidationError
pub fn nanobook::ValidationError::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
pub struct nanobook::ApplyResult
pub nanobook::ApplyResult::trades: alloc::vec::Vec<nanobook::Trade>
pub struct nanobook::BookSnapshot
pub nanobook::BookSnapshot::asks: alloc::vec::Vec<nanobook::LevelSnapshot>
pub nanobook::BookSnapshot::bids: alloc::vec::Vec<nanobook::LevelSnapshot>
pub nanobook::BookSnapshot::timestamp: nanobook::Timestamp
impl nanobook::BookSnapshot
pub fn nanobook::BookSnapshot::best_ask(&self) -> core::option::Option<nanobook::Price>
pub fn nanobook::BookSnapshot::best_bid(&self) -> core::option::Option<nanobook::Price>
pub fn nanobook::BookSnapshot::imbalance(&self) -> core::option::Option<f64>
pub fn nanobook::BookSnapshot::mid_price(&self) -> core::option::Option<f64>
pub fn nanobook::BookSnapshot::spread(&self) -> core::option::Option<i64>
pub fn nanobook::BookSnapshot::total_ask_quantity(&self) -> nanobook::Quantity
pub fn nanobook::BookSnapshot::total_bid_quantity(&self) -> nanobook::Quantity
pub fn nanobook::BookSnapshot::weighted_mid(&self) -> core::option::Option<f64>
pub struct nanobook::CancelResult
pub nanobook::CancelResult::cancelled_quantity: nanobook::Quantity
pub nanobook::CancelResult::error: core::option::Option<nanobook::CancelError>
pub nanobook::CancelResult::success: bool
impl nanobook::CancelResult
pub fn nanobook::CancelResult::failure(error: nanobook::CancelError) -> Self
pub fn nanobook::CancelResult::success(cancelled_quantity: nanobook::Quantity) -> Self
pub struct nanobook::Exchange
impl nanobook::Exchange
pub fn nanobook::Exchange::apply(&mut self, event: &nanobook::Event) -> nanobook::ApplyResult
pub fn nanobook::Exchange::apply_all(&mut self, events: &[nanobook::Event]) -> alloc::vec::Vec<nanobook::Trade>
pub fn nanobook::Exchange::clear_events(&mut self)
pub fn nanobook::Exchange::events(&self) -> &[nanobook::Event]
pub fn nanobook::Exchange::replay(events: &[nanobook::Event]) -> Self
impl nanobook::Exchange
pub fn nanobook::Exchange::best_ask(&self) -> core::option::Option<nanobook::Price>
pub fn nanobook::Exchange::best_bid(&self) -> core::option::Option<nanobook::Price>
pub fn nanobook::Exchange::best_bid_ask(&self) -> (core::option::Option<nanobook::Price>, core::option::Option<nanobook::Price>)
pub fn nanobook::Exchange::book(&self) -> &nanobook::OrderBook
pub fn nanobook::Exchange::book_mut(&mut self) -> &mut nanobook::OrderBook
pub fn nanobook::Exchange::cancel(&mut self, order_id: nanobook::OrderId) -> nanobook::CancelResult
pub fn nanobook::Exchange::clear_order_history(&mut self) -> usize
pub fn nanobook::Exchange::clear_trades(&mut self)
pub fn nanobook::Exchange::compact(&mut self)
pub fn nanobook::Exchange::depth(&self, levels: usize) -> nanobook::BookSnapshot
pub fn nanobook::Exchange::full_book(&self) -> nanobook::BookSnapshot
pub fn nanobook::Exchange::get_order(&self, order_id: nanobook::OrderId) -> core::option::Option<&nanobook::Order>
pub fn nanobook::Exchange::get_stop_order(&self, order_id: nanobook::OrderId) -> core::option::Option<&nanobook::stop::StopOrder>
pub fn nanobook::Exchange::last_trade_price(&self) -> core::option::Option<nanobook::Price>
pub fn nanobook::Exchange::modify(&mut self, order_id: nanobook::OrderId, new_price: nanobook::Price, new_quantity: nanobook::Quantity) -> nanobook::ModifyResult
pub fn nanobook::Exchange::new() -> Self
pub fn nanobook::Exchange::pending_stop_count(&self) -> usize
pub fn nanobook::Exchange::spread(&self) -> core::option::Option<i64>
pub fn nanobook::Exchange::stop_book(&self) -> &nanobook::stop::StopBook
pub fn nanobook::Exchange::stp_policy(&self) -> nanobook::StpPolicy
pub fn nanobook::Exchange::submit_limit(&mut self, side: nanobook::Side, price: nanobook::Price, quantity: nanobook::Quantity, tif: nanobook::TimeInForce) -> nanobook::SubmitResult
pub fn nanobook::Exchange::submit_limit_with_owner(&mut self, side: nanobook::Side, price: nanobook::Price, quantity: nanobook::Quantity, tif: nanobook::TimeInForce, owner: nanobook::OrderOwner) -> nanobook::SubmitResult
pub fn nanobook::Exchange::submit_market(&mut self, side: nanobook::Side, quantity: nanobook::Quantity) -> nanobook::SubmitResult
pub fn nanobook::Exchange::submit_stop_limit(&mut self, side: nanobook::Side, stop_price: nanobook::Price, limit_price: nanobook::Price, quantity: nanobook::Quantity, tif: nanobook::TimeInForce) -> nanobook::StopSubmitResult
pub fn nanobook::Exchange::submit_stop_market(&mut self, side: nanobook::Side, stop_price: nanobook::Price, quantity: nanobook::Quantity) -> nanobook::StopSubmitResult
pub fn nanobook::Exchange::submit_trailing_stop_limit(&mut self, side: nanobook::Side, initial_stop_price: nanobook::Price, limit_price: nanobook::Price, quantity: nanobook::Quantity, tif: nanobook::TimeInForce, trail_method: nanobook::stop::TrailMethod) -> nanobook::StopSubmitResult
pub fn nanobook::Exchange::submit_trailing_stop_market(&mut self, side: nanobook::Side, initial_stop_price: nanobook::Price, quantity: nanobook::Quantity, trail_method: nanobook::stop::TrailMethod) -> nanobook::StopSubmitResult
pub fn nanobook::Exchange::trades(&self) -> &[nanobook::Trade]
pub fn nanobook::Exchange::try_submit_limit(&mut self, side: nanobook::Side, price: nanobook::Price, quantity: nanobook::Quantity, tif: nanobook::TimeInForce) -> core::result::Result<nanobook::SubmitResult, nanobook::ValidationError>
pub fn nanobook::Exchange::try_submit_market(&mut self, side: nanobook::Side, quantity: nanobook::Quantity) -> core::result::Result<nanobook::SubmitResult, nanobook::ValidationError>
pub fn nanobook::Exchange::with_stp_policy(self, policy: nanobook::StpPolicy) -> Self
impl nanobook::Exchange
pub fn nanobook::Exchange::load(path: &std::path::Path) -> std::io::error::Result<Self>
pub fn nanobook::Exchange::save(&self, path: &std::path::Path) -> std::io::error::Result<()>
impl core::default::Default for nanobook::Exchange
pub fn nanobook::Exchange::default() -> Self
pub struct nanobook::Level
impl nanobook::Level
pub fn nanobook::Level::compact(&mut self)
pub fn nanobook::Level::decrease_quantity(&mut self, amount: nanobook::Quantity)
pub fn nanobook::Level::front(&mut self) -> core::option::Option<nanobook::OrderId>
pub fn nanobook::Level::is_empty(&self) -> bool
pub fn nanobook::Level::iter(&self) -> impl core::iter::traits::iterator::Iterator<Item = nanobook::OrderId> + '_
pub fn nanobook::Level::mark_tombstone(&mut self, index: usize, quantity: nanobook::Quantity)
pub fn nanobook::Level::new(price: nanobook::Price) -> Self
pub fn nanobook::Level::order_count(&self) -> usize
pub fn nanobook::Level::pop_front(&mut self, quantity: nanobook::Quantity) -> core::option::Option<nanobook::OrderId>
pub fn nanobook::Level::price(&self) -> nanobook::Price
pub fn nanobook::Level::push_back(&mut self, order_id: nanobook::OrderId, quantity: nanobook::Quantity)
pub fn nanobook::Level::raw_len(&self) -> usize
pub fn nanobook::Level::remove(&mut self, order_id: nanobook::OrderId, quantity: nanobook::Quantity) -> bool
pub fn nanobook::Level::tombstone_count(&self) -> usize
pub fn nanobook::Level::total_quantity(&self) -> nanobook::Quantity
pub struct nanobook::LevelSnapshot
pub nanobook::LevelSnapshot::order_count: usize
pub nanobook::LevelSnapshot::price: nanobook::Price
pub nanobook::LevelSnapshot::quantity: nanobook::Quantity
pub struct nanobook::MatchResult
pub nanobook::MatchResult::remaining_quantity: nanobook::Quantity
pub nanobook::MatchResult::stp_cancelled: bool
pub nanobook::MatchResult::trades: alloc::vec::Vec<nanobook::Trade>
impl nanobook::MatchResult
pub fn nanobook::MatchResult::filled_quantity(&self) -> nanobook::Quantity
pub fn nanobook::MatchResult::is_empty(&self) -> bool
pub fn nanobook::MatchResult::is_fully_filled(&self) -> bool
pub struct nanobook::ModifyResult
pub nanobook::ModifyResult::cancelled_quantity: nanobook::Quantity
pub nanobook::ModifyResult::error: core::option::Option<nanobook::ModifyError>
pub nanobook::ModifyResult::new_order_id: core::option::Option<nanobook::OrderId>
pub nanobook::ModifyResult::old_order_id: nanobook::OrderId
pub nanobook::ModifyResult::success: bool
pub nanobook::ModifyResult::trades: alloc::vec::Vec<nanobook::Trade>
impl nanobook::ModifyResult
pub fn nanobook::ModifyResult::failure(old_order_id: nanobook::OrderId, error: nanobook::ModifyError) -> Self
pub fn nanobook::ModifyResult::success(old_order_id: nanobook::OrderId, new_order_id: nanobook::OrderId, cancelled_quantity: nanobook::Quantity, trades: alloc::vec::Vec<nanobook::Trade>) -> Self
pub struct nanobook::MultiExchange
impl nanobook::multi_exchange::MultiExchange
pub fn nanobook::multi_exchange::MultiExchange::best_prices(&self) -> alloc::vec::Vec<(nanobook::Symbol, core::option::Option<nanobook::Price>, core::option::Option<nanobook::Price>)>
pub fn nanobook::multi_exchange::MultiExchange::get(&self, symbol: &nanobook::Symbol) -> core::option::Option<&nanobook::Exchange>
pub fn nanobook::multi_exchange::MultiExchange::get_mut(&mut self, symbol: &nanobook::Symbol) -> core::option::Option<&mut nanobook::Exchange>
pub fn nanobook::multi_exchange::MultiExchange::get_or_create(&mut self, symbol: &nanobook::Symbol) -> &mut nanobook::Exchange
pub fn nanobook::multi_exchange::MultiExchange::is_empty(&self) -> bool
pub fn nanobook::multi_exchange::MultiExchange::len(&self) -> usize
pub fn nanobook::multi_exchange::MultiExchange::new() -> Self
pub fn nanobook::multi_exchange::MultiExchange::symbols(&self) -> impl core::iter::traits::iterator::Iterator<Item = &nanobook::Symbol>
pub struct nanobook::Order
pub nanobook::Order::filled_quantity: nanobook::Quantity
pub nanobook::Order::id: nanobook::OrderId
pub nanobook::Order::original_quantity: nanobook::Quantity
pub nanobook::Order::owner: core::option::Option<nanobook::OrderOwner>
pub nanobook::Order::price: nanobook::Price
pub nanobook::Order::remaining_quantity: nanobook::Quantity
pub nanobook::Order::side: nanobook::Side
pub nanobook::Order::status: nanobook::OrderStatus
pub nanobook::Order::time_in_force: nanobook::TimeInForce
pub nanobook::Order::timestamp: nanobook::Timestamp
impl nanobook::Order
pub fn nanobook::Order::cancel(&mut self) -> nanobook::Quantity
pub fn nanobook::Order::fill(&mut self, quantity: nanobook::Quantity)
pub fn nanobook::Order::is_active(&self) -> bool
pub fn nanobook::Order::new(id: nanobook::OrderId, side: nanobook::Side, price: nanobook::Price, quantity: nanobook::Quantity, timestamp: nanobook::Timestamp, time_in_force: nanobook::TimeInForce) -> Self
pub fn nanobook::Order::with_owner(self, owner: nanobook::OrderOwner) -> Self
pub struct nanobook::OrderBook
impl nanobook::OrderBook
pub fn nanobook::OrderBook::active_order_count(&self) -> usize
pub fn nanobook::OrderBook::add_order(&mut self, order: nanobook::Order)
pub fn nanobook::OrderBook::asks(&self) -> &nanobook::PriceLevels
pub fn nanobook::OrderBook::asks_mut(&mut self) -> &mut nanobook::PriceLevels
pub fn nanobook::OrderBook::best_ask(&self) -> core::option::Option<nanobook::Price>
pub fn nanobook::OrderBook::best_bid(&self) -> core::option::Option<nanobook::Price>
pub fn nanobook::OrderBook::best_bid_ask(&self) -> (core::option::Option<nanobook::Price>, core::option::Option<nanobook::Price>)
pub fn nanobook::OrderBook::bids(&self) -> &nanobook::PriceLevels
pub fn nanobook::OrderBook::bids_mut(&mut self) -> &mut nanobook::PriceLevels
pub fn nanobook::OrderBook::cancel_order(&mut self, order_id: nanobook::OrderId) -> core::option::Option<nanobook::Quantity>
pub fn nanobook::OrderBook::clear_history(&mut self) -> usize
pub fn nanobook::OrderBook::compact(&mut self)
pub fn nanobook::OrderBook::contains_order(&self, order_id: nanobook::OrderId) -> bool
pub fn nanobook::OrderBook::create_order(&mut self, side: nanobook::Side, price: nanobook::Price, quantity: nanobook::Quantity, time_in_force: nanobook::TimeInForce) -> nanobook::Order
pub fn nanobook::OrderBook::get_order(&self, order_id: nanobook::OrderId) -> core::option::Option<&nanobook::Order>
pub fn nanobook::OrderBook::get_order_mut(&mut self, order_id: nanobook::OrderId) -> core::option::Option<&mut nanobook::Order>
pub fn nanobook::OrderBook::is_crossed(&self) -> bool
pub fn nanobook::OrderBook::new() -> Self
pub fn nanobook::OrderBook::next_order_id(&mut self) -> nanobook::OrderId
pub fn nanobook::OrderBook::next_timestamp(&mut self) -> nanobook::Timestamp
pub fn nanobook::OrderBook::next_trade_id(&mut self) -> nanobook::TradeId
pub fn nanobook::OrderBook::opposite_side(&self, side: nanobook::Side) -> &nanobook::PriceLevels
pub fn nanobook::OrderBook::opposite_side_mut(&mut self, side: nanobook::Side) -> &mut nanobook::PriceLevels
pub fn nanobook::OrderBook::order_count(&self) -> usize
pub fn nanobook::OrderBook::peek_next_order_id(&self) -> nanobook::OrderId
pub fn nanobook::OrderBook::side(&self, side: nanobook::Side) -> &nanobook::PriceLevels
pub fn nanobook::OrderBook::side_mut(&mut self, side: nanobook::Side) -> &mut nanobook::PriceLevels
pub fn nanobook::OrderBook::spread(&self) -> core::option::Option<i64>
impl nanobook::OrderBook
pub fn nanobook::OrderBook::available_to_fill(&self, side: nanobook::Side, price: nanobook::Price) -> nanobook::Quantity
pub fn nanobook::OrderBook::can_fully_fill(&self, side: nanobook::Side, price: nanobook::Price, quantity: nanobook::Quantity) -> bool
pub fn nanobook::OrderBook::match_order(&mut self, incoming: &mut nanobook::Order) -> nanobook::MatchResult
pub fn nanobook::OrderBook::match_order_with_policy(&mut self, incoming: &mut nanobook::Order, policy: nanobook::StpPolicy) -> nanobook::MatchResult
impl nanobook::OrderBook
pub fn nanobook::OrderBook::full_snapshot(&self) -> nanobook::BookSnapshot
pub fn nanobook::OrderBook::snapshot(&self, depth: usize) -> nanobook::BookSnapshot
impl core::default::Default for nanobook::OrderBook
pub fn nanobook::OrderBook::default() -> Self
pub struct nanobook::OrderId(pub u64)
impl core::fmt::Display for nanobook::OrderId
pub fn nanobook::OrderId::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
pub struct nanobook::OrderOwner(pub u32)
pub struct nanobook::Price(pub i64)
impl nanobook::Price
pub const nanobook::Price::MAX: nanobook::Price
pub const nanobook::Price::MIN: nanobook::Price
pub const nanobook::Price::ZERO: nanobook::Price
impl core::fmt::Display for nanobook::Price
pub fn nanobook::Price::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
pub struct nanobook::PriceLevels
impl nanobook::PriceLevels
pub fn nanobook::PriceLevels::best_level(&self) -> core::option::Option<&nanobook::Level>
pub fn nanobook::PriceLevels::best_level_mut(&mut self) -> core::option::Option<&mut nanobook::Level>
pub fn nanobook::PriceLevels::best_price(&self) -> core::option::Option<nanobook::Price>
pub fn nanobook::PriceLevels::compact(&mut self)
pub fn nanobook::PriceLevels::get_level(&self, price: nanobook::Price) -> core::option::Option<&nanobook::Level>
pub fn nanobook::PriceLevels::get_level_mut(&mut self, price: nanobook::Price) -> core::option::Option<&mut nanobook::Level>
pub fn nanobook::PriceLevels::get_or_create_level(&mut self, price: nanobook::Price) -> &mut nanobook::Level
pub fn nanobook::PriceLevels::insert_order(&mut self, price: nanobook::Price, order_id: nanobook::OrderId, quantity: nanobook::Quantity) -> usize
pub fn nanobook::PriceLevels::is_empty(&self) -> bool
pub fn nanobook::PriceLevels::iter_best_to_worst(&self) -> impl core::iter::traits::iterator::Iterator<Item = (&nanobook::Price, &nanobook::Level)>
pub fn nanobook::PriceLevels::level_count(&self) -> usize
pub fn nanobook::PriceLevels::mark_tombstone(&mut self, price: nanobook::Price, index: usize, quantity: nanobook::Quantity)
pub fn nanobook::PriceLevels::new(side: nanobook::Side) -> Self
pub fn nanobook::PriceLevels::pop_best_level(&mut self) -> core::option::Option<nanobook::Level>
pub fn nanobook::PriceLevels::quantity_at_or_better(&self, price: nanobook::Price) -> nanobook::Quantity
pub fn nanobook::PriceLevels::remove_level(&mut self, price: nanobook::Price)
pub fn nanobook::PriceLevels::remove_order(&mut self, price: nanobook::Price, order_id: nanobook::OrderId, quantity: nanobook::Quantity) -> bool
pub fn nanobook::PriceLevels::side(&self) -> nanobook::Side
pub fn nanobook::PriceLevels::total_quantity(&self) -> nanobook::Quantity
pub struct nanobook::StopBook
impl nanobook::stop::StopBook
pub fn nanobook::stop::StopBook::cancel(&mut self, order_id: nanobook::OrderId) -> bool
pub fn nanobook::stop::StopBook::clear_history(&mut self)
pub fn nanobook::stop::StopBook::collect_triggered(&mut self, trade_price: nanobook::Price) -> alloc::vec::Vec<nanobook::stop::StopOrder>
pub fn nanobook::stop::StopBook::contains_pending(&self, order_id: nanobook::OrderId) -> bool
pub fn nanobook::stop::StopBook::get(&self, order_id: nanobook::OrderId) -> core::option::Option<&nanobook::stop::StopOrder>
pub fn nanobook::stop::StopBook::insert(&mut self, order: nanobook::stop::StopOrder)
pub fn nanobook::stop::StopBook::is_empty(&self) -> bool
pub fn nanobook::stop::StopBook::new() -> Self
pub fn nanobook::stop::StopBook::pending_count(&self) -> usize
pub fn nanobook::stop::StopBook::update_trailing_stops(&mut self, trade_price: nanobook::Price)
pub struct nanobook::StopOrder
pub nanobook::StopOrder::id: nanobook::OrderId
pub nanobook::StopOrder::limit_price: core::option::Option<nanobook::Price>
pub nanobook::StopOrder::quantity: nanobook::Quantity
pub nanobook::StopOrder::side: nanobook::Side
pub nanobook::StopOrder::status: nanobook::stop::StopStatus
pub nanobook::StopOrder::stop_price: nanobook::Price
pub nanobook::StopOrder::time_in_force: nanobook::TimeInForce
pub nanobook::StopOrder::timestamp: nanobook::Timestamp
pub nanobook::StopOrder::trail_method: core::option::Option<nanobook::stop::TrailMethod>
pub nanobook::StopOrder::watermark: core::option::Option<nanobook::Price>
pub struct nanobook::StopSubmitResult
pub nanobook::StopSubmitResult::order_id: nanobook::OrderId
pub nanobook::StopSubmitResult::status: nanobook::stop::StopStatus
pub struct nanobook::SubmitResult
pub nanobook::SubmitResult::cancelled_quantity: nanobook::Quantity
pub nanobook::SubmitResult::filled_quantity: nanobook::Quantity
pub nanobook::SubmitResult::order_id: nanobook::OrderId
pub nanobook::SubmitResult::resting_quantity: nanobook::Quantity
pub nanobook::SubmitResult::status: nanobook::OrderStatus
pub nanobook::SubmitResult::trades: alloc::vec::Vec<nanobook::Trade>
impl nanobook::SubmitResult
pub fn nanobook::SubmitResult::has_trades(&self) -> bool
pub fn nanobook::SubmitResult::is_fully_filled(&self) -> bool
pub fn nanobook::SubmitResult::is_resting(&self) -> bool
pub struct nanobook::Symbol
impl nanobook::Symbol
pub fn nanobook::Symbol::as_str(&self) -> &str
pub fn nanobook::Symbol::from_str_truncated(s: &str) -> Self
pub fn nanobook::Symbol::new(s: &str) -> Self
pub fn nanobook::Symbol::try_new(s: &str) -> core::option::Option<Self>
impl core::convert::AsRef<str> for nanobook::Symbol
pub fn nanobook::Symbol::as_ref(&self) -> &str
impl core::fmt::Debug for nanobook::Symbol
pub fn nanobook::Symbol::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
impl core::fmt::Display for nanobook::Symbol
pub fn nanobook::Symbol::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
impl serde_core::ser::Serialize for nanobook::Symbol
pub fn nanobook::Symbol::serialize<S: serde_core::ser::Serializer>(&self, serializer: S) -> core::result::Result<<S as serde_core::ser::Serializer>::Ok, <S as serde_core::ser::Serializer>::Error>
impl<'de> serde_core::de::Deserialize<'de> for nanobook::Symbol
pub fn nanobook::Symbol::deserialize<D: serde_core::de::Deserializer<'de>>(deserializer: D) -> core::result::Result<Self, <D as serde_core::de::Deserializer>::Error>
pub struct nanobook::Trade
pub nanobook::Trade::aggressor_order_id: nanobook::OrderId
pub nanobook::Trade::aggressor_side: nanobook::Side
pub nanobook::Trade::id: nanobook::TradeId
pub nanobook::Trade::passive_order_id: nanobook::OrderId
pub nanobook::Trade::price: nanobook::Price
pub nanobook::Trade::quantity: nanobook::Quantity
pub nanobook::Trade::timestamp: nanobook::Timestamp
impl nanobook::Trade
pub fn nanobook::Trade::new(id: nanobook::TradeId, price: nanobook::Price, quantity: nanobook::Quantity, aggressor_order_id: nanobook::OrderId, passive_order_id: nanobook::OrderId, aggressor_side: nanobook::Side, timestamp: nanobook::Timestamp) -> Self
pub fn nanobook::Trade::notional(&self) -> core::result::Result<i64, nanobook::ValidationError>
pub fn nanobook::Trade::passive_side(&self) -> nanobook::Side
pub fn nanobook::Trade::vwap(trades: &[nanobook::Trade]) -> core::option::Option<nanobook::Price>
impl core::fmt::Display for nanobook::Trade
pub fn nanobook::Trade::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
pub struct nanobook::TradeId(pub u64)
impl core::fmt::Display for nanobook::TradeId
pub fn nanobook::TradeId::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
pub type nanobook::Quantity = u64
pub type nanobook::Timestamp = u64
