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

Re: RE: [amibroker] Potential problem with Portfolio Backtester?



PureBytes Links

Trading Reference Links

As a followup to your question ...

Let's take a nice simple system like the one below and give it $1000 
in account balance ...

One would think that it would have a maximum of two positions i.e. 
PositionSize = -50, but if we allow position size shrinking it 
generates the following trades in a small amount of time:

Ticker	Trade	Date	Price	Ex. date	Ex. Price	% chg.
	Profit	% Profit	Shares	Position value	Cum. Profit
	# bars	Profit/bar	MAE	MFE	
AMZN	Long (profit)	10/7/2002	16.64	10/11/2002	18.304
	10.00%	50.00	10.00%	30.0481	500.00	50.00	5	10.00
	-1.62%	10.00%
PTEN	Long (profit)	10/7/2002	25.16	10/15/2002	27.676
	10.00%	50.00	10.00%	19.8728	500.00	100.00	7	7.14
	-4.77%	10.00%
SYMC	Long (profit)	10/11/2002	17.2	10/15/2002	18.92
	10.00%	53.32	10.00%	31.0027	533.25	153.32	3	17.77
	-2.62%	10.00%
INTU	Long (profit)	10/15/2002	49.53	11/1/2002	54.483
	10.00%	57.67	10.00%	11.6427	576.66	210.99	14	4.12
	-2.40%	10.00%
PDCO	Open Long	10/15/2002	53.09	11/1/2002	51.99
	-2.07%	-11.95	-2.07%	10.862	576.66	199.04	15	-0.80
	-3.54%	3.80%
HSIC	Open Long	11/1/2002	51.96	11/1/2002	51.96
	0.00%	0.00	0.00%	11.5381	599.52	199.04	2	0.00
	-3.79%	0.54%
NXTL	Open Long	11/1/2002	12.47	11/1/2002	12.47
	0.00%	0.00	0.00%	2.79128	34.81	199.04	2	0.00
	-11.31%	0.56%

As you can see it has taken a small position in NXTL on 11/1 which is 
the THIRD security it is now holding as of 11/1.

With no position size shrinking you get this list of trades ...

Ticker	Trade	Date	Price	Ex. date	Ex. Price	% chg.
	Profit	% Profit	Shares	Position value	Cum. Profit
	# bars	Profit/bar	MAE	MFE	
AMZN	Long (profit)	10/7/2002	16.64	10/11/2002	18.304
	10.00%	50.00	10.00%	30.0481	500.00	50.00	5	10.00
	-1.62%	10.00%
SYMC	Long (profit)	10/11/2002	17.2	10/15/2002	18.92
	10.00%	52.50	10.00%	30.5233	525.00	102.50	3	17.50
	-2.62%	10.00%
INTU	Long (profit)	10/15/2002	49.53	11/1/2002	54.483
	10.00%	55.13	10.00%	11.1296	551.25	157.63	14	3.94
	-2.40%	10.00%
PDCO	Open Long	10/15/2002	53.09	11/1/2002	51.99
	-2.07%	-11.42	-2.07%	10.3833	551.25	146.20	15	-0.76
	-3.54%	3.80%
HSIC	Open Long	11/1/2002	51.96	11/1/2002	51.96
	0.00%	0.00	0.00%	11.0297	573.10	146.20	2	0.00
	-3.79%	0.54%

So it does appear that AB is investing 50% of total assets not 
available cash for each entry and if we allow position size shrinking 
it sometimes of course will result in smaller than normal positions 
being taken.

PositionSize = -50;
PositionScore = C / Ref(C, -252);

Buy = 1;
Sell = 0;

ApplyStop(stopTypeLoss, stopModePercent, 10, True);
ApplyStop(stopTypeProfit, stopModePercent, 10, True);




Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Yahoo! Groups Links

To visit your group on the web, go to:
 http://groups.yahoo.com/group/amibroker/

To unsubscribe from this group, send an email to:
 amibroker-unsubscribe@xxxxxxxxxxxxxxx

Your use of Yahoo! Groups is subject to:
 http://docs.yahoo.com/info/terms/