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

[amibroker] sigScaleOut Problem



PureBytes Links

Trading Reference Links

My Backtest is Long Only, based on Weekly Charts.

The only two statements in my AFL code regarding Position Size are:

SetPositionSize (100/3,spsPercentOfEquity);
SetPositionSize(50, IIf( Buy == sigScaleOut, spsPercentOfPosition, 
spsNoChange ) );

Execution of the scaling out gives unpredictable results.  An example 
below shows that the first scaleout was OK  (110 out of 220 open 
shares of IBM scaled out on 11/5/2004).  However, the next scale out 
on  11/12/2004 (the next weekly bar) scales out 210 shares, when 
there are only 110 shares in the position, leaving the account short 
by 100 shares. 

Any thoughts as to what may be going wrong?

I have lots of other examples where the scale out size is not 50% of 
the current position.  Am happy to share more of the code, but 
thought this might be enough to generate some ideas.


Thanks,
David
------------------------------------------------





Date	Information
…	
8/20/2004	
	Entry signals(score):
	Exit signals:
	0 Open Positions: , Equity: 57406.1, Cash: 57406.1
8/27/2004	
	Entry signals(score):IBM=Buy(14.4218), 
	Exit signals:
	Enter Long, IBM, Price: 85.23, Shares: 220, Commission: 2.2, 
Rank: 14.4218, Equity 57401.7, Margin Loan: 0, Fx rate: 1
	1 Open Positions: , IBM (+220), Equity: 57359.8, Cash: 38675.2
9/3/2004	
	Entry signals(score):
	Exit signals:
	1 Open Positions: , IBM (+220), Equity: 57260.8, Cash: 38697.2
…	
10/29/2004	
	Entry signals(score):
	Exit signals:
	1 Open Positions: , IBM (+220), Equity: 58615.8, Cash: 38873
11/5/2004	
	Entry signals(score):
	Exit signals:IBM=Scale-Out, 
	Scale-Out Long IBM, Price 89.33, Shares 110, Fx Rate 1, Total 
Shares Hold 110, Exited 110, Avg. Price Entry 85.23, Exit 89.33, Avg 
Fx. Rate Entry 1, Exit 1
	1 Open Positions: , IBM (+110), Equity: 58985.6, Cash: 48725.9
11/12/2004	
	Entry signals(score):
	Exit signals:IBM=Scale-Out, 
	Scale-Out Long IBM, Price 92.5, Shares 210, Fx Rate 1, Total 
Shares Hold -100, Exited 320, Avg. Price Entry 85.23, Exit 91.4103, 
Avg Fx. Rate Entry 1, Exit 1
	1 Open Positions: , IBM (-100), Equity: 58656.4, Cash: 68187.4
…	
	






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
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/