Badge |
Status |
|---|---|
Python versions |
|
Documentation |
|
Continuous integration |
|
Test coverage |
|
Google Colab |
|
PyPI package |
|
PyPI downloads |
|
Anaconda package |
|
Anaconda downloads |
|
Latest Anaconda release |
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.
Graphical workspace
Launch the local strategy lab in your browser:
TradeTide
After updating a source checkout, reinstall with pip install -e . to register the command. You can also use python -m TradeTide.gui or the tradetide-gui alias. The GUI runs locally and needs no additional dependencies, accounts, or internet access. The home page offers editable mean-reversion, trend-following, and momentum templates, plus recent experiments. The strategy workspace separates setup, results, orders and trades, and run comparisons into four keyboard-accessible tabs. Navigation preserves your draft and completed runs; a successful backtest opens the Results tab. The run action sits in a separate toolbar above the form.
Build a stack of up to eight independently configured Bollinger Bands, moving-average crossings, RSI, RMI, and MACD indicators. Enable or disable each indicator and combine its entry events using unanimous agreement, any non-conflicting agreement, or weighted voting with a configurable threshold.
Tune fixed position size, concurrent positions, capital at risk, fixed/trailing/ break-even exits, commission, slippage, and additional spread. Inspect equity, drawdown, market entry markers, individual indicator curves, simulated entry requests (executed or skipped), and a searchable trade ledger with costs and position sizes. Open any trade to see its cost breakdown and highlight its entry and exit on the market chart. Filter trades by side or outcome, sort by P&L, and export the filtered ledger as CSV. Chart range sliders and keyboard inspection make individual periods easier to examine.
The parameter-sweep tool tests 2–6 values for one setting, keeping all other settings fixed. Every candidate is validated before the first simulation; queued runs can be stopped after the current run finishes. Compare any two completed runs to inspect metric changes and exact parameter differences. Normalized equity curves are overlaid only for matching markets and observation times; metric comparisons remain available for different samples.
Drafts and up to 20 named strategies are saved locally. The last 30 runs are stored in the browser and restored after a refresh, using the same browser profile and server address/port. Import strategy JSON or the settings from an exported run; undo restores the replaced draft. Export JSON to keep portable copies independent of browser storage. Ctrl+Enter or Cmd+Enter runs the current draft from any workspace tab.
Samples begin at each dataset’s first observation; the selected duration is calendar time and may include market closures. The displayed dates show the actual simulation period. Bollinger, moving-average, and RMI windows use minutes; RSI and MACD windows use bars. Signal rules combine entry events on the same bar, not persistent indicator regions. Simulated entries use the native engine’s bid/ask closing prices. Skipped requests reflect portfolio constraints or the end of the sample; they are not broker orders. Costs adjust reported equity and P&L after simulation, without changing position sizing. Editing settings leaves the previous result visible until a new run succeeds. The results page identifies when the current draft differs from the selected run.
Use python -m TradeTide.gui --port 8766 --no-browser to choose a port or open the displayed URL yourself. Stop the server with Ctrl+C. The server binds only to 127.0.0.1 and is intended for a local research session.
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 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| tradetide-1.0.0-cp313-cp313-win_amd64.whl | CPython 3.13 | CPython 3.13 | Windows x86-64 | Details |
| tradetide-1.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.13 | CPython 3.13 | Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 | Details |
| tradetide-1.0.0-cp313-cp313-macosx_26_0_arm64.whl | CPython 3.13 | CPython 3.13 | macOS 26.0+ ARM64 | Details |
| tradetide-1.0.0-cp312-cp312-win_amd64.whl | CPython 3.12 | CPython 3.12 | Windows x86-64 | Details |
| tradetide-1.0.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-1.0.0-cp312-cp312-macosx_26_0_arm64.whl | CPython 3.12 | CPython 3.12 | macOS 26.0+ ARM64 | Details |
| tradetide-1.0.0-cp311-cp311-win_amd64.whl | CPython 3.11 | CPython 3.11 | Windows x86-64 | Details |
| tradetide-1.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 | Details |
| tradetide-1.0.0-cp311-cp311-macosx_26_0_arm64.whl | CPython 3.11 | CPython 3.11 | macOS 26.0+ ARM64 | Details |
Total release size: 135.2 MB
Release files / tradetide-1.0.0-cp313-cp313-win_amd64.whl
| Download URL | tradetide-1.0.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 18.7 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
a9b2bcf1bf6a2001c683e933450c4dd622fc591af612e5f8dd6d0385e8d1f11b
|
|
BLAKE2b-256 checksum How to use checksums |
9fc5e45217a78822255e6984a7ee76c6a16d2846585f2e48858ec413edc5def6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / tradetide-1.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | tradetide-1.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 12.7 MB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
011fa1d007d9d65d6c3514f9f43fd15ae8b9ce8e2293eaf941a84501ae77675b
|
|
BLAKE2b-256 checksum How to use checksums |
8d306128f1b58143a76b71b68f9b9cfa677a89c114f4768811654bfb46371356
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / tradetide-1.0.0-cp313-cp313-macosx_26_0_arm64.whl
| Download URL | tradetide-1.0.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 |
18bac697b02666d713500e6d1bd32c3c528d84975df9960e726e6b6bbace5ad1
|
|
BLAKE2b-256 checksum How to use checksums |
ffd4ad65e6bd1e62dd416429a2e0971ac6d97fd2e6d938a8b61c71bd8876eee7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / tradetide-1.0.0-cp312-cp312-win_amd64.whl
| Download URL | tradetide-1.0.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 18.7 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
783b1f59c65e7ce1525354cfe55e1016f623b0ed383b7fa6fe63ee7701e99dbd
|
|
BLAKE2b-256 checksum How to use checksums |
f030029a27804e34f0acafdf78c09d0094dc668ecf1bbe3c46ec84a284130d83
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / tradetide-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | tradetide-1.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 12.7 MB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
c998bff7556589ee843deeab28281fb8cff62a24a18c97a44d3399bdc61e1586
|
|
BLAKE2b-256 checksum How to use checksums |
450dbe4238bd57cfcc56729258b7070c81addc1662b8486b2d73b94747c57fc9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / tradetide-1.0.0-cp312-cp312-macosx_26_0_arm64.whl
| Download URL | tradetide-1.0.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 |
ae35f10a4d71f1bfb12224aae5a027d81e1563d3a070bc2acd372ee19471235d
|
|
BLAKE2b-256 checksum How to use checksums |
9a9fd656052ce10d60e711431cf13a5253a99a12e42165b73b8d88f1876facf7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / tradetide-1.0.0-cp311-cp311-win_amd64.whl
| Download URL | tradetide-1.0.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 18.6 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
69da817e8b810198b769adcdfc61456b894e4b27014bdeb62b91eb2e532fdb59
|
|
BLAKE2b-256 checksum How to use checksums |
ea83559a71d44650a16c6f0b5c13f43879e3ad046a0d2926560dd557523d4767
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / tradetide-1.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | tradetide-1.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 12.7 MB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
dbae9d75884f49f92e3aa6cdbdd9c4a87a7fe54ce2e0a27e0089fe464207b079
|
|
BLAKE2b-256 checksum How to use checksums |
514f31877f65b7256fb716dc252271b90100d209f453060ef932f48ffee4f2e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / tradetide-1.0.0-cp311-cp311-macosx_26_0_arm64.whl
| Download URL | tradetide-1.0.0-cp311-cp311-macosx_26_0_arm64.whl |
|---|---|
| Size | 13.7 MB |
| Tags | CPython 3.11 macOS 26.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
04421cb196b1c965ac2bce24d1723fe058f5b8892107b412651b45c3d1dc74cb
|
|
BLAKE2b-256 checksum How to use checksums |
d3e36e388b330dea02517437f051bfc1f0a59caf4ee52ec1d29aed6bfd552e8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|