Monte Carlo optimization ignores Step value
Author: MustPlayOptions
Creation Date: 8/6/2018 2:15 PM
profile picture

MustPlayOptions

#1
Hi,

I've noticed a few bugs:

1) When trying to place trades from WL into Fidelity, an error occurs if the stock price is >1k, e.g. BKNG, AMZN, GOOGL. Same for retrieving the status of the orders.

2) Optimization of a strategy using Monte Carlo or Exhaustive, ignores the step sizes. It would make results much easier to compare and make things a lot faster if it used the step sizes of the parameters.

3) Data updates get stock at stocks that have recently split so those stocks need to be removed from the dataset in order for the rest of the set to get updated.

Thanks
profile picture

Eugene

#2
Hi,

When posting questions, please don't 'pack' unrelated questions into one thread. Managing such threads becomes a disappointing experience and they can hardly be useful for the other forum users - including you.

Having encountered an error message or an issue, please always check out these pages before reporting it:

1. Known Errors
2. Open Issues

In particular, issue #3 "Data updates get stock at stocks that have recently split" is well known and is described in the Open Issues list with workarounds. Sadly, Fidelity still hasn't allocated resources to fix it once and forever as users keep getting affected by it.

Also, choose meaningful topic titles in the spirit of "a wise man's question contains half the answer". "Bugs" (which I renamed) sounds like judgment and may be incorrect (see below). On our forum you're hardly going to find indescriptive topic titles and such containing the words like problem, bug, question, help, newbie etc. - they've been replaced with short problem description or feature request. An effort is being continually invested into making your forum search experience as effective as possible. So you could find several topics raised re: issue #3 on the forum as well - just give the search-as-you-type box a try.

QUOTE:
2) Optimization of a strategy using Monte Carlo (haven't tried exhaustive), ignores the step sizes.

It's by design. Kindly revisit the Wealth-Lab User Guide > Strategy Window > Optimization > Full Optimization > Optimization Control > Optimization Method > Monte Carlo.

QUOTE:
1) When trying to place trades from WL into Fidelity, an error occurs if the stock price is >1k, e.g. BKNG, AMZN, GOOGL. Same for retrieving the status of the orders.

What error? Please start a new topic for this issue and copy/paste the error message exactly as it appears.

Thanks.
profile picture

MustPlayOptions

#3
I did what was explained in the reference and yet it is ignoring the step size. Thus it appears to be a bug.
profile picture

Eugene

#4
QUOTE:
I did what was explained in the reference and yet it is ignoring the step size. Thus it appears to be a bug.

Not sure what you did but let me quote that paragraph here for you and others who might stumble onto this topic later:

The Monte Carlo process chooses random combinations of values that fall between the Start and Stop values defined for the parameters; the Step value is meaningless.

Hope this helps.
profile picture

MustPlayOptions

#5
Ok, I missed that my bad.

The Exhaustive says it also looks at every possible combination and when I calculate it out it too seems to be ignoring the step size.

So what may I ask then is the purpose of the step size in the optimizer if both types of optimization ignore them?

I guess then I'd like to change this to a request to have the option to limit parameter trials to the step size in both types of optimization.

Thanks
profile picture

Eugene

#6
The Exhaustive optimization does not ignore the Step size. Try to approach it from a different angle: let's set requests aside for now and determine what goes wrong with your optimization. If you share your optimizable parameters and related Optimizer settings we might help you with this.
profile picture

LenMoz

#7
Add-in Particle Swarm Optimizer(PSO) respects Step Size. Internally it works on the Start-Stop continuum, but rounds to Step Size before calculating parameter result.

LenMoz (PSO author)
profile picture

Eugene

#8
QUOTE:
Add-in Particle Swarm Optimizer(PSO) respects Step Size

...but doesn't respect Parameter Checkboxes ;)

Sorry for the offtopic.
profile picture

MustPlayOptions

#9
Ok,

So as you can see I have 4 parameters and we will look at the Exhaustive search. Assuming the edges are included, there should be 8 x 5 x 9 x 9 = 3240 combinations. The optimizer as you can see wants to do 696,600 different combinations. The Exhaustive search btw would be faster than a Monte Carlo in this case which is doing 43,000 combinations.

The 3,240 combinations would be done in a few minutes. For the full 696k it will take an estimated 4+ hrs.

What can I do to fix this please?

Thanks
profile picture

Eugene

#10
There's nothing to fix when you realize that the "Runs Required" takes into account the number of each and every run it makes. Each optimization run in a multi-symbol portfolio backtest includes running your system on each stock with each parameter combination before building the portfolio's equity curve. There are 215 symbols in your DataSet, correct? Multiply that by 3,240 combinations and you get the 696,600 runs required.
profile picture

MustPlayOptions

#11
Aaahhhh that explains it. I considered 1 run being a run on the data set. Thank you.

I tried downloading the PSO optimizer but I don't think it works with Fidelity. Oh well.
profile picture

Eugene

#12
No idea whether the PSO works with Schwab, Interactive Brokers or Tradestation but it definitely works well with Fidelity! :) Just make sure to ask in a suitable thread please.
profile picture

LenMoz

#13
QUOTE:
...but doesn't respect Parameter Checkboxes ;)

My (unpublished) version does. ;)

I never use this functionality, so, without other enhancements, it's not worth the effort of publishing. Workaround? Set Default, Start, and Stop to the same value.

Sorry for the offtopic.
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).