Add-on scripts are used for adding functionality to the platform by allowing custom code to be triggered manually from its trading tools. Common use-cases include sending orders, sending basket orders, exporting data to files, communicating with social media and running automated processes.


Setup


An Add-on 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.

OnTriggered(int, int, int)

This function is called when the add-on is triggered by the user.


Function Details


OnInitialize()

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


OnTriggered(int strategyNumber, int symbolIndex, int index)

This function is called when the add-on is triggered by the user.


Parameters


Type

Identifier

Description

int

strategyNumber

The strategy number on which the add-on was called (or -1 if none is available)

int

symbolIndex

The symbol index of the symbol on which the add-on was called (or -1 if none is available)

int

index

The item index of the item on which the add-on was called, such as the order index or position index (or -1 if none is available)