Changing a live bot's configuration is always a bet. You're betting that the adjustment you're making will perform better than the current setup, but without testing it, you're deciding on intuition alone.
Relay's What-If Simulation changes that. It takes your historical trade data and models how different parameters would have affected your outcomes, giving you a concrete basis for evaluating a change before it goes live.
This guide covers how to frame a simulation, what parameters you can test, and how to interpret the results.
What What-If Simulation does
What-If Simulation runs a retrospective analysis against your actual trade history. You specify a parameter change, a tighter stop loss, a different take profit level, adjusted position sizing, and Relay calculates how your past trades would have resolved under those conditions.
The output shows you the difference: what actually happened versus what would have happened under the hypothetical parameters. This isn't a prediction of future performance. It's an evaluation of how the change would have interacted with the trades you've already taken.
When to use it
The most valuable use cases:
Before changing a stop loss or take profit Stop and TP levels are the most impactful configuration settings. Even small adjustments can significantly change outcomes. Simulate the change before applying it.
When a bot is underperforming If recent results are below your expectations, What-If lets you test whether different parameters would have improved things, or whether the issue is in signal quality rather than configuration.
When investigating a pattern If you've noticed that a lot of your losses hit stop loss and then the position recovers, What-If Simulation can model whether a slightly wider stop would have changed those outcomes.
Before increasing position size Sizing up amplifies both wins and losses. Simulate the larger size against your historical trades to understand what the P&L distribution would have looked like.
Triggering a simulation
From the capability grid: Click "What-If Simulation" from the Relay capability menu.
Through conversation — the most flexible approach:
"What would have happened if my stop loss on QQQ UT was -35% instead of -40%?" "Simulate QQQ UT [LNG] with a 10-minute average hold time instead of 5 minutes." "What if I had used $2,000 position size instead of $1,000 on my SPY BEAR ODTE bot?" "How would my trades have looked with TP1 at 8% instead of 10%?"
Be specific about:
- Which bot you're simulating (or whether you want it across all bots)
- What parameter you're changing and what value you're changing it to
- What time range to simulate against (defaults to recent history if not specified)
Parameters you can test
What-If Simulation can model changes to:
- Stop loss level — tighter or wider
- Take profit levels — individual TP1, TP2, TP3 thresholds
- Take profit sizing — the percentage of the position closed at each TP level
- Trailing stop — enabling trailing vs fixed, or changing the trail percentage
- Position sizing — fixed dollar amount or percentage changes
- Hold time — simulating what would have happened with earlier or later exits
- Cooldown period — modeling a longer or shorter minimum time between trades
Reading the output
The simulation output compares two scenarios side by side:
Actual results — what happened with your current configuration Simulated results — what would have happened under the hypothetical parameters
For each scenario, Relay shows:
- Total P&L
- Win rate
- Number of winning and losing trades
- Average P&L per trade
- How the stop loss or TP levels would have fired differently on specific trades
The output will also note which trades were most affected by the parameter change, useful for understanding whether the improvement (or decline) is driven by a few outlier trades or by a consistent change across many trades.
A practical example: tighter stop loss
Suppose your bot has a -40% stop loss and you're seeing a pattern where stop losses fire and then the position recovers. You wonder if widening the stop to -50% would have reduced those stop-out losses.
You ask Relay:
"Simulate my QQQ UT (SHRT) bot with a -50% stop loss instead of -40% over the last 60 days."
Relay returns: with a -50% stop loss, 12 trades that stopped out at -40% would have continued. Of those 12, 8 recovered and closed in profit, while 4 continued to fall and would have produced larger losses. Net result: P&L improves by roughly $X, but maximum single-trade loss increases.
This gives you a clear trade-off to evaluate: better average P&L, but a higher ceiling on your worst-case trade. Whether that trade-off makes sense depends on your risk tolerance, but now you're deciding with data, not a guess.
Important context: simulation vs reality
A few things to keep in mind when interpreting simulation results:
Simulations use historical data. The results reflect how the parameter would have interacted with the specific market conditions in your historical trades. Those exact conditions may not repeat.
Slippage and fill quality aren't modeled. The simulation assumes your orders fill at the theoretical price. In practice, tight markets and fast moves can affect fill quality, particularly for TP levels.
More recent history is more relevant. A simulation across the last 30 days is generally more indicative than one across the last 12 months, because recent market conditions are more similar to what you'll face going forward.
Look for consistency, not outliers. If a simulated parameter change looks dramatically better, check whether that improvement is driven by a few unusual trades or by consistent improvement across many trades. Consistent improvement across many trades is a much stronger signal.
After the simulation
If the simulation supports the change, make the update in the Bot Builder and use Bot Health Check after a week or two to verify that the live results are tracking with what the simulation predicted. If they're not, that's a useful signal too — it may mean market conditions have changed in a way that makes the historical simulation less applicable.
If the simulation doesn't support the change, or produces ambiguous results, it's worth exploring whether the issue you were trying to solve is actually a configuration issue or something else, like signal quality or entry timing.
Congratulations! 🎉
You've completed this tutorial. Mark it as complete to track your progress.