Broker
Broker functions are mostly used for creating, modifying and cancelling orders. The platform can generate and backtest a wide selection of standard and advanced order types, but those must actually be supported by your broker in order to be traded live.
Sections
Name |
Description |
Specifies whether duplicate orders should be processed or cancelled (the default is 'false', i.e. duplicate orders are cancelled). Duplicate orders are orders that share the same symbol, action type and order type. Call the function once from OnInitialize. |
|
Submits a cancel order request, of a specified pending order, to the broker. The order will be cancelled if possible. |
|
Submits a cancel order request, of a specified pending order, to the broker. The order will be cancelled if possible. |
|
Submits market orders that will close all of the open positions of all of the symbols. |
|
Submits market orders that will close all of the open positions of all of the symbols. |
|
Submits a market order that will close the open position of the underlying symbol, if such a position exists. |
|
Submits a market order that will close a specified position. |
|
int BrokerDiscretionary(C_ActionType, double, C_TIF, double, double, string) |
Submits a specified discretionary order to the broker. |
int BrokerDiscretionary(int, int, C_ActionType, double, C_TIF, double, double, string) |
Submits a specified discretionary order to the broker. |
int BrokerIceberg(C_ActionType, double, double, C_TIF, double, string) |
Submits a specified iceberg order to the broker. Iceberg orders display a specified part of their quantity, while hiding the rest. |
int BrokerIceberg(int, int, C_ActionType, double, double, C_TIF, double, string) |
Submits a specified iceberg order to the broker. Iceberg orders display a specified part of their quantity, while hiding the rest. |
int BrokerLimit(C_ActionType, double, C_TIF, double, string) |
Submits a specified limit order to the broker. Limit orders are executed only at the specified limit price or better. |
int BrokerLimit(int, int, C_ActionType, double, C_TIF, double, string) |
Submits a specified limit order to the broker. Limit orders are executed only at the specified limit price or better. |
int BrokerLimitIfTouched(C_ActionType, double, C_TIF, double, double, string) |
Submits a specified limit-if-touched order to the broker. |
int BrokerLimitIfTouched(int, int, C_ActionType, double, C_TIF, double, double, string) |
Submits a specified limit-if-touched order to the broker. |
int BrokerLimitOnClose(C_ActionType, double, C_TIF, double, string) |
Submits a specified limit-on-close order to the broker. Limit-on-close orders are executed only at the market close at the specified limit price or better, and cancelled otherwise. |
int BrokerLimitOnClose(int, int, C_ActionType, double, C_TIF, double, string) |
Submits a specified limit-on-close order to the broker. Limit-on-close orders are executed only at the market close at the specified limit price or better, and cancelled otherwise. |
int BrokerLimitOnOpen(C_ActionType, double, C_TIF, double, string) |
Submits a specified limit-on-open order to the broker. Limit-on-open orders are executed only at the market open at the specified limit price or better, and cancelled otherwise. |
int BrokerLimitOnOpen(int, int, C_ActionType, double, C_TIF, double, string) |
Submits a specified limit-on-open order to the broker. Limit-on-open orders are executed only at the market open at the specified limit price or better, and cancelled otherwise. |
Submits a specified market order to the broker. Market orders are executed at the current market price. |
|
int BrokerMarket(int, int, C_ActionType, double, C_TIF, string) |
Submits a specified market order to the broker. Market orders are executed at the current market price. |
int BrokerMarketIfTouched(C_ActionType, double, C_TIF, double, string) |
Submits a specified market-if-touched order to the broker. |
int BrokerMarketIfTouched(int, int, C_ActionType, double, C_TIF, double, string) |
Submits a specified market-if-touched order to the broker. |
int BrokerMarketOnClose(C_ActionType, double, C_TIF, string) |
Submits a specified market on close order to the broker. Market on close orders are executed at the next market close at the closing price. |
int BrokerMarketOnClose(int, int, C_ActionType, double, C_TIF, string) |
Submits a specified market on close order to the broker. Market on close orders are executed at the next market close at the closing price. |
Submits a specified market on open order to the broker. Market on open orders are executed at the next market open at the opening price. |
|
int BrokerMarketOnOpen(int, int, C_ActionType, double, C_TIF, string) |
Submits a specified market on open order to the broker. Market on open orders are executed at the next market open at the opening price. |
Modifies a specified pending order before it is executed. Note that the order modification won't take place until the next call. |
|
Modifies a specified pending order before it is executed. Note that the order modification won't take place until the next call. |
|
int BrokerRelative(C_ActionType, double, C_TIF, double, double, string) |
Submits a specified relative/pegged-to-primary order to the broker. |
int BrokerRelative(int, int, C_ActionType, double, C_TIF, double, double, string) |
Submits a specified relative/pegged-to-primary order to the broker. |
Sets a specified order as an all or none order, meaning that the broker should execute it all in one fill or not at all. |
|
Sets a specified order as an all or none order, meaning that the broker should execute it all in one fill or not at all. |
|
Allows a specified order to be processed during ETH. |
|
Allows a specified order to be processed during ETH. |
|
Sets the routing destination of a specified order using one of the broker's routing identifiers. |
|
Sets the routing destination of a specified order using one of the broker's routing identifiers. |
|
Sets the financial advisor group and method for a specified pending order (IB only). |
|
Sets the financial advisor group and method for a specified pending order (IB only). |
|
Sets the financial advisor profile for a specified pending order (IB only). |
|
Sets the financial advisor profile for a specified pending order (IB only). |
|
Sets a specified limit order to be a hidden order. |
|
Sets a specified limit order to be a hidden order. |
|
Sets a specified order as part of an OCA group. Note that this function must be called at the same strategy call in which the order is first created, prior to it being submitted to the broker. |
|
Sets a specified order as part of an OCA group. Note that this function must be called at the same strategy call in which the order is first created, prior to it being submitted to the broker. |
|
Submits a specified stop loss order to the broker. Stop loss orders are attached orders. They are attached to an entry order and are executed only when the trade that resulted from the entry order reaches a specified loss. If a trade is closed before its attached stop loss order is executed, the order is cancelled. |
|
Submits a specified stop loss order to the broker. Stop loss orders are attached orders. They are attached to an entry order and are executed only when the trade that resulted from the entry order reaches a specified loss. If a trade is closed before its attached stop loss order is executed, the order is cancelled. |
|
Submits a specified stop loss order to the broker, with the stop loss price specified as a percent from the current price. Note that the percent offset isn't from the order execution price, but from the current price. In order for the stop price to be from the order execution price the modifyAfterExecution parameter should be set to true. Stop loss orders are attached orders, they are attached to an entry order and are executed only when the trade that resulted from the entry order reaches a specified loss. If a trade is closed before its attached stop loss order is executed then the order is cancelled. |
|
Submits a specified take profit order to the broker. Take profit orders are attached orders. They are attached to an entry order and are executed only when the trade that resulted from the entry order reaches a specified profit target. If a trade is closed before its attached take profit order is executed, the order is cancelled. |
|
Submits a specified take profit order to the broker. Take profit orders are attached orders. They are attached to an entry order and are executed only when the trade that resulted from the entry order reaches a specified profit target. If a trade is closed before its attached take profit order is executed, the order is cancelled. |
|
Submits a specified take profit order to the broker, with the take profit price specified as a percent from the current price. Note that the percent offset isn't from the order execution price, but from the current price. In order for the take profit price to be from the order execution price the modifyAfterExecution parameter should be set to true. Take profit orders are attached orders, they are attached to an entry order and are executed only when the trade that resulted from the entry order reaches a specified profit target. If a trade is closed before its attached take profit order is executed then the order is cancelled. |
|
Submits a specified trailing stop loss order to the broker. Trailing stop/loss orders are attached orders. They are attached to an entry order and are executed only when the trade that resulted from the entry order reaches a moving stop/loss price. If a trade is closed before its attached trailing stop loss order is executed, the order is cancelled. |
|
int BrokerSetTrailingStopLoss(int, int, bool, double, string) |
Submits a specified trailing stop loss order to the broker. Trailing stop/loss orders are attached orders. They are attached to an entry order and are executed only when the trade that resulted from the entry order reaches a moving stop/loss price. If a trade is closed before its attached trailing stop loss order is executed, the order is cancelled. |
Submits a specified stop order to the broker. Stop orders are executed at the market price when the specified stop price is reached. |
|
int BrokerStop(int, int, C_ActionType, double, C_TIF, double, string) |
Submits a specified stop order to the broker. Stop orders are executed at the market price when the specified stop price is reached. |
int BrokerStopLimit(C_ActionType, double, C_TIF, double, double, string) |
Submits a specified stop limit order to the broker. Stop limit orders become normal limit orders when the specified stop price is reached. |
int BrokerStopLimit(int, int, C_ActionType, double, C_TIF, double, double, string) |
Submits a specified stop limit order to the broker. Stop limit orders become normal limit orders when the specified stop price is reached. |
int BrokerVWAP(C_ActionType, double, C_TIF, long, long, string) |
Submits a specified VWAP order to the broker. |
int BrokerVWAP(int, int, C_ActionType, double, C_TIF, long, long, string) |
Submits a specified VWAP order to the broker. |
BrokerAllowDuplicateOrders(bool allowDuplicates) |
||||||
Specifies whether duplicate orders should be processed or cancelled (the default is 'false', i.e. duplicate orders are cancelled). Duplicate orders are orders that share the same symbol, action type and order type. Call the function once from OnInitialize. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
BrokerCancelOrder(int orderIndex, string comment) |
|||||||||
Submits a cancel order request, of a specified pending order, to the broker. The order will be cancelled if possible. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
BrokerCancelOrder(int strategyNumber, int orderIndex, string comment) |
||||||||||||
Submits a cancel order request, of a specified pending order, to the broker. The order will be cancelled if possible. Parameters
Scripts AddOn, RiskManagement |
BrokerCloseAllPositions(string comment) |
||||||
Submits market orders that will close all of the open positions of all of the symbols. Parameters
Scripts MultiSymbolTradingStrategy |
BrokerCloseAllPositions(int strategyNumber, string comment) |
|||||||||
Submits market orders that will close all of the open positions of all of the symbols. Parameters
Scripts AddOn, RiskManagement |
BrokerClosePosition(string comment) |
||||||
Submits a market order that will close the open position of the underlying symbol, if such a position exists. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
BrokerClosePosition(int strategyNumber, int positionIndex, string comment) |
||||||||||||
Submits a market order that will close a specified position. Parameters
Scripts AddOn, RiskManagement |
int BrokerDiscretionary(C_ActionType actionType, double quantity, C_TIF timeInForce, double limitPrice, double priceOffset, string comment) |
|||||||||||||||||||||
Submits a specified discretionary order to the broker. Returns The order index of the new order. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
int BrokerDiscretionary(int strategyNumber, int symbolIndex, C_ActionType actionType, double quantity, C_TIF timeInForce, double limitPrice, double priceOffset, string comment) |
|||||||||||||||||||||||||||
Submits a specified discretionary order to the broker. Returns The order index of the new order. Parameters
Scripts AddOn, RiskManagement |
int BrokerIceberg(C_ActionType actionType, double quantity, double displayQuantity, C_TIF timeInForce, double limitPrice, string comment) |
|||||||||||||||||||||
Submits a specified iceberg order to the broker. Iceberg orders display a specified part of their quantity, while hiding the rest. Returns The order index of the new order. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
int BrokerIceberg(int strategyNumber, int symbolIndex, C_ActionType actionType, double quantity, double displayQuantity, C_TIF timeInForce, double limitPrice, string comment) |
|||||||||||||||||||||||||||
Submits a specified iceberg order to the broker. Iceberg orders display a specified part of their quantity, while hiding the rest. Returns The order index of the new order. Parameters
Scripts AddOn, RiskManagement |
int BrokerLimit(C_ActionType actionType, double quantity, C_TIF timeInForce, double limitPrice, string comment) |
||||||||||||||||||
Submits a specified limit order to the broker. Limit orders are executed only at the specified limit price or better. Returns The order index of the new order. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
int BrokerLimit(int strategyNumber, int symbolIndex, C_ActionType actionType, double quantity, C_TIF timeInForce, double limitPrice, string comment) |
||||||||||||||||||||||||
Submits a specified limit order to the broker. Limit orders are executed only at the specified limit price or better. Returns The order index of the new order. Parameters
Scripts AddOn, RiskManagement |
int BrokerLimitIfTouched(C_ActionType actionType, double quantity, C_TIF timeInForce, double touchPrice, double limitPrice, string comment) |
|||||||||||||||||||||
Submits a specified limit-if-touched order to the broker. Returns The order index of the new order. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
int BrokerLimitIfTouched(int strategyNumber, int symbolIndex, C_ActionType actionType, double quantity, C_TIF timeInForce, double touchPrice, double limitPrice, string comment) |
|||||||||||||||||||||||||||
Submits a specified limit-if-touched order to the broker. Returns The order index of the new order. Parameters
Scripts AddOn, RiskManagement |
int BrokerLimitOnClose(C_ActionType actionType, double quantity, C_TIF timeInForce, double limitPrice, string comment) |
||||||||||||||||||
Submits a specified limit-on-close order to the broker. Limit-on-close orders are executed only at the market close at the specified limit price or better, and cancelled otherwise. Returns The order index of the new order. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
int BrokerLimitOnClose(int strategyNumber, int symbolIndex, C_ActionType actionType, double quantity, C_TIF timeInForce, double limitPrice, string comment) |
||||||||||||||||||||||||
Submits a specified limit-on-close order to the broker. Limit-on-close orders are executed only at the market close at the specified limit price or better, and cancelled otherwise. Returns The order index of the new order. Parameters
Scripts AddOn, RiskManagement |
int BrokerLimitOnOpen(C_ActionType actionType, double quantity, C_TIF timeInForce, double limitPrice, string comment) |
||||||||||||||||||
Submits a specified limit-on-open order to the broker. Limit-on-open orders are executed only at the market open at the specified limit price or better, and cancelled otherwise. Returns The order index of the new order. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
int BrokerLimitOnOpen(int strategyNumber, int symbolIndex, C_ActionType actionType, double quantity, C_TIF timeInForce, double limitPrice, string comment) |
||||||||||||||||||||||||
Submits a specified limit-on-open order to the broker. Limit-on-open orders are executed only at the market open at the specified limit price or better, and cancelled otherwise. Returns The order index of the new order. Parameters
Scripts AddOn, RiskManagement |
int BrokerMarket(C_ActionType actionType, double quantity, C_TIF timeInForce, string comment) |
|||||||||||||||
Submits a specified market order to the broker. Market orders are executed at the current market price. Returns The order index of the new order. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
int BrokerMarket(int strategyNumber, int symbolIndex, C_ActionType actionType, double quantity, C_TIF timeInForce, string comment) |
|||||||||||||||||||||
Submits a specified market order to the broker. Market orders are executed at the current market price. Returns The order index of the new order. Parameters
Scripts AddOn, RiskManagement |
int BrokerMarketIfTouched(C_ActionType actionType, double quantity, C_TIF timeInForce, double touchPrice, string comment) |
||||||||||||||||||
Submits a specified market-if-touched order to the broker. Returns The order index of the new order. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
int BrokerMarketIfTouched(int strategyNumber, int symbolIndex, C_ActionType actionType, double quantity, C_TIF timeInForce, double touchPrice, string comment) |
||||||||||||||||||||||||
Submits a specified market-if-touched order to the broker. Returns The order index of the new order. Parameters
Scripts AddOn, RiskManagement |
int BrokerMarketOnClose(C_ActionType actionType, double quantity, C_TIF timeInForce, string comment) |
|||||||||||||||
Submits a specified market on close order to the broker. Market on close orders are executed at the next market close at the closing price. Returns The order index of the new order. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
int BrokerMarketOnClose(int strategyNumber, int symbolIndex, C_ActionType actionType, double quantity, C_TIF timeInForce, string comment) |
|||||||||||||||||||||
Submits a specified market on close order to the broker. Market on close orders are executed at the next market close at the closing price. Returns The order index of the new order. Parameters
Scripts AddOn, RiskManagement |
int BrokerMarketOnOpen(C_ActionType actionType, double quantity, C_TIF timeInForce, string comment) |
|||||||||||||||
Submits a specified market on open order to the broker. Market on open orders are executed at the next market open at the opening price. Returns The order index of the new order. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
int BrokerMarketOnOpen(int strategyNumber, int symbolIndex, C_ActionType actionType, double quantity, C_TIF timeInForce, string comment) |
|||||||||||||||||||||
Submits a specified market on open order to the broker. Market on open orders are executed at the next market open at the opening price. Returns The order index of the new order. Parameters
Scripts AddOn, RiskManagement |
BrokerModifyOrder(int orderIndex, double quantity, double stopPrice, double limitPrice) |
|||||||||||||||
Modifies a specified pending order before it is executed. Note that the order modification won't take place until the next call. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
BrokerModifyOrder(int strategyNumber, int orderIndex, double quantity, double stopPrice, double limitPrice) |
||||||||||||||||||
Modifies a specified pending order before it is executed. Note that the order modification won't take place until the next call. Parameters
Scripts AddOn, RiskManagement |
int BrokerRelative(C_ActionType actionType, double quantity, C_TIF timeInForce, double limitPrice, double offset, string comment) |
|||||||||||||||||||||
Submits a specified relative/pegged-to-primary order to the broker. Returns The order index of the new order. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
int BrokerRelative(int strategyNumber, int symbolIndex, C_ActionType actionType, double quantity, C_TIF timeInForce, double limitPrice, double offset, string comment) |
|||||||||||||||||||||||||||
Submits a specified relative/pegged-to-primary order to the broker. Returns The order index of the new order. Parameters
Scripts AddOn, RiskManagement |
BrokerSetAllOrNone(int orderIndex) |
||||||
Sets a specified order as an all or none order, meaning that the broker should execute it all in one fill or not at all. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
BrokerSetAllOrNone(int strategyNumber, int orderIndex) |
|||||||||
Sets a specified order as an all or none order, meaning that the broker should execute it all in one fill or not at all. Parameters
Scripts AddOn |
BrokerSetAllowETH(int orderIndex) |
||||||
Allows a specified order to be processed during ETH. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
BrokerSetAllowETH(int strategyNumber, int orderIndex) |
|||||||||
Allows a specified order to be processed during ETH. Parameters
Scripts AddOn, RiskManagement |
BrokerSetDestination(int orderIndex, string destination) |
|||||||||
Sets the routing destination of a specified order using one of the broker's routing identifiers. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
BrokerSetDestination(int strategyNumber, int orderIndex, string destination) |
||||||||||||
Sets the routing destination of a specified order using one of the broker's routing identifiers. Parameters
Scripts AddOn, RiskManagement |
BrokerSetFAGroup(int orderIndex, string faGroup, C_FA_Method faMethod, double faPercent) |
|||||||||||||||
Sets the financial advisor group and method for a specified pending order (IB only). Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
BrokerSetFAGroup(int strategyNumber, int orderIndex, string faGroup, C_FA_Method faMethod, double faPercent) |
||||||||||||||||||
Sets the financial advisor group and method for a specified pending order (IB only). Parameters
Scripts AddOn, RiskManagement |
BrokerSetFAProfile(int orderIndex, string faProfile) |
|||||||||
Sets the financial advisor profile for a specified pending order (IB only). Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
BrokerSetFAProfile(int strategyNumber, int orderIndex, string faProfile) |
||||||||||||
Sets the financial advisor profile for a specified pending order (IB only). Parameters
Scripts AddOn, RiskManagement |
BrokerSetHidden(int orderIndex) |
||||||
Sets a specified limit order to be a hidden order. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
BrokerSetHidden(int strategyNumber, int orderIndex) |
|||||||||
Sets a specified limit order to be a hidden order. Parameters
Scripts AddOn, RiskManagement |
BrokerSetOCA(int orderIndex, string groupName, C_OCA_Type type) |
||||||||||||
Sets a specified order as part of an OCA group. Note that this function must be called at the same strategy call in which the order is first created, prior to it being submitted to the broker. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
BrokerSetOCA(int strategyNumber, int orderIndex, string groupName, C_OCA_Type type) |
|||||||||||||||
Sets a specified order as part of an OCA group. Note that this function must be called at the same strategy call in which the order is first created, prior to it being submitted to the broker. Parameters
Scripts AddOn, RiskManagement |
int BrokerSetStopLoss(int orderIndex, double stopPrice, string comment) |
||||||||||||
Submits a specified stop loss order to the broker. Stop loss orders are attached orders. They are attached to an entry order and are executed only when the trade that resulted from the entry order reaches a specified loss. If a trade is closed before its attached stop loss order is executed, the order is cancelled. Returns The order index of the new order. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
int BrokerSetStopLoss(int strategyNumber, int orderIndex, double stopPrice, string comment) |
|||||||||||||||
Submits a specified stop loss order to the broker. Stop loss orders are attached orders. They are attached to an entry order and are executed only when the trade that resulted from the entry order reaches a specified loss. If a trade is closed before its attached stop loss order is executed, the order is cancelled. Returns The order index of the new order. Parameters
Scripts AddOn, RiskManagement |
int BrokerSetStopLossPercent(int orderIndex, double stopPercent, bool modifyAfterExecution, string comment) |
|||||||||||||||
Submits a specified stop loss order to the broker, with the stop loss price specified as a percent from the current price. Note that the percent offset isn't from the order execution price, but from the current price. In order for the stop price to be from the order execution price the modifyAfterExecution parameter should be set to true. Stop loss orders are attached orders, they are attached to an entry order and are executed only when the trade that resulted from the entry order reaches a specified loss. If a trade is closed before its attached stop loss order is executed then the order is cancelled. Returns The order index of the new order. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
int BrokerSetTakeProfit(int orderIndex, double limitPrice, string comment) |
||||||||||||
Submits a specified take profit order to the broker. Take profit orders are attached orders. They are attached to an entry order and are executed only when the trade that resulted from the entry order reaches a specified profit target. If a trade is closed before its attached take profit order is executed, the order is cancelled. Returns The order index of the new order. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
int BrokerSetTakeProfit(int strategyNumber, int orderIndex, double limitPrice, string comment) |
|||||||||||||||
Submits a specified take profit order to the broker. Take profit orders are attached orders. They are attached to an entry order and are executed only when the trade that resulted from the entry order reaches a specified profit target. If a trade is closed before its attached take profit order is executed, the order is cancelled. Returns The order index of the new order. Parameters
Scripts AddOn, RiskManagement |
int BrokerSetTakeProfitPercent(int orderIndex, double limitPercent, bool modifyAfterExecution, string comment) |
|||||||||||||||
Submits a specified take profit order to the broker, with the take profit price specified as a percent from the current price. Note that the percent offset isn't from the order execution price, but from the current price. In order for the take profit price to be from the order execution price the modifyAfterExecution parameter should be set to true. Take profit orders are attached orders, they are attached to an entry order and are executed only when the trade that resulted from the entry order reaches a specified profit target. If a trade is closed before its attached take profit order is executed then the order is cancelled. Returns The order index of the new order. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
int BrokerSetTrailingStopLoss(int orderIndex, bool isPercentOffset, double trailingOffset, string comment) |
|||||||||||||||
Submits a specified trailing stop loss order to the broker. Trailing stop/loss orders are attached orders. They are attached to an entry order and are executed only when the trade that resulted from the entry order reaches a moving stop/loss price. If a trade is closed before its attached trailing stop loss order is executed, the order is cancelled. Returns The order index of the new order. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
int BrokerSetTrailingStopLoss(int strategyNumber, int orderIndex, bool isPercentOffset, double trailingOffset, string comment) |
||||||||||||||||||
Submits a specified trailing stop loss order to the broker. Trailing stop/loss orders are attached orders. They are attached to an entry order and are executed only when the trade that resulted from the entry order reaches a moving stop/loss price. If a trade is closed before its attached trailing stop loss order is executed, the order is cancelled. Returns The order index of the new order. Parameters
Scripts AddOn, RiskManagement |
int BrokerStop(C_ActionType actionType, double quantity, C_TIF timeInForce, double stopPrice, string comment) |
||||||||||||||||||
Submits a specified stop order to the broker. Stop orders are executed at the market price when the specified stop price is reached. Returns The order index of the new order. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
int BrokerStop(int strategyNumber, int symbolIndex, C_ActionType actionType, double quantity, C_TIF timeInForce, double stopPrice, string comment) |
||||||||||||||||||||||||
Submits a specified stop order to the broker. Stop orders are executed at the market price when the specified stop price is reached. Returns The order index of the new order. Parameters
Scripts AddOn, RiskManagement |
int BrokerStopLimit(C_ActionType actionType, double quantity, C_TIF timeInForce, double stopPrice, double limitPrice, string comment) |
|||||||||||||||||||||
Submits a specified stop limit order to the broker. Stop limit orders become normal limit orders when the specified stop price is reached. Returns The order index of the new order. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
int BrokerStopLimit(int strategyNumber, int symbolIndex, C_ActionType actionType, double quantity, C_TIF timeInForce, double stopPrice, double limitPrice, string comment) |
|||||||||||||||||||||||||||
Submits a specified stop limit order to the broker. Stop limit orders become normal limit orders when the specified stop price is reached. Returns The order index of the new order. Parameters
Scripts AddOn, RiskManagement |
int BrokerVWAP(C_ActionType actionType, double quantity, C_TIF timeInForce, long startTime, long endTime, string comment) |
|||||||||||||||||||||
Submits a specified VWAP order to the broker. Returns The order index of the new order. Parameters
Scripts Alert, TradeManagementStrategy, MultiSymbolTradingStrategy, TradingStrategy |
int BrokerVWAP(int strategyNumber, int symbolIndex, C_ActionType actionType, double quantity, C_TIF timeInForce, long startTime, long endTime, string comment) |
|||||||||||||||||||||||||||
Submits a specified VWAP order to the broker. Returns The order index of the new order. Parameters
Scripts AddOn, RiskManagement |