Portfolio Simulation mode for live trading in Strategy Monitor?
Author: tschwei
Creation Date: 10/13/2017 7:12 PM
profile picture

tschwei

#1
Hello experts,

I've been enjoying using WLP to develop several multi-symbol strategies over the last months,and after extensive Portfolio Simulation-based backtesting, I am finally ready to start trading them. These strategies follow a general pattern mentioned by LenMoz a while ago (see post 20 of this thread: https://www.wealth-lab.com/Forum/Posts/Neuro-Lab-please-explain-output-script-and-NNIndicator-38651).

Unfortunately, it seems that I should have read more of the user guide before I started using WLP, because it appears that these strategies (which depend on LastPosition.Priority and % equity position size) are incompatible with WLP live trading.

Taken from the user guide:

QUOTE:
Operational difference between the Strategy Monitor and Backtester

Wealth-Lab's Backtester runs a Strategy on all of the symbols and then applies position sizing on a Portfolio-level after the fact. The Strategy Monitor cannot take this approach because it's required to run the Strategy and produce alerts in the most timely manner possible, especially for intraday data. The Strategy Monitor runs the Strategy individually for each symbol as soon as the data is available. This will lead to differences in position sizing between the Strategy Monitor and Backtester when using Portfolio Simulation modes. For this reason it is generally recommended to use Raw Profit sizing modes in the Strategy Monitor and not a Portfolio Simulation mode (like PosSizers).

For example, a PosSizer that sizes based on "percent winners" would base the number of winners on all symbols in the DataSet in a Multi-Symbol Backtest, whereas in the Strategy Monitor the winners would come only from the symbol currently executing.


Based on this, and my limited testing, it appears that the Strategy Monitor tool indeed does not support the features that make the Portfolio Simulation mode so useful (such as position sizers, or using a % of equity to set position sizes, or LastPosition.Priority to choose the best of several possible symbols per bar). So I have a few questions:

Given the above, why would anyone ever want to use Portfolio Simulation mode in WLP, when the features it provides can't be used for live trading with the Strategy Monitor?

Why does WLP let me choose a Portfolio Simulation config when adding a strategy to the Strategy Monitor, but then warm me not to do this?

What is the difference between specifying a Raw Profit config and a Portfolio Sim config when using the Strategy Monitor?

I really hope I am confused and there is some way the Strategy Monitor can utilize LastPosition.Priority and % of equity position sizes, but so far it appears that it does not (the trades generated from my strategies are different when run in Backtest mode VS. run in the Strategy Monitor). It currently seems that the only way I can use my strategies is to manually run them every day in Portfolio Sim mode to generate the correct alerts, and then do the trading manually. That would suck, and it wasn't what I was expecting when I started using WLP.

Thanks a bunch,
Tim
profile picture

Cone

#2
QUOTE:
.. why would anyone ever want to use Portfolio Simulation mode in WLP, when the features it provides can't be used for live trading with the Strategy Monitor?
The only proper way to use P-Sim mode is in a Strategy Window. There, the equity curve is built from all trades in the simulation, and it can be very accurate to match live trading. If you're trading EOD and require P-Sim sizing methods, use the S. Window. It's as simple as that.

QUOTE:
Why does WLP let me choose a Portfolio Simulation config when adding a strategy to the Strategy Monitor, but then warm me not to do this?
The S. Monitor doesn't generate a combined equity curve. Each symbol is run individually, as if you clicked on one symbol in a Strategy Window. It's recommended that you use RP sizing so that you get the size you want for "today". Let's say I want to use 10% equity sizing and my account is currently $100K. Well, that's the same as a $10K RP size for today. So as not to switch sizing too frequently, I continue to use that $10K size until my account reaches, say, $105K. Then I switch to $10,500 sizes. Conversely, if my account equity drops to $95K, switch to $9,500.

So, you can test with P-Sim sizing and switch to RP sizing when trading. You just need to adjust it when required.

Tip:
As long as your strategy doesn't trade multiple positions in the same stock, I recommend enabling Preferences (F12) > Trading > Exit Orders...

QUOTE:
What is the difference between specifying a Raw Profit config and a Portfolio Sim config when using the Strategy Monitor?
Answered above.

QUOTE:
I really hope I am confused and there is some way the Strategy Monitor can utilize LastPosition.Priority
If you're trading EOD market order entries and rely on Priority, you can use either the S. Monitor or the S. Window. Pass the Priority value as the entry's signalName string, and when your cash is limited and do not have enough to purchase all the trade candidates, sort the Alerts by priority and purchase the ones with the greatest value until you run out of buying power.
profile picture

tschwei

#3
Thanks Cone!

Yes I'm only going to trade EOD market orders and I care more about the priority than the position size, since it can make a big difference in the strategy results. I agree I can manually set the position size using RP mode and adjust as my equity changes.

Thank you for the idea of passing the priority value as the buy signal name and then sorting on that column in the S. Monitor window. That will let me relatively easily select the "best confidence" buy signals and ignore/cancel the rest.

Occasionally my strategies will attempt to buy 5-10 symbols per bar, but the portfolio only has enough $ to buy one, which is where the priority can make a big difference in symbol selection. Also, if I don't set the priority I get different results with each P-Sim mode backtest. (FYI, here's how I'm formatting the priority double so it will sort correctly: string ppStr =string.Format("{0:00.00}", positionPriority);)
But unfortunately I will still need to do this manually for each strategy every day. Believe it or not, I was really hoping to eventually be able to let WLP auto-trade hands-free. I guess I won't be able to do that with these position-priority-based strategies.

I'm still not sure what is different with the S. Monitor when you use RP sizing versus P-Sim sizing. In your $100K/10% example above, what would happen if instead of using an RP size of $10k, I switched to using 10% equity P-Sim sizing?

IMO, last position priority is cool WLP feature that both increases gains AND insures consistent backtesting runs. So it would sure be a great feature enhancement if WLP had an "EOD mode" in the S. Monitor that could somehow support position priority when generating buy signals.

Thanks,
Tim