- ago
2 Optimization settings questions

I am looking at a strategy that actually changes how many assets are traded using a optimized parameter of # of symbols.

When I trade a strategy that is a portfolio, I would divide 100 by # of assets traded to get a rough % of equity for position size. I then add this setting to strategy settings.

For optimization, one parameter is the # of symbols used. So if I trade 2 symbols then % of equity is 50. If I trade 3 assets, % of equity is 33.

I am assuming that the Optimization settings are influenced by strategy settings "% of equity". Is this true?

So if I had 10 symbols traded, but the % of equity is 50, then I can not make these trades in the long run, they would be NSF positions.

Next question:

I am having an optimized result yielding a very high APR. However, I can not replicate this in the back test window. Can you please tell me how to fix this.

Here are my print screens.

Here is the optimized run, showing a very high APR. I want to replicate this in a back test:



Here is the strategy window showing the correct standard opt params:



Here is the metrics reports showing a much lower APR:



Thank you,

Larry







0
230
Solved
8 Replies

Reply

Bookmark

Sort
- ago
#1
Did you double-click on that optimization run to invoke the strategy window or just opened it and changed the parameters manually?
0
- ago
#2
QUOTE:
Did you double-click on that optimization run to invoke the strategy window or just opened it and changed the parameters manually?


I have a strategy window open, then run the optimization. Then, I tried both these methods:

1) Save these parameters as the strategy's defaults, then run backtest.

2) I also tried to run a backtest with these parameters values.


0
Glitch8
 ( 7.81% )
- ago
#3
Hi Larry, first see if the results keep changing if you just run the backtest again and again. That would be an indication that there are NSF positions and WL8 is randomly selecting which ones to fill. If there are no NSFs then the backtest with the exact same parameters and settings should match exactly.
0
- ago
#4
QUOTE:
see if the results keep changing if you just run the backtest again and again. That would be an indication that there are NSF positions and WL8 is randomly selecting which ones to fill.


Glitch,
Results keep changing, even though I unchecked Retain NSF positions. I also put % of equity as 2%, so I would think this would not happen.

What can I do to stop this from occurring and be able to reproduce the results I want from an optimization.
0
Glitch8
 ( 7.81% )
- ago
#5
Checking the retain option does not influence whether the results will change or not, you're misunderstanding it.

It influences whether the non-sufficient-funds positions are RETAINED during the backtest, and thus contribute to the state of the ongoing simulation.

To get consistent results you need to either use a transaction weight, or keep decreasing the position size until such time that ALL trades are taken and there are zero NSFs.
0
- ago
#6
Glitch,

Maybe something else is happening here. If you look at this new strategy setting screen. I now have 10,000,000 starting capital and fixed value of 100. Still getting nfs trades.

Looks like position sizing in strategy setting of $100 is not in sync in Positions screen.



Here is the Positions screen, showing many thousands of shares trading:



Thank you,

Larry
0
Glitch8
 ( 7.81% )
- ago
#7
I'd need to see the strategy to comment, strategies are able to override the position size settings.
0
Best Answer
- ago
#8
Glitch,

You are correct. I was able to modify the code (comment out the section) that would over ride the position sizing.

Thank you,

Larry
0

Reply

Bookmark

Sort