Why Optimization in Portfolio Simulation and Raw Profit mode is different?
Author: fairone99
Creation Date: 6/28/2019 4:55 PM
profile picture

fairone99

#1
Hi!

It just recently happens to my strategy. By using Portfolio Simulation Mode, I get pretty good trading result...

However, when I use Raw Profit Mode, the result is different (worse).

I find out the reason is that the the Portfolio Simulation Mode after optimization, "luckily" pick the trades that can produce great APR (well, it might not be luck, it is because the optimization process..). With only about half the total trade taken...

When using the Raw Profit Mode which shows the "true color" of each trade without the capital limitation and does show a worse trading result.

Does anybody experience this? And, how can I solve this?


Alex
profile picture

Eugene

#2
Hi Alex,

Your question is too general and lacks key factors. To start with:

a) the optimization method or methods you're using;
b) position sizing in use (and its parameters);
c) Preferences > Backtest Settings;
d) Position.Priority assignment in your Strategy code.

If you could expand on how you determined that "cherry-picking" happens we may explain what goes wrong.
profile picture

fairone99

#3
Thanks!

Sure, Eugene...

Let me explain it in more details.

a) the optimization method or methods you're using;
I am using Exhaustive Method.

b) position sizing in use (and its parameters);
100% Equity in Portfolio Simulation Mode

c) Preferences > Backtest Settings;
I think it is default without any thing checked.

d) Position.Priority assignment in your Strategy code.
None as 100% equity is used.

The process I did is this:

1. Use Portfolio Simulation Mode to Optimize.
2. Find a good set of parameters after the Optimization.
3. Apply the good set of parameters in my code.
4. Happy with the result and test it on out of the sample data, still very happy with the result.
5. Run the strategy using the Raw Profit with $10000 (RP)
6. And, very much shocked with the result showing Negative profit per Bar: ($1.02).
7. Investigate and find out the Portfolio Simulation Mode Optimization "picks" the better trades (about 50% of the total trades taken ) while Raw Profit Mode shows Negative profit per Bar: ($1.02) if all the trades are taken.

So what happened and what should I do with this?

Oh, if I reduce the position size to 50% equity and run the strategy again, the result becomes worse as every trade is taken...


Alex
profile picture

fairone99

#4
Further investigation, I figure out that there are three trades with very large loss (about negative 40%) that happened during the huge market downturn of 2000 to 2002 and 2008.

These three trades are "covered up" when using 100% equity. However, these trades do show up when using 50% equity or Raw Profit Mode...
profile picture

Eugene

#5
"100% of equity" is a recipe for dropping too many trades. It's stressed in the User Guide > Strategy Window > Backtesting Strategies > 100% of Equity Sizing. There are several workarounds to it:

1. reduce the position size
2. use of margin (covered in the WL UG)
3. a scripting solution (again, see the UG)
4. Position Options PosSizer's "Skipped trade solution"

Assuming you've employed one of them, enable "Use Worst Trades in Portfolio Simulation" in Preferences > Backtest Settings. The most-pessimistic choice of candidate trades is a good way to err on the side of caution.

profile picture

fairone99

#6
Thank you, Eugene for the quick response back.

I will follow your instructions and give them a try and will post the result back later, thanks!

Alex
profile picture

Eugene

#7
P.S. As an alternative to the "Use Worst Trades..." option you could try setting a custom Position.Priority but for simplicity's sake and your demand for the "true color" of each trade I'd suggest enabling that checkbox better than anything.
profile picture

fairone99

#8
Hi! Eugene,

I am reporting back the result.

The issue with my strategy is that I place market order and the "Gap Up" causes about half of the trades been NOT taken. By slightly reduce the percentage of equity position size, the strategy can be adjust to take on more trades and even all the trades.

So the issue has been solved and thank you for your help!
profile picture

Eugene

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