Lean  $LEAN_TAG$
OrderResponseErrorCode.cs
1 /*
2  * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
3  * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14 */
15 
16 namespace QuantConnect.Orders
17 {
18  /// <summary>
19  /// Error detail code
20  /// </summary>
22  {
23  /// <summary>
24  /// No error (0)
25  /// </summary>
26  None = 0,
27 
28  /// <summary>
29  /// Unknown error (-1)
30  /// </summary>
31  ProcessingError = -1,
32 
33  /// <summary>
34  /// Cannot submit because order already exists (-2)
35  /// </summary>
36  OrderAlreadyExists = -2,
37 
38  /// <summary>
39  /// Not enough money to to submit order (-3)
40  /// </summary>
42 
43  /// <summary>
44  /// Internal logic invalidated submit order (-4)
45  /// </summary>
47 
48  /// <summary>
49  /// Brokerage submit error (-5)
50  /// </summary>
52 
53  /// <summary>
54  /// Brokerage update error (-6)
55  /// </summary>
57 
58  /// <summary>
59  /// Internal logic invalidated update order (-7)
60  /// </summary>
62 
63  /// <summary>
64  /// Brokerage cancel error (-8)
65  /// </summary>
67 
68  /// <summary>
69  /// Only pending orders can be canceled (-9)
70  /// </summary>
71  InvalidOrderStatus = -9,
72 
73  /// <summary>
74  /// Missing order (-10)
75  /// </summary>
76  UnableToFindOrder = -10,
77 
78  /// <summary>
79  /// Cannot submit or update orders with zero quantity (-11)
80  /// </summary>
81  OrderQuantityZero = -11,
82 
83  /// <summary>
84  /// This type of request is unsupported (-12)
85  /// </summary>
87 
88  /// <summary>
89  /// Unknown error during pre order request validation (-13)
90  /// </summary>
91  PreOrderChecksError = -13,
92 
93  /// <summary>
94  /// Security is missing. Probably did not subscribe (-14)
95  /// </summary>
96  MissingSecurity = -14,
97 
98  /// <summary>
99  /// Some order types require open exchange (-15)
100  /// </summary>
101  ExchangeNotOpen = -15,
102 
103  /// <summary>
104  /// Zero security price is probably due to bad data (-16)
105  /// </summary>
106  SecurityPriceZero = -16,
107 
108  /// <summary>
109  /// Need both currencies in cashbook to trade a pair (-17)
110  /// </summary>
112 
113  /// <summary>
114  /// Need conversion rate to account currency (-18)
115  /// </summary>
117 
118  /// <summary>
119  /// Should not attempt trading without at least one data point (-19)
120  /// </summary>
121  SecurityHasNoData = -19,
122 
123  /// <summary>
124  /// Transaction manager's cache is full (-20)
125  /// </summary>
126  ExceededMaximumOrders = -20,
127 
128  /// <summary>
129  /// Below buffer time for MOC order to be placed before exchange closes. 15.5 minutes by default (-21)
130  /// </summary>
132 
133  /// <summary>
134  /// Request is invalid or null (-22)
135  /// </summary>
136  InvalidRequest = -22,
137 
138  /// <summary>
139  /// Request was canceled by user (-23)
140  /// </summary>
141  RequestCanceled = -23,
142 
143  /// <summary>
144  /// All orders are invalidated while algorithm is warming up (-24)
145  /// </summary>
146  AlgorithmWarmingUp = -24,
147 
148  /// <summary>
149  /// Internal logic invalidated update order (-25)
150  /// </summary>
152 
153  /// <summary>
154  /// Need quote currency in cashbook to trade (-26)
155  /// </summary>
156  QuoteCurrencyRequired = -26,
157 
158  /// <summary>
159  /// Need conversion rate to account currency (-27)
160  /// </summary>
161  ConversionRateZero = -27,
162 
163  /// <summary>
164  /// The order's symbol references a non-tradable security (-28)
165  /// </summary>
166  NonTradableSecurity = -28,
167 
168  /// <summary>
169  /// The order's symbol references a non-exercisable security (-29)
170  /// </summary>
172 
173  /// <summary>
174  /// Cannot submit or update orders with quantity that is less than lot size (-30)
175  /// </summary>
177 
178  /// <summary>
179  /// The order's quantity exceeds the max shortable quantity set by the brokerage (-31)
180  /// </summary>
182 
183  /// <summary>
184  /// Cannot update/cancel orders with OrderStatus.New (-32)
185  /// </summary>
186  InvalidNewOrderStatus = -32,
187 
188  /// <summary>
189  /// Exercise time before expiry for European options (-33)
190  /// </summary>
192 
193  /// <summary>
194  /// Option order is invalid due to underlying stock split (-34)
195  /// </summary>
197  }
198 }