Crate barter

Source
Expand description

§Barter

Barter core is a Rust framework for building high-performance live-trading, paper-trading and back-testing systems.

  • Fast: Written in native Rust. Minimal allocations. Data-oriented state management system with direct index lookups.
  • Robust: Strongly typed. Thread safe. Extensive test coverage.
  • Customisable: Plug and play Strategy and RiskManager components that facilitates most trading strategies (MarketMaking, StatArb, HFT, etc.).
  • Scalable: Multithreaded architecture with modular design. Leverages Tokio for I/O. Memory efficient data structures.

§Overview

Barter core is a Rust framework for building professional grade live-trading, paper-trading and back-testing systems. The central Engine facilitates executing on many exchanges simultaneously, and offers the flexibility to run most types of trading strategies. It allows turning algorithmic order generation on/off and can action Commands issued from external processes (eg/ CloseAllPositions, OpenOrders, CancelOrders, etc.)

At a high-level, it provides a few major components:

  • Engine with plug and play Strategy and RiskManager components.
  • Centralised cache friendly EngineState management with O(1) constant lookups using indexed data structures.
  • Strategy interfaces for customising Engine behavior (AlgoStrategy, ClosePositionsStrategy, OnDisconnectStrategy, etc.).
  • RiskManager interface for defining custom risk logic which checking generated algorithmic orders.
  • Event-driven system that allows for Commands to be issued from external processes (eg/ CloseAllPositions, OpenOrders, CancelOrders, etc.), as well as turning algorithmic trading on/off.
  • Comprehensive statistics package that provides a summary of key performance metrics (PnL, Sharpe, Sortino, Drawdown, etc.).

§Getting Started Via Engine Examples

See Engine Examples

Modules§

backtest
Backtesting utilities.
engine
Algorithmic trading Engine, and entry points for processing input Events.
error
Defines all possible errors in Barter core.
execution
Components for initialising multi-exchange execution, routing ExecutionRequests and other execution logic.
logging
Provides default Barter core Tracing logging initialisers.
risk
RiskManager interface for reviewing and optionally filtering algorithmic cancel and open order requests.
shutdown
Traits and types related to component shutdowns.
statistic
Statistical algorithms for analysing datasets, financial metrics and financial summaries.
strategy
Strategy interfaces for generating algorithmic orders, closing positions, and performing Engine actions on disconnect / trading disabled.
system
Utilities for initialising and interacting with a full trading system.
test_utils
Barter core test utilities.

Structs§

Sequence
Monotonically increasing event sequence. Used to track Engine event processing sequence.
Timed
A timed value.

Enums§

EngineEvent
Default Engine event that encompasses market events, account/execution events, and Engine commands.