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

Re: [amibroker] Count database quotations



PureBytes Links

Trading Reference Links

Hi Graham,

The difficulty when attempting to learn how to program with the object model
documentation is that it presumes the person has certain knowledge and
is really not designed as the first point of reference when your in
the initial learning phase. There are books that focus on this
subject, some very complex and some which present just the necessary basics of OLE
automation.

I have taken your reference to 'time period' to mean 'periodicity', so
the number of quotations will be equal to that set in Database
setting:bars to load.
You can run this as an exploration and then adapt to an indicator as
required. The reference to the Analysis object is only required during
an exploration.

/* Start of exploration code */
AB = CreateStaticObject("Broker.Application");

/* Remove this section for indicator use */
AA = AB.Analysis;
AA.ApplyTo = 0;
AA.RangeMode = 1;
AA.RangeN = 1;
/* Remove above section for indicator use */

Stock = AB.Stocks(Name()); /* Reference to current stock */
Quotations = Stock.Quotations(); /* Reference to the quotations of the current stock */
TotalQuotes = Quotations.Count(); /* Retreive count of the quotations collection */
Filter = 1;
AddColumn( TotalQuotes, "Total Quotes");
/* End of exploration code */



/* Simple indicator code below */
AB = CreateStaticObject("Broker.Application");

Stock = AB.Stocks(Name()); /* Reference to current stock */
Quotations = Stock.Quotations(); /* Reference to the quotations of the current stock */
TotalQuotes = Quotations.Count(); /* Retreive count of the quotations collection */

Title = "" + TotalQuotes;



Regards,
William Peters
www.amitools.com




Wednesday, September 7, 2005, 6:54:21 AM, you wrote:
G>    I am trying to learn a bit about using the object automation in AB
G>  My purpose is to count the actual number of quotations in the database
G>  and present in the chart, regardless of the time period setting of the
G>  chart.

G>  I see this in the help screens and the few examples which seem to be
G>  about running scans etc.

G>  Quotations (collection)
G>  properties:
G>  Count : number 

G>  where do I start to learn what to do?

G>  -- 
G>  Cheers
G>  Graham
G>  AB-Write >< Professional AFL Writing Service
G>  Yes, I write AFL code to your requirements
G> http://e-wire.net.au/~eb_kavan/ab_write.htm
    

G>  Please note that this group is for discussion between users only.

G>  To get support from AmiBroker please send an e-mail directly to 
G>  SUPPORT {at} amibroker.com

G>  For other support material please check also:
G> http://www.amibroker.com/support.html



      

  
G>   SPONSORED LINKS  
G>         Investment management software      Real estate
G> investment software      Investment property software         
G> Software support      Real estate investment analysis software     
G> Investment software              
  
  

G>   YAHOO! GROUPS LINKS

G>    Visit your group "amibroker" on the web.
G>     To unsubscribe from this group, send an email to:
G>  amibroker-unsubscribe@xxxxxxxxxxxxxxx
G>     Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

  


    
  




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Put more honey in your pocket. (money matters made easy).
http://us.click.yahoo.com/r7D80C/dlQLAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/