Trade Management Strategy Scripts
Trade Management Strategy scripts have multiple use-cases such as implementing position entry strategies, implementing position exit strategies and implementing advanced order management systems, among others.
Setup
A Trade Management Strategy script can be set up in the Trade Pad of a Standard Desktop and then triggered each time a new order is generated from it. This script type is not supported in a Strategy Desktop.
Functions
Name |
Description |
This function is used for accepting the script parameters and for initializing the script prior to all other function calls. |
|
This function is called after each new bar belonging to the symbol that triggered the Trade Management Strategy. It can be used to evaluate the symbol and its new bar in order to submit, modify or cancel orders. The TradeManagementStart function must first be called in order for the platform to start calling this function. |
|
This function is called once for the entry order that triggered the script. It's called before the order is submitted and can be used for setting attached orders and OCA groups. |
|
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. |
OnBarUpdate(int symbolIndex, int dataSeries) |
|||||||||
This function is called after each new bar belonging to the symbol that triggered the Trade Management Strategy. It can be used to evaluate the symbol and its new bar in order to submit, modify or cancel orders. The TradeManagementStart function must first be called in order for the platform to start calling this function. Parameters
|
OnEntryOrder(int symbolIndex, int orderIndex) |
|||||||||
This function is called once for the entry order that triggered the script. It's called before the order is submitted and can be used for setting attached orders and OCA groups. Parameters
|
OnShutdown() |
This function is called when the script is shutdown. |