output textfile with symbolname  [SOLVED]

Questions about MultiCharts and user contributed studies.
takehana13
Posts: 9
Joined: 20 Nov 2017
Has thanked: 5 times

output textfile with symbolname

Postby takehana13 » 09 Dec 2017

Hello

I'd like to output a text file with the File name as the symbol name in the File function.
Is this possible?

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: output textfile with symbolname

Postby TJ » 09 Dec 2017

Hello

I'd like to output a text file with the File name as the symbol name in the File function.
Is this possible?
It is possible.

Please go to the wiki,
look under the keyword for coding examples.

User avatar
Smoky
Posts: 507
Joined: 03 Dec 2010
Location: Thailand
Has thanked: 97 times
Been thanked: 115 times

Re: output textfile with symbolname  [SOLVED]

Postby Smoky » 09 Dec 2017

GetSymbolName
Returns a string expression containing the name of the symbol that the study is applied to.

Code: Select all

vars: Filelog(""),ENRG("txt to write in file");

Filelog=GetSymbolName;

print(file(Filelog),ENRG);

takehana13
Posts: 9
Joined: 20 Nov 2017
Has thanked: 5 times

Re: output textfile with symbolname

Postby takehana13 » 09 Dec 2017

thank you for your reply.

I solved the problem.
Code does not matter with stocks.
However, in FX, "/" is included in the symbol name, so an error occurs.

Help me.

Code: Select all

vars : Filelog(""),var1("");

Filelog = SymbolName;
var1 = "My pass"+Filelog+".txt";

Print(File(value1),O,H,L,C);

takehana13
Posts: 9
Joined: 20 Nov 2017
Has thanked: 5 times

Re: output textfile with symbolname

Postby takehana13 » 10 Dec 2017

I solved it myself.
If an error occurs in FX, if you change the symbol name using QuoteManager, no error will occur.


Return to “MultiCharts”