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

Re: PositionSize Variable - Help - Inexplicable Results



PureBytes Links

Trading Reference Links

Thanks to all who responded with such very helpful input: Ara, Ken, 
Herman, Rick, Mark, and Tomasz.

I had overlooked the fact that in AmiBroker, PositionSize is 
expressed in dollars, not shares. 

This was my oversight due to the fact that in most of my other 
readings (Tharp, Turtle Trader site, and perhaps a dozen or so other 
sites, Position Size IS expressed in Number of Shares, and is defined 
as "the number of Contracts or Shares purchased."

This realization has resulted in me having to rewrite parts of many 
systems and explorations, but it's so good to have it cleared up in 
my own mind and see where the error arose.

My apologies for not doing enough due diligence research especially 
in AmiBroker's Help before posting, and thanks once more for 
everyone's helpfulness and patience through this small bump in my 
learning curve.

Just one last question on this subject: Shouldn't the following two 
situations produce identical results?


1) PositionSize = 30000; ( with equity set to 30000 in Settings as 
well as in "Capital" variable in code and no position size shrinking)
2) PositionSize = -100 ( with equity set to 30000 in Settings as 
well as in "Capital" variable in code and no position size shrinking)

Even after I adjusted my code to fix the misunderstanding I had 
regarding position size, these two tests, which seem to me should be 
equivalent, produce entirely different results.

Here are the different results obtained in each case:


# of Tr	Avg.Tr.	Portfolio	%

1)	3708	+644.06	53938	+79.79 %
2)	3708	+1739.65	94692	+215.64 %

... of course, I'd never trade with 100%, but these #'s illustrate my 
point better; 30000 should produce the same results as -100 (100% of 
30000)

Here are the results for the same test at $3000 and -10 (10% of 
30000). They are still significantly different:

1)	3708	+65.80	32445	+ 8.15 %
2)	3708	+70.10	32605	+ 8.68 %


Do you think that the difference between the integer and the 
floating point calculation of the percentage could account for this 
large of a difference?

Best Regards to all

Nick Molchanoff

--- In amibroker@xxxx, "Tomasz Janeczko" <amibroker@xxxx> wrote:
> Hello,
> 
> Nick wrote:
> 
> > PositionSize) then, if you DO use PositionSize and set the number 
of 
> > shares to TotalEquity/Close, then the results of the two runs 
should 
> > be identical, but in all my tests, they are not. I do not 
understand 
> > why this is so. I must conclude that I am either suffering a 
> > misunderstanding, making an error, or there is a problem with 
> > PositionSize implementation.
> First of all POSITION SIZE is expressed in DOLLARS not in number of 
shares.
> 
> RTFM !
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com