10-22-2009, 01:20 PM
|
#9 |
Join Date: Sep 2008 Location: Geelong Thanks: 2,084
Thanked 1,474 Times in 912 Posts
| Re: Print (EasyLanguage) if you amend this code to the indicator in the previous post,
your file log will get an automatic filename in this format:
symbolname-YYYYMMDDhhmm
e.g.: ESZ9-200910221313
i.e. you can have this code in any indicators, in any chart, with any symbol... your log files will be given a different name automatically. Quote: // modified section
var:
File.name("");
if currentbar = 1 then
File.name =
"c:\docs\"
+ getsymbolname
+"-"
+ numtostr(currentdate+1900 0000,0)
+ numtostr(currenttime,0)
+ ".txt"; | Code: // Scan Print (for use in scanner)
// version: beta 0.2
// Author: TAMS
// License: public use
//
// this indicator is for demonstration purpose only
//
// Description:
// this indicator scans the last bar on the chart,
// if the close is higher than previous bar's high,
// it will make a printout to
// a) the Output log window,
// b) the printer, or
// c) a file.
//
// see this thread for discussion
// http://www.traderslaboratory.com/forums/f46/scan-print-6194.html
//
Input:
Send.to.Log(true),
Send.to.printer(false),
Send.to.file(false);
var:
File.name("c:\docs\scan_print.txt");
{========== end of variables ==========}
{---------- auto filename ----------}
if currentbar = 1 then
File.name =
"c:\docs\"
+ getsymbolname
+"-"
+ numtostr(currentdate+19000000,0)
+ numtostr(currenttime,0)
+ ".txt";
{---------- end of auto filename ----------}
if time <> time[1] then
begin
if c > h[1] then
begin
if Send.to.Log then
print(NumToStr(date+19000000,0), " C>H[1] " + getsymbolname);
if Send.to.printer then
print(printer, NumToStr(date+19000000,0), " C>H[1] " + getsymbolname);
if Send.to.file then
Fileappend(file.name, NumToStr(date+19000000,0) + " C>H[1] " + getsymbolname + newline);
end;
end;
__________________ Only an idiot would reply to a stupid post |
| |