Skip to main content

A Python backtesting engine for trading strategies, designed for SimTrading platform.

Project description

SimTrading Engine

A lightweight and flexible Python backtesting engine designed for testing trading strategies with the SimTrading platform.

Features

  • Event-driven Architecture: Simulates market data replay candle by candle.
  • Strategy Interface: Easy-to-implement BaseStrategy class.
  • Remote & Local Execution: Run backtests locally or connect to a remote platform.
  • Detailed Reporting: Generates comprehensive logs and metrics (PnL, Drawdown, etc.).

Installation

You can install the package from PyPI:

pip install simtrading-engine

Or from source:

pip install -e .

Usage

Defining a Strategy

Create a new class inheriting from BaseStrategy:

from simtrading.backtest_engine.strategy.base import BaseStrategy
from simtrading.backtest_engine.entities.order_intent import OrderIntent, OrderSide, OrderType

class MyStrategy(BaseStrategy):
    def on_bar(self, context):
        # Your logic here
        pass

Running a Backtest

from simtrading.runners.local_runner import run_local_backtest
# or
from simtrading.runners.remote_runner import run_remote_backtest
from my_strategy import MyStrategy

strategy = MyStrategy()

# See examples in the repository for more details.

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

simtrading_engine-0.1.0.tar.gz (24.8 kB view details)

Uploaded Source

Built Distribution

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

simtrading_engine-0.1.0-py3-none-any.whl (31.7 kB view details)

Uploaded Python 3

File details

Details for the file simtrading_engine-0.1.0.tar.gz.

File metadata

  • Download URL: simtrading_engine-0.1.0.tar.gz
  • Upload date:
  • Size: 24.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for simtrading_engine-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8bb4a04190ba3489ad8a8c7bc8077d840650a85ffcbaedc894c34af1f54a3e02
MD5 6d2c77c45531f4f611c199b9d4d35e30
BLAKE2b-256 70f9a46cd1fa9382d12520fadbce879968fa80edd3a66baf620124188a454ee4

See more details on using hashes here.

File details

Details for the file simtrading_engine-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for simtrading_engine-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e84903be6179c86b44d1b4572b910b1d9243777ffc18173fd61b11de4263bd6b
MD5 c9a166777ef98e77330cf195627a9903
BLAKE2b-256 c3cfaf2316aaa009f871071d794495e4d2e31ea491db0285edde8bf98b4cdbc5

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