# MidasTrader
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
[![pypi-version](https://img.shields.io/pypi/v/midastrader.svg)](https://pypi.org/project/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
1. **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.
2. **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.
3. **Execution Engine**:
- Facilitates live trading by connecting to brokers:
- Currently supports Interactive Brokers.
- Users can configure broker details in the `config.toml` file.
## Installation
You can install `midastrader` directly from [PyPI](https://pypi.org/project/midastrader/):
```bash
pip install midastrader
```
## Configuration
### Configuration File (`config.toml`)
Define system parameters, including data sources, execution settings, and strategy configuration.
- Example : [config.toml](example/config.toml)
### Strategy File (`logic.py`)
Strategies are implemented by extending the `BaseStrategy` class. Define your custom logic in Python.
- Example : [logic.py](example/logic.py)
## Usage
#### CLI Mode
Run the system using the following commands:
```bash
# 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:
```python
from midas.cli import run
# Backtest Mode
run("path/to/config.toml", "backtest")
# Live Mode
run("path/to/config.toml", "live")
```
## Supported Features
<!-- | ✅ | Alpha Vantage | -->
<!-- | ❌ | Yahoo Finance (Planned) | -->
<!-- | ❌ | Quandl (Planned) | -->
| | **Data Vendors** |
| --- | ---------------- |
| ✅ | Databento |
| | **Brokers** |
| --- | ------------------- |
| ✅ | Interactive Brokers |
<!-- | ✅ | TD Ameritrade | -->
<!-- | ❌ | E\*TRADE | -->
<!-- | ❌ | Robinhood | -->
## 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](LICENSE) file for details.
Raw data
{
"_id": null,
"home_page": null,
"name": "midastrader",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "algorithmic-trading, event-driven-backtest, quantitative-finance, finance, markets",
"author": null,
"author_email": "Anthony Baxter <anthonybaxter819@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/66/2d/ee96b9b10f905128c413c9b7183fe00fdeef676d87904f8b87a86e92c0d8/midastrader-1.0.7.tar.gz",
"platform": null,
"description": "# MidasTrader\n\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)\n[![pypi-version](https://img.shields.io/pypi/v/midastrader.svg)](https://pypi.org/project/midastrader/)\n\nMidasTrader 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.\n\n### Key Components\n\n1. **Core Engine**:\n\n - Central to the system, the Core Engine includes:\n - **Order Book**: Tracks market depth and price movements.\n - **Portfolio Server**: Manages and tracks portfolio allocations and positions.\n - **Performance Tracking**: Calculates and monitors key trading metrics.\n - **Order Management System**: Handles order placement, modifications, and cancellations.\n - **Base Strategy**: A foundation for user-defined strategies.\n\n2. **Data Engine**:\n\n - Connects to user-defined data sources:\n - **Midas Server**: Access historical data via the Midas ecosystem.\n - **Binary Data Files**: Handles local files encoded with the Midas Binary Encoding Library.\n - **External Sources**: Currently supports Databento, with more integrations planned.\n\n3. **Execution Engine**:\n\n - Facilitates live trading by connecting to brokers:\n - Currently supports Interactive Brokers.\n - Users can configure broker details in the `config.toml` file.\n\n## Installation\n\nYou can install `midastrader` directly from [PyPI](https://pypi.org/project/midastrader/):\n\n```bash\npip install midastrader\n```\n\n## Configuration\n\n### Configuration File (`config.toml`)\n\nDefine system parameters, including data sources, execution settings, and strategy configuration.\n\n- Example : [config.toml](example/config.toml)\n\n### Strategy File (`logic.py`)\n\nStrategies are implemented by extending the `BaseStrategy` class. Define your custom logic in Python.\n\n- Example : [logic.py](example/logic.py)\n\n## Usage\n\n#### CLI Mode\n\nRun the system using the following commands:\n\n```bash\n# Backtest Mode\nmidas path/to/config.toml backtest\n\n# Live Mode\nmidas path/to/config.toml live\n```\n\n#### Application Mode\n\nAlternatively, you can use the system programmatically in your application:\n\n```python\nfrom midas.cli import run\n\n# Backtest Mode\nrun(\"path/to/config.toml\", \"backtest\")\n\n# Live Mode\nrun(\"path/to/config.toml\", \"live\")\n```\n\n## Supported Features\n\n<!-- | \u2705 | Alpha Vantage | -->\n<!-- | \u274c | Yahoo Finance (Planned) | -->\n<!-- | \u274c | Quandl (Planned) | -->\n\n| | **Data Vendors** |\n| --- | ---------------- |\n| \u2705 | Databento |\n\n| | **Brokers** |\n| --- | ------------------- |\n| \u2705 | Interactive Brokers |\n\n<!-- | \u2705 | TD Ameritrade | -->\n<!-- | \u274c | E\\*TRADE | -->\n<!-- | \u274c | Robinhood | -->\n\n## Future Plans\n\n- Add more data sources.\n- Integrate additional brokers.\n\n## Contributing\n\nContributions are welcome! Feel free to open an issue or submit a pull request with suggestions or improvements.\n\n## License\n\nThis project is licensed under the Apache 2.0 License. See the [LICENSE](LICENSE) file for details.\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "A robust backtesting and live trading engine designed for seamless strategy development and deployment. It supports user-defined strategies, multi-threaded execution, and integrations with brokers and data sources.",
"version": "1.0.7",
"project_urls": null,
"split_keywords": [
"algorithmic-trading",
" event-driven-backtest",
" quantitative-finance",
" finance",
" markets"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ec2bf0003a07a8ddbd144344dafd3b873d9efcf1f156c67329dffe08c6195426",
"md5": "c51108ed92577e7537dae486f30efa0e",
"sha256": "58fd0c45f5595f623846d92010f82701db7d21f20e6c0da97077117a9a16b5c9"
},
"downloads": -1,
"filename": "midastrader-1.0.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c51108ed92577e7537dae486f30efa0e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 113920,
"upload_time": "2025-01-14T21:42:39",
"upload_time_iso_8601": "2025-01-14T21:42:39.865112Z",
"url": "https://files.pythonhosted.org/packages/ec/2b/f0003a07a8ddbd144344dafd3b873d9efcf1f156c67329dffe08c6195426/midastrader-1.0.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "662dee96b9b10f905128c413c9b7183fe00fdeef676d87904f8b87a86e92c0d8",
"md5": "0949ea2aeae2d42f3a78863e50dd1845",
"sha256": "7fd1c97c67afa1fd07f0467abe774027379f06334a91a9d148a1b47b08a207ac"
},
"downloads": -1,
"filename": "midastrader-1.0.7.tar.gz",
"has_sig": false,
"md5_digest": "0949ea2aeae2d42f3a78863e50dd1845",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 89453,
"upload_time": "2025-01-14T21:42:44",
"upload_time_iso_8601": "2025-01-14T21:42:44.932171Z",
"url": "https://files.pythonhosted.org/packages/66/2d/ee96b9b10f905128c413c9b7183fe00fdeef676d87904f8b87a86e92c0d8/midastrader-1.0.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-14 21:42:44",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "midastrader"
}