How do I verify that my application configuration is loaded correctly?

  • Home
  • Documentation
  • How do I verify that my application configuration is loaded correctly?

MagicTradeBot is built to be strict and fail-safe when it comes to configuration loading. This means the bot will never run with a broken or partially invalid configuration.

1. Configuration validation on startup

When MagicTradeBot starts:

  • 🔍 It parses and validates the YAML configuration file
  • ❌ If any syntax error, missing key, or invalid value is detected:

    • Bot execution stops immediately
    • The issue is clearly reported in the startup output/logs
  • ✅ The bot will only continue running if all configuration values are valid

This prevents undefined behavior, incorrect trades, or silent misconfigurations.


YAML is sensitive to formatting (indentation, spacing, structure). After making any change to your configuration file, it’s strongly recommended to validate it before restarting the bot.

You can use online validators such as:

Steps:

  1. Open your config.yaml file
  2. Copy the full content
  3. Paste it into the validator
  4. Fix any reported errors or warnings
  5. Save the corrected file and restart the bot

This simple step prevents most startup failures.


3. Confirm successful loading during initialization

When the configuration is valid and loaded successfully:

  • ✅ The bot starts normally
  • 📄 On first-time initialization, you will see:

    • Parsed YAML configuration values printed on screen or in logs
    • Confirmation that key sections (exchange, strategy, risk, symbols, etc.) are loaded
  • 🚀 Trading logic begins only after configuration loading completes successfully

If you do not see the configuration summary during startup, it usually indicates that the bot did not pass validation.


4. Common signs your configuration is loaded correctly

You can safely assume your configuration is working if:

  • ✔️ Bot does not terminate on startup
  • ✔️ No YAML parsing errors are shown
  • ✔️ Configuration values are displayed during initialization
  • ✔️ Market data syncing and strategy evaluation begins normally

Best practice checklist

Before running MagicTradeBot:

  • 🔁 Validate YAML after every edit
  • 🧪 Test new configurations in demo mode first
  • 📋 Keep backups of known-working config files
  • 🔍 Review startup logs carefully after each restart

MagicTradeBot intentionally enforces strict configuration validation so you can trade with confidence, knowing the bot is running exactly as configured — or not running at all.

📎 Related Topics