17 using Newtonsoft.Json;
19 using Newtonsoft.Json.Converters;
20 using System.Runtime.Serialization;
21 using System.Runtime.CompilerServices;
37 public static string JsonFormat {
get; } =
"yyyy-MM-ddTHH:mm:ss";
39 public const string DB =
"yyyy-MM-dd HH:mm:ss";
41 public const string UI =
"yyyy-MM-dd HH:mm:ss";
43 public const string USShort =
"M/d/yy h:mm tt";
47 public const string US =
"M/d/yyyy h:mm:ss tt";
51 public const string Forex =
"yyyyMMdd HH:mm:ss.ffff";
53 public const string FIX =
"yyyyMMdd-HH:mm:ss";
67 [JsonProperty(PropertyName =
"symbol")]
71 [JsonProperty(PropertyName =
"type")]
75 [JsonProperty(PropertyName =
"currencySymbol")]
79 [JsonProperty(PropertyName =
"averagePrice", DefaultValueHandling = DefaultValueHandling.Ignore)]
83 [JsonProperty(PropertyName =
"quantity", DefaultValueHandling = DefaultValueHandling.Ignore)]
87 [JsonProperty(PropertyName =
"marketPrice", DefaultValueHandling = DefaultValueHandling.Ignore)]
91 [JsonProperty(PropertyName =
"conversionRate", DefaultValueHandling = DefaultValueHandling.Ignore)]
95 [JsonProperty(PropertyName =
"marketValue", DefaultValueHandling = DefaultValueHandling.Ignore)]
99 [JsonProperty(PropertyName =
"unrealizedPnl", DefaultValueHandling = DefaultValueHandling.Ignore)]
103 [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
129 AveragePrice = Math.Round(holding.AveragePrice, rounding);
167 [JsonConverter(typeof(StringEnumConverter))]
173 [EnumMember(Value =
"live")]
179 [EnumMember(Value =
"paper")]
186 [JsonConverter(typeof(StringEnumConverter))]
192 [EnumMember(Value =
"C#")]
198 [EnumMember(Value =
"F#")]
204 [EnumMember(Value =
"VB")]
210 [EnumMember(Value =
"Ja")]
216 [EnumMember(Value =
"Py")]
765 [MethodImpl(MethodImplOptions.AggressiveInlining)]
770 return exchange.GetPrimaryExchange(securityType, market).Code;
777 [MethodImpl(MethodImplOptions.AggressiveInlining)]
783 if (
string.IsNullOrEmpty(exchange))
785 return primaryExchange;
790 switch (exchange.LazyToUpper())
883 switch (exchange.LazyToUpper())
928 case "MIAX SAPPHIRE":
929 case "MIAX_SAPPHIRE":
937 switch (exchange.LazyToUpper())
971 public const string Vacated =
"channel_vacated";
982 [JsonConverter(typeof(StringEnumConverter))]
1004 [JsonConverter(typeof(StringEnumConverter))]