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

Re: [amibroker] Bug in sellprice for some stocks



PureBytes Links

Trading Reference Links



Hello,
 
This is true that Open position take sellprice (coverprice for 
short) for
calculation. This is by design.
The rule is that sell price array should be valid for all bars 
(because if you use
ApplyStop in conjunction to sellprice array and you don't set 
"Exit at stop"
flag the stops are entered at the sell price 
and it can happen anytime).
 
So again - sellprice array must contain valid values from the 
very first bar
to the last bar.
 
This is also the reason why you get strange first out 
pos:




Out
02/07/94
-10000000000.00
05/11/94
49.50
0.00
10000.00
 
 
-10000000000.00 is a -1e10 = empty value.
 
This also causes strange buy and hold profit 
calculation.
 
You have to make sure buyprice/sellprice 
arrays never contain empty values.
To do so use:
buyprice = IIF( IsEmpty( buyprice ), close, buyprice 
);

sellprice = IIF( IsEmpty( sellprice ), close, sellprice 
);
 
at the end of your formula.
 
Best regards,
Tomasz Janeczko
amibroker.com
 
----- Original Message ----- 


From: "Stephane Carrasset" <<A 
href=""><FONT face=Arial 
size=2>nenapacwanfr@xxxx<FONT face=Arial 
size=2>>
To: <<A 
href=""><FONT face=Arial 
size=2>amibroker@xxxxxxxxxxxxxxx<FONT face=Arial 
size=2>>
Sent: Wednesday, November 07, 2001 12:25 
PM
Subject: [amibroker] Bug in sellprice for some 
stocks
Tz,have you solved the bug I have 
observed with sellprice for some stocksmessage 
5942Stephane Your use of Yahoo! Groups is 
subject to <FONT face=Arial 
size=2>http://docs.yahoo.com/info/terms/