Worked flawlessly, Paul.

I'll be able to store the stock's weekly composite grade [A,B,C or F]  in its 
OI field.
[Or that grade plus its10 sub-grades assuming I figure out how to decipher it.]

Many thanks,
Bob
  ----- Original Message ----- 
  From: Paul Ho 
  To: amibroker@yahoogroups.com 
  Sent: Thursday, March 20, 2008 8:23 PM
  Subject: RE: [amibroker] Import Data into OI field?


  Bob
  You can't do it in Amiquote or fget, but you can do it with COM objects.
  The following example gives you a means
  Ranking = C;  // replace this with something you want to store
  ab = createobject("broker.Application");
  target = ab.Stocks(name());
  qts = target.Quotations;
  for(i = 0; i < Barcount; i++)
  {
      qt = qts.Item(i);
      qt.OpenInt = Ranking[i];
  }
  buy = sell = 0;

  Run scan over tickers that you want. and Remember to refresh all to see the 
changes
  It is very important to know that AB does not detect the OI field for 
changes, so if there is no other changes in your database, pressing save doesnt 
save your changes in OI (at least that was the case in the past), To force 
save, choose save database as, or make some sure there are some other changes 
in your database and press save. Otherwise, the OI fields would be blank next 
time you open it.
  Good luck.




----------------------------------------------------------------------------
    From: amibroker@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
[EMAIL PROTECTED]
    Sent: Friday, 21 March 2008 10:38 AM
    To: amibroker@yahoogroups.com
    Subject: [amibroker] Import Data into OI field?



    Although I understand that additional AB data arrays [and means of 
populating them] are planned for the future, I'd like to store a weekly value 
into the OI field.of existing tickers.

    Any way to do this with AmiQuote?
    If not, how about with fget, etc?

    TIA,
    Bob


   

Reply via email to