[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PositionSize Variable - Help - Inexplicable Results



PureBytes Links

Trading Reference Links

Nick,

Position Size IS a dollar amount, not number of shares.

Of course you can translate that into shares by calculating 
PositionSize = Close * number of shares you want.

If you specify number of shares that way, you really dont have a good 
measure of return as a point point gain is a different percentage 
gain for varying prices.

Also using total equity vs psotion size will not produce a 
proportionate return. For example of you invest all assets (say $100K)
each time and get a return of $50k, then if you tested positionsize = 
50K, you would not get half the profits (100k/50k) because of the 
compounding effect of investing more or less than 100k when 
psotionsize is not specified.

Ara

--- In amibroker@xxxx, "n94612" <nkm@xxxx> wrote:
> Thanks for the quick response, Ara, but, a few things you said, I'm 
> not sure I understand correctly:
> 
> 1) " > So if your starting equity is $100K and positionsize = $20K 
> gives you 
> > a profit of $10K, that becomes 10% return." 
> 
> I understand positionsize to be a number of shares, not a dollar 
> amount. Please correct me if I'm wrong on that.
> 
> 2) "> If you remove position size, each trade uses all of the 
capital 
> > available, so the return will be significantly higher."
> 
> I thought I had checked against this possibility properly by 
> substituting the number of shares purchaseable with total capital 
> available (total equity / closing price == # of shares if total 
> equity invested) into the positionsize variable and then testing 
with 
> that amount explicitly defined in the code. Instead of being the 
> same as I would have expected, I found that the percentage gain 
> results were still dramatically decreased. This should not be the 
> case. If AB is calculating using total equity when I don't 
> explicitly declare it, then if I use Total Equity/close explicitly 
> declared in PositionSize variable, the results should be identical--

