Print (Reserved Word)

image\trumpet2.gif Disclaimer

Sends information to the Print Log or, if specified, to an output location (a file or the default printer).

Print(Parameters);

Parameters is any number of valid string, true/false, numeric series, or numeric expressions, each separated by a comma. The maximum number of cooma-separated Parameters is 255. The maximum number of characters that will be shown on a single line in the Print Log, before wrapping, is 2047. Lines in the Print Log that contain more than 2047 characters will automatically be wrapped to the next line. To send output to a printer or file instead of the Print Log, you must also specify output location.  

Remarks

If no output location is specified, the information is sent to the Print Log.

To send information to a specified file instead of the Print Log, specify the file and path as the first parameter. Enclose the file name and path in quotation marks. To send the information to the default printer, include the word Printer as the first parameter.

You can format the numeric expressions displayed using the Print reserved word. To do so, use the following syntax:

Print(Value1:N:M);

Value1 is any numeric expression, N is the minimum number of integers to use, and M is the number of decimals to use. If the numeric expression being sent to the Print Log has more integers than what is specified by N, the Print statement uses as many digits as necessary, and the decimal values are rounded to the nearest value. For example, assume Value1 is equal to 3.14159 and we have written the following statement:

Print(Value1:0:4);

The numeric expression displayed in the Print Log would be 3.1416. As another example, to format the closing prices, you can use the following statement:

Print(ELDateToString(Date), Time, Close:0:4);

Examples

The following statement sends the date, time, and closing price of the current bar to the Print Log:

Print(Date, Time, Close);

The following statement sends the same information to an ASCII file called Mydata.txt:

Print(File("c:\data\mydata.txt"), Date, Time, Close);

       File must include the full path and file name enclosed in quotes. It cannot be a variable or input.

The following statement sends the information to the default printer instead:

Print(Printer, Date, Time, Close);