Dry-Run Mode (also called Paper Mode) is a 100% safe simulation mode that allows you to:
CRITICAL SAFETY GUARANTEES:
The easiest way to run dry-run mode:
# Run continuously until you stop it
./run_dry_run.sh
# Run for a specific duration (e.g., 30 minutes)
./run_dry_run.sh 30
Set the DRY_RUN_MODE environment variable:
# Enable dry-run mode
export DRY_RUN_MODE=true
# Ensure live trading is disabled
export LIVE_CAPITAL_VERIFIED=false
# Start the bot
./start.sh
Create or edit your .env file:
# Dry-Run Mode Configuration
DRY_RUN_MODE=true
PAPER_MODE=false
LIVE_CAPITAL_VERIFIED=false
# All your exchange credentials
# (These won't be used for real trading in dry-run mode)
KRAKEN_PLATFORM_API_KEY=your_key_here
KRAKEN_PLATFORM_API_SECRET=your_secret_here
# ... other exchange credentials ...
Then start the bot:
./start.sh
When the bot starts in dry-run mode, you’ll see a clear banner:
╔══════════════════════════════════════════════════════════════════════════════╗
║ ║
║ 🟡 DRY RUN MODE (PAPER TRADING) 🟡 ║
║ ║
║ ⚠️ SIMULATION ONLY ⚠️ ║
║ ║
║ ✅ NO REAL ORDERS will be placed on any exchange ║
║ ✅ NO REAL MONEY at risk ║
║ ✅ ALL TRADING is simulated in-memory ║
║ ✅ ALL EXCHANGES are in simulation mode ║
║ ║
╚══════════════════════════════════════════════════════════════════════════════╝
The feature flags will show dry-run mode status:
🏁 FEATURE FLAGS STATUS
======================================================================
🟡 Dry-Run Mode (Paper Trading): ENABLED (SIMULATION)
✅ Profit Confirmation Logging: ENABLED
✅ Execution Intelligence: ENABLED
...
======================================================================
Before trading begins, you’ll see a comprehensive validation summary:
╔══════════════════════════════════════════════════════════════════════════════╗
║ DRY RUN VALIDATION SUMMARY ║
╚══════════════════════════════════════════════════════════════════════════════╝
✅ SIMULATION CONFIGURATION VALIDATED:
📊 Exchanges Configured: 3
💰 Initial Balance: 10,000.00 USD
⏱️ Duration: Continuous
🎯 Mode: PAPER TRADING (100% Safe)
✅ SAFETY GUARANTEES CONFIRMED:
✓ Zero real orders will be placed
✓ Zero real money at risk
✓ All exchanges in simulation mode
✓ Trade history will be logged for review
✓ Performance metrics will be calculated
✅ NEXT STEPS:
1. Monitor simulation logs for expected behavior
2. Review performance metrics after run
3. Verify all exchanges are responding correctly
4. Check banner displays are clear and visible
5. Operator sign-off when satisfied with validation
6. Enable live trading with confidence:
• export DRY_RUN_MODE=false
• export LIVE_CAPITAL_VERIFIED=true
NIJA supports multiple trading mode flags. They are evaluated in this priority order:
Important: If multiple flags are set, DRY_RUN_MODE takes priority to ensure safety.
Before going live, use dry-run mode to validate:
Once you’ve validated everything in dry-run mode and are satisfied:
export DRY_RUN_MODE=false
Or remove/comment it from your .env file:
# DRY_RUN_MODE=true # Commented out
export LIVE_CAPITAL_VERIFIED=true
Or in your .env file:
LIVE_CAPITAL_VERIFIED=true
./start.sh
You should see:
🎯 TRADING MODE VERIFICATION
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
DRY_RUN_MODE: false
PAPER_MODE: false
LIVE_CAPITAL_VERIFIED: true
🔴 MODE: LIVE TRADING
⚠️ REAL MONEY AT RISK
⚠️ This bot will execute real trades with real capital
⚠️ Ensure this is INTENTIONAL
The dry-run engine simulates realistic trading:
You can customize the dry-run engine:
from bot.dry_run_engine import DryRunEngine
# Create with custom settings
engine = DryRunEngine(
initial_balance=50000.0, # Starting balance
currency="USD", # Base currency
slippage_bps=10, # Slippage in basis points (10 = 0.1%)
enable_realistic_fills=True # Enable realistic fill delays
)
A: No. In dry-run mode, the bot never connects to real exchanges. Your API keys are not used for placing orders.
A: Yes! Configure credentials for all exchanges you want to test. All will run in simulation mode.
A: At minimum, run it long enough to:
Typically 15-30 minutes is sufficient.
A: Some errors are expected (e.g., no real market data). Focus on:
A: Yes! Simply set DRY_RUN_MODE=true again and restart.
A: The dry-run engine simulates fills at specified prices. For full backtesting with real historical data, use the backtest scripts instead.
Solution: Ensure DRY_RUN_MODE=true is set BEFORE starting the bot:
export DRY_RUN_MODE=true
./start.sh
Solution: Check that DRY_RUN_MODE is set correctly:
echo $DRY_RUN_MODE # Should output: true
Solution: Ensure exchange credentials are configured in .env file (even though they won’t be used for real trading).
DRY_RUN_MODE=true as your default for testingIMPLEMENTATION_SUMMARY_STARTUP_VALIDATION.md - Startup validation detailsbot/dry_run_engine.py - Dry-run engine implementationbot/startup_diagnostics.py - Startup diagnosticsbot/startup_validation.py - Startup validationIf you have questions or issues with dry-run mode:
Remember: Dry-run mode is your safety net. Use it liberally, test thoroughly, and go live with confidence!