Problem mit Data Export from QuoteManager

Questions about MultiCharts and user contributed studies.
User avatar
piranhaxp
Posts: 241
Joined: 18 Oct 2005
Has thanked: 4 times
Been thanked: 30 times

Problem mit Data Export from QuoteManager

Postby piranhaxp » 17 Dec 2009

Dear Forum User,

I try to get OHLC Min-Data right from the chart into a txt-file. I'm using the same indicator in TS. But in MC the "volume"-Data comes out with the date. In TS it works very well.

Here is my indicator :
If Init then
begin
Init = False;
FileDelete(Filename);
FileAppend(Filename, "Date, Time, Open, High, Low, Close, Volume" + NewLine);
end;

FileAppend(Filename, ELDateToString(Date) + ","
+ NumToStr(Time, 0) + ","
+ NumToStr(Open+Adj, Dec) + ","
+ NumToStr(High+Adj, Dec) + ","
+ NumToStr(Low+Adj, Dec) + ","
+ NumToStr(Close+Adj, Dec) + ","
+ NumToStr(Ticks, 0) + ""
+ NewLine);
End;
... and this line comes out :
Date, Time, Open, High, Low, Close, Volume
04/30/2009,938,121.45,121.45,121.45,121.45,30
05/08/2009,925,120.65,120.65,120.65,120.65,08
05/08/2009,1107,120.65,120.65,120.65,120.65,08
05/08/2009,1108,120.65,120.65,120.65,120.65,08
05/08/2009,1109,120.65,120.65,120.65,120.65,08
05/08/2009,1113,120.65,120.65,120.65,120.65,08
05/08/2009,1202,120.65,120.65,120.65,120.65,08
05/08/2009,1216,120.65,120.65,120.65,120.65,08
05/28/2009,2109,117.01,117.01,117.01,117.01,28
05/29/2009,1621,117.15,117.15,117.15,117.15,29
As you can see, the "Volume" is exactly the date of the day.

What I'm doing wrong ?

Regards.

Mike

brodnicki steven
Posts: 407
Joined: 01 Jan 2008
Been thanked: 3 times

Postby brodnicki steven » 17 Dec 2009

Try this: (you may need to modify it to your liking but it works as is)

Input:Filename("test.csv");
vars:init(true),out_str("");

If init then
begin
init = False;
FileDelete(Filename);
FileAppend(Filename, "Date, Time, Open, High, Low, Close, Volume" + NewLine);
end;

out_str=elDateToString(Date) + ",";
out_str=out_str + NumToStr(Time,6) + ",";
out_str=out_str + NumToStr(O,6) + ",";
out_str=out_str + NumToStr(H,6) + ",";
out_str=out_str + NumToStr(L,6) + ",";
out_str=out_str + NumToStr(C,6) + ",";
out_str=out_str + NumToStr(V,6) + ",";
FileAppend(filename,out_str + NewLine);

User avatar
piranhaxp
Posts: 241
Joined: 18 Oct 2005
Has thanked: 4 times
Been thanked: 30 times

Postby piranhaxp » 17 Dec 2009

Thx. That helps. Thx again.

Regards.

Mike


Return to “MultiCharts”