Commission Scripts
Commission scripts are used for calculating the commission paid to a broker for each executed order, based on the broker's exact commission schedule.
Setup
A Commission script can be set up from the Advanced tab in the Desktop Settings.
Functions
Name |
Description |
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 and can be selected for optimization. |
|
This function is called to calculate the commission paid to a broker for a specified order fill. Note that the commission is denominated in the base currency of the Desktop. |
|
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 and can be selected for optimization. |
double OnCommission(int strategyNumber, int orderIndex, int orderFillIndex, double fillQuantity, double fillPrice) |
||||||||||||||||||
This function is called to calculate the commission paid to a broker for a specified order fill. Note that the commission is denominated in the base currency of the Desktop. Returns The commission paid for the specified order fill, in the Desktop strategy currency. Parameters
|
OnShutdown() |
This function is called when the script is shutdown. |