Plotting Balance and Equity During Strategy Tester Visualization
Summary
This article shows how to display a simulated trading account’s balance and equity while an Expert Advisor runs in MetaTrader’s visual testing mode. The central problem is that a separate indicator cannot directly read the tested account state through ordinary account functions; those functions return information for the live account instead. The proposed workaround has the EA write each account value to a uniquely named terminal global variable, which a custom indicator reads and plots in a separate chart window.
The examples cover balance and equity, and the same pattern is suggested for other account statistics, such as average lot size or position profit. The article provides code examples and describes the resulting balance line changing as trades close, but it gives no quantitative test results or comparison with alternative approaches. The method depends on matching variable names between the EA and indicator and is intended for visual inspection during testing; the plotted series alone does not evaluate strategy quality or risk.
Key ideas
- A custom indicator cannot directly retrieve the simulated account state using ordinary account functions during visual testing.
- The EA can publish simulated account values through terminal global variables for an indicator to read.
- Separate indicator buffers can plot balance and equity as the test progresses.
- The same data-transfer pattern can be adapted to other account statistics with unique, matching variable names.
- The article demonstrates visualization plumbing rather than a method for measuring strategy performance.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.