Lean  $LEAN_TAG$
QuantConnect.Brokerages.Brokerage Class Referenceabstract

Represents the base Brokerage implementation. This provides logging on brokerage events. More...

Inheritance diagram for QuantConnect.Brokerages.Brokerage:
[legend]

Public Member Functions

abstract bool PlaceOrder (Order order)
 Places a new order and assigns a new broker ID to the order More...
 
abstract bool UpdateOrder (Order order)
 Updates the order with the same id More...
 
abstract bool CancelOrder (Order order)
 Cancels the order with the specified ID More...
 
abstract void Connect ()
 Connects the client to the broker's remote servers More...
 
abstract void Disconnect ()
 Disconnects the client from the broker's remote servers More...
 
virtual void Dispose ()
 Dispose of the brokerage instance More...
 
abstract List< OrderGetOpenOrders ()
 Gets all open orders on the account. NOTE: The order objects returned do not have QC order IDs. More...
 
abstract List< HoldingGetAccountHoldings ()
 Gets all holdings for the account More...
 
abstract List< CashAmountGetCashBalance ()
 Gets the current cash balance for each currency held in the brokerage account More...
 
virtual IEnumerable< BaseDataGetHistory (HistoryRequest request)
 Gets the history for the requested security More...
 
virtual bool ShouldPerformCashSync (DateTime currentTimeUtc)
 Returns whether the brokerage should perform the cash synchronization More...
 
virtual bool PerformCashSync (IAlgorithm algorithm, DateTime currentTimeUtc, Func< TimeSpan > getTimeSinceLastFill)
 Synchronizes the cashbook with the brokerage account More...
 

Public Attributes

virtual bool AccountInstantlyUpdated => false
 Specifies whether the brokerage will instantly update account balances More...
 
DateTime LastSyncDateTimeUtc => new DateTime(Interlocked.Read(ref _lastSyncTimeTicks))
 Gets the datetime of the last sync (UTC) More...
 

Protected Member Functions

 Brokerage (string name)
 Creates a new Brokerage instance with the specified name More...
 
virtual void OnOrderEvents (List< OrderEvent > orderEvents)
 Event invocator for the OrderFilled event More...
 
virtual void OnOrderEvent (OrderEvent e)
 Event invocator for the OrderFilled event More...
 
virtual void OnOrderUpdated (OrderUpdateEvent e)
 Event invocator for the OrderUpdated event More...
 
virtual void OnOrderIdChangedEvent (BrokerageOrderIdChangedEvent e)
 Event invocator for the OrderIdChanged event More...
 
virtual void OnOptionPositionAssigned (OrderEvent e)
 Event invocator for the OptionPositionAssigned event More...
 
virtual void OnOptionNotification (OptionNotificationEventArgs e)
 Event invocator for the OptionNotification event More...
 
virtual void OnNewBrokerageOrderNotification (NewBrokerageOrderNotificationEventArgs e)
 Event invocator for the NewBrokerageOrderNotification event More...
 
virtual void OnDelistingNotification (DelistingNotificationEventArgs e)
 Event invocator for the DelistingNotification event More...
 
virtual void OnAccountChanged (AccountEvent e)
 Event invocator for the AccountChanged event More...
 
virtual void OnMessage (BrokerageMessageEvent e)
 Event invocator for the Message event More...
 
virtual List< HoldingGetAccountHoldings (Dictionary< string, string > brokerageData, IEnumerable< Security > securities)
 Helper method that will try to get the live holdings from the provided brokerage data collection else will default to the algorithm state More...
 
virtual List< CashAmountGetCashBalance (Dictionary< string, string > brokerageData, CashBook cashBook)
 Helper method that will try to get the live cash balance from the provided brokerage data collection else will default to the algorithm state More...
 
