NinjaScript > Language Reference > Alert & Debug >

Print()

Print this Topic Previous pageReturn to chapter overviewNext page

Definition

Prints data to the NinjaTrader output window.

 

NOTE: High frequency of Print() method calls can represent a performance hit on your PC. Please see the NinjaScript section of the Performance Tips article for more information.

 

Syntax

Print(string message)

Print(bool value)

Print(double value)

Print(int value)

Print(DateTime value)

 

Parameters

message

User defined message

 

 

Examples

// Generates a message

Print("This is a message");

 

// Prints the current bar SMA value to the output window

Print(SMA(Close, 20)[0]);

 

 

Tips

1.You can align prices to be formatted for easier debugging such as Low[0].ToString("0.00"). So if you have
 
12.5
12.75
 
you would get
 
12.50
12.75