> however, they are not.
> 
> 3) "> Check your setting to see your starting amount available"
> 
> I not only checked and re-checked this, I tested and re-tested over 
a 
> range of different values, and in addition, tested with Total 
Equity 
> specified in Settings AND in Code, as well as in Settings alone, 
and 
> in code alone.
> 
> Please forgive me. I had thought I had made all that clear in my 
> post, but re-reading, I fear I may have become unclear by providing 
> too much detail in some areas and not taking enough time and space 
to 
> state all the basic precautions I took before posting.
> 
> Let me restate the crux of my issue more succinctly:
> 
> If AB calculates total percent gain using total equity as defined 
in 
> settings if positionsize in not explicitly declared, then if you DO 
> explicitly declare positionsize and set it equal to total equity, 
the 
> results should be the same. In all my testing, the results were 
not 
> the same, and I think they should be.
> 
> I have double-checked my results yet again in light of your 
comments 
> and find the same anomalies still present.
> 
> Have you tested this yourself? and is it working OK for you? 
> 
> Regards,
> 
> Nick Molchanoff 
> 
> 
> 
> 
> 
> --- In amibroker@xxxx, "akaloustian" <ara1@xxxx> wrote:
> > The position size limits your profita as it is decreased.
> > 
> > The %profits are computed based on total starting equity.
> > 
> > So if your starting equity is $100K and positionsize = $20K gives 
> you 
> > a profit of $10K, that becomes 10% return.
> > 
> > If you remove position size, each trade uses all of the capital 
> > available, so the return will be significantly higher.
> > 
> > Check your setting to see your starting amount available
> > 
> > Ara
> > 
> > --- In amibroker@xxxx, "n94612" <nkm@xxxx> wrote:
> > > I've been studying position sizing / money management for about 
> a 
> > > month or two now, and have been following most of the recent 
> > postings 
> > > on Money Management with great interest. My understanding is 
> > > increasing, but I have been having some inexplicable results in 
> > some 
> > > backtests and explorations that I have been running as learning 
> > tools 
> > > regarding position sizing, and I sure could use some help or 
> input:
> > > 
> > > Like some others of you out there, I noticed that whenever I 
add 
> > > position-sizing code to any of my experimental systems, the 
> percent 
> > > gain drops WAY down.
> > > 
> > > For example, in one particular test using a Dip-Buying 
algorithm 
> > > translated from Wealth-Script, the results were +18.54 with no 
> > > position size statement in the code and only +0.07% with 
Tharp's 
> > > volatility based stops set at a generous 5% of total equity. 
> > > Lowering the % of TE to the recommended 1 or 2% resulted in 
> further 
> > > degradation of results, (1% : -0.02%loss and 2%: +0.00% 
> negligible 
> > > gain.) This did not surprise me as I had already read that 
> many 
> > of 
> > > you had the same or similar experiences with severely impacted 
> > gains 
> > > in your own backtests that also were resultant from adding 
> position 
> > > sizing.
> > > 
> > > However, I then determined to try to get an idea at what 
> percentage 
> > > of total equity risked with Tharps volatility, WOULD the 
results 
> > come 
> > > near to those obtained with no position sizing. That's when I 
> > > discovered that it made almost no difference whether %TE risked 
> was 
> > > 0.1%, 0.2% or whatever, even at 10%, 25%, 33%, 50% and 100% of 
> > total 
> > > equity risked, the results were still enormously degraded 
> compared 
> > to 
> > > those without explicitly coded position-sizing. That just 
didn't 
> > > sound right to me. 
> > > 
> > > Growing suspicious, I then proceeded to test a wide range of 
> fixed-
> > > dollar-amount sizings, and fixed-share-amount sizings, all with 
> > > similarly degraded overall results as the Volatilty-based 
sizings.
> > > I found it made no significant difference whatsoever what 
> position 
> > > sizing scheme or formula I employed -- What I found was...
> > > 
> > > ---As soon as the PositionSize variable is added to the code, 
> the 
> > > percentage gain results decrease dramatically. All of which 
> leads 
> > me 
> > > to wonder...
> > > 
> > > 1) What is the default for position size used in AmiBroker's 
> > backtest 
> > > calculations when the variable is NOT declared? Anybody 
know? 
> > > 
> > > --I don't think it's total equity from Settings because I 
tested 
> > for 
> > > that -- when I use the PositionSize variable 
> using "capital/close" 
> > > (total equity as position size) the results are still way down 
> > (over 
> > > 95% down) from teh non-declared sizing results, and if that is 
> so, 
> > > how can the non-declared sizings result in such better gains? 
It 
> > > doesn't make sense.
> > > 
> > > 2) Why can't these non-position sizing results be approximated 
> > using 
> > > ANY position-sizing formula when the variable IS declared? I 
> have 
> > > been wracking my brain on this, to no avail.
> > > 
> > > Anybody else tried anything like this? If so, did you notice 
> the 
> > > same thing. I mean, I can ceratinly see where capping ones 
risk 
> to 
> > a 
> > > small percentage of total equity, and the resulting inevitable 
> > > decrease in position sizes, especially for very volatile 
issues, 
> > must 
> > > have SOME negative impact on profits and backtest results; 
Less 
> > Risk-
> > > Less Profit; it's the price of insuring against catastrophic 
> loss, 
> > > and would be more pronounced the shorter the hold-time of the 
> > system, 
> > > but this effect should not occur with fixed-share or fixed-
dollar 
> > > sizings, at least not to the same degree. And, it seems to me, 
> > that 
> > > at SOME parameter range, the results using the "PositionSize" 
> > > variable should approach and eventually approximate the default
> (no 
> > > explicitly declared position size variable) gain percentages. 
But 
> > > apparently, judging from the results of my own testing anyway, 
> this 
> > > is not occuring, so how are the better results without position 
> > size 
> > > declaration even possible?
> > > 
> > > I'm baffled. Please anybody, help, comment, question, share 
> > insights.
> > > 
> > > If anyone out there gets interested enough to take the time and 
> > > trouble to test some of their systems - not necessarily with 
> Tharp-
> > > style volatility based position sizing - but with a similar 
wide 
> > > variety of simpler, more "vanilla" share-based or dollar-amount-
> > based 
> > > sizings, I'd sure love to hear what you find out.
> > > 
> > > I'm hoping that this is some error or misunderstanding on my 
part 
> > and 
> > > not a problem inherent in the the PositionSize variable 
> > > implementation, but on the off-chance I've inadvertantly 
> uncovered 
> > a 
> > > glitch of some sort, it'd be a good thing to get to the bottom 
of 
> > it.
> > > 
> > > 
> > > Respectfully,
> > > 
> > > Nick Molchanoff