Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 10-22-2009, 01:20 PM   #9

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,779
Ignore this user

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
Tams is offline  
Reply With Quote
The Following User Says Thank You to Tams For This Useful Post:
aaa (10-24-2009)

Reply

Tags
debug, easylanguage, file, output, print

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trendline (EasyLanguage) Tams Coding Forum 43 07-09-2011 12:36 AM
ADE - All Data Everywhere (EasyLanguage) Tams Trading Indicators 22 05-01-2010 01:48 AM
Transaction Tax Buried in the Fine Print ! zdo Trading and the Markets 14 01-28-2009 12:17 AM
Some EasyLanguage Help Please jjthetrader Coding Forum 8 06-02-2008 04:20 PM
Question regarding single print tails Nextek Market Profile 1 09-03-2006 09:07 AM

All times are GMT -4. The time now is 01:16 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.