Can MT5 preserve Strategy Tester trade state while reinitializing the same EA with a new input?
Is there an officially supported way to preserve an MT5 Strategy Tester session’s simulated order and deal history and an open position with its Stop Loss, then change an EA input and reinitialize the same compiled EX5?
I’m testing an EA that blocks new entries after a simulated fill exceeds its risk budget. To lift the block, the EA must match the release ID, reconcile the original order and deal against MT5’s trade history, and read the registered Stop Loss from the open position. I want to verify that the next eligible signal produces a new simulated order only after reconciliation succeeds and the saved stop record is deleted.
The original local test used a JPY-denominated hedging setup. In a separate tester run, the EA restored the saved stop record with a matching release ID, but it could not confirm that the original simulated order was in a final state. The EA logged order_not_final and blocked all eight subsequent entry signals.
Anonymized excerpt from the separate run:
InpPostFillReleaseId=[redacted; matched saved ID]
2025.06.30 00:00:00 state=restore_pending
2025.06.30 01:00:00 state=order_not_final
Run summary: entry signals=8, blocked=8, new order requests=0, manual releases=0
Is either of these workflows supported?
1. In the same tester session: Pause after the breach, change InpPostFillReleaseId, and trigger OnDeinit and OnInit for the same EX5 while preserving the simulated order history, deal history, and open position.
2. In a separate isolated environment: Restore the original simulated order and deal tickets, the open position’s POSITION_IDENTIFIER, and its registered Stop Loss. Then reinitialize the same EX5 with the matching release ID. The restored state must be accessible through HistoryOrderSelect, HistoryDealGet*, and PositionGet*.
The test must use the existing EX5 without code changes or recompilation. Any new order must be processed entirely within the simulation, with no orders sent to a live or broker demo account and no routing to an external execution venue.
If either workflow is supported, could you share the official documentation or describe the required setup? If neither is supported, is there another officially supported way to verify this recovery path with the same EX5?
Thank you.
- Refactoring and Converting Existing Algorithms - Examples - MCP and AI
- Strategy Testing - Algorithmic Trading, Trading Robots
- Selecting orders and deals from history