I need to print to multiple files within a Signal. For example, if the trade is long, I want to write to ABC if the trade is long and to DEF if it is short. Furthermore, the file names depend on the symbol itself. Ex., if the symbol is SPX, I might want to print to C:\DATA\SPXL.csv for long trades and C:\DATA\SPXS.csv for short trades. If the strategy is applied to a different symbol, the name would change.
The documentation indicates the file name is a string expression. However, it appears it is a string constant. If I build a string variable, FILENAME, and use it in the print expression:
this results in Error(#287)
File name expected here.
It appears Easylanguage is looking for quotation marks, but I'm not sure [and I don't know how to append them.]
I don't believe dynamic filenames are currently supported (re: Print - MultiCharts) by Easy/PowerLanguage.
You can always request that they enhance the Print API call to support dynamic filenames though there's no guarantee they'll do that or "soon" (plus it would make it a superset of functionality of TS EasyLanguage, but that's fine). You could also write a DLL yourself and do whatever you want in the external module - quite a bit more involved, but definitely doable.
The following user says Thank You to Fu510n for this post: