MidasTrader
MidasTrader is a robust trading system designed for seamless transitions between backtesting and live trading without requiring changes to user code. It integrates a flexible architecture combining a data engine, execution engine, and core components that streamline the strategy development process. The system is built with a multi-threaded design where each component communicates via a shared message bus.
Key Components
-
Core Engine:
- Central to the system, the Core Engine includes:
- Order Book: Tracks market depth and price movements.
- Portfolio Server: Manages and tracks portfolio allocations and positions.
- Performance Tracking: Calculates and monitors key trading metrics.
- Order Management System: Handles order placement, modifications, and cancellations.
- Base Strategy: A foundation for user-defined strategies.
- Central to the system, the Core Engine includes:
-
Data Engine:
- Connects to user-defined data sources:
- Midas Server: Access historical data via the Midas ecosystem.
- Binary Data Files: Handles local files encoded with the Midas Binary Encoding Library.
- External Sources: Currently supports Databento, with more integrations planned.
- Connects to user-defined data sources:
-
Execution Engine:
- Facilitates live trading by connecting to brokers:
- Currently supports Interactive Brokers.
- Users can configure broker details in the
config.tomlfile.
- Facilitates live trading by connecting to brokers:
Installation
You can install midastrader directly from PyPI:
pip install midastrader
Configuration
Configuration File (config.toml)
Define system parameters, including data sources, execution settings, and strategy configuration.
- Example : config.toml
Strategy File (logic.py)
Strategies are implemented by extending the BaseStrategy class. Define your custom logic in Python.
- Example : logic.py
Usage
CLI Mode
Run the system using the following commands:
# Backtest Mode
midas path/to/config.toml backtest
# Live Mode
midas path/to/config.toml live
Application Mode
Alternatively, you can use the system programmatically in your application:
from midas.cli import run
# Backtest Mode
run("path/to/config.toml", "backtest")
# Live Mode
run("path/to/config.toml", "live")
Supported Features
| Data Vendors | |
|---|---|
| ✅ | Databento |
| Brokers | |
|---|---|
| ✅ | Interactive Brokers |
Future Plans
- Add more data sources.
- Integrate additional brokers.
Contributing
Contributions are welcome! Feel free to open an issue or submit a pull request with suggestions or improvements.
License
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
Metadata
Release files for midastrader 1.0.30
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| midastrader-1.0.30.tar.gz | 88.9 kB | Without provenance | Details for midastrader-1.0.30.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| midastrader-1.0.30-py3-none-any.whl | Python 3 | none | any | Details for midastrader-1.0.30-py3-none-any.whl |
Total release size: 201.8 kB
Release files / midastrader-1.0.30.tar.gz
| Download URL | midastrader-1.0.30.tar.gz |
|---|---|
| Size | 88.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1b4bd944c5e2048f644343102d32ca70a4c5abdf8faf600c1364985c2fae3307
|
|
BLAKE2b-256 checksum How to use checksums |
af35b9c006ae679e7f7472e20f41e809c129285b56b52d753f0bdd3a5fa344c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.18
|
Release files / midastrader-1.0.30-py3-none-any.whl
| Download URL | midastrader-1.0.30-py3-none-any.whl |
|---|---|
| Size | 112.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3bea69a7591e3907fdca9bcea6e2eccfa51941ee0939582e5b63db91c076061b
|
|
BLAKE2b-256 checksum How to use checksums |
b040aa77bb26b36277a1d2270b1d1fe6521c68fd09feded6aeddde9345285e85
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.18
|
Security for midastrader 1.0.30
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.