Supported Models
ClearStreet
Introduction
This page explains the ClearStreetBrokerageModel, including the asset classes it supports, its default security-level models, and its default markets.
SetBrokerageModel(BrokerageName.ClearStreet, AccountType.Cash); SetBrokerageModel(BrokerageName.ClearStreet, AccountType.Margin);
self.set_brokerage_model(BrokerageName.CLEAR_STREET, AccountType.CASH) self.set_brokerage_model(BrokerageName.CLEAR_STREET, AccountType.MARGIN)
For more information about this model, see the class reference and implementation.
For more information about this model, see the class reference and implementation.
Orders
The ClearStreetBrokerageModel supports several order types, order properties, and order updates.
Order Types
The following table describes the available order types for each asset class that the ClearStreetBrokerageModel supports:
| Order Type | Equity | Equity Options | Index Options |
|---|---|---|---|
| Market | ![]() | ![]() | ![]() |
| Limit | ![]() | ![]() | ![]() |
| Stop market | ![]() | ||
| Stop limit | ![]() | ||
| Trailing stop | ![]() |
Order Properties
The ClearStreetBrokerageModel supports custom order properties. The following table describes the members of the ClearStreetOrderProperties object that you can set to customize order execution.
| Property | Data Type | Description | Default Value |
|---|---|---|---|
TimeInForcetime_in_force | TimeInForce | A TimeInForce instruction to apply to the order. The following instructions are supported:
DayDAY, which the brokerage sets automatically.
| TimeInForce.GoodTilCanceledTimeInForce.GOOD_TIL_CANCELED |
OutsideRegularTradingHoursoutside_regular_trading_hours | bool | If set to true, allows orders to also trigger or fill outside of regular trading hours. Clear Street accepts only limit and stop limit orders in the pre-market (4:00 AM to 9:30 AM Eastern Time) and after-hours (4:00 PM to 8:00 PM Eastern Time) sessions. | falseFalse |
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 ClearStreetOrderProperties
{
TimeInForce = TimeInForce.Day,
OutsideRegularTradingHours = true
});
LimitOrder(_symbol, quantity, limitPrice,
orderProperties: new ClearStreetOrderProperties
{
TimeInForce = TimeInForce.GoodTilDate(new DateTime(year, month, 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 = ClearStreetOrderProperties()
order_properties.time_in_force = TimeInForce.DAY
order_properties.outside_regular_trading_hours = True
self.limit_order(self._symbol, quantity, limit_price, order_properties=order_properties)
order_properties.time_in_force = TimeInForce.good_til_date(datetime(year, month, day))
self.limit_order(self._symbol, quantity, limit_price, order_properties=order_properties)
Updates
The ClearStreetBrokerageModel supports order updates.
Handling Splits
If you're using raw data normalization and you have active orders with a limit, stop, or trigger price in the market for a US Equity when a stock split occurs, the following properties of your orders automatically adjust to reflect the stock split:
- Quantity
- Limit price
- Stop price
- Trigger price
Fills
The ClearStreetBrokerageModel uses the EquityFillModel for Equity trades and the ImmediateFillModel for Equity Options and Index Options trades.
Slippage
The ClearStreetBrokerageModel uses the NullSlippageModel.
Fees
The ClearStreetBrokerageModel uses the InteractiveBrokersFeeModel for Equity and Equity Option trades and the ConstantFeeModel with no fees for Index Option trades.
// For Equity and Equity Option trades: security.SetFeeModel(new InteractiveBrokersFeeModel()); // For Index Option trades: security.SetFeeModel(new ConstantFeeModel(0.0m));
# For Equity and Equity Option trades: security.set_fee_model(InteractiveBrokersFeeModel()) # For Index Option trades: security.set_fee_model(ConstantFeeModel(0))
Settlement
The ClearStreetBrokerageModel uses the ImmediateSettlementModel for margin accounts and the DelayedSettlementModel with the default settlement rules for cash accounts.
// For cash accounts: security.SetSettlementModel(new DelayedSettlementModel(Equity.DefaultSettlementDays, Equity.DefaultSettlementTime)); // For margin accounts: security.SetSettlementModel(new ImmediateSettlementModel());
# For cash accounts: security.set_settlement_model(DelayedSettlementModel(Equity.DEFAULT_SETTLEMENT_DAYS, Equity.DEFAULT_SETTLEMENT_TIME)) # For margin accounts: security.set_settlement_model(ImmediateSettlementModel())
Margin Interest Rate
The ClearStreetBrokerageModel uses the NullMarginInterestRateModel.
Account Currency
The ClearStreetBrokerageModel doesn't set a default currency.
To change the algorithm's currency from USD to a different currency, see Set Account Currency.