virtual CrossZeroOrderResponse PlaceCrossZeroOrder (CrossZeroFirstOrderRequest crossZeroOrderRequest, bool isPlaceOrderWithLeanEvent=true)
 Places an order that crosses zero (transitions from a short position to a long position or vice versa) and returns the response. This method should be overridden in a derived class to implement brokerage-specific logic for placing such orders. More...
 
bool? TryCrossZeroPositionOrder (Order order, decimal holdingQuantity)
 Attempts to place an order that may cross the zero position. If the order needs to be split into two parts due to crossing zero, this method handles the split and placement accordingly. More...
 
bool TryGetUpdateCrossZeroOrderQuantity (Order leanOrder, out decimal quantity)
 Determines whether the given Lean order crosses zero quantity based on the initial order quantity. More...
 
bool TryGetOrRemoveCrossZeroOrder (string brokerageOrderId, OrderStatus leanOrderStatus, out Order leanOrder)
 Attempts to retrieve or remove a cross-zero order based on the brokerage order ID and its filled status. More...
 
bool TryHandleRemainingCrossZeroOrder (Order leanOrder, OrderEvent orderEvent)
 Attempts to handle any remaining orders that cross the zero boundary. More...
 

Static Protected Member Functions

static OrderPosition GetOrderPosition (OrderDirection orderDirection, decimal holdingsQuantity)
 Gets the position that might result given the specified order direction and the current holdings quantity. This is useful for brokerages that require more specific direction information than provided by the OrderDirection enum (e.g. Tradier differentiates Buy/Sell and BuyToOpen/BuyToCover/SellShort/SellToClose) More...
 

Protected Attributes

DateTime LastSyncDate => LastSyncDateTimeUtc.ConvertFromUtc(TimeZones.NewYork).Date
 Gets the date of the last sync (New York time zone) More...
 

Properties

string Name [get]
 Gets the name of the brokerage More...
 
abstract bool IsConnected [get]
 Returns true if we're currently connected to the broker More...
 
virtual string AccountBaseCurrency [get, protected set]
 Returns the brokerage account's base currency More...
 
ConcurrentDictionary< string, OrderLeanOrderByZeroCrossBrokerageOrderId = new() [get]
 A thread-safe dictionary that maps brokerage order IDs to their corresponding Order objects. More...
 
- Properties inherited from QuantConnect.Interfaces.IBrokerage
string Name [get]
 Gets the name of the brokerage More...
 
bool IsConnected [get]
 Returns true if we're currently connected to the broker More...
 
bool AccountInstantlyUpdated [get]
 Specifies whether the brokerage will instantly update account balances More...
 
string AccountBaseCurrency [get]
 Returns the brokerage account's base currency More...
 
- Properties inherited from QuantConnect.Interfaces.IBrokerageCashSynchronizer
DateTime LastSyncDateTimeUtc [get]
 Gets the datetime of the last sync (UTC) More...
 

Events

EventHandler< BrokerageOrderIdChangedEventOrderIdChanged
 Event that fires each time the brokerage order id changes More...
 
EventHandler< List< OrderEvent > > OrdersStatusChanged
 Event that fires each time the status for a list of orders change More...
 
EventHandler< OrderUpdateEventOrderUpdated
 Event that fires each time an order is updated in the brokerage side More...
 
EventHandler< OrderEventOptionPositionAssigned
 Event that fires each time a short option position is assigned More...
 
EventHandler< OptionNotificationEventArgsOptionNotification
 Event that fires each time an option position has changed More...
 
EventHandler< NewBrokerageOrderNotificationEventArgsNewBrokerageOrderNotification
 Event that fires each time there's a brokerage side generated order More...
 
EventHandler< DelistingNotificationEventArgsDelistingNotification
 Event that fires each time a delisting occurs More...
 
EventHandler< AccountEventAccountChanged
 Event that fires each time a user's brokerage account is changed More...
 
EventHandler< BrokerageMessageEventMessage
 Event that fires when an error is encountered in the brokerage More...
 
