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

RE: [amibroker] Looping through "foreign" files



PureBytes Links

Trading Reference Links










I don’t mean to sound dumb, but what do you do with the
script to get it to work?

�



<font size=3 color=teal
face="Times New Roman">Cheers,
Graham

<font size=2
color="#339966" face="Times New Roman"><font
color="#339966">http://groups.msn.com/ASXShareTrading

<font size=2
color="#339966" face="Times New Roman"><font
color="#339966">http://groups.msn.com/FMSAustralia



<span
>-----Original Message-----
From: uenal.mutlu@xxxxxxxxxxx
[mailto:uenal.mutlu@xxxxxxxxxxx] 
Sent: Saturday, 3 May 2003 10:49
AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] Looping
through "foreign" files

<font size=2
face="Times New Roman">�



<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 size=2
face="Times New Roman">�





<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 size=2
face="Times New Roman">�





<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 size=2
face="Times New Roman">�





<span
>Filter = true;





<font size=2
face="Times New Roman">�





<span
>WL��� =
1;������������ // set
your WL here
fname = "test2a.txt";� // define the filename





<font size=2
face="Times New Roman">�





<span
>nTickerWL = TickerCount(WL);
AddColumn(nTickerWL, "TickersInWL", 1);





<font size=2
face="Times New Roman">�





<span
>nTickerAll = TickerCount();
AddColumn(nTickerAll, "TickersAll", 1);





<font size=2
face="Times New Roman">�





<span
>
// write all tickers in WL to a file
fh = 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 size=2
face="Times New Roman">�





<font size=2
face="Times New Roman">�







<span
>----- Original Message ----- 





<font
size=2 face=Arial>From: <a
href="" title="chuck_rademacher@xxxxxxxxxx">Chuck
Rademacher 





<span
>To:<font
face=Arial> <a
href="" title="amibroker@xxxxxxxxxxxxxxx">amibroker@xxxxxxxxxxxxxxx






<span
>Sent:<font
face=Arial> Friday, May 02, 2003 11:04 PM





<span
>Subject:<font
face=Arial> RE: [amibroker] Looping through
"foreign" files





<font size=2
face="Times New Roman">�





<font size=2 color=blue
face=Arial>I'll
partially answer my own question by asking another.�� Perhaps it
might give someone an idea for helping me.�� 





<font size=2
face="Times New Roman">�





<font size=2 color=blue
face=Arial>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 size=2
face="Times New Roman">�





<font size=2 color=blue
face=Arial>Cheers







-----Original
Message-----
From: Chuck Rademacher
[mailto:chuck_rademacher@xxxxxxxxxx]
Sent: Friday, May 02, 2003 4:52 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Looping
through "foreign" files





<font size=2 color=blue
face=Arial>The time
has come for me to find a better way of looping through thousands of foreign
files.





<font size=2
face="Times New Roman">�





<font size=2 color=blue
face=Arial>For each
stock in my watchlist, I want to look at all of the other stocks in that
watchlist within a loop.�� 





<font size=2
face="Times New Roman">�





<font size=2 color=blue
face=Arial>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 size=2
face="Times New Roman">�





<font size=2 color=blue
face=Arial>Surely
someone has been here before?





<font size=2
face="Times New Roman">�





<font size=2 color=blue
face=Arial>Any
assistance would be appreciated.







<font size=2
face="Times New Roman">



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


Your use of Yahoo! Groups is subject to the <a
href="">Yahoo! Terms of Service.











Yahoo! Groups Sponsor












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.