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

RE: [amibroker] Keeping a counter



PureBytes Links

Trading Reference Links

Alex,

 

This works exactly the same way in AFL:

 

Cntr = 0;

for(i=0; i<BarCount; i++) { 

       if (Sell[i])

              Cntr = Cntr + 1;

}

 

Regards,

 

David

 

  _____  

From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
Of dralexchambers
Sent: 02/19/2007 3:05 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Keeping a counter

 

How do you do this in AFL?

I want to keep a counter variable that adds 1 everytime a Sell=1. In 
VisualBasic it would be:

cntr = 0
for i = 0 to barcount
if Sell[i] = 1 then cntr = cntr + 1
next i

cntr then becomes the number of trades that have closed. For example, 
if there were two trades in the backtest, cntr would be 2.

Thanks - Alex

 


Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.18.3/693 - Release Date: 2/19/2007 5:01 PM