Lean  $LEAN_TAG$
KrakenOrderProperties.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 
17 namespace QuantConnect.Orders
18 {
19  /// <summary>
20  /// Kraken order properties
21  /// </summary>
23  {
24  private bool _feeInQuote;
25  private bool _feeInBase;
26 
27  /// <summary>
28  /// Post-only order (available when ordertype = limit)
29  /// </summary>
30  public bool PostOnly { get; set; }
31 
32  /// <summary>
33  /// If true or by default when selling, fees will be charged in base currency. If false will be ignored. Mutually exclusive with FeeInQuote.
34  /// </summary>
35  /// <remarks>See (https://support.kraken.com/hc/en-us/articles/202966956#howclosingtransactionswork) for more information about the currency selection.</remarks>
36  public bool FeeInBase
37  {
38  get
39  {
40  return _feeInBase;
41  }
42  set
43  {
44  if (value)
45  {
46  _feeInBase = value;
47  _feeInQuote = !_feeInBase;
48  }
49  }
50  }
51 
52  /// <summary>
53  /// If true or by default when buying, fees will be charged in quote currency. If false will be ignored. Mutually exclusive with FeeInBase.
54  /// </summary>
55  /// <remarks>See (https://support.kraken.com/hc/en-us/articles/202966956#howclosingtransactionswork) for more information about the currency selection.</remarks>
56  public bool FeeInQuote
57  {
58  get
59  {
60  return _feeInQuote;
61  }
62  set
63  {
64  if (value)
65  {
66  _feeInQuote = value;
67  _feeInBase = !_feeInQuote;
68  }
69  }
70  }
71 
72  /// <summary>
73  /// https://support.kraken.com/hc/en-us/articles/201648183-Market-Price-Protection
74  /// </summary>
75  public bool NoMarketPriceProtection { get; set; }
76 
77  /// <summary>
78  /// Conditional close orders are triggered by execution of the primary order in the same quantity and opposite direction. Ordertypes can be the same with primary order.
79  /// </summary>
80  public Order ConditionalOrder { get; set; }
81  }
82 }