Skip to main content

TradeTide logo

Badge

Status

Python versions

Python

Documentation

Documentation Status

Continuous integration

Unittest Status

Test coverage

Unittest coverage

Google Colab

Google Colab

PyPI package

PyPI version

PyPI downloads

PyPI downloads

Anaconda package

Anaconda version

Anaconda downloads

Anaconda downloads

Latest Anaconda release

Latest release date

TradeTide

TradeTide is a Python/C++ package for researching and backtesting foreign-exchange trading strategies. It includes bundled historical samples, technical indicators, position management, and portfolio simulation.

Features

  • Bundled historical samples for five major FX pairs.

  • Technical indicators including Bollinger Bands, moving-average crossings, RMI, RSI, and MACD.

  • Composable all_of, any_of, and weighted signal rules.

  • Backtesting with configurable exit and capital-management strategies.

Installation

TradeTide is available from PyPI and Anaconda:

pip install TradeTide
conda install TradeTide --channel MartinPdeS

Verify the installation with the Python interpreter used for backtests:

python -c "import TradeTide; print(TradeTide.__version__)"

Released wheels are the easiest option. Building from source requires CMake, a C++20 compiler, pybind11, and OpenMP.

First backtest

Load the bundled EUR/USD sample, add an indicator to a strategy, and run a backtest:

from TradeTide import Backtester, BacktestResult, Currency, Market, Strategy
from TradeTide import capital_management, exit_strategy
from TradeTide.indicators import BollingerBands
from TradeTide.times import days, minutes

market = Market()
market.load_from_database(Currency.EUR, Currency.USD, time_span=3 * days)

strategy = Strategy()
strategy.add_indicator(BollingerBands(window=30 * minutes, multiplier=2.0))

backtester = Backtester(
    strategy=strategy,
    market=market,
    exit_strategy=exit_strategy.Static(stop_loss=4, take_profit=4),
    capital_management=capital_management.FixedLot(
        capital=100_000,
        fixed_lot_size=10_000,
        max_capital_at_risk=10_000,
        max_concurrent_positions=1,
    ),
)
backtester.run()
result = BacktestResult.from_portfolio(backtester.portfolio)
result.plot_equity_drawdown()

Bundled datasets are EUR/USD, GBP/USD, CHF/USD, JPY/USD, and CAD/USD. time_span accepts a timedelta or a positive duration string such as "2d 6h".

Testing

For local development, install the development extra and run the suite:

git clone https://github.com/MartinPdeS/TradeTide.git
cd TradeTide
pip install -e '.[dev]'
pytest

Contributing

See CONTRIBUTING.md for the native-build requirements, formatting checks, and pull-request guidelines.

Contact

For questions or contributions, contact martin.poinsinet.de.sivry@gmail.com.

Release files for TradeTide 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for TradeTide 0.3.0
File
tradetide-0.3.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
tradetide-0.3.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
tradetide-0.3.0-cp313-cp313-macosx_26_0_arm64.whl CPython 3.13 CPython 3.13 macOS 26.0+ ARM64 Details
tradetide-0.3.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
tradetide-0.3.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
tradetide-0.3.0-cp312-cp312-macosx_26_0_arm64.whl CPython 3.12 CPython 3.12 macOS 26.0+ ARM64 Details
tradetide-0.3.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
tradetide-0.3.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
tradetide-0.3.0-cp311-cp311-macosx_26_0_arm64.whl CPython 3.11 CPython 3.11 macOS 26.0+ ARM64 Details

Total release size: 134.7 MB

Release files / tradetide-0.3.0-cp313-cp313-win_amd64.whl