- Events inherited from QuantConnect.Interfaces.IBrokerage
EventHandler< BrokerageOrderIdChangedEventOrderIdChanged
 Event that fires each time the brokerage order id changes More...
 
EventHandler< List< OrderEvent > > OrdersStatusChanged
 Event that fires each time the status for a list of orders change More...
 
EventHandler< OrderUpdateEventOrderUpdated
 Event that fires each time an order is updated in the brokerage side More...
 
EventHandler< OrderEventOptionPositionAssigned
 Event that fires each time a short option position is assigned More...
 
EventHandler< OptionNotificationEventArgsOptionNotification
 Event that fires each time an option position has changed More...
 
EventHandler< NewBrokerageOrderNotificationEventArgsNewBrokerageOrderNotification
 Event that fires each time there's a brokerage side generated order More...
 
EventHandler< DelistingNotificationEventArgsDelistingNotification
 Event that fires each time a delisting occurs More...
 
EventHandler< AccountEventAccountChanged
 Event that fires each time a user's brokerage account is changed More...
 
EventHandler< BrokerageMessageEventMessage
 Event that fires when a message is received from the brokerage More...
 

Detailed Description

Represents the base Brokerage implementation. This provides logging on brokerage events.

Definition at line 36 of file Brokerage.cs.

Constructor & Destructor Documentation

◆ Brokerage()

QuantConnect.Brokerages.Brokerage.Brokerage ( string  name)
protected

Creates a new Brokerage instance with the specified name

Parameters
nameThe name of the brokerage

Definition at line 107 of file Brokerage.cs.

Member Function Documentation

◆ PlaceOrder()

abstract bool QuantConnect.Brokerages.Brokerage.PlaceOrder ( Order  order)
pure virtual

Places a new order and assigns a new broker ID to the order

Parameters
orderThe order to be placed
Returns
True if the request for a new order has been placed, false otherwise

Implements QuantConnect.Interfaces.IBrokerage.

Implemented in QuantConnect.Brokerages.Backtesting.BacktestingBrokerage.

◆ UpdateOrder()

abstract bool QuantConnect.Brokerages.Brokerage.UpdateOrder ( Order  order)
pure virtual

Updates the order with the same id

Parameters
orderThe new order information
Returns
True if the request was made for the order to be updated, false otherwise

Implements QuantConnect.Interfaces.IBrokerage.

Implemented in QuantConnect.Brokerages.Backtesting.BacktestingBrokerage.

◆ CancelOrder()

abstract bool QuantConnect.Brokerages.Brokerage.CancelOrder ( Order  order)
pure virtual

Cancels the order with the specified ID

Parameters
orderThe order to cancel
Returns
True if the request was made for the order to be canceled, false otherwise

Implements QuantConnect.Interfaces.IBrokerage.

Implemented in QuantConnect.Brokerages.Backtesting.BacktestingBrokerage.

◆ Connect()

abstract void QuantConnect.Brokerages.Brokerage.Connect ( )
pure virtual

◆ Disconnect()

abstract void QuantConnect.Brokerages.Brokerage.Disconnect ( )
pure virtual

Disconnects the client from the broker's remote servers

Implements QuantConnect.Interfaces.IBrokerage.

Implemented in QuantConnect.Brokerages.Backtesting.BacktestingBrokerage.

◆ Dispose()

virtual void QuantConnect.Brokerages.Brokerage.Dispose ( )
virtual

Dispose of the brokerage instance

Definition at line 146 of file Brokerage.cs.

◆ OnOrderEvents()

virtual void QuantConnect.Brokerages.Brokerage.OnOrderEvents ( List< OrderEvent orderEvents)
protectedvirtual

Event invocator for the OrderFilled event

Parameters
orderEventsThe list of order events

Reimplemented in QuantConnect.Brokerages.Backtesting.BacktestingBrokerage.

Definition at line 155 of file Brokerage.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnOrderEvent()

