Performance Metric scripts are used for calculating performance statistics similar to those in the Performance tab of the Desktop. Common use-cases include calculating custom performance metrics and custom optimization scores.


Setup


A Performance Metric script can be set up in the Performance tab of the Desktop, where it will be displayed as part of the performance results. A Performance Metric script can also be set up in the Optimization Setup Window where it can be used as the optimization score (goal) for the optimization process.


Functions


Name

Description

OnInitialize()

This function is used for accepting the script parameters and for initializing the script prior to all other function calls. Once the script is assigned to a Desktop, its parameter values can be specified by the user.

double OnCalculateMetric(long, long, int[])

This function calculates the performance metric for the specified Desktop strategies.

OnShutdown()

This function is called when the script is shutdown.


Function Details


OnInitialize()

This function is used for accepting the script parameters and for initializing the script prior to all other function calls. Once the script is assigned to a Desktop, its parameter values can be specified by the user.


double OnCalculateMetric(long startUtcDateTime, long endUtcDateTime, int[] strategyNumbers)

This function calculates the performance metric for the specified Desktop strategies.


Returns


The performance metric based on the specified settings.


Parameters


Type

Identifier

Description

long

startUtcDateTime

The start UTC date/time from which to calculate the metric

long

endUtcDateTime

The end UTC date/time up to which to calculate the metric

int[]

strategyNumbers

The Desktop strategy numbers on which to calculate the metric


OnShutdown()

This function is called when the script is shutdown.