Download URL tradetide-0.3.0-cp313-cp313-win_amd64.whl
Size 18.6 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
e7e697be27752029817f456cd0e495c0f885f3cfee819e4f5bd42fc5b3aa278a
BLAKE2b-256 checksum
How to use checksums
443c7f3a66c1344b74f6c6d7a2be3695bff6d9e57b7918dc7beab232fab94fb9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / tradetide-0.3.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL tradetide-0.3.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 12.6 MB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
7eacbcd99572772a40981453db6785c038cab358f9792dccd6b440059d44563d
BLAKE2b-256 checksum
How to use checksums
f83dcb738d46e92ef8d54750c8376f1fe7ec1cac9f4e74cd4082a2f17ccf1080
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / tradetide-0.3.0-cp313-cp313-macosx_26_0_arm64.whl

Download URL tradetide-0.3.0-cp313-cp313-macosx_26_0_arm64.whl
Size 13.7 MB
Tags CPython 3.13 macOS 26.0+ ARM64
SHA-256 checksum
How to use checksums
ee18b03375fd9c17535cde7bfcb067e99eebf1d2f02ca110643129d204164f0e
BLAKE2b-256 checksum
How to use checksums
7e6ad0817720ff420d7fa77c94e85394f0f3db61f05c13741fa5a051a6b3f959
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / tradetide-0.3.0-cp312-cp312-win_amd64.whl

Download URL tradetide-0.3.0-cp312-cp312-win_amd64.whl
Size 18.6 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
5afc0f10a51dffce8625b71c1361b30461d5a5d2025e6a901404c9972be6b56b
BLAKE2b-256 checksum
How to use checksums
c83a71053dd4603296215d29847d7294dd2bdbe8fd7723fe32628c0f9e6b69f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / tradetide-0.3.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL tradetide-0.3.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 12.6 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
1d325e4266151550df23af783e4d9d5b1d23c185045da25b1000fbeaaf5b2ee3
BLAKE2b-256 checksum
How to use checksums
f28c50d8c0a53021678eaa2b12b65034d17afb004061bcee648db11cb458f704
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / tradetide-0.3.0-cp312-cp312-macosx_26_0_arm64.whl

Download URL tradetide-0.3.0-cp312-cp312-macosx_26_0_arm64.whl
Size 13.7 MB
Tags CPython 3.12 macOS 26.0+ ARM64
SHA-256 checksum
How to use checksums
ab49427901563def1337695ec936a99a0569226b7648b83eb89058138a1940dd
BLAKE2b-256 checksum
How to use checksums
edc621fc53b6b174218ff61abec35eec22429e1464bf2c59e87ffbd835807756
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / tradetide-0.3.0-cp311-cp311-win_amd64.whl

Download URL tradetide-0.3.0-cp311-cp311-win_amd64.whl
Size 18.6 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
6e679e72dcf1e0f2677e4a3b80262b44ecaca460458b5f32dc0fea4d49f22d7c
BLAKE2b-256 checksum
How to use checksums
85c2117a24c33ea3063850ef036577974a25c08a40ea8f57fee8317093ecb66a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / tradetide-0.3.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL tradetide-0.3.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 12.6 MB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
c2068b8a6873fa99ee830a6ba5a5e6d440431b33e7944884ad5d784ef2c7df5e
BLAKE2b-256 checksum
How to use checksums
bad73fc46370f3ef6c6d2dcd63da5615184eb633396f55f99682f33e39bfbf62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / tradetide-0.3.0-cp311-cp311-macosx_26_0_arm64.whl

Download URL tradetide-0.3.0-cp311-cp311-macosx_26_0_arm64.whl
Size 13.6 MB
Tags CPython 3.11 macOS 26.0+ ARM64
SHA-256 checksum
How to use checksums
a2135a554d1ca6943f7dcdc513d2d97237bd79d15e2db6d3148199ff4cfe0007
BLAKE2b-256 checksum
How to use checksums
308b014eb71ce557891a05a70e133b1f4d80300b46e2a21d322660b3766e0291
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

1.0.0

9 release files

This release

0.3.0 This release

9 release files

0.2.6

9 release files

0.2.5

9 release files

0.2.4

9 release files

0.2.3

9 release files

0.2.2

9 release files

0.2.1

9 release files

0.2.0

9 release files

0.1.5

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page