virtual void QuantConnect.Brokerages.Brokerage.OnOrderEvent ( OrderEvent  e)
protectedvirtual

Event invocator for the OrderFilled event

Parameters
eThe order event

Definition at line 171 of file Brokerage.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnOrderUpdated()

virtual void QuantConnect.Brokerages.Brokerage.OnOrderUpdated ( OrderUpdateEvent  e)
protectedvirtual

Event invocator for the OrderUpdated event

Parameters
eThe update event

Definition at line 180 of file Brokerage.cs.

Here is the call graph for this function:

◆ OnOrderIdChangedEvent()

virtual void QuantConnect.Brokerages.Brokerage.OnOrderIdChangedEvent ( BrokerageOrderIdChangedEvent  e)
protectedvirtual

Event invocator for the OrderIdChanged event

Parameters
eThe BrokerageOrderIdChangedEvent

Definition at line 196 of file Brokerage.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnOptionPositionAssigned()

virtual void QuantConnect.Brokerages.Brokerage.OnOptionPositionAssigned ( OrderEvent  e)
protectedvirtual

Event invocator for the OptionPositionAssigned event

Parameters
eThe OrderEvent

Definition at line 212 of file Brokerage.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnOptionNotification()

virtual void QuantConnect.Brokerages.Brokerage.OnOptionNotification ( OptionNotificationEventArgs  e)
protectedvirtual

Event invocator for the OptionNotification event

Parameters
eThe OptionNotification event arguments

Definition at line 230 of file Brokerage.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnNewBrokerageOrderNotification()

virtual void QuantConnect.Brokerages.Brokerage.OnNewBrokerageOrderNotification ( NewBrokerageOrderNotificationEventArgs  e)
protectedvirtual

Event invocator for the NewBrokerageOrderNotification event

Parameters
eThe NewBrokerageOrderNotification event arguments

Definition at line 248 of file Brokerage.cs.

Here is the call graph for this function:

◆ OnDelistingNotification()

virtual void QuantConnect.Brokerages.Brokerage.OnDelistingNotification ( DelistingNotificationEventArgs  e)
protectedvirtual

Event invocator for the DelistingNotification event

Parameters
eThe DelistingNotification event arguments

Definition at line 266 of file Brokerage.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnAccountChanged()

virtual void QuantConnect.Brokerages.Brokerage.OnAccountChanged ( AccountEvent  e)
protectedvirtual

Event invocator for the AccountChanged event

Parameters
eThe AccountEvent

Definition at line 284 of file Brokerage.cs.

Here is the call graph for this function:

◆ OnMessage()

virtual void QuantConnect.Brokerages.Brokerage.OnMessage ( BrokerageMessageEvent  e)
protectedvirtual

Event invocator for the Message event

Parameters
eThe error

Definition at line 302 of file Brokerage.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAccountHoldings() [1/2]

virtual List<Holding> QuantConnect.Brokerages.Brokerage.GetAccountHoldings ( Dictionary< string, string >  brokerageData,
IEnumerable< Security securities 
)
protectedvirtual

Helper method that will try to get the live holdings from the provided brokerage data collection else will default to the algorithm state

Holdings will removed from the provided collection on the first call, since this method is expected to be called only once on initialize, after which the algorithm should use Lean accounting

Definition at line 328 of file Brokerage.cs.

Here is the call graph for this function:

◆ GetCashBalance() [1/2]

virtual List<CashAmount> QuantConnect.Brokerages.Brokerage.GetCashBalance ( Dictionary< string, string >  brokerageData,
CashBook  cashBook 
)
protectedvirtual

Helper method that will try to get the live cash balance from the provided brokerage data collection else will default to the algorithm state

Cash balance will removed from the provided collection on the first call, since this method is expected to be called only once on initialize, after which the algorithm should use Lean accounting

Definition at line 357 of file Brokerage.cs.

Here is the call graph for this function:

◆ GetOpenOrders()

