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

Loosing hair over this formula!



PureBytes Links

Trading Reference Links

I'm down to just a few hairs over a problem I'm having with the 
forumla below:

//---------------------------------------------------

X1=Optimize("X1",20,10,20,1);
Dbuy=Optimize("Dbuy",9,0,20,1);
Dsell=Optimize("Dsell",1,0,20,1);
osl = 3; 
oAvrsi = 50;

ApplyStop(2,1,Optimize("Trl Stop %",10,5,10,1),0);

s1=MA(RSI(X1),osl);
AVRSI=MA(s1,OAvrsi);
Buy = Cross( s1,AVRSI-DBuy);
Sell = Cross( AVRSI+Dsell,s1);

Short = Sell;
Cover = Buy;

//Buy = ExRem( Buy, Sell ); 
//Sell = ExRem( Sell, Buy ); 
//Short = ExRem( Short, Cover ); 
//Cover = ExRem( Cover, Short ); 

//---------------------------------------------------

The problem is that when I back test it against the NDX-X From TC2000 
with the following settings:

>From 1/1/1997 to 7/15/2002
Initial equity: 10000
Posisitions: Long and Short
Peiodicity: Daily
Commissions: percent = 0
Buy Price: Close with delay of 1
Sell Price: Close with delay of 1
Short Price: Close with delay of 1
Cover Price: Close with delay of 1
Max loss Stop: disabled
Profit target: disabled
Trailing stop: disabled
Reporting: overall summary, settings, incl out-of-market are checked 
with "Trade list with prices and pos" selected.

and double click on the resultant grid I get a bunch of arrows. When 
I check against the trades in the grid versus the arrows for the year 
2000 I see a lot of extra arrows. In reading the forum 
messages I learned that you can right click on the grid and 
select "Show arrows for actual trades" which I've done and the 
green/red arrows change. The trades on the grid now seem to match the 
arrows except that it shows a buy arrow for 7/5/2002 which is not 
listed in the grid as a trade. Coincidentally on that same date the 
short from 5/30/2002 is stopped out via the applystop. Is this 
preventing the buy? If so how can I Fix this?

I read in a post (see link below) that in Version 4.0 and later that 
you're not supposed to use the ExRem function anymore. 

http://groups.yahoo.com/group/amibroker/message/17676?threaded=1

Is that correct or should I use the ExRems? (I want to do some tests 
on a year by year basis)