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

Data collection tool.



PureBytes Links

Trading Reference Links

Hi List:

The below code has been extremely helpful for us in data collection.   It
was provided to us FREELY by Rina Systems, and should be noted as such.  We
use it with their PortfolioStream software and both come highly recommended.

The purpose of this TradeStation Strategy code is to create text files with
each data bar on the chart stored in it.  When applied to a TS6.0 chart,
you will then create a txt file at the OutputPath input location.   These
text files can then be accessed by 2000i by creating a new 3rd party
Directory Symbol list, which allows for us to continue our offline testing
on secondary computers.

By using PortfolioStream, we were able to have it automatically go through
each symbol in the SP500 without user intervention.

One problem however, is the intra-day data limitations of TS6.0.    Their
intraday data only goes back to November of 2000.


Any suggestions for using other software that stores more intradata data?
Esignal has 60 days, and i heard MetaStock stores more but not sure how
much.
Looking for around 5 years of intraday stock data for testing.

Thanks, and hope this simple tool helps.

David






{This code is provided by RINA Systems, Inc.

Data Exporter Signal

The Data Exporter signal exports the date and pricebars of the data in your
TradeStaiton chart to a file.  The file is
named and placed on your computer based on the inputs you provide.  The
price data that is exported can be constrained
by a date rage if you wish, or you can export all the data in the chart that
the strategy is applied to.
The signal automatically names the file after the symbol in the chart so
that you can run workspace assistant to export
multiple signals and have each signal written to its own file.}

Inputs:
StartDTE(701210),EndDTE(1011231),OutputPath("C:\Data\"),FileExtension(".txt"
),UseDateRange(false),HeaderAndFooter(false),IncludeVOI(false),DecimalPlaces
(8);
Var: priceO(Open), priceH(High), priceL(low), PriceC(close);
var: PadDate("PaddedDate"),PadYear("PaddedYear"), PadMonth("PaddedMonth"),
PadDay("PaddedDay"), PadTime("PaddedTime");

{Sets the OHLC values every bar}
PriceO=Open;
PriceH=High;
PriceL=Low;
PriceC=close;




if HeaderAndFooter = true then {Print the header if desired}
begin
 if barnumber = 1 then
  FileAppend((OutputPath + getsymbolname + FileExtension), "Begin PriceData
for "+getsymbolname+NewLine);
end;

if UseDateRange = true then {Set Condition1 if you are using the date range}
 begin;
 Condition1 = date >= StartDTE and date <= EndDTE; {set Condition 1 to
export only inclusively between the two input dates}
end;

if UseDateRange = false then {Set Condition1 if you are not using the date
range}
 begin;
 Condition1 = open > 0; {Export all price data}
end;

if Condition1 = true then
begin

 if time < 0010 then {Pad the Time with zeros as needed}
  PadTime = numtostr(0,0)+ numtostr(0,0)+numtostr(0,0)+numtostr(time,0);
 if time > 0009 and time < 0100 then
  PadTime = numtostr(0,0)+numtostr(0,0)+numtostr(time,0);
 if time > 0059 and time < 1000 then
  PadTime = numtostr(0,0)+numtostr(time,0);
 if time > 0959 then
  Padtime = numtostr(time,0);

 if dayofmonth(date) < 10 then {Pad the Day with zeros as needed}
  PadDay = numtostr(0,0)+numtostr(dayofmonth(date),0);
 if dayofmonth(date) > 9 then
  PadDay = numtostr(dayofmonth(date),0);

 if month(date) < 10 then {Pad the Month with zeros as needed}
  PadMonth = numtostr(0,0)+numtostr(month(date),0);
 if month(date) > 9 then
  PadMonth = numtostr(month(date),0);

 if year(date) < 100 then {Pad the Year with zeros as needed}
  PadYear = numtostr(19,0)+numtostr(year(date),0);
 if year(date) > 99 then
  PadYear = numtostr(200,0)+numtostr(year(date)-100,0); {takes care of the
non y2k compliancy problem with EasyLanguage}

 {Propper Date formats: YYYYMMDD, YYYYDDMM, MMDDYYYY, DDMMYYYY
 All of whice can be easlity achived by moving around the padded variables
in the line below.}
 PadDate = PadMonth + PadDay + PadYear;

 {Last but not least the printing.  8 decimal places should be sufficient
for most markets.
 The file outputs to the specified OutputPath input.
 The format in the comma delimited output file is as follows:
 Date, Time, Open, High, Low, Close}

 if IncludeVOI = false then
 FileAppend((OutputPath + getsymbolname + FileExtension),
PadDate+","+PadTime+","+numtostr(Open,DecimalPlaces)+","+numtostr(High,Decim
alPlaces)+","+numtostr(Low,DecimalPlaces)+","+numtostr(Close,DecimalPlaces)+
NewLine);
 if IncludeVOI = true then
 FileAppend((OutputPath + getsymbolname + FileExtension),
PadDate+","+PadTime+","+numtostr(Open,DecimalPlaces)+","+numtostr(High,Decim
alPlaces)+","+numtostr(Low,DecimalPlaces)+","+numtostr(Close,DecimalPlaces)+
","+numtostr(Volume,0)+","+numtostr(OpenInt,0)+NewLine);

{End Condition1}
end;


if HeaderAndFooter = true then {Print the footer if desired}
begin
 if lastbaronchart then
  FileAppend((OutputPath + getsymbolname + FileExtension), "End PriceData
for "+getsymbolname+NewLine);
end;