WFO: Optimize in Raw Profit, then out-of-sample in Portfolio Simulation
Author: kbellare
Creation Date: 6/28/2016 9:31 PM
profile picture

kbellare

#1
I have a strategy that runs on S&P500 stocks and holds 20 positions.
- Would like to optimize the strategy over 6-month period per symbol and then run it in Portfolio Simulation mode (holding only 20 positions) over the next 2 months. Then, repeat the process until i have an out-of-sample equity curve and drawdown curve over 3 years.

- this is like running in-sample in Raw Profit mode (to optimize per symbol, since PortSim doesn't support per-symbol optimization) but running out-of-sample in PortSim mode to achieve an equity curve.

How do i achieve this? The WFO process runs in-sample and out-of-sample in the same mode.

thx
Kiran
profile picture

Eugene

#2
Since Wealth-Lab is an extensive platform, you could achieve this by developing a custom WFO optimizer from scratch: Creating Optimizers in Wealth-Lab Pro®.
profile picture

kbellare

#3
Thanks Eugene for the document,

I read it but didn't find objects to
1) access and update the Mode and Dates in each run (i.e. Raw Profit during in-sample vs Portfolio Simulation in OOS and Start/End Date), so i can alternate between IS and OOS in subsequent runs.
2) access the symbol-specific optimal parameters when running in Raw Profit mode
3) assigning the symbol-specific optimal parameters to the Preferred Values, that would be used in the Next Run (in Port Sim mode).

thanks
Kiran
profile picture

Eugene

#4
Sounds like you've hit a limitation in the API. In this case, possible suggestion could be to build your custom "optimizer" as a compiled Strategy (like the WFO library by AronowSoftware back in the days of WLP 5.1) or as an addon library (like Neuro-Lab, for example). Through the use of the internal and unsupported TradingSystemExecutor class a strategy can be executed with arbitrary position sizing and data loading settings. Not sure if you'd be able to assign Preferred Values this way but the whole logic of the "optimizer" is under your complete control.

Like I said it's all unsupported but here's an example to give you a general idea: Interacting Dynamically with Portfolio Level Equity. Check out the PortfolioEquityEx.cs class in the Community Components open source code.