Skip to Content
VRVP StrategyGuidesGetting Started

Getting Started

This guide walks you through setting up VRVP Strategy from scratch.

Prerequisites

  • Python 3.10 or higher
  • pip package manager
  • Capital.com trading account (for live/paper trading)
  • Git (optional, for cloning)

Installation

# Navigate to vrvp-strategy directory cd vrvp-strategy # Run the installation script ./install.sh # Activate the virtual environment source venv/bin/activate

Option 2: Manual Installation

# Navigate to vrvp-strategy directory cd vrvp-strategy # Create virtual environment python -m venv venv # Activate virtual environment # On Linux/macOS: source venv/bin/activate # On Windows: .\venv\Scripts\activate # Install dependencies pip install -r requirements-main.txt

Configuration

Environment Variables

Copy the example environment file and configure it:

cp .env.example .env

Edit .env with your settings:

# Capital.com API Credentials CAPITAL_API_KEY=your_api_key_here CAPITAL_IDENTIFIER=your_email@example.com CAPITAL_PASSWORD=your_password CAPITAL_DEMO=true # Set to false for live trading # Email Notifications (optional) RESEND_API_KEY=your_resend_api_key NOTIFICATION_EMAIL=your_email@example.com # Risk Management RISK_PER_TRADE=0.02 # 2% risk per trade MAX_POSITION_SIZE=0.10 # 10% max position CIRCUIT_BREAKER=0.15 # 15% daily loss limit

Capital.com API Setup

  1. Create an account at Capital.com 
  2. Navigate to Settings > API
  3. Generate an API key
  4. Copy the API key to your .env file

Demo Mode: Always start with CAPITAL_DEMO=true to test your strategy without risking real capital.

Verify Installation

Run a quick test to verify everything is set up correctly:

# Check the help menu python main.py --help # Expected output: # usage: main.py [-h] {backtest,paper} ... # # VRVP Strategy - Multi-timeframe Forex Trading System # # positional arguments: # {backtest,paper} # backtest Run backtesting simulation # paper Run paper trading (signal generation)

Running Your First Backtest

python main.py backtest \ -i EUR_USD \ -s 2023-01-01 \ -e 2024-01-01 \ -b 10000

Parameters Explained

ParameterShortDescription
--instrument-iTrading pair (e.g., EUR_USD)
--start-sBacktest start date
--end-eBacktest end date
--balance-bInitial account balance

Running Paper Trading

Paper trading generates signals in real-time without executing trades:

python main.py paper -i EUR_USD

This will:

  • Connect to Capital.com API
  • Fetch real-time price data
  • Generate trading signals
  • Log signals to console and file
  • Send email notifications (if configured)

Starting the API Server

For production use, start the FastAPI server:

python server.py --port 8000

The API will be available at http://localhost:8000 with:

  • Health checks at /health
  • Swagger docs at /docs
  • Strategy controls at /start, /stop, /restart

Next Steps

Last updated on