Supported Models

Webull

Introduction

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

SetBrokerageModel(BrokerageName.Webull, AccountType.Cash);
SetBrokerageModel(BrokerageName.Webull, AccountType.Margin);
self.set_brokerage_model(BrokerageName.WEBULL, AccountType.CASH)
self.set_brokerage_model(BrokerageName.WEBULL, 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.

Asset Classes

The WebullBrokerageModel supports the following asset classes:

Orders

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

Order TypeEquityEquity OptionsIndex Options
Marketgreen checkgreen checkgreen check
Limitgreen checkgreen checkgreen check
Stop marketgreen checkgreen checkgreen check
Stop limitgreen checkgreen checkgreen check
Trailing stopgreen check

Order Properties

The WebullBrokerageModel supports custom order properties. The following table describes the members of the WebullOrderProperties 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
Market orders support only DayDAY, which the brokerage sets automatically. Option and Index Option sell orders also support only DayDAY.
TimeInForce.GoodTilCanceledTimeInForce.GOOD_TIL_CANCELED
OutsideRegularTradingHoursoutside_regular_trading_hoursboolIf set to true, allows orders to also trigger or fill outside of regular trading hours. This property applies to Equity orders only and isn't supported for market orders.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 WebullOrderProperties
               {
                   TimeInForce = TimeInForce.Day,
                   OutsideRegularTradingHours = true
               });
}
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 = WebullOrderProperties()
    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)

Updates

The WebullBrokerageModel 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 WebullBrokerageModel uses the EquityFillModel for Equity trades and the ImmediateFillModel for Equity Options and Index Options trades.

Slippage

The WebullBrokerageModel uses the NullSlippageModel.

Fees

The WebullBrokerageModel uses the WebullFeeModel.

Buying Power

The WebullBrokerageModel uses the SecurityMarginModel. If you have a margin account, the WebullBrokerageModel allows up to 2x leverage.

Settlement

The WebullBrokerageModel 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 WebullBrokerageModel uses the NullMarginInterestRateModel.

Default Markets

The default market of the WebullBrokerageModel is Market.USA.

Account Currency

The WebullBrokerageModel doesn't set a default currency. To change the algorithm's currency from USD to a different currency, see Set Account Currency.

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: