Using the money management script, you can debug and trace a trading system simulation by two ways.
Steps:
- Select your trading system then click on "Update"
- Select "Money Management" tab then click on "Add a new money management script"
- Click on "Update Script" to open the money management editor
First function:
Divers.Output("the text goes to the Detailed tab in the trading system report");
Example:
int buySignals = Data.GetBuySignals().Count;
Divers.Output("Number of buy signals for the current period: " + buySignals);
Gets the number of buy signals for the current period and then displays the number in the detailed tab of the trading system report.
Second function:
Global.Trace("The text goes the output window (View -> Output)");
Example:
int buySignals = Data.GetBuySignals().Count;
Global.Trace("Number of buy signals for " + Divers.CurrentDate.ToString() + " : " + buySignals);
You can use these functions in all events of the money management script. For example, you can use the OnNewPosition event to analyze new trades.