PureBytes Links
Trading Reference Links
|
Really need a FTP site to post such things as this since we get
a request like this repeated often.
Clyde
{
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Indicator: MakeASCIFile
Purpose: Create an ASCII file from SC/TS data with the format
MMDDYY,HHMM,OPEN,HIGH,LOW,CLOSE,VOL with a bar
bar interval the same as currently displayed on the
chart.
Inputs: FilDir -- a set of ASCII characters included within
quote marks which defines the full path to the
directory/folder (e.g. "C:\OMEGA\" ...) in which you
wish to save the new file.
TimeAdj -- an hourly amount (represented in 24 hour
time HHMM by which to adjust the time of data in
display before outputting to file.
PricAdj -- an amount (represented in big points and
decimal part of point -- PP.dd) by which to adjust the
PRICE amounts in data before outputting to file. This
can be used to make "back/front adjusted" sets of data
which can be combined using a text editor to provide
continuous data files.
BegDate -- first date YYMMDD to output.
EndDate -- last date YYMMDD to output.
Caution: When entering the DIRECTORY (full path) where final
file is to be saved you MAY include a backslash \
as the final character in the FilDir input. If
you don't the system will append one.
Files are automatically named with the name in the
form SSTTYYMM.CSV
Where: SS = First 2 letters of symbol.
TT = Time interval (intraday) or the
characters DA WK MO as is proper.
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
}
Inputs: FileDir(""), {Directory for file SHOULD end with \ }
{Set to blank "" for no file output }
{This file is a BAR by BAR DATA file }
TimeAdj(0.0), {Hours - decimal - to adjust time }
PricAdj(0.0), {Price - decimal - to adjust price }
BegDate(650101), {Beginning date for data output }
EndDate(991231), {Ending date for data output }
OutVol(True); {Flag to output/not output volume data }
Vars: SymID(""),FileID(""),AddS(""),TInt("DA"),DoInit(True),
AdjTime(IntPortion(TimeAdj*.01)+FracPortion(TimeAdj*.01)/.60),
X(0);
If DoInit then begin
SymID=LeftStr(GetSymbolName+"__",2);
IF DataCompression=1 THEN
TInt=RightStr("00"+NumToStr(BarInterval,0),2);
IF DataCompression=3 THEN TInt="WK";
IF DataCompression=4 THEN TInt="MO";
If FileDir<>"" then begin
If RightStr(FileDir,1)<>"\" then AddS="\";
FileID=FileDir+AddS+SymID+ TInt
+ LeftStr(NumToStr(date,0),4) + ".csv";
FileDelete(FileID);
FileAppend(FileID,"Date,Time,Open,High,Low,Close,Volume"+NewLine);
End;
DoInit=False;
If DoInit then Plot1(c,"");
End;
If FileDir<>"" and Date>=BegDate and Date<=EndDate then begin
X=Time;
If TimeAdj<>0 then begin
X=X*.01;
X=IntPortion(x)+FracPortion(x)/.60+AdjTime+.001;
X=IntPortion(x)*100+IntPortion(FracPortion(x)*60);
End;
If OutVol then begin
FileAppend(FileID, NumToStr(date,0) + "," +
NumToStr(X,0) + "," +
NumToStr(O+PricAdj,2) + "," +
NumToStr(H+PricAdj,2) + "," +
NumToStr(L+PricAdj,2) + "," +
NumToStr(C+PricAdj,2) + "," +
NumToStr(V,0) + NewLine) ;
End
Else begin
FileAppend(FileID, NumToStr(date,0) + "," +
NumToStr(X,0) + "," +
NumToStr(O+PricAdj,2) + "," +
NumToStr(H+PricAdj,2) + "," +
NumToStr(L+PricAdj,2) + "," +
NumToStr(C+PricAdj,2) + NewLine) ;
End;
End;
I remember reading in the list that there was and "indicator" that you
could
put on an Omega chart that would convert the chart data to an asci
file.
Does anyone have this code?
I have just started looking at Ensign and would like to paste in some
of my
back data.
Thanks.--
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Clyde Lee Chairman/CEO (Home of SwingMachine)
SYTECH Corporation email: <clydelee@xxxxxxx>
7910 Westglen, Suite 105 Work: (713) 783-9540
Houston, TX 77063 Fax: (713) 783-1092
SM available at: ftp://intrepid.com/pub/clyde
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Attachment Converted: "c:\eudora\attach\Makascfl.ela"
|