Skip to content

Installation

This guide covers setting up the RQF-ML system for local development and backtesting.

Prerequisites

Requirement Version Check Command
Python 3.10+ python --version
Git 2.0+ git --version
pip Latest pip --version

Clone the Repository

git clone https://github.com/kelvin-o/rqf-ml.git
cd rqf-ml

Python Environment Setup

# Create virtual environment
python -m venv .venv

# Activate (macOS/Linux)
source .venv/bin/activate

# Activate (Windows)
.venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt
# Create environment
conda create -n rqf-ml python=3.11

# Activate
conda activate rqf-ml

# Install dependencies
pip install -r requirements.txt
# Install poetry if needed
pip install poetry

# Install dependencies
poetry install

# Activate shell
poetry shell

Verify Installation

# Run tests
pytest tests/ -v

# Check backtest engine
python scripts/run_backtest.py --help

# Check ML training
python scripts/train_edge_model.py --help

Expected output:

✓ All tests passed
✓ Backtest engine ready
✓ ML trainer ready

Project Structure

rqf-ml/
├── config/                 # Configuration files
│   └── edge_config.yaml   # ML and backtest settings
├── data/
│   ├── raw/               # Price data (CSV)
│   └── processed/         # Validated datasets
├── docs/                  # This documentation
├── execution/             # Live/paper trading
│   ├── tradingview_alerts/
│   └── mt5/
├── scripts/               # CLI tools
│   ├── run_backtest.py
│   └── train_edge_model.py
├── src/                   # Python source code
│   ├── core/             # Pattern detection
│   ├── backtest/         # Simulation engine
│   └── ml/               # Machine learning
├── strategies/
│   └── pine_v6/          # PineScript indicators
└── tests/                 # Test suite

Data Setup

Download Sample Data

# Create data directory
mkdir -p data/raw

# Download sample MNQ data (if available)
# Or use your own data in CSV format:
# timestamp,open,high,low,close,volume

Data Format

CSV files should have this structure:

timestamp,open,high,low,close,volume
2024-01-02 09:30:00,16500.25,16505.50,16498.00,16502.75,1234
2024-01-02 09:31:00,16502.75,16510.00,16501.25,16508.50,1567
...

TradingView Setup

  1. Open TradingView and go to Pine Editor
  2. Copy indicator code from strategies/pine_v6/STRAT_02.pine
  3. Paste and save as "STRAT_02: RQF"
  4. Add to chart and configure settings

See Quick Start for detailed TradingView setup.

Claude Code Setup (Optional)

For Claude Code skills integration:

# Verify Claude Code is installed
claude --version

# Skills are automatically detected from .claude/skills/
# List available skills
claude
> /skills-list

Troubleshooting

Python version mismatch

Ensure you're using Python 3.10+:

python3.11 -m venv .venv
source .venv/bin/activate

Missing dependencies
pip install --upgrade pip
pip install -r requirements.txt --force-reinstall
Import errors

Ensure you're in the project root:

cd /path/to/rqf-ml
export PYTHONPATH="${PYTHONPATH}:$(pwd)"

Next Steps