Skip to main content

AI-Driven Qutan, Open to All

Project description

APilot - AI-Driven Quantitative Trading Platform

Overview

APilot is a high-performance quantitative trading framework focused on cryptocurrency and stock markets, developed by the AlphaPilot.tech team. The framework supports both strategy backtesting and live trading, providing a comprehensive solution for quantitative traders.

Official website: www.alphapilot.tech

Key Features

  • Event-driven architecture: Built for high-performance, real-time trading systems
  • Multiple trading strategies: Price Action strategies, Factor strategies (in development)
  • Professional execution algorithms: BestLimit, TWAP algorithms
  • Comprehensive backtesting: Accurate simulation with detailed performance analytics
  • Multi-exchange support: Currently focusing on Binance, with more to come
  • Live trading capability: Execute strategies in real-time with risk management
  • Extensible framework: Easy to add new strategies, data sources, and exchanges

Strategy Types

  • Price Action (PA) strategies: Support for trend following, mean reversion, and other classic price action strategies
  • Factor strategies: Quantitative strategies based on multi-factor models (in development)

Technical Architecture

Design Principles

  • Core Module: Contains all abstract interfaces and core data structures

    • Abstract base classes (BaseEngine, BaseGateway, etc.)
    • Data models (OrderData, TickData, etc.)
    • Constant definitions (Direction, Interval, etc.)
    • Basic event system
  • Feature Modules: Specific implementations for different domains

    • execution/gateway/ - Exchange API implementations
    • engine/ - Specific engine implementations
    • strategy/ - Trading strategy templates and implementations
    • performance/ - Performance calculation and reporting

Installation

# Clone the repository
git clone https://github.com/yourusername/apilot.git
cd apilot

# Install the package in development mode
pip install -e .

# Install with development dependencies
pip install -e ".[dev]"

Quick Start

Backtesting a Strategy

from apilot.engine import BacktestingEngine
from apilot.strategy import SampleStrategy

# Create a backtesting engine
engine = BacktestingEngine()
engine.set_parameters(
    start="2023-01-01",
    end="2023-12-31",
    initial_capital=10000,
    commission_rate=0.001
)

# Add a strategy
engine.add_strategy(SampleStrategy, "MyStrategy", "BTC/USDT.BINANCE", {
    "param1": 10,
    "param2": 20
})

# Run backtest
engine.run_backtest()

# Analyze performance
engine.show_performance()

Running Live Trading

from apilot.engine import PAEngine
from apilot.strategy import SampleStrategy

# Create a live trading engine
engine = PAEngine(main_engine, event_engine)

# Add a strategy
engine.add_strategy(SampleStrategy, "MyStrategy", "BTC/USDT.BINANCE", {
    "param1": 10,
    "param2": 20
})

# Initialize and start the strategy
engine.init_strategy("MyStrategy")
engine.start_strategy("MyStrategy")

Getting Started with Development

For detailed documentation on developing with APilot, please refer to our Development Guide.

Testing

# Run all tests
python -m pytest tests/

# Run specific test file
python -m pytest tests/test_bar_generator.py

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT 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

apilot-0.1.1.tar.gz (57.4 kB view details)

Uploaded Source

Built Distribution

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

apilot-0.1.1-py3-none-any.whl (68.2 kB view details)

Uploaded Python 3

File details

Details for the file apilot-0.1.1.tar.gz.

File metadata

  • Download URL: apilot-0.1.1.tar.gz
  • Upload date:
  • Size: 57.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for apilot-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a7b83d8d0ba257412059efdc528bb5389dbbf35d0b982216f4eefd8a301b5e6a
MD5 049682815634a733bfca8b31989e77aa
BLAKE2b-256 4d695f8bb9a7f410ba6c2a96cc9f061e199ca7d088c0452a15d65d1179d74615

See more details on using hashes here.

File details

Details for the file apilot-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: apilot-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 68.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for apilot-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e088ce99df1771ea4b52f137620ab2da0e4088fd48129d482da49839781caa4a
MD5 f6627348f987d3c3ef9b400a79a8dc5e
BLAKE2b-256 5a9d8487899c7d25a84ff95235cec26a37661f61ef513f0535a0b0011720446c

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