Skip to content

Algo.Print

method · Algo · cAlgo.API.Internals

DesktopCLICloud

Prints text representation of the specified object to the log.

Environment behaviour

CLI — works differently. Lines go to ctrader-cli standard output as 'time | level | message'; no Log tab and no instance log file is written.

Cloud — works differently. Lines go to the cloud host output as 'level | message' with no timestamp; no instance log file is written.

Overloads

Signature Description
Print(object value) Prints text representation of the specified object to the log.
Print(object[] parameters) Prints a message to the Log
Print(string message, object[] parameters) Prints a message to the Log.

Prints text representation of the specified object to the log.

public void Print(object value)
api.Print(value: object) -> None

Parameters

Name C# type Python type Description
value object object Object to print.

Examples

Print(Positions.Count);
api.Print(api.Positions.Count)

Prints a message to the Log

public void Print(object[] parameters)
api.Print(parameters: list[object]) -> None

Parameters

Name C# type Python type Description
parameters object[] list[object] Parameters to print

Examples

Print(Account.Balance, " ", Account.Equity);
api.Print(api.Account.Balance, " ", api.Account.Equity)

Prints a message to the Log.

public void Print(string message, object[] parameters)
api.Print(message: str, parameters: list[object]) -> None

Parameters

Name C# type Python type Description
message string str Message to print.
parameters object[] list[object] Parameters (optional)

Examples

Print("Current Balance is {0}, Equity is {1}.", Account.Balance, Account.Equity);
api.Print(f"Current Balance is {api.Account.Balance}, Equity is {api.Account.Equity}.")