Print

Outputs a message to the console with the current UTC time in testing.

Syntax

Print(message: string): void

Parameters

  • message - A string containing the message to be printed.

Return Value

This method does not return a value.

Description

The Print method outputs a message to the console, prefixed with the current UTC time in testing. This is useful for debugging and logging information during strategy development and testing.

The timestamp format is "YYYY.MM.DD HH:nn:ss" and represents the last processed tick time in the testing environment.

Example

// Print a simple message
this.api.Print('Hello, world!')

// Print a variable value
const rsi = this.api.iRSI('EURUSD', 14, 0)
this.api.Print(`Current RSI value: ${rsi}`)

// Print information during strategy execution
if (this.api.iRSI('EURUSD', 14, 0) < 30) {
    this.api.Print('Oversold condition detected')
}

Last updated