From #15 in
https://www.wealth-lab.com/Forum/Posts/Community-Components-library-28615:
QUOTE:
Long story short: it's impossible to access anything in any Tab from Strategy code. WL5 is not designed to access information generated by Visualizers, because they start to process backtest results after the strategy has already finished executing.
On the contrary, the article you're referring makes it possible to access -- among the rest -- the Net Profit number by utilizing a "hack" i.e. calling an instance of the internal TradingSystemExecutor class used to run strategies. Problem here is that the API documentation of the SystemResults and SystemPerformance classes is currently unavailable.
This is the closest thing I've found to what I'm trying to do but since this is so old, I was wondering if is still relevant.
I would like to programmatically export a Kelly statistic from a backtest. Currently I believe WL only generates Kelly for the use of the PosSizer, not as a performance statistic. I was not able to access the Wiki so I could be wrong. I can construct it myself if I can get the following data.
I would like to export (or construct) programmatically two performance metrics from the Backtest Performance Report (Performance Tab): Win Rate and Payoff ratio. I can also create the Payoff Ratio if I have the Average Profit % from Winning Trades and Average Loss % from Losing Trades. I want this data for each symbol in a dataset after running a strategy. Alternatively, if there is a way to copy / paste the data on the Performance tab into an Excel spreadsheet, that could work also.
I see that the Streamwriter function can be used to export to CSV Bar data, but I don't see reference to summarized performance data. Sounds like your reference to the hack above maybe comes close.
Currently, I am running backtests for individual symbols, and copy / pasting manually into Excel spreadsheet, to do additional processing on the data. As I mentioned above, I don't require all the data on the Performance tab, but I can extract what I need if there is a way to get it all programmatically.