Skip to content

Miscellaneous

CustomReport

Creates an item in the bots custom reports.

Syntax: CustomReport(key, value, [ group ], [ displayValue ])

Return type: Void

Parameter Name Parameter Type Required Suggestions
key String True
value Dynamic True
group String False
displayValue Boolean False

Overriding Built-in Report Values

When group is set to "Override" and key matches a supported built-in field, the bot's report will display your custom value instead of the calculated value. The overrides also appear under an Override group in the Custom Report section for visibility. Pass nil as the value to clear an override.

Supported keys: GrossProfit, FeeCosts, RealizedProfit, UnrealizedProfit, ROI, BuyAndHodl, ClosedPositions, WinningPositions, AvgProfit, AvgPositionSize, AvgPositionMargin, FilledOrders, PartiallyFilledOrders, CancelledOrders, FailedOrders, BiggestWin, BiggestLoss, SharpeRatio, SortinoRatio, WinPercentage, ProfitFactor

-- Override profit section values
CustomReport("RealizedProfit", myNetPnL, "Override")
CustomReport("ROI", myROI, "Override")
CustomReport("FeeCosts", myTotalFees, "Override")

-- Clear an override
CustomReport("ROI", nil, "Override")

GetCommand

Gets a command by name.

Syntax: GetCommand(name)

Returns the command.

Return type: Dynamic

Parameter Name Parameter Type Required Suggestions
name String True

GetType

Gets the data type of the input.

Syntax: GetType(value)

Returns the data type.

Return type: Enum

Parameter Name Parameter Type Required Suggestions
value Dynamic True

HNC

HNC is an array on which match can be applied directly. This is not position with the lua code {}.

Syntax: HNC([ size ], [ value ])

Returns an array with or without values.

Return type: ListNumbers

Parameter Name Parameter Type Required Suggestions
size Number False
value Number False