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

Re: [amibroker] Creating a text file - NEVER MIND. Figured it out.



PureBytes Links

Trading Reference Links

Hi Dan,
 
That's very nice - thanks for sharing!  I don't know OLE/COM, but would like to learn it for use with AB. Could I please ask you a couple of questions?
 
1. How does your code query Yahoo? I would have thought that Server.Class would need to be something created by Yahoo, but I don't see any refenrence to Yahoo. What is rmaAFLobjects?
 
2. What do you think might be the best way for me to learn this? Is it part of learning a specific language ( VC++, VB, etc ), or is it sort of a language in itself? Any good book reccomendations?
 
Thanks very much!
 
Steve
 
 
----- Original Message -----
From: Dan Clark
Sent: Saturday, August 13, 2005 1:46 PM
Subject: RE: [amibroker] Creating a text file - NEVER MIND. Figured it out.

Ron,

 

Actually, that’s the easy part.  J   Here’s the scan:

 

// Queries Yahoo for earnings date, parses html and reports the date.

rmaObj = CreateStaticObject("rmaAFLObjects.EstEarnDate");

EarningsDate = "";

EarningsDate = rmaObj.EarningsDate(Name());

if (StrLeft(EarningsDate , 1) == "c")

      EarningsDate = "N/A";

 

Filter   =  Buy = 1;

SetOption( "NoDefaultColumns"             , True                                 );

AddTextColumn( Name()                     , "Symbol"                             );

AddTextColumn( FullName()                 , "Company"                            );

AddTextColumn( EarningsDate               , "EarningsDate"                       )

 

Regards,

 

Dan.

 


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of mrdavis9
Sent: Saturday, August 13, 2005 10:35 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] Creating a text file - NEVER MIND. Figured it out.

 

Dan, hopefully, at least one result of these creative efforts of yours will enable us to create explorations with>>>  AddColumn(EstEarningsDate);  Ron D

 

 

----- Original Message -----

From: Dan Clark

Sent: Saturday, August 13, 2005 11:58 AM

Subject: RE: [amibroker] Creating a text file - NEVER MIND. Figured it out.

 

Ron,

 

Thanks.   Actually, I figured out something similar about 3 minutes ago.  (Great minds… :) 

 

In my case, I’m not interested in saving quote data, but simply the Estimated Earnings Date (at least in this iteration) plus other data.   If I understand the string handling functions correctly, it appears that multiple types of data could be saved in each file as a string pair.   The first member of the string pair would be a type identifier with the second member being the value.  For example, data in an “MSFT_Val.csv” file might be:

 

EstEarningDate,18-Aug-05

CurrentRSC,307

RSCMinus5,251

RSCMinus21,251

 

If this works, it might be a way of speeding up scans tremendously.    I.e., you’d populate the files in one scan and then use the data in other scans and charts.

 

Do you see any issues with this?  Better solution?

 

Thanks and regards,

 

Dan.

 

 


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of ronbo
Sent: Saturday, August 13, 2005 9:33 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: RE: [amibroker] Creating a text file - NEVER MIND. Figured it out.

 

here is an example Graham coded a while back.  use it as an example to do what you want.  it creates a .csv file for every symbol...

 

hth,

ron

 

/*

Export EOD data to CSV files One file for each stock

In the first line insert the directory you want to save them to, make sure the directory exists

Select your charts to export with the "Apply to" filter in AA window

Select the timeframe period you want to save as using the AA "Settings"

Press Scan button

by Graham Kavanagh 05 Feb 2004

Modified 4/1/2004 by ronbo to remove the Time column,

1. remove the dashes in the date

2. remove the Time column

3. customize the file location

*/

fh = fopen( "C:\\Program Files\\PFScan 2\\Data\\"+Name()+".csv ", "w");

if( fh )

{

fputs( "Ticker,Date,Open,High,Low,Close,Volume \n", fh );

y = Year();

m = Month();

d = Day();

for( i = 0; i < BarCount; i++ )

{

fputs( Name() + "," , fh );

ds = StrFormat("%04.0f%02.0f%02.0f,",

y[ i ], m[ i ], d[ i ] );

fputs( ds, fh );

qs = StrFormat("%.3f,%.3f,%.3f,%.3f,%.0f\n",

O[ i ],H[ i ],L[ i ],C[ i ],V[ i ] );

fputs( qs, fh );

}

fclose( fh );

}

Buy = 1;

-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx]On Behalf Of Dan Clark
Sent: Saturday, August 13, 2005 9:09 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: RE: [amibroker] Creating a text file - NEVER MIND. Figured it out.

 

 


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Dan Clark
Sent: Saturday, August 13, 2005 8:49 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Creating a text file

 

Hi,

 

I’m trying to read from and save data to a file.   There is an fdelete function, but I can’t find an fcreate function.  How do you CREATE a file in AFL if it does not already exist?  

 

Regards,

 

Dan.

 

 




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





SPONSORED LINKS
Investment management software Investment property software Investment software
Investment tracking software Return on investment software Stock investment software


YAHOO! GROUPS LINKS