/* * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ namespace QuantConnect.Orders { /// /// Type of the order: market, limit or stop /// public enum OrderType { /// /// Market Order Type (0) /// Market, /// /// Limit Order Type (1) /// Limit, /// /// Stop Market Order Type - Fill at market price when break target price (2) /// StopMarket, /// /// Stop limit order type - trigger fill once pass the stop price; but limit fill to limit price (3) /// StopLimit, /// /// Market on open type - executed on exchange open (4) /// MarketOnOpen, /// /// Market on close type - executed on exchange close (5) /// MarketOnClose, /// /// Option Exercise Order Type (6) /// OptionExercise, /// /// Limit if Touched Order Type - a limit order to be placed after first reaching a trigger value (7) /// LimitIfTouched, /// /// Combo Market Order Type - (8) /// ComboMarket, /// /// Combo Limit Order Type - (9) /// ComboLimit, /// /// Combo Leg Limit Order Type - (10) /// ComboLegLimit, /// /// Trailing Stop Order Type - (11) /// TrailingStop } /// /// Direction of the order /// public enum OrderDirection { /// /// Buy Order (0) /// Buy, /// /// Sell Order (1) /// Sell, /// /// Default Value - No Order Direction (2) /// /// /// Unfortunately this does not have a value of zero because /// there are backtests saved that reference the values in this order /// Hold } /// /// Position of the order /// public enum OrderPosition { /// /// Indicates the buy order will result in a long position, starting either from zero or an existing long position (0) /// BuyToOpen, /// /// Indicates the buy order is starting from an existing short position, resulting in a closed or long position (1) /// BuyToClose, /// /// Indicates the sell order will result in a short position, starting either from zero or an existing short position (2) /// SellToOpen, /// /// Indicates the sell order is starting from an existing long position, resulting in a closed or short position (3) /// SellToClose, } /// /// Fill status of the order class. /// public enum OrderStatus { /// /// New order pre-submission to the order processor (0) /// New = 0, /// /// Order submitted to the market (1) /// Submitted = 1, /// /// Partially filled, In Market Order (2) /// PartiallyFilled = 2, /// /// Completed, Filled, In Market Order (3) /// Filled = 3, /// /// Order cancelled before it was filled (5) /// Canceled = 5, /// /// No Order State Yet (6) /// None = 6, /// /// Order invalidated before it hit the market (e.g. insufficient capital) (7) /// Invalid = 7, /// /// Order waiting for confirmation of cancellation (8) /// CancelPending = 8, /// /// Order update submitted to the market (9) /// UpdateSubmitted = 9 } }