output textfile with symbolname  [SOLVED]

Questions about MultiCharts and user contributed studies.
takehana13
Posts: 5
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: 6760
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 977 times
Been thanked: 1949 times

Re: output textfile with symbolname

Postby TJ » 09 Dec 2017

takehana13 wrote: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: 303
Joined: 03 Dec 2010
Has thanked: 55 times
Been thanked: 79 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);

These users thanked the author Smoky for the post (total 2):
sptradertakehana13

takehana13
Posts: 5
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: 5
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”