A probabilistic-based trading system built using nautilus_trader, implementing Hidden Markov Models and Kalman Filters for market analysis and trading decisions.
- Python 3.12 or higher
- uv (modern Python package installer)
uv is a modern Python package installer and resolver that offers significant performance improvements over traditional tools. There are several ways to install uv:
Using curl (recommended for Unix-like systems):
curl -LsSf https://astral.sh/uv/install.sh | shUsing PowerShell (for Windows):
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"For more detailed installation instructions and alternatives, please refer to the official uv documentation.
To install the package for development:
- Clone the repository:
git clone https://github.com/Martingale42/probabilistic_trader.git
cd probabilistic_trading- Install the package in editable mode with development dependencies:
uv pip install -e ".[dev]"To install the latest version as a user:
uv pip install git+https://github.com/Martingale42/probabilistic_trader.git- Hidden Markov Model (HMM) based trading strategies
- Kalman Filter implementation for state estimation
- Integration with nautilus_trader for backtesting and live trading
- Support for multiple timeframes and trading pairs
probabilistic_trading/
├── model/
│ ├── hmm/ # Hidden Markov Model implementations
│ └── kalman/ # Kalman Filter implementations
└── strategy/ # Trading strategies
Basic example of using the HMM strategy:
from probabilistic_trading.strategy import HMMStrategy
# Example code hereThis project uses several development tools:
- black for code formatting
- ruff for linting
- mypy for type checking
- pytest for testing
To run the development tools:
# Format code
black .
# Run linting
ruff check .
# Run type checking
mypy .
# Run tests
pytest