Output Strategy Results to a File
Author: angel57
Creation Date: 1/26/2010 11:24 PM
profile picture

angel57

#1
Is it possible from within a strategy (or some other C# method) to output the data that gets summarized in the "By Symbol" area to a file? I know you can right click and copy/paste to excel spreadsheet, but would like to run the strategy on many symbols, and then get "By Symbol" and "Trades" data to a file for further processing. Is the data stored somewhere in an array in memory that could be accessed by the strategy code?
profile picture

Eugene

#2
All Performance Visualizers, including "By Symbol" and "Trades", execute after the strategy has finished running and position sizing has been applied. So, it's not possible to access this data during strategy execution.

(Theoretically, a workaround could be to use the SystemResults/SystemPerformance objects in the same manner as "Interacting with equity curve", but there are certain drawbacks to this approach.)
profile picture

angel57

#3
Thanks. Are the SystemResults/SystemPerformance objects documented somewhere? Or is your example the only thing to go on at the moment?
profile picture

dansmo

#4
If I undestand you correct, then this gives you a hint in the right direction.
It will export the netProfit for each trade into a file:

CODE:
Please log in to see this code.


Of course, with this method you would have to do the calculations yourself in the script. But the export procedure will give you everything you need.
profile picture

Eugene

#5
QUOTE:
Are the SystemResults/SystemPerformance objects documented somewhere?

In the (currently unpublished) Wealth-Lab API documentation.
QUOTE:
Or is your example the only thing to go on at the moment?

We're not recommending that example.

See the QuickRef example of ClearPositions on how to get the Percent Winners number.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).