abstract List<Order> QuantConnect.Brokerages.Brokerage.GetOpenOrders ( )
pure virtual

Gets all open orders on the account. NOTE: The order objects returned do not have QC order IDs.

Returns
The open orders returned from IB

Implements QuantConnect.Interfaces.IBrokerage.

Implemented in QuantConnect.Brokerages.Backtesting.BacktestingBrokerage.

◆ GetAccountHoldings() [2/2]

abstract List<Holding> QuantConnect.Brokerages.Brokerage.GetAccountHoldings ( )
pure virtual

Gets all holdings for the account

Returns
The current holdings from the account

Implements QuantConnect.Interfaces.IBrokerage.

Implemented in QuantConnect.Brokerages.Backtesting.BacktestingBrokerage, and QuantConnect.Brokerages.Paper.PaperBrokerage.

◆ GetCashBalance() [2/2]

abstract List<CashAmount> QuantConnect.Brokerages.Brokerage.GetCashBalance ( )
pure virtual

Gets the current cash balance for each currency held in the brokerage account

Returns
The current cash balance for each currency available for trading

Implements QuantConnect.Interfaces.IBrokerage.

Implemented in QuantConnect.Brokerages.Backtesting.BacktestingBrokerage, and QuantConnect.Brokerages.Paper.PaperBrokerage.

Here is the caller graph for this function:

◆ GetHistory()

virtual IEnumerable<BaseData> QuantConnect.Brokerages.Brokerage.GetHistory ( HistoryRequest  request)
virtual

Gets the history for the requested security

Parameters
requestThe historical data request
Returns
An enumerable of bars covering the span specified in the request

Implements QuantConnect.Interfaces.IBrokerage.

Definition at line 413 of file Brokerage.cs.

◆ GetOrderPosition()

static OrderPosition QuantConnect.Brokerages.Brokerage.GetOrderPosition ( OrderDirection  orderDirection,
decimal  holdingsQuantity 
)
staticprotected

Gets the position that might result given the specified order direction and the current holdings quantity. This is useful for brokerages that require more specific direction information than provided by the OrderDirection enum (e.g. Tradier differentiates Buy/Sell and BuyToOpen/BuyToCover/SellShort/SellToClose)

Parameters
orderDirectionThe order direction
holdingsQuantityThe current holdings quantity
Returns
The order position

Definition at line 426 of file Brokerage.cs.

Here is the caller graph for this function:

◆ ShouldPerformCashSync()

virtual bool QuantConnect.Brokerages.Brokerage.ShouldPerformCashSync ( DateTime  currentTimeUtc)
virtual

Returns whether the brokerage should perform the cash synchronization

Parameters
currentTimeUtcThe current time (UTC)
Returns
True if the cash sync should be performed

Implements QuantConnect.Interfaces.IBrokerageCashSynchronizer.

Definition at line 453 of file Brokerage.cs.

◆ PerformCashSync()

virtual bool QuantConnect.Brokerages.Brokerage.PerformCashSync ( IAlgorithm  algorithm,
DateTime  currentTimeUtc,
Func< TimeSpan >  getTimeSinceLastFill 
)
virtual

Synchronizes the cashbook with the brokerage account

Parameters
algorithmThe algorithm instance
currentTimeUtcThe current time (UTC)
getTimeSinceLastFillA function which returns the time elapsed since the last fill
Returns
True if the cash sync was performed successfully

Implements QuantConnect.Interfaces.IBrokerageCashSynchronizer.

Definition at line 472 of file Brokerage.cs.

Here is the call graph for this function:

◆ PlaceCrossZeroOrder()

virtual CrossZeroOrderResponse QuantConnect.Brokerages.Brokerage.PlaceCrossZeroOrder ( CrossZeroFirstOrderRequest  crossZeroOrderRequest,
bool  isPlaceOrderWithLeanEvent = true 
)
protectedvirtual

