Print and File#

Print is used to output information to the screen or a file. The most important application is debugging, to verify that the program’s execution flow and computational logic are correct.

Syntax#

1
Print([OutputTarget], Expression1, Expression2, ...);
Syntax ElementOptionalDescription
OutputTargetOptionalSpecifies the output target. Defaults to PowerLanguage Editor Output Log
ExpressionRequiredString, TrueFalse, or Numerical

Output Target (OutputTarget)#

Output TargetDescription
(Not specified)Output to PowerLanguage Editor Output Log (default)
PrinterSpecifies the default printer as the output target
File("FilePath")Specifies the file at FilePath as the output target. If the file does not exist, a new file will be created

Numeric Output Format#

If Expression is numerical, you can use the Expression:C:D syntax to specify the output format:

Syntax ElementDescription
CThe minimum number of output characters (integer + decimal point + decimal places). If the number of characters is less than C, leading spaces will be added in front of the value to fill up
DThe number of decimal places. If the number of decimal places is greater than D, the value will be rounded to D places

The default output format is a minimum of 7 characters and 2 decimal places.

Example#

Print 0.10 in the PowerLanguage Editor Output Log (3 leading spaces are added in front of 0.10).

1
Print(.1);

Print 1.556 in the PowerLanguage Editor Output Log (1 leading space is added in front of 1.556).

1
Print(1.555555:6:3);

Output CurrentDate and CurrentTime to the file C:\test.txt.

1
Print(File("C:\test.txt"), CurrentDate, CurrentTime);

Reference#

https://www.multicharts.com/trading-software/index.php?title=Print

© 2026 CodeReindeer. All rights reserved.