Changing Position Size
Author: dansmo
Creation Date: 10/13/2010 4:38 AM
profile picture

dansmo

#1
Hi,

when I did backtests on Daily basis and changed the position Sizer after the run, the new position sizing rules were applied on that run.
When I change the position sizer on a 5 Minute scale, there is a new run done by WLD.
Is that intentional?
profile picture

Eugene

#2
Hi,

No, it shouldn't happen. How did you determine there was a new run?
profile picture

dansmo

#3
Hi Eugene,

I saw it because the code uses PrintStatusBar() during bar loop.
profile picture

Eugene

#4
What I'm seeing now is that PrintStatusBar works each time position sizing was changed (regardless of bar scale). For me it's quite unexpected.
profile picture

dansmo

#5
I use this line of code:
CODE:
Please log in to see this code.

It definitely loops through all bars when I change position size.

I never saw this happen on a Daily timescale.
profile picture

Eugene

#6
How many daily bars do you load? Maybe they get processed too fast?
profile picture

dansmo

#7
Okay, you are right: the statusbar also changes on Daily Bars.
But it seems to me that the whole code is executed. I have included a PrintDebug() in my testcode on Daily Bars and there are several prints to the debug window while playing with position size. It really seems to me that the whole code is executed again.
profile picture

Eugene

#8
Looks like a bug to me.

Because the design, as we all know, is to obtain raw profit results using 1 share and then apply position sizing - like it always has been.
profile picture

dansmo

#9
It looks like it was introduced in version 6. I am on 6.0.51.

[will I get a reward for spotting all these bugs? ;-)]
profile picture

Eugene

#10
[Like throwing in more bugs? ;)]
profile picture

Eugene

#11
Strategies won't re-run in MSB (multi-symbol) mode after applying a different position sizing but will do so in SSB (single-symbol) mode.

Having to run the strategy in an MSB again would be undesirable, and it doesn't happen, but in the case of a single symbol, that doesn't make a big difference.
profile picture

dansmo

#12
QUOTE:
but in the case of a single symbol, that doesn't make a big difference.


Totally disagree.
1. why should there be a difference at all between MSB and SSB?
2. A SSB on very long intraday data can take very very long. In that case it would be very good if it was not run again.
profile picture

Eugene

#13
In the first place, PrintStatusBar makes your Strategy run very slow (btw, this fact is mentioned in the RSI Rotation strategy's code).
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).