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

Re: Data conversion



PureBytes Links

Trading Reference Links


Also, for MS EOD users, see PseudoRT for turning intraday data into a 
"daily" format -- http://xmlworks.com/pseudort/ (free,OpenSource,GPL).

Cheers,

Jim

On Wed, 1 Sep 1999, Kent Rollins wrote:

> Below is a perl script that I used to turn tics into 1 minute bars.  It
> could fairly easily be adapted to convert 1 minute bars into 10 mins or
> perform other similar conversions.  If you're not familiar with perl, ask
> questions and I'll answer them the best I can.  I'm not a hardcore perl'er
> myself (although I am a programmer), but I have found perl to be very useful
> at performing data translations.  Free perl interpreters can be downloaded
> from www.cpan.org or www.cpan.org.
> 
> Kent
> 
> #!/perl5
> 
> $barFile  = "";
> $barDate  = "";
> $barMins  = 0;
> $barHigh  = 0;
> $barLow   = 99999;
> $barClose = 0;
> $currDate = "";
> $currMins = 0;
> $currTic  = 0;
> 
> while (<>)
>   {
>   if (/(..)(..)(..) (.+) (.+)/o)
>     {
>     $currDate = $1 . "/" . $2 . "/" . $3;
>     $currMins = int( $4 / 100) * 60 + $4 % 100;
>     $currMins = int( $currMins / 30) * 30;
>     $currTic  = $5;
> 
>     if (($currDate ne $barDate) || ($currMins ne $barMins))
>       {
>       if ($barDate ne "")
>         {
>         $h = int( $barMins / 60);
>         $m = $barMins % 60;
> 
>         print "$barFile,$barDate $h:$m,$barHigh,$barLow,$barClose\n";
>         }
> 
>       $barFile  = $ARGV;
>       $barDate  = $currDate;
>       $barMins  = $currMins;
>       $barHigh  = $currTic;
>       $barLow   = $currTic;
>       $barClose = $currTic;
>       }
> 
>     if ($currTic < $barLow)   { $barLow = $currTic;  }
>     if ($currTic > $barHigh)  { $barHigh = $currTic; }
>     $barClose = $currTic;
>     }
>   }
> 
> $h = int( $barMins / 60);
> $m = $barMins % 60;
> 
> print "$barFile,$barDate $h:$m,$barHigh,$barLow,$barClose\n";
> 
> 
> 
> -----Original Message-----
> From: Glen Wallace <gcwallace@xxxxxxxx>
> To: MetaStock listserver <metastock@xxxxxxxxxxxxx>
> Date: Wednesday, September 01, 1999 11:50 AM
> Subject: Data conversion
> 
> 
> Does anyone know of any applications that can take tick, one-minute and
> five-minute data from a DownLoader datasheet and convert it to, say,
> ten-minute or sixty-minute data?  Either MetaStock or ASCII format.
> 
> I am constantly bumping up against that annoying 65,500 record limit.
> 
> 
> 
>