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

[amibroker] question about the buyprice array



PureBytes Links

Trading Reference Links

Hi all,

I have a question about the buyprice referencing.
let's say after the buy = codition, AB generated arrays

 1   2   3   4   5  <- bar index
 1   1   1   0   0  <- buy array
$10  12  13  14  15 <- buyprice = open;
     ^   
if for some reason the backtest system enter the position at bar 2,
how to reference the actual entry price later in the code? for
instance, at "sell =" statement.

I think 
ref(buyprice, -barssince(buy)); 
won't work, it simply return $13 at bar4 and bar5.

Please advice, thank you.

Eric


Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.14/637 - Release Date: 1/18/2007 1:03 PM