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

Re: [amibroker] Looping through "foreign" files



PureBytes Links

Trading Reference Links




Hi Graham,
you would need to put the ABtool.DLL into ABs 
"Plugins"
subdirectory and load this new plugin (all DLLs there 
are
usually loaded automatically at AB start. To <FONT 
face=Arial>see which
plugins have been loaded use menu 
Tools/Plugins).
The AFL plugin DLLs offer some special or additional 

functionality which the user can 
use in his AFL scripts. 
If you think the functionality it 
offers is of some use for you
then let me know <FONT 
face=Arial>and I'll send you a copy of ABtool.DLL 
beta version.
So, regarding your question about the script below: it 
is
to demonstrate the use of the new 
functions ABtool.DLL offers.
You would need to load it into the Automatic Analysis 
window,
set your scan parameters (see note) a<FONT 
face=Arial>nd change the
watchlistnum and the name of the filename to yours, 
and
press "Explore" to run the script.
UM
 
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  <A title=gkavanagh@xxxxxxxxxxxxx 
  href="">Graham 
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Saturday, May 03, 2003 6:18 
AM
  Subject: RE: [amibroker] Looping through 
  "foreign" files
  
  
  <SPAN 
  >I don$B!G(Bt mean to sound dumb, but 
  what do you do with the script to get it to work?
  <SPAN 
  > 
  
  <FONT face="Times New Roman" color=teal 
  size=3><SPAN 
  >Cheers,<FONT 
  color=teal size=3><SPAN 
  >Graham
  <FONT 
  face="Times New Roman" color=#339966 size=2><SPAN 
  ><A 
  href=""><SPAN 
  >http://groups.msn.com/ASXShareTrading
  <FONT 
  face="Times New Roman" color=#339966 size=2><SPAN 
  ><A 
  href=""><SPAN 
  >http://groups.msn.com/FMSAustralia
  <SPAN 
  >-----Original 
  Message-----From: <A 
  href="">uenal.mutlu@xxxxxxxxxxx 
  [mailto:uenal.mutlu@xxxxxxxxxxx] <SPAN 
  >Sent: Saturday, 3 May 2003 10:49 
  AMTo: <A 
  href="">amibroker@xxxxxxxxxxxxxxx<SPAN 
  >Subject: Re: [amibroker] Looping through 
  "foreign" files
  <FONT face="Times New Roman" 
  size=2> 
  
  <SPAN 
  >Hi Chuck,
  
  <SPAN 
  >would the following help? If yes, 
  I can send you a 
  
  <SPAN 
  >beta of the plugin. But, 
  it is a beta and not certified
  
  <SPAN 
  >yet by amibroker.com. 
  
  
  <SPAN 
  >I'm open for more useful additions 
  to the plugin.
  
  <SPAN 
  >UM
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <SPAN 
  >/* ABtool.AFL for private plugin 
  ABtool.DLL   Demonstrates the use of some of the following AFL 
  extension    functions of the plugin "ABtool.DLL" (still beta 
  version!).   You should set "ApplyTo current stock" and "n last 
  quotes n=1"   before starting such a script. 
  
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <SPAN 
  >     STRING 
  TickerFirst(NUMBER 
  watchlistnum);             
  // gets first ticker in the WL (eventually put all to a WL to use 
  this)     STRING TickerNext(NUMBER 
  watchlistnum);     STRING TickerPrev(NUMBER 
  watchlistnum);     STRING TickerLast(NUMBER 
  watchlistnum);     NUMBER TickerCount(NUMBER 
  watchlistnum = -1);        // -1 means all 
  tickers in the database
  
  <SPAN 
  >     NUMBER 
  FileOpen(STRING filename, STRING mode);       // 
  mode: "r", "w", "a"     NUMBER FileClose(NUMBER 
  filehandle);                 
  // filehandle was returned by FileOpen()     NUMBER 
  FileWriteStr(STRING str, NUMBER filehandle);
  
  <SPAN 
  >     STRING 
  FileReadLine(NUMBER 
  filehandle);              
  // newline char will be removed internally*/
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <SPAN 
  >Filter = 
  true;
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <SPAN 
  >WL    = 
  1;             // 
  set your WL herefname = "test2a.txt";  // define the 
  filename
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <SPAN 
  >nTickerWL = 
  TickerCount(WL);AddColumn(nTickerWL, "TickersInWL", 
  1);
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <SPAN 
  >nTickerAll = 
  TickerCount();AddColumn(nTickerAll, "TickersAll", 
  1);
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <SPAN 
  >// write all tickers in WL to 
  a filefh = FileOpen(fname, "w");ticker = 
  TickerFirst(WL);FileWriteStr(ticker + "\n", fh);fEnd = false;while 
  (!fEnd)  {    ticker = 
  TickerNext(WL);    if (ticker != 
  "")      FileWriteStr(ticker + "\n", 
  fh);    else      fEnd = 
  true;  }FileClose(fh);  // dont forget to 
  close!
  
  <SPAN 
  > 
  
  <SPAN 
  >// read file:fh = 
  FileOpen(fname, "r");fEnd = false;while (!fEnd)  
  {    ticker = FileReadLine(fh);    if 
  (ticker != "")      ticker = ticker;  // do 
  here something better than that    
  else      fEnd = true;  
  }FileClose(fh);  // dont forget to close!
  
  <FONT face="Times New Roman" 
  size=2> 
  
  <FONT face="Times New Roman" 
  size=2> 
  <BLOCKQUOTE 
  >
    
    <SPAN 
    >----- Original Message ----- 
    
    
    <FONT 
    face=Arial size=2><SPAN 
    >From:<FONT 
    face=Arial> <A 
    title=chuck_rademacher@xxxxxxxxxx 
    href="">Chuck Rademacher 
    
    
    <FONT face=Arial 
    size=2><SPAN 
    >To:<FONT 
    face=Arial> <A 
    title=amibroker@xxxxxxxxxxxxxxx 
    href="">amibroker@xxxxxxxxxxxxxxx 
    
    
    <FONT face=Arial 
    size=2><SPAN 
    >Sent:<FONT 
    face=Arial> Friday, May 02, 2003 11:04 
    PM
    
    <FONT face=Arial 
    size=2><SPAN 
    >Subject:<FONT 
    face=Arial> RE: [amibroker] Looping through 
    "foreign" files
    
    <FONT face="Times New Roman" 
    size=2> 
    
    <FONT face=Arial color=blue 
    size=2>I'll 
    partially answer my own question by asking another.   Perhaps it 
    might give someone an idea for helping me.   
    
    
    <FONT face="Times New Roman" 
    size=2> 
    
    <FONT face=Arial color=blue 
    size=2>Is 
    there some way to access a text file from within a loop?    
    The text file could contain all of the tickers that I want to access in the 
    loop.   Or... do I need to write a dll to do 
    this?
    
    <FONT face="Times New Roman" 
    size=2> 
    
    <FONT face=Arial color=blue 
    size=2><SPAN 
    >Cheers
    <BLOCKQUOTE 
    >
      
      <P class=MsoNormal 
      ><FONT 
      face="Times New Roman" size=2>-----Original 
      Message-----From: Chuck 
      Rademacher [mailto:chuck_rademacher@xxxxxxxxxx]<SPAN 
      >Sent: Friday, May 02, 2003 4:52 
      PMTo: 
      amibroker@xxxxxxxxxxxxxxx<SPAN 
      >Subject: [amibroker] Looping through 
      "foreign" files
      
      <FONT face=Arial color=blue 
      size=2>The 
      time has come for me to find a better way of looping through thousands of 
      foreign files.
      
      <FONT face="Times New Roman" 
      size=2> 
      
      <FONT face=Arial color=blue 
      size=2>For 
      each stock in my watchlist, I want to look at all of the other stocks in 
      that watchlist within a loop.   
      
      <FONT face="Times New Roman" 
      size=2> 
      
      <FONT face=Arial color=blue 
      size=2>If 
      the "foreign" statement would accept a stockID number instead of a ticker, 
      I could probably make a decent loop to do the job.   But, alas, 
      that's not how it works.
      
      <FONT face="Times New Roman" 
      size=2> 
      
      <FONT face=Arial color=blue 
      size=2><SPAN 
      >Surely someone 
      has been here before?
      
      <FONT face="Times New Roman" 
      size=2> 
      
      <FONT face=Arial color=blue 
      size=2>Any 
      assistance would be 
  appreciated.






Yahoo! Groups Sponsor


ADVERTISEMENT









Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.