|
Lean
$LEAN_TAG$
|
Brokerage interface that defines the operations all brokerages must implement. The IBrokerage implementation must have a matching IBrokerageFactory implementation. More...
Public Member Functions | |
| List< Order > | GetOpenOrders () |
| Gets all open orders on the account More... | |
| List< Holding > | GetAccountHoldings () |
| Gets all holdings for the account More... | |
| List< CashAmount > | GetCashBalance () |
| Gets the current cash balance for each currency held in the brokerage account More... | |
| bool | PlaceOrder (Order order) |
| Places a new order and assigns a new broker ID to the order More... | |
| bool | UpdateOrder (Order order) |
| Updates the order with the same id More... | |
| bool | CancelOrder (Order order) |
| Cancels the order with the specified ID More... | |
| void | Connect () |
| Connects the client to the broker's remote servers More... | |
| void | Disconnect () |
| Disconnects the client from the broker's remote servers More... | |
| IEnumerable< BaseData > | GetHistory (HistoryRequest request) |
| Gets the history for the requested security More... | |
Public Member Functions inherited from QuantConnect.Interfaces.IBrokerageCashSynchronizer | |
| bool | ShouldPerformCashSync (DateTime currentTimeUtc) |
| Returns whether the brokerage should perform the cash synchronization More... | |
| bool | PerformCashSync (IAlgorithm algorithm, DateTime currentTimeUtc, Func< TimeSpan > getTimeSinceLastFill) |
| Synchronizes the cashbook with the brokerage account More... | |
Properties | |
| 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< BrokerageOrderIdChangedEvent > | OrderIdChanged |
| 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< OrderUpdateEvent > | OrderUpdated |
| Event that fires each time an order is updated in the brokerage side More... | |
| EventHandler< OrderEvent > | OptionPositionAssigned |
| Event that fires each time a short option position is assigned More... | |
| EventHandler< OptionNotificationEventArgs > | OptionNotification |
| Event that fires each time an option position has changed More... | |
| EventHandler< NewBrokerageOrderNotificationEventArgs > | NewBrokerageOrderNotification |
| Event that fires each time there's a brokerage side generated order More... | |
| EventHandler< DelistingNotificationEventArgs > | DelistingNotification |
| Event that fires each time a delisting occurs More... | |
| EventHandler< AccountEvent > | AccountChanged |
| Event that fires each time a user's brokerage account is changed More... | |
| EventHandler< BrokerageMessageEvent > | Message |
| Event that fires when a message is received from the brokerage More... | |
Brokerage interface that defines the operations all brokerages must implement. The IBrokerage implementation must have a matching IBrokerageFactory implementation.
Definition at line 29 of file IBrokerage.cs.
| List<Order> QuantConnect.Interfaces.IBrokerage.GetOpenOrders | ( | ) |
Gets all open orders on the account
Implemented in QuantConnect.Brokerages.Brokerage, and QuantConnect.Brokerages.Backtesting.BacktestingBrokerage.
| List<Holding> QuantConnect.Interfaces.IBrokerage.GetAccountHoldings | ( | ) |
Gets all holdings for the account
Implemented in QuantConnect.Brokerages.Brokerage, QuantConnect.Brokerages.Backtesting.BacktestingBrokerage, and QuantConnect.Brokerages.Paper.PaperBrokerage.
| List<CashAmount> QuantConnect.Interfaces.IBrokerage.GetCashBalance | ( | ) |
Gets the current cash balance for each currency held in the brokerage account
Implemented in QuantConnect.Brokerages.Brokerage, QuantConnect.Brokerages.Backtesting.BacktestingBrokerage, and QuantConnect.Brokerages.Paper.PaperBrokerage.
| bool QuantConnect.Interfaces.IBrokerage.PlaceOrder | ( | Order | order | ) |
Places a new order and assigns a new broker ID to the order
| order | The order to be placed |
Implemented in QuantConnect.Brokerages.Backtesting.BacktestingBrokerage, and QuantConnect.Brokerages.Brokerage.
| bool QuantConnect.Interfaces.IBrokerage.UpdateOrder | ( | Order | order | ) |
Updates the order with the same id
| order | The new order information |
Implemented in QuantConnect.Brokerages.Backtesting.BacktestingBrokerage, and QuantConnect.Brokerages.Brokerage.
| bool QuantConnect.Interfaces.IBrokerage.CancelOrder | ( | Order | order | ) |
Cancels the order with the specified ID
| order | The order to cancel |
Implemented in QuantConnect.Brokerages.Backtesting.BacktestingBrokerage, and QuantConnect.Brokerages.Brokerage.
| void QuantConnect.Interfaces.IBrokerage.Connect | ( | ) |
Connects the client to the broker's remote servers
Implemented in QuantConnect.Brokerages.Backtesting.BacktestingBrokerage, QuantConnect.Brokerages.Brokerage, and QuantConnect.Brokerages.BaseWebsocketsBrokerage.
| void QuantConnect.Interfaces.IBrokerage.Disconnect | ( | ) |
Disconnects the client from the broker's remote servers
Implemented in QuantConnect.Brokerages.Backtesting.BacktestingBrokerage, and QuantConnect.Brokerages.Brokerage.
| IEnumerable<BaseData> QuantConnect.Interfaces.IBrokerage.GetHistory | ( | HistoryRequest | request | ) |
Gets the history for the requested security
| request | The historical data request |
Implemented in QuantConnect.Brokerages.Brokerage.
|
get |
Gets the name of the brokerage
Definition at line 83 of file IBrokerage.cs.
|
get |
Returns true if we're currently connected to the broker
Definition at line 88 of file IBrokerage.cs.
|
get |
Specifies whether the brokerage will instantly update account balances
Definition at line 142 of file IBrokerage.cs.
|
get |
Returns the brokerage account's base currency
Definition at line 147 of file IBrokerage.cs.
| EventHandler<BrokerageOrderIdChangedEvent> QuantConnect.Interfaces.IBrokerage.OrderIdChanged |
Event that fires each time the brokerage order id changes
Definition at line 34 of file IBrokerage.cs.
| EventHandler<List<OrderEvent> > QuantConnect.Interfaces.IBrokerage.OrdersStatusChanged |
Event that fires each time the status for a list of orders change
Definition at line 39 of file IBrokerage.cs.
| EventHandler<OrderUpdateEvent> QuantConnect.Interfaces.IBrokerage.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 47 of file IBrokerage.cs.
| EventHandler<OrderEvent> QuantConnect.Interfaces.IBrokerage.OptionPositionAssigned |
Event that fires each time a short option position is assigned
Definition at line 52 of file IBrokerage.cs.
| EventHandler<OptionNotificationEventArgs> QuantConnect.Interfaces.IBrokerage.OptionNotification |
Event that fires each time an option position has changed
Definition at line 57 of file IBrokerage.cs.
| EventHandler<NewBrokerageOrderNotificationEventArgs> QuantConnect.Interfaces.IBrokerage.NewBrokerageOrderNotification |
Event that fires each time there's a brokerage side generated order
Definition at line 62 of file IBrokerage.cs.
| EventHandler<DelistingNotificationEventArgs> QuantConnect.Interfaces.IBrokerage.DelistingNotification |
Event that fires each time a delisting occurs
TODO: Wire brokerages to call this event to process delistings
Definition at line 68 of file IBrokerage.cs.
| EventHandler<AccountEvent> QuantConnect.Interfaces.IBrokerage.AccountChanged |
Event that fires each time a user's brokerage account is changed
Definition at line 73 of file IBrokerage.cs.
| EventHandler<BrokerageMessageEvent> QuantConnect.Interfaces.IBrokerage.Message |
Event that fires when a message is received from the brokerage
Definition at line 78 of file IBrokerage.cs.