Places an order that crosses zero (transitions from a short position to a long position or vice versa) and returns the response. This method should be overridden in a derived class to implement brokerage-specific logic for placing such orders.

Parameters
crossZeroOrderRequestThe request object containing details of the cross zero order to be placed.
isPlaceOrderWithLeanEventA boolean indicating whether the order should be placed with triggering a Lean event. Default is true, meaning Lean events will be triggered.
Returns
A CrossZeroOrderResponse object indicating the result of the order placement.
Exceptions
NotImplementedExceptionThrown if the method is not overridden in a derived class.

Definition at line 610 of file Brokerage.cs.

Here is the caller graph for this function:

◆ TryCrossZeroPositionOrder()

bool? QuantConnect.Brokerages.Brokerage.TryCrossZeroPositionOrder ( Order  order,
decimal  holdingQuantity 
)
protected

Attempts to place an order that may cross the zero position. If the order needs to be split into two parts due to crossing zero, this method handles the split and placement accordingly.

Parameters
orderThe order to be placed. Must not be null.
holdingQuantityThe current holding quantity of the order's symbol.
Returns
true if the order crosses zero and the first part was successfully placed;

false if the first part of the order could not be placed;

null if the order does not cross zero.

Exceptions
ArgumentNullExceptionThrown if order is null.

Definition at line 630 of file Brokerage.cs.

Here is the call graph for this function:

◆ TryGetUpdateCrossZeroOrderQuantity()

bool QuantConnect.Brokerages.Brokerage.TryGetUpdateCrossZeroOrderQuantity ( Order  leanOrder,
out decimal  quantity 
)
protected

Determines whether the given Lean order crosses zero quantity based on the initial order quantity.

Parameters
leanOrderThe Lean order to check.
quantityThe quantity to be updated based on whether the order crosses zero.
Returns
true if the Lean order does not cross zero quantity; otherwise, false.
Exceptions
ArgumentNullExceptionThrown when the leanOrder is null.

Definition at line 697 of file Brokerage.cs.

◆ TryGetOrRemoveCrossZeroOrder()

bool QuantConnect.Brokerages.Brokerage.TryGetOrRemoveCrossZeroOrder ( string  brokerageOrderId,
OrderStatus  leanOrderStatus,
out Order  leanOrder 
)
protected

Attempts to retrieve or remove a cross-zero order based on the brokerage order ID and its filled status.

Parameters
brokerageOrderIdThe unique identifier of the brokerage order.
leanOrderStatusThe updated status of the order received from the brokerage
leanOrderWhen this method returns, contains the Order object associated with the given brokerage order ID, if the operation was successful; otherwise, null. This parameter is passed uninitialized.
Returns
true if the method successfully retrieves or removes the order; otherwise, false.

The method locks on a private object to ensure thread safety while accessing the collection of orders. If the order is filled, it is removed from the collection. If the order is partially filled, it is retrieved but not removed. If the order is not found, the method returns false.

Definition at line 741 of file Brokerage.cs.

◆ TryHandleRemainingCrossZeroOrder()

bool QuantConnect.Brokerages.Brokerage.TryHandleRemainingCrossZeroOrder ( Order  leanOrder,
OrderEvent  orderEvent 
)
protected

Attempts to handle any remaining orders that cross the zero boundary.

Parameters
leanOrderThe order object that needs to be processed.
orderEventThe event object containing order event details.

Definition at line 767 of file Brokerage.cs.

Here is the call graph for this function:

Member Data Documentation

◆ AccountInstantlyUpdated

virtual bool QuantConnect.Brokerages.Brokerage.AccountInstantlyUpdated => false

Specifies whether the brokerage will instantly update account balances

Definition at line 401 of file Brokerage.cs.

◆ LastSyncDate

DateTime QuantConnect.Brokerages.Brokerage.LastSyncDate => LastSyncDateTimeUtc.ConvertFromUtc(TimeZones.NewYork).Date
protected

Gets the date of the last sync (New York time zone)

Definition at line 441 of file Brokerage.cs.

◆ LastSyncDateTimeUtc

DateTime QuantConnect.Brokerages.Brokerage.LastSyncDateTimeUtc => new DateTime(Interlocked.Read(ref _lastSyncTimeTicks))

Gets the datetime of the last sync (UTC)

Definition at line 446 of file Brokerage.cs.

Property Documentation

◆ Name

string QuantConnect.Brokerages.Brokerage.Name
get

Gets the name of the brokerage

Definition at line 96 of file Brokerage.cs.

◆ IsConnected

abstract bool QuantConnect.Brokerages.Brokerage.IsConnected
get

Returns true if we're currently connected to the broker

Definition at line 101 of file Brokerage.cs.

◆ AccountBaseCurrency

virtual string QuantConnect.Brokerages.Brokerage.AccountBaseCurrency
getprotected set

Returns the brokerage account's base currency

Definition at line 406 of file Brokerage.cs.

◆ LeanOrderByZeroCrossBrokerageOrderId

ConcurrentDictionary<string, Order> QuantConnect.Brokerages.Brokerage.LeanOrderByZeroCrossBrokerageOrderId = new()
getprotected

A thread-safe dictionary that maps brokerage order IDs to their corresponding Order objects.

This ConcurrentDictionary is used to maintain a mapping between Zero Cross brokerage order IDs and Lean Order objects. The dictionary is protected and read-only, ensuring that it can only be modified by the class that declares it and cannot be assigned a new instance after initialization.

Definition at line 593 of file Brokerage.cs.

Event Documentation

◆ OrderIdChanged

EventHandler<BrokerageOrderIdChangedEvent> QuantConnect.Brokerages.Brokerage.OrderIdChanged

Event that fires each time the brokerage order id changes

Definition at line 48 of file Brokerage.cs.

◆ OrdersStatusChanged

EventHandler<List<OrderEvent> > QuantConnect.Brokerages.Brokerage.OrdersStatusChanged

Event that fires each time the status for a list of orders change

Definition at line 53 of file Brokerage.cs.

◆ OrderUpdated

EventHandler<OrderUpdateEvent> QuantConnect.Brokerages.Brokerage.OrderUpdated

Event that fires each time an order is updated in the brokerage side

These are not status changes but mainly price changes, like the stop price of a trailing stop order

Definition at line 61 of file Brokerage.cs.

◆ OptionPositionAssigned

EventHandler<OrderEvent> QuantConnect.Brokerages.Brokerage.OptionPositionAssigned

Event that fires each time a short option position is assigned

Definition at line 66 of file Brokerage.cs.

◆ OptionNotification

EventHandler<OptionNotificationEventArgs> QuantConnect.Brokerages.Brokerage.OptionNotification

Event that fires each time an option position has changed

Definition at line 71 of file Brokerage.cs.

◆ NewBrokerageOrderNotification

EventHandler<NewBrokerageOrderNotificationEventArgs> QuantConnect.Brokerages.Brokerage.NewBrokerageOrderNotification

Event that fires each time there's a brokerage side generated order

Definition at line 76 of file Brokerage.cs.

◆ DelistingNotification

EventHandler<DelistingNotificationEventArgs> QuantConnect.Brokerages.Brokerage.DelistingNotification

Event that fires each time a delisting occurs

Definition at line 81 of file Brokerage.cs.

◆ AccountChanged

EventHandler<AccountEvent> QuantConnect.Brokerages.Brokerage.AccountChanged

Event that fires each time a user's brokerage account is changed

Definition at line 86 of file Brokerage.cs.

◆ Message

EventHandler<BrokerageMessageEvent> QuantConnect.Brokerages.Brokerage.Message

Event that fires when an error is encountered in the brokerage

Definition at line 91 of file Brokerage.cs.


The documentation for this class was generated from the following file: