Table of Contents

Method Trace

Namespace
WhalesSecret.TradeScriptLib.API
Assembly
WhalesSecret.TradeScriptLib.dll

Trace(EventCategory, string, ChartInformation?, string, params object?[])

Raises a trace severity event in the trade script, which is sent to the Core application and can be consumed by the user.

bool Trace(EventCategory category, string id, ChartInformation? chartInformation, string message, params object?[] args)

Parameters

category EventCategory

Category of the raised event. This must not be set to TradeSystem.

id string

Identifier of the event assigned to it by the originating trade script. This should be a short string that may help to identify the event, such as an event code. It must not be longer than MaxEventIdLength.

chartInformation ChartInformation

Optionally, information about visualization of the event on the chart.

message string

Event message in markdown which may contain composite formatting items. Final markdown message string must not be longer than MaxEventMessageLength.

args object[]

If message contains composite formatting items, these are the format arguments.

Returns

bool

If the trade script runs in the production mode, the return value is true in case the event was successfully created and inserted to the queue from which it will be sent to the Core application. The return value is false in case of a formatting error or a violation of arguments constraints, or in case the event cannot be delivered.

If the trade script runs in the debug mode, the method only returns true or it throws an exception in case of a failure.

Exceptions

InvalidArgumentException

Thrown if the trade script runs in the debug mode and id or the message after being formatted exceed the maximum allowed length, or if id or message is null, or if category is set to TradeSystem.

InvalidStateException

Thrown if the trade script runs in the debug mode and the event cannot be delivered.

Trace(EventCategory, string, string, params object?[])

Raises a trace severity event in the trade script, which is sent to the Core application and can be consumed by the user.

bool Trace(EventCategory category, string id, string message, params object?[] args)

Parameters

category EventCategory

Category of the raised event. This must not be set to TradeSystem.

id string

Identifier of the event assigned to it by the originating trade script. This should be a short string that may help to identify the event, such as an event code. It must not be longer than MaxEventIdLength.

message string

Event message in markdown which may contain composite formatting items. Final markdown message string must not be longer than MaxEventMessageLength.

args object[]

If message contains composite formatting items, these are the format arguments.

Returns

bool

If the trade script runs in the production mode, the return value is true in case the event was successfully created and inserted to the queue from which it will be sent to the Core application. The return value is false in case of a formatting error or a violation of arguments constraints, or in case the event cannot be delivered.

If the trade script runs in the debug mode, the method only returns true or it throws an exception in case of a failure.

Exceptions

InvalidArgumentException

Thrown if the trade script runs in the debug mode and id or the message after being formatted exceed the maximum allowed length, or if id or message is null, or if category is set to TradeSystem.

InvalidStateException

Thrown if the trade script runs in the debug mode and the event cannot be delivered.