book
Checkout our new book! Hands on AI Trading with Python, QuantConnect, and AWS Learn More arrow

Supported Models

SSC Eze

Introduction

This page explains the EzeBrokerageModel, including the asset classes it supports, its default security-level models, and its default markets.

SetBrokerageModel(BrokerageName.Eze, AccountType.Margin);
self.set_brokerage_model(BrokerageName.EZE, AccountType.MARGIN)

To view the implementation of this model, see the LEAN GitHub repository.

Asset Classes

The EzeBrokerageModel supports the following asset classes:

Orders

The EzeBrokerageModel 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 EzeBrokerageModel supports:

Order TypeEquityEquity OptionsFuturesFuture OptionsIndex Options
Marketgreen checkgreen checkgreen checkgreen checkgreen check
Limitgreen checkgreen checkgreen checkgreen checkgreen check
Stop marketgreen checkgreen checkgreen checkgreen checkgreen check
Stop limitgreen checkgreen checkgreen checkgreen checkgreen check
Market on Opengreen check
Market on Closegreen check

Order Properties

The EzeBrokerageModel supports custom order properties. The following table describes the members of the EzeOrderProperties object that you can set to customize order execution.

PropertyData TypeDescriptionDefault Value
TimeInForcetime_in_forceTimeInForceA TimeInForce instruction to apply to the order. The following instructions are supported:
  • DayDAY
  • GoodTilCanceledGOOD_TIL_CANCELED
  • GoodTilDategood_til_date
TimeInForce.GoodTilCanceledTimeInForce.GOOD_TIL_CANCELED
RouteroutestringstrSets the route name as shown in SS&C Eze EMS.
AccountaccountstringstrSets a semi-colon separated list of trade or neutral accounts the user has permission for, e.g., "TAL;TEST;USER1;TRADE" or "TAL;TEST;USER2;NEUTRAL".
NotesnotesstringstrSets the user message or notes.
public override void Initialize()
{
    // Set the default order properties
    DefaultOrderProperties = new EzeOrderProperties
    {
        TimeInForce = TimeInForce.GoodTilCanceled,
        Notes = "Default order properties"
    };
}

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 EzeOrderProperties
               { 
                   TimeInForce = TimeInForce.Day,
                   Notes = "Default order properties"
               });
}
def initialize(self) -> None:
    # Set the default order properties
    self.default_order_properties = EzeOrderProperties()
    self.default_order_properties.time_in_force = TimeInForce.GOOD_TIL_CANCELED
    self.default_order_properties.notes = "Default order properties"

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 = EzeOrderProperties()
    order_properties.time_in_force = TimeInForce.DAY
    order_properties.notes = "Default order properties"
    self.limit_order(self._symbol, quantity, limit_price, order_properties=order_properties)

Updates

The EzeBrokerageModel 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 following table shows the fill model that the EzeBrokerageModel uses for each SecurityType:

SecurityTypeFill Model
EquityEquityFillModel
FutureFutureFillModel
FutureOptionFutureOptionFillModel
Remaining SecurityType valuesImmediateFillModel

Slippage

The EzeBrokerageModel uses the NullSlippageModel.

Fees

The EzeBrokerageModel uses the EzeFeeModel which extends the ConstantFeeModel with with zero as fee for all assets.

Buying Power

The EzeBrokerageModel sets the buying power model based on the asset class of the security. The following table shows the default buying power model of each asset class:

Asset ClassModel
EquitiesSecurityMarginModel
FuturesFutureMarginModel
All Options TypesOptionMarginModel

If you have a margin account, the EzeBrokerageModel allows 2x leverage for Equities. The remaining asset classes are derivatives.

Settlement

The following table shows which settlement model the EzeBrokerageModel uses based on the security type and your account type:

Security TypeAccount TypeSettlement Model
EquityCashDelayedSettlementModel with the default settlement rules
OptionCashDelayedSettlementModel with the default settlement rules
FutureAnyFutureSettlementModel

For all other cases, the EzeBrokerageModel uses the ImmediateSettlementModel.

// For US Equities with a cash account:
security.SetSettlementModel(new DelayedSettlementModel(Equity.DefaultSettlementDays, Equity.DefaultSettlementTime));

// For Equity Options with a cash account:
security.SetSettlementModel(new DelayedSettlementModel(Option.DefaultSettlementDays, Option.DefaultSettlementTime));

// For Futures
security.SetSettlementModel(new FutureSettlementModel());

// For remaining cases:
security.SetSettlementModel(new ImmediateSettlementModel());
# For US Equities with a cash account:
security.set_settlement_model(DelayedSettlementModel(Equity.DEFAULT_SETTLEMENT_DAYS, Equity.DEFAULT_SETTLEMENT_TIME))

# For Equity Options with a cash account:
security.set_settlement_model(DelayedSettlementModel(Option.DEFAULT_SETTLEMENT_DAYS, Option.DEFAULT_SETTLEMENT_TIME))

# For Futures
security.set_settlement_model(FutureSettlementModel())

# For remaining cases:
security.set_settlement_model(ImmediateSettlementModel())

Margin Interest Rate

The EzeBrokerageModel uses the NullMarginInterestRateModel.

Default Markets

The following table describes the default markets of each SecurityType for the EzeBrokerageModel:

SecurityTypeMarket
EquityUSA
OptionUSA
FutureCME
FutureOptionCME
IndexUSA
IndexOptionUSA

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: