Brokers & Datafeeds
AQE keeps execution and market data behind broker/datafeed traits so strategy code can run against the same runtime surface in backtests, paper workflows, and live operation.
Current integrations
Section titled “Current integrations”AQE currently exposes these concrete runtime integrations:
- execution brokers:
PaperBroker,Mt5Broker - datafeeds:
YahooFinanceDataFeed,Mt5DataFeed
Start with the focused integration pages:
- PaperBroker and paper execution covers simulated execution, paper-account state, Yahoo market data, and the asset fee model.
- MT5 broker and datafeed integration covers the live MetaTrader 5 bridge, Expert Advisor setup, and MT5 fee data sources.
They are composed through UnifiedBroker, which gives the strategy runtime one consistent broker-facing surface.
Broker traits
Section titled “Broker traits”pub trait Broker { async fn connect(&self) -> Result<bool, BrokerError>; async fn disconnect(&self) -> Result<bool, BrokerError>; fn is_connected(&self) -> bool; fn get_name(&self) -> String; fn get_account_type(&self) -> Result<AccountType, BrokerError>;}
pub trait OrderManagementProvider: Broker { async fn submit_order(&self, insight: Insight) -> Result<Order, BrokerError>; async fn cancel_order(&self, order_id: &str) -> Result<bool, BrokerError>; async fn close_position(&self, order_id: &str, qty: f64, price: Option<f64>) -> Result<bool, BrokerError>; async fn get_account(&self) -> Result<Account, BrokerError>; fn drain_trade_events(&self) -> Vec<(Order, TradeUpdateEvent)>;}Datafeed traits
Section titled “Datafeed traits”pub trait DataFeed { async fn connect(&self) -> Result<bool, BrokerError>; async fn disconnect(&self) -> Result<bool, BrokerError>; fn is_connected(&self) -> bool;}
pub trait DataProvider: DataFeed { async fn get_ticker_info(&self, symbol: &str) -> Result<Asset, BrokerError>; async fn get_history( &self, symbol: &str, start: DateTime<Utc>, end: DateTime<Utc>, time_frame: TimeFrame, ) -> Result<DataFrame, BrokerError>; async fn get_latest_quote(&self, symbol: &str) -> Result<Quote, BrokerError>; async fn get_latest_bar(&self, symbol: &str) -> Result<Bar, BrokerError>;}Combining brokers and datafeeds
Section titled “Combining brokers and datafeeds”let execution = PaperBroker::new(AccountType::Paper, 100_000.0, 1);let data = YahooFinanceDataFeed::new();
let broker = UnifiedBroker::new_backtest(execution, data);For live operation, the same pattern applies, but the runtime uses the live path instead of new_backtest(...).
What AQS consumes from live execution
Section titled “What AQS consumes from live execution”When live sync is enabled, AQE publishes broker/runtime state into session-scoped tables used by AQS:
insightsstrategy_accountsstrategy_equity_pointsstrategy_live_metricsstrategy_events
That means broker/datafeed behaviour directly shapes what the operator sees in the desktop UI.
Related source
Section titled “Related source”aq-engine/src/core/broker/mod.rsaq-engine/src/core/broker/types/mod.rsaq-engine/src/core/broker/paper_broker.rsaq-engine/src/core/broker/mt5_broker.rsaq-engine/src/core/broker/data_feeds/yahoo.rs
We use essential cookies and storage for sign-in, account security, colour theme preferences, this notice, and required PostHog internal usage, session quality, and reliability metrics. We do not use advertising cookies.
