kazuna8
 ( 47.90% )
- ago
Is there a way from the strategy code (say BacktestComplete) to access the optimization results in order to trim the results by filtering the metric value?

For example, I would like to remove all the results that are [WinRate] value < 50, sort the result by [Profit] value and then remove all except the top 3 [Profit] value.
9
1,796
18 Replies

Reply

Bookmark

Sort
- ago
#1
No, the optimization results are not accessible from the Strategy code.
0
kazuna8
 ( 47.90% )
- ago
#2
So if I want to filter and sort the results, I have to export the results to Excel?
I have been doing it in WL6 and it's a lot of work for 50~100 symbols.

BacktestComplete looks like the best place to do such filtering to the results.
0
- ago
#3
Not sure, sounds like a task for a custom optimization visualizer:
https://www.wealth-lab.com/Support/ExtensionApi/OptimizationVisualizer
0
Glitch8
 ( 10.62% )
- ago
#4
It would be a piece of cake to enable the tabular visualizer to delete selected results. I think doing so would give the poster what they’re asking for!
2
kazuna8
 ( 47.90% )
- ago
#5
QUOTE:
delete selected results
Yes, that would work as well! So that I don't have to copy-paste into Excel. filter out some results and sort the final results for each symbols in a DataSets that would have tens or hundreds of symbols. I'm spending hours for every weekend just for those in WL6.
1
Glitch8
 ( 10.62% )
- ago
#6
Eugene can we mark this as a Feature Request?
0
- ago
#7
Done.
0
- ago
#8
It seems this feature is now active and should be coming out in one of the next releases. Considering my use, this one alone (although not suggested by me), is worthy of the subscription renewal.

I take the opportunity to say thank you very much to all the WL team for the incredible effort that has been put into the product lately; in order for it to become the best backtesting software ever designed. Sometimes, the passion of some users comes out a bit too strong and it might look like your work is not appreciated and that we only reivindicaste more and more.
Looking at the release schedule and the replies to the posts, it’s obvious that you are all putting extra hours, including weekends!

So, thank you very much and keep up the good work.
6
- ago
#9
Is it possible to call the new row-delete functionality via the Extension API? I'd love to be able to automate the process so that it's not necessary to manually locate and click on the unwanted rows.
0
Glitch8
 ( 10.62% )
- ago
#10
That would call for a custom Optimizer, which is of course possible and could be a valuable new Extension. The idea would be to just exclude unwanted results based on a filter criteria.

But there's no way to access it in the plain Optimizers using the API.
1
- ago
#11
First of all, thank you for one more implemented request.

I know that one should never look a gift horse in the mouth, but I think I misinterpreted the original request: I was hoping for something more in line with the "Filter" functionality that we find in Excel. For example, I would select the APR column and then select the records >20%; or Sharpe Ratio > 1.2 AND Drawdown <30%.

Or alternatively, in the Optimization Settings, being able to write some sort of filtering expression (APR>20 AND SR>1.2 AND DD<30), which would result in the records not matching the criteria being removed from the Tabular list.
1
Glitch8
 ( 10.62% )
- ago
#12
Hmmm, yes that's substantially more involved. See if the multi-level sorting and deleting will work for what you're looking for. If not, feel free to submit another reuqest for built-in filtering capability in the Tabular Optimization Result Viewer.
0
Glitch8
 ( 10.62% )
- ago
#13
Maybe a “delete before” and “delete after” right click options would streamline this process? 🤔
0
- ago
#14
For my use case (which seems similar to Kazuna's) anything that can help filter a long list of optimization results is very welcome. The multi-column sorting, introduced in build 15; and now the deletion of rows, introduced in build 26; are both great time savers. However, ideally, something more sophisticated would be even better (especially considering that the deletion of a row is destructive in the sense that once done it doesn't seem reversible without re-running the optimization) and I can think of 3 alternatives in the tabular view:
1. Customize filter Items within a column's filter dropdown (like in Excel's "Filter" mode); or
2. Adding a text box, before the table, where we could input the filter expressions (something as described here https://docs.devexpress.com/WPF/6499/controls-and-libraries/data-grid/filtering-and-searching/filtering-in-code/filter-expressions).
or
3. Adding a filter editor (like described here; https://docs.devexpress.com/WPF/7788/controls-and-libraries/data-grid/filtering-and-searching/filter-editor).

Of course, as it is, I can always copy the results and export them to Excel and manipulate the list there. But it would be more convenient to do it all in WL7; and even more important when the capability to save optimization results is introduced.
1
- ago
#15
Syncfusion has a state of the art DataGrid control for WPF with Filter capability. Looks like there's a community license so it can be free (unlike DevExpress or Telerik):
https://www.syncfusion.com/wpf-controls/datagrid
https://www.syncfusion.com/products/communitylicense
2
- ago
#16
Hi Eugene,

It looks great. If that would be feasible, it would definitely deliver beyond what I could ever ask in terms of filtering the optimisation table.
1
Glitch8
 ( 10.62% )
- ago
#17
Now this looks like something Eugene can really sink his teeth into! That is, after he's done painstakingly converting all the obscure IndexLab indicators! In any case, I think we'd need a new #FeatureRequest to get the ball rolling and gauge interest.
2
- ago
#18
Just to be sure that whoever finds back this discussion, also find the follow-up request:
https://www.wealth-lab.com/Discussion/Advanced-filtering-of-optimization-results-7015
1

Reply

Bookmark

Sort