Strategy Validation

Real-time validation ensures your strategy is correctly configured before backtesting or deployment. Understanding validation rules, common errors, and how to fix them is essential for building robust trading strategies.

Why Validation Matters

Validation catches configuration errors, type mismatches, and logical issues before you run a backtest. This saves time by preventing failed backtests and helps you build more reliable strategies. The validation system runs continuously as you build, providing immediate feedback.

Understanding the Validation Panel

The validation panel appears at the bottom of the canvas and updates in real-time as you modify your strategy.

Strategy Valid

When the panel displays a green "Strategy Valid" message with a checkmark:

  • All required outputs (buy_signal, sell_signal) are present
  • No configuration errors in any nodes
  • All connections are valid (correct data types)
  • No circular dependencies detected
  • Strategy is ready to save and backtest

Warnings

Yellow warnings indicate potential issues that don't prevent saving:

  • Disconnected nodes (not contributing to final output)
  • Unused features or data sources
  • Missing documentation (Comment nodes recommended)
  • Suboptimal node arrangements

You can save and backtest with warnings, but consider addressing them for better strategy quality.

Errors (Must Fix)

Red errors prevent saving and backtesting. Common errors:

  • Missing required outputs (buy_signal or sell_signal)
  • Type mismatch in connections
  • Incomplete node configuration (missing feature selection)
  • Circular dependencies in node graph
  • Invalid parameter values

The Save button is disabled until all errors are resolved.

Required Outputs

Every MangoLabs strategy must have specific output nodes to function correctly:

buy_signal

REQUIRED

Determines when to enter a long position. Must output a BOOLEAN value.

Error if missing: "Strategy must have a buy_signal output"

sell_signal

REQUIRED

Determines when to exit a long position. Must output a BOOLEAN value.

Error if missing: "Strategy must have a sell_signal output"

position_size

OPTIONAL

Determines trade size (percentage of capital or absolute amount). Must output a NUMERIC value.

If not provided, defaults to 10% of account balance per trade.

Common Validation Errors

Learn to recognize and fix the most frequent validation errors:

Error: "Node missing required configuration"

Feature node without feature selected, or comparison without operator

Cause:

You added a node but didn't configure its required properties.

How to Fix:

  1. Click the node with the red border to select it
  2. The side panel opens showing configuration options
  3. Fill in all required fields (marked with red asterisks)
  4. For Feature nodes: Select a feature from the dropdown
  5. For Comparison nodes: Choose an operator (<, >, ==, etc.)

✓ Fixed: Node border turns from red to normal color, error disappears from validation panel

Error: "Type mismatch in connection"

Connecting NUMERIC output to BOOLEAN input (or vice versa)

Cause:

You tried to connect incompatible data types. For example, connecting a Feature node (NUMERIC) directly to buy_signal (requires BOOLEAN).

How to Fix:

  1. Identify the problematic connection (shown in validation panel)
  2. Delete the invalid connection
  3. Add an intermediate node to convert data types
  4. For NUMERIC → BOOLEAN: Use a Comparison node (e.g., "RSI < 30")
  5. Recreate connections with proper type flow

Tip: Watch connection colors: Cyan = NUMERIC, White = BOOLEAN, Teal = DATA

Error: "Missing required output: buy_signal"

Strategy doesn't have a buy_signal output node

Cause:

You haven't created a buy_signal output node, or the output node isn't labeled "buy_signal" exactly.

How to Fix:

  1. Drag an "Output" node from the palette onto the canvas
  2. Configure the output node with label: buy_signal
  3. Connect your entry logic (BOOLEAN) to this output node's input
  4. Verify the validation panel shows the error is resolved

Note: Output node labels are case-sensitive. Use exactly "buy_signal" (lowercase, underscore).

Error: "Circular dependency detected"

Node graph contains a loop where data flows back to its source

Cause:

A node's output eventually connects back to its own input through a chain of other nodes, creating an infinite loop.

How to Fix:

  1. The validation panel lists nodes involved in the circular dependency
  2. Trace the connection path to identify the loop
  3. Delete one connection in the loop to break the cycle
  4. Rethink your strategy logic - circular dependencies usually indicate a design flaw
  5. Restructure your nodes to create a directed acyclic graph (DAG)

Example circular dependency: Node A → Node B → Node C → Node A (INVALID)

Error: "Output node has no input connection"

buy_signal or sell_signal output node isn't connected to any logic

Cause:

You created an output node but didn't connect any logic to it. Output nodes need input to determine when to trigger.

How to Fix:

  1. Build your entry/exit logic using Comparison and Logic nodes
  2. Ensure the final node in your logic chain outputs a BOOLEAN value
  3. Connect that BOOLEAN output to the input of your buy_signal or sell_signal node
  4. Verify the connection is valid (should be white/BOOLEAN colored)

Understanding Warnings

Warnings don't prevent saving but indicate areas for improvement:

Warning: "Disconnected nodes detected"

What it means: You have nodes that aren't connected to the main strategy graph. They won't affect your strategy's behavior.

Should you fix it? Usually yes - disconnected nodes are either mistakes or leftover from testing. Delete them to keep your strategy clean.

Exception: Comment nodes are allowed to be disconnected (they're for documentation).

Warning: "Unused feature detected"

What it means: A Feature node is on the canvas but its output isn't connected to anything.

Should you fix it? Probably - either connect the feature to your logic or remove the node. Unused features don't slow down your strategy but clutter the canvas.

Warning: "No position_size output - using default"

What it means: Your strategy doesn't specify position sizing, so the system will use the default (10% of capital per trade).

Should you fix it? Optional - if you want custom position sizing (e.g., volatility-adjusted), add a position_size output. Otherwise, the default is fine.

Validation Workflow Best Practices

Build-Validate-Fix Cycle

  1. Build incrementally: Add 2-3 nodes at a time, then check validation panel
  2. Fix errors immediately: Don't accumulate errors - address each one as it appears
  3. Watch for red borders: Nodes with errors show red borders - click them to see details
  4. Verify connections: Ensure connection colors match expected data types
  5. Test logic: Mentally trace data flow from sources to outputs
  6. Address warnings: Clean up disconnected nodes and unused features
  7. Final check: Green "Strategy Valid" in panel before saving

Testing Strategy Logic

Validation ensures technical correctness, but you should also verify logical correctness:

Trace Data Flow

Manually follow the path from data sources through logic nodes to outputs. Ensure the logic makes sense: "If RSI is below 30 AND price is above SMA, then buy_signal should be true."

Consider Edge Cases

Think about extreme scenarios: What happens if RSI is exactly 30? What if all indicators are neutral? Ensure your logic handles these cases appropriately.

Run Small Backtest First

Before running a full backtest, test with a small date range (1 week). This quickly reveals logic errors without waiting for a long backtest to complete.

Check for Conflicting Signals

Ensure buy_signal and sell_signal can't both be true simultaneously (unless your strategy intentionally supports this). Use logic nodes to create mutually exclusive conditions.

Pre-Backtest Validation Checklist

Before Running Your Backtest

Validation Panel Shows Green

"Strategy Valid" message with checkmark visible

Required Outputs Present

buy_signal and sell_signal nodes connected to valid logic

All Features Configured

Every Feature node has a feature selected from dropdown

No Type Mismatches

All connection colors match expected types (cyan to cyan, white to white)

Logic Makes Sense

Traced data flow from sources to outputs, logic is sound

Disconnected Nodes Removed

All nodes contribute to final outputs (except Comment nodes)

Strategy Saved

Clicked Save button and received success notification

Documentation Added

Comment nodes explain key logic sections (optional but recommended)

Pro Tip: Save your strategy before running a backtest, even if it's still a work in progress. This way, if the backtest reveals issues, you can return to the saved version and iterate.

After Validation Passes

Once your strategy shows "Strategy Valid" in green:

1. Save

Click the Save button to persist your strategy to the database

2. Backtest

Run a backtest to evaluate historical performance and validate logic

3. Deploy

If backtest results are good, deploy to paper trading for live testing

What's Next?