Virtual Trading Environments for Testing, Optimization, and Execution
Summary
The document describes a cross-platform virtual trading library that lets an expert advisor run in simulated and live environments. It presents uses including testing against current prices, optimizing over historical data, pausing live orders while monitoring a virtual strategy, and restoring strategy state after a restart. It also describes running multiple strategies on netting accounts, maintaining separate virtual positions, hiding order levels, and reversing a strategy’s trades.
A reversal example shows the same trading logic operating in both environments, while a tester mode is presented as a way to speed up optimization. The document says the virtual environment supports hedge and netting modes but does not implement everything in the built-in tester. Its execution assumptions are simplified: limit orders and take profits fill at specified prices, while stops and stop losses fill at the first accepted price. Those assumptions and the claim of matching real and virtual trading warrant careful validation; the tool cannot reproduce all live-market events, such as rejects and partial fills.
Key ideas
- A virtual environment can run strategy logic against current ticks or selected historical data.
- The same strategy code can be used in live and virtual environments by changing the selected environment.
- Virtual positions can help separate multiple strategies on a netting account and support simulated reversal.
- Tester acceleration comes from omitting some details of the full trading environment.
- Simplified fill rules and incomplete market emulation limit how closely virtual results represent live execution.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.