Supported Models
Trading Technologies
Introduction
This page explains the TradingTechnologiesBrokerageModel
, including the asset classes it supports, its default security-level models, and it's default markets.
SetBrokerageModel(BrokerageName.TradingTechnologies, AccountType.Cash); SetBrokerageModel(BrokerageName.TradingTechnologies, AccountType.Margin);
self.set_brokerage_model(BrokerageName.TRADING_TECHNOLOGIES, AccountType.CASH) self.set_brokerage_model(BrokerageName.TRADING_TECHNOLOGIES, AccountType.MARGIN)
To view the implementation of this model, see the LEAN GitHub repository.
Asset Classes
The TradingTechnologiesBrokerageModel
supports trading Futures.
Orders
The TradingTechnologiesBrokerageModel
supports several order types, some TimeInForce
order properties, and order updates.
Order Types
The following table describes the available order types for each asset class that the TradingTechnologiesBrokerageModel
supports:
Order Type | Futures |
---|---|
Market | |
Limit | |
Stop market | |
Stop limit |
The TradingTechnologiesBrokerageModel
enforces the following order rules:
- If you are buying (selling) with a
StopMarketOrder
stop_market_order
or aStopLimitOrder
stop_limit_order
, the stop price of the order must be greater (less) than the current security price. - If you are buying (selling) with a
StopLimitOrder
stop_limit_order
, the limit price of the order must be greater (less) than the stop price.
Time In Force
The TradingTechnologiesBrokerageModel
supports the Day
DAY
and GoodTilCanceled
GOOD_TIL_CANCELED
TimeInForce order properties.
public override void Initialize() { // Set the default order properties DefaultOrderProperties.TimeInForce = TimeInForce.GoodTilCanceled; } public override void OnData(Slice slice) { // Use default order order properties LimitOrder(_symbol, quantity, limitPrice); // Override the default order properties LimitOrder(_symbol, quantity, limitPrice, orderProperties: new OrderProperties { TimeInForce = TimeInForce.Day }); }
def initialize(self) -> None: # Set the default order properties self.default_order_properties.time_in_force = TimeInForce.GOOD_TIL_CANCELED def on_data(self, slice: Slice) -> None: # Use default order order properties self.limit_order(self._symbol, quantity, limit_price) # Override the default order properties order_properties = OrderProperties() order_properties.time_in_force = TimeInForce.DAY self.limit_order(self._symbol, quantity, limit_price, order_properties=order_properties)
Updates
The TradingTechnologiesBrokerageModel
supports order updates.
Fills
The TradingTechnologiesBrokerageModel
uses the FutureFillModel.
Slippage
The TradingTechnologiesBrokerageModel
uses the NullSlippageModel.
Fees
The TradingTechnologiesBrokerageModel
uses the ConstantFeeModel with zero fees.
security.SetFeeModel(new ConstantFeeModel(0.0m));
security.set_fee_model(ConstantFeeModel(0))
Settlement
The TradingTechnologiesBrokerageModel
uses the FutureSettlementModel.
Margin Interest Rate
The TradingTechnologiesBrokerageModel
uses the NullMarginInterestRateModel.