Donor Strategies w/ Extension Methods
Author: sedelstein
Creation Date: 5/21/2014 8:36 PM
profile picture

sedelstein

#1
Hello Eugene

I just read this post
http://www.wealth-lab.com/Forum/Posts/Is-there-a-way-to-make-strategy-optimization-multi-threaded-34079

and saw that the old way of running things described here http://www2.wealth-lab.com/WL5WIKI/kbInteractingWithPortfolioEquity.ashx has changed.

In the examples in the first post the donor strategy was part of the code.

I don't see how it's done when you want to run an existing Strategy from disk

My old code looks like this
CODE:
Please log in to see this code.


Is it possible to demonstrate how it should be changed using the extension methods?
I was unable to Load from disk, and it looks like

WealthLab.PortfolioEquityEx.ExecuteDonorStrategy(this,new Donor(),Bars);

requires a bars argument that I didnt seem to need with runDonor.. Can you confirm?

Thanks for your help

profile picture

leszek

#2
CODE:
Please log in to see this code.


yes you can pass null for Bars in which case the strategy will be run on all symbols in the selected dataset.
profile picture

Eugene

#3
sedelstein:

Nothing has changed with regard to the legacy code. It can still be used, acting as wrapper for the new syntax. Like you already read in the thread you referred to, it's not documented and therefore is left up to the motivated user. If you're interested in the use of extension methods, the project's code is open source and this page suggests where to go further:

Home - Community Components

leszek:

The real beauty of extension methods is uncovered when you call it this way:
CODE:
Please log in to see this code.


profile picture

leszek

#4
good to know. :)
profile picture

sedelstein

#5
Yes Eugene, I did read that the old method will work. All things being equal I prefer not to get compiler error messages.

Thank you both for your input

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).