Alert scripts are used for executing custom actions as part of the actions executed by an alert. Common use-cases include sending orders, sending basket orders, exporting data to files, communicating with social media and running automated processes (similar use-cases to those of the Add-On script).


Setup


An Alert script can be set up to be triggered from a chart as well as from any of the platform's data grids, such as watchlists, depth-of-market, time and sales, orders and positions, among others.


Functions


Name

Description

OnInitialize()

This function is used for accepting the script parameters and for initializing the script prior to all other function calls.

OnAction(int, int)

This function is called when the alert processes its actions on one of the data grid rows.


Function Details


OnInitialize()

This function is used for accepting the script parameters and for initializing the script prior to all other function calls.


OnAction(int symbolIndex, int index)

This function is called when the alert processes its actions on one of the data grid rows.


Parameters


Type

Identifier

Description

int

symbolIndex

The symbol index of the symbol being displayed in the data grid row (or -1 if none is available)

int

index

The item index of the item being displayed in the data grid row, such as the order index or position index (or -1 if none is available)