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

[amibroker] Re: Help on AFL to export closingprices only to .csv file


  • Date: Mon, 21 Dec 2009 18:52:19 -0000
  • From: "bistrader" <bistrader@xxxxxxxxx>
  • Subject: [amibroker] Re: Help on AFL to export closingprices only to .csv file

PureBytes Links

Trading Reference Links

without header line ... 

Buy = Sell = Short = Cover = 0; // Use Scan with n=1

WatchListNo  = Param("WatchListNo", 0, 0, 63, 1);

fh = fopen( "C:\\AmiBroker\\Temp\\myfile.csv", "w");

list = CategoryGetSymbols( categoryWatchlist, WatchListNo );

for( i = 0; ( symbol = StrExtract( list, i ) ) != ""; i++ )
 {
   fputs( symbol + ",", fh ); 
 }
 
 fclose( fh );


--- In amibroker@xxxxxxxxxxxxxxx, "bistrader" <bistrader@xxx> wrote:
>
> Sorry Mike, did see your Transpose reply or I would not have provided same.
> 
> Here is an afl to place each Stock Name in row from any watchlist.  Is this what hjansenvanrensburg is looking for?
> 
> // Start
> WatchListNo  = Param("WatchListNo", 0, 0, 63, 1);
> 
> list = CategoryGetSymbols( categoryWatchlist, WatchListNo );
> 
> //Filter = 1;
> Filter = Status("lastbarinrange");
> SetOption("NoDefaultColumns", True);
> 
> for( i = 0; ( symbol = StrExtract( list, i ) ) != ""; i++ )
>  {
>    AddTextColumn(symbol, "Symbol");
>  }
> // End
> 
> 
> This places the (stock) Symbol header in row 1 and the actual Stock Symbol in row 2.  I do not know how to eleminate row1 and just have symbols in row 1 with nothing else.  I guess I could do by opening file and writing just what I need.
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Mike" <sfclimbers@> wrote:
> >
> > If you want to spare yourself the programming, just do the normal Exploration with AddColumn, giving one row per symbol. Then when opening the .csv file in excel; copy the data and right click to where you want to past it - using Paste Special. From the Paste Special dialog just select the "Transpose" option.
> > 
> > Mike
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, "h3po" <h3pooo@> wrote:
> > >
> > > Hi, thanks.
> > > 
> > > Yes, I have tried that, but all tickers are then written to only one column containing the tickerdata successively, so it is difficult to separate them when opening the .csv file in other programs. I need each ticker to have their own column.. 
> > > 
> > > 
> > > 
> > > --- In amibroker@xxxxxxxxxxxxxxx, "hjansenvanrensburg" <hjansenvanrensburg@> wrote:
> > > >
> > > > 
> > > > You don't have to use a loop. Just by adding
> > > > 
> > > > AddColumn(C, "Close", 1.0);
> > > > 
> > > > to your formula, you will be able to use
> > > > 
> > > > Analysis, Automatic Analysis, Explore
> > > > 
> > > > to get a list of ticker name, dates and closing prices. You can then save the results as a CSV file (File button).
> > > > 
> > > > To select all the tickers that you are interested in, create a watch list and then use "use filter" and the Define button (also on the Automatic Analysis dialog) to only export those tickers that are on the watch list. You can also specify the date range that you are interested in, or export all the available bars.
> > > >
> > >
> >
>




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

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

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    amibroker-digest@xxxxxxxxxxxxxxx 
    amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/