Lean  $LEAN_TAG$
Messages.Orders.Fees.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 using System.Runtime.CompilerServices;
17 
19 
20 using static QuantConnect.StringExtensions;
21 
22 namespace QuantConnect
23 {
24  /// <summary>
25  /// Provides user-facing message construction methods and static messages for the <see cref="Orders.Fees"/> namespace
26  /// </summary>
27  public static partial class Messages
28  {
29  /// <summary>
30  /// Provides user-facing messages for the <see cref="Orders.Fees.FeeModel"/> class and its consumers or related classes
31  /// </summary>
32  public static class FeeModel
33  {
34  [MethodImpl(MethodImplOptions.AggressiveInlining)]
35  public static string UnsupportedSecurityType(Securities.Security security)
36  {
37  return Invariant($"Unsupported security type: {security.Type}");
38  }
39  }
40 
41  /// <summary>
42  /// Provides user-facing messages for the <see cref="Orders.Fees.AlphaStreamsFeeModel"/> class and its consumers or related classes
43  /// </summary>
44  public static class AlphaStreamsFeeModel
45  {
46  [MethodImpl(MethodImplOptions.AggressiveInlining)]
47  public static string UnexpectedEquityMarket(string market)
48  {
49  return Invariant($"AlphaStreamsFeeModel(): unexpected equity Market {market}");
50  }
51  }
52 
53  /// <summary>
54  /// Provides user-facing messages for the <see cref="Orders.Fees.ExanteFeeModel"/> class and its consumers or related classes
55  /// </summary>
56  public static class ExanteFeeModel
57  {
58  [MethodImpl(MethodImplOptions.AggressiveInlining)]
59  public static string UnsupportedExchange(Orders.Order order)
60  {
61  return Invariant($"Unsupported exchange: ${order.Symbol.ID.Market}");
62  }
63  }
64 
65  /// <summary>
66  /// Provides user-facing messages for the <see cref="Orders.Fees.InteractiveBrokersFeeModel"/> class and its consumers or related classes
67  /// </summary>
68  public static class InteractiveBrokersFeeModel
69  {
70  [MethodImpl(MethodImplOptions.AggressiveInlining)]
71  public static string UnexpectedOptionMarket(string market)
72  {
73  return Invariant($"InteractiveBrokersFeeModel(): unexpected option Market {market}");
74  }
75 
76  [MethodImpl(MethodImplOptions.AggressiveInlining)]
77  public static string UnexpectedFutureMarket(string market)
78  {
79  return Invariant($"InteractiveBrokersFeeModel(): unexpected future Market {market}");
80  }
81 
82  [MethodImpl(MethodImplOptions.AggressiveInlining)]
83  public static string UnexpectedEquityMarket(string market)
84  {
85  return Invariant($"InteractiveBrokersFeeModel(): unexpected equity Market {market}");
86  }
87 
88  [MethodImpl(MethodImplOptions.AggressiveInlining)]
89  public static string UnitedStatesFutureFeesUnsupportedSecurityType(Securities.Security security)
90  {
91  return Invariant($"InteractiveBrokersFeeModel.UnitedStatesFutureFees(): Unsupported security type: {security.Type}");
92  }
93 
94  [MethodImpl(MethodImplOptions.AggressiveInlining)]
95  public static string HongKongFutureFeesUnexpectedQuoteCurrency(Securities.Security security)
96  {
97  return Invariant($"Unexpected quote currency {security.QuoteCurrency.Symbol} for Hong Kong futures exchange");
98  }
99  }
100 
101  /// <summary>
102  /// Provides user-facing messages for the <see cref="Orders.Fees.TDAmeritradeFeeModel"/> class and its consumers or related classes
103  /// </summary>
104  public static class TDAmeritradeFeeModel
105  {
106  [MethodImpl(MethodImplOptions.AggressiveInlining)]
107  public static string UnsupportedSecurityType(SecurityType securityType)
108  {
109  return $"TDAmeritradeFeeModel doesn't return correct fee model for SecurityType = {nameof(securityType)}";
110  }
111  }
112  }
113 }