Data exporter: Parsing "/" from GetSymbolName?  [SOLVED]

Questions about MultiCharts and user contributed studies.
hughesfleming
Posts: 275
Joined: 22 Apr 2014
Has thanked: 70 times
Been thanked: 72 times

Data exporter: Parsing "/" from GetSymbolName?

Postby hughesfleming » 29 Sep 2014

I have put together a generic data exporter that outputs daily data to a couple of external applications that I use and it works well enough. Here it is setup to export to Price Action Labs.

Code: Select all

Inputs:
OutputFileNamePath ("C:\PriceActionLab\Data\"),
OutputFileNameExtention("_PAL.txt"),
OutputDateFormat("yyyMMdd"),
OutputDigits(2);

vars:
OutputFile(""),
OutputDateString(""),
ExportString("");



OutputFile = OutputFileNamePath+GetSymbolName+OutputFileNameExtention;
OutputDateString = FormatDate(OutputDateFormat, ELDateToDateTime(Date));
ExportString = OutputDateString+" "+NumToStr(O,OutputDigits)+" "+NumToStr(H,OutputDigits)+" "+NumToStr(L,OutputDigits)+" "+NumToStr(C,OutputDigits)+NewLine;

Once begin
FileDelete(OutputFile);
end;


If BarType= 2 then begin
FileAppend(OutputFile,ExportString);
end;
Where it fails is exporting currency data from LMAX because GetSymbolName returns "EUR/USD". Is there a way to filter the forward slash or replace the forward slash with another character?

Many thanks,

Alex

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Data exporter: Parsing "/" from GetSymbolName?  [SOLVED]

Postby JoshM » 29 Sep 2014

Is there a way to filter the forward slash or replace the forward slash with another character?
I use this in a function to remove the forward slash from forex symbols:

Code: Select all

if (Category = 12) then
GetSymbol = Text(LeftStr(GetSymbolName, 3), RightStr(GetSymbolName, 3))
else
GetSymbol = GetSymbolName;

hughesfleming
Posts: 275
Joined: 22 Apr 2014
Has thanked: 70 times
Been thanked: 72 times

Re: Data exporter: Parsing "/" from GetSymbolName?

Postby hughesfleming » 29 Sep 2014

Terrific! That did it. Thanks

Alex


Return to “MultiCharts”