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

[EquisMetaStock Group] Re: data dramas



PureBytes Links

Trading Reference Links

Hi All,
 
    It's very easy to create individual files out of the output 
provided from ms2asc, hence I donot want to
add this feature in the tool as such, but will include this below 
provided perl script for the same purpose.
Now that ms2asc can output data on standard output device you can 
even pipe the output of ms2asc into
this perl script, please paste the following perl script in a file by 
name ms2singleasc.pl and try the following
command.
 
   c:\MsDataDir\>ms2asc -q | perl ms2singleasc.pl
 
or
 
  c:\MsDataDir\>ms2asc -f msascdata.csv
  c:\MsDataDir\>perl ms2singleasc.pl -fmsascdata.csv
 
note: No space between -f and msascdata.csv in the above command. 
Also the script does not accept ticker symbols containing '*' or '$' 
in the ticker symbol name.

<cut>
# ms2singleasc.pl (v0.1)
# Written By Mohammed Illyas Mansoor (mimansoor@xxxxxxxxx)
# Copyright (C) 2006 Mohammed Illyas Mansoor.
#
# This program converts MetaStock Binary data into 
# ASCII Data One file per ticker, in metastock ascii format.
#
# This is free software.
# There is NO warranty; not even for MERCHANTABILITY or FITNESS 
# FOR A PARTICULAR PURPOSE.
#
# Change Log
# v0.1 (03-JUL-2006)
#  *) Initial Version of ms2singleasc.pl
#
$file = "JUNK1234100527041975DEADBEEF";

while ($_ = $ARGV[0], /^-/) {
 shift;
 last if /^--$/;
 if (/^-v(.*)/) 
 {
     print "ms2singleasc (v0\.1)\n";
     print "Written by Mohammed Illyas Mansoor \(mimansoor at yahoo 
dot com\)\n"; 
     print "\nCopyright (C) 2005 Mohammed Illyas Mansoor.\n";
     print "This is free software; There is NO warrenty; not even for 
MERCHANTABILITY\n";
     print "\nor FITNESS FOR A PARTICULAR PURPOSE\.\n"; 
     print "ms2singleasc: Converts Continous MS Data to Single file 
per ticker\n Metastock ascii format\n";
     exit;
       }
 if (/^-f(.*)/) { $file = $1; }
} #End of while

if ($file eq "JUNK1234100527041975DEADBEEF") { 
$FILE = STDIN;
}
else {
open ($FILE, "< $file") or die "Could not open $file\n";
}

$TICKER=0;
$NAME=1;
$PER=2;
$DATE=3;
$TIME=4;
$OPEN=5;
$HIGH=6;
$LOW=7;
$CLOSE=8;
$VOL=9;
$OPENINT=10;

#Save Header line.
$header_line = <$FILE>;

LINE: while ($line = <$FILE>)
{

    # Get the tokens first
    @tokens = split/,/, $line;

    $ticker = $tokens[$TICKER];

    if ($isopen{$ticker} == 0) {

        $isopen{$ticker} = 1;
 $file = "$ticker\.csv";

 open ($SNGL_FILE{$ticker}, ">> $file") or warn "Could not open 
$file\n"; 

 $file_handle = $SNGL_FILE{$ticker};
 print $file_handle $header_line;
 print $file_handle "$line";

    }
    else {
 $file_handle = $SNGL_FILE{$ticker};
 print $file_handle "$line";
    }

    $name = $tokens[$NAME];

} # end of while 

#Close all open handles.
close ($FILE);

foreach $ticker (keys %isopen) {
 $file_handle = $SNGL_FILE{$ticker};
 close ($file_handle);
}

</cut>

 
Enjoy!
Mansoor
 
http://www.geocities.com/mimansoor
 

--- In equismetastock@xxxxxxxxxxxxxxx, Equity Solver 
<equitysolver@xxx> wrote:
>
> Hi Jose,
> Cool man, Camacazi is looking for some ease in operation of the 
great 
> software by mansoor, the ms2asc. It is actually the demand of a 
user to 
> its developer. By this way the software will also be developed. 
Please 
> do not stop him. Industry develops in this way. Try to feel him, 
and you 
> will not find anything wrong.
> regards
> ES
> 
> 
> Jose Silva wrote:
> >
> > Cam, stop wasting (your & other's) time and purchase the data in 
the
> > required native format for your other software.
> >
> > jose '-)
> >
> > --- In equismetastock@xxxxxxxxxxxxxxx 
> > <mailto:equismetastock%40yahoogroups.com>, "cj" <camacazi@> wrote:
> > >
> > > hi all
> > >
> > > many year ago i used metastock v7 ... then i have moved over to
> > other
> > > softwares. I still get all my data though in metastock format , 
and
> > wish to
> > > convert it to ascii [every day/night] I tried the ms2asci.exe 
but
> > > unfortunately i need the individual symbols in there own files.
> > Also i need
> > > format for date yyyymmdd. Also i need to do this as easy as
> > possible , like
> > > ummmmmm right click on a folder 'export all' then 5 minutes late
> > 'finished'
> > > because i have a lot of data to export in many different 
meatastock
> > folders.
> > > Also needs to be a seperate tickersymbol.csv fle for each 
ticker.
> > >
> > > I was wondering does the later version of 'downloader' has this
> > capabilty?
> > > What other tools can i use?
> > > What do people recommend?
> > >
> > > maybe Mimansoor could perhaps be the one to write a new version 
of
> > ms2ascii
> > > that exports the individual ticker name.csv output files?
> > >
> > > Also what would be handy is a command line tool to just list 
what
> > the
> > > metastock files contain ..ie ticker , name , first date , last 
date
> > > open-yes,high-yes,low-yes,close-yes,volume-yes,opint-no . or
> > alternatively
> > > ticker,name,frequency[daily/intra],firstdate,lastdate.
> > >
> > > TIA
> > > Cam
> >
> >
>










------------------------ Yahoo! Groups Sponsor --------------------~--> 
Great things are happening at Yahoo! Groups.  See the new email design.
http://us.click.yahoo.com/TISQkA/hOaOAA/yQLSAA/BefplB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

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

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/