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

Re: [amibroker] First Value When



PureBytes Links

Trading Reference Links

Ken,

why not save the number of shares (when initially bought), into a static variable?

Ara
  ----- Original Message ----- 
  From: Ken Close 
  To: amibroker@xxxxxxxxxxxxxxx 
  Sent: Sunday, February 04, 2007 8:07 AM
  Subject: [amibroker] First Value When


  I want to determine the stock price (to become the Buyprice) at the very first Buy signal in a series of buy signals over a range.

  When I have written 

  ValueWhen(Buy, Close);

  I get changing buy prices at each Buy signal.

  I have tried counting the number of Buy signals in the Range, and using

  ValueWhen(Buy, Close, NumbBuys);  but that does not seem to get it.

  What I am doing is using the BuyPrice to determine the number of shares purchased at that very first buy signal, then wanting to maintain that same number of shares throughout the range.

  Any suggestions to solve my problem?

  Thanks,

  Ken
   
Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.17.24/668 - Release Date: 2/4/2007 1:30 AM