Skip to main content

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.

Project description

MidasTrader

License

Overview

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

  1. Clone the repository:

    git clone https://github.com/midassystems/midastrader.git
    cd midastrader
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Install the package:

    python setup.py install
    

Configuration

Configuration File (config.toml)

Define system parameters, including data sources, execution settings, and strategy configuration.

Strategy File (logic.py)

Strategies are implemented by extending the BaseStrategy class. Define your custom logic in Python.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

midastrader-1.0.1.tar.gz (88.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

midastrader-1.0.1-py3-none-any.whl (112.7 kB view details)

Uploaded Python 3

File details

Details for the file midastrader-1.0.1.tar.gz.

File metadata

  • Download URL: midastrader-1.0.1.tar.gz
  • Upload date:
  • Size: 88.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for midastrader-1.0.1.tar.gz
Algorithm Hash digest
SHA256 b9f2ecff995abfba260757aa12d2254ac7f3487c0db3c38b50a7536620024964
MD5 53bb16c02abc88625f351493ea684be6
BLAKE2b-256 682a08562fdb8fd8898dbd4f76386ec3f869444aac7aa33c4abe4041188821bf

See more details on using hashes here.

File details

Details for the file midastrader-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: midastrader-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 112.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for midastrader-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 43b1bc8bb01bc1e2f57cd757f7103d1e1313ae85f2a84f87816225352e85146e
MD5 9b4e42ccbac02e54a4389c93b7dfe7cf
BLAKE2b-256 f6e8f136d44d2aeec8c50f9469cbbe0681fcb35c927b99eb0ee529e2e2381866

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page