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

Swing Machine - Omega ASCII export



PureBytes Links

Trading Reference Links

I posted an indicator here last week that would create an Ascii file of the data from any chart displayed in an Omega product.
Here's an upgraded version of that indicator.

With some valuable input from Cliff Scheller, the indicator has now been modified so that it will automatically name the file as
explained below.  All that the user need do is specify the path.

Attached is the .ela version.

Bob Hunt

***********************************************

{This indicator will create an ASCII file of the price data displayed on any chart. INPUT specifies the user designated file
path. The actual name of the file is automatically determined from the symbol and the time frame represented in the chart. For
example, when this indicator is applied to a weekly OEX chart, the file created will have the name "oex_w.asc"   When used with
an OEX 30 minute chart it will create the filename "oex_i30.asc"

For ease of use, create a workspace specifically for the purpose of exporting data. Set up a separate chart for each item or time
frame for which you want to export data.  For example, if trading the OEX, you might want to set up separate OEX weekly, daily,
and hourly charts within one workspace.  Apply the indicator to each chart. Now, every time that you open this workspace, three
separate files will be automatically created containing the exported data.

This indicator is a contribution by Bob Hunt and Cliff Scheller
        Bob Hunt <RHunt.066@xxxxxxxxxxxxxxxx>
        Cliff Scheller <cliffsch@xxxxxxx>
}

Input: Path("C:\swngmach\");
vars: intvl(""),ticker(""),ftmp(""),fname(""),PS(0),Txt("");

Txt = NumToStr(PriceScale,0);
PS = StrLen(Txt) - 1;

If barnumber = 1 then begin
  if leftstr(getsymbolname,1)="$" then ticker=midstr(getsymbolname,2,3) else ticker = leftstr(getsymbolname,3);
  if midstr(ticker,2,1) = " " then ticker = leftstr(getsymbolname,1);
  if midstr(ticker,3,1) = " " then ticker = leftstr(getsymbolname,2);
  ticker = ticker + "_";
  if datacompression = 2 then ftmp = ticker + "d.asc";
  if datacompression = 3 then ftmp = ticker + "w.asc";
  if datacompression = 4 then ftmp = ticker + "m.asc";
  if datacompression = 1 then begin
    intvl = numtostr(barinterval,0);
    ftmp = ticker + "i" + intvl + ".asc";
  end;
  fname = path+ftmp;

  FileDelete(fname);
  FileAppend(fname,"Date,Time,Open,High,Low,Close"+NewLine);
end;

FileAppend(fname, NumToStr(date,0) +","+  NumToStr(Time,0) +","+
NumToStr(Open,PS) +","+ NumToStr(High,PS) +","+ NumToStr(Low,PS) +","+
NumToStr(Close,PS)+NewLine);

If LastBarOnChart then FileAppend(fname,NumToStr(date,0)+NewLine);

Plot1(0,"0");

Attachment Converted: "c:\eudora\attach\BOBH2FIL1.ELA"