add display_symbol and get_all_display_symbol method bones (taha will impl)

This commit is contained in:
John Colvin committed 2020-06-23 15:48:47 -05:00
1 parent 5905ca3e92
commit f55dbdd088
2 files changed
+18 -1

No files matched your search

@@ -11,5 +11,8 @@ namespace bts.api {
default: return SecurityType.Unset;
}
}
public static string display_symbol(this SecurityImmutable security) =>
SecurityHelper.get_display_symbol(security);
}
}
@@ -1,10 +1,24 @@
using System;
using mbts.co2;
using System;
using System.Collections.Generic;
using System.Linq;
using static bts.api.Security;
namespace bts.api {
internal static class SecurityHelper {
public static IEnumerable<string> get_all_display_symbols() =>
get_all_display_symbols(UserSymbol.get_all().Select(usym => usym.symbol));
public static IEnumerable<string> get_all_display_symbols(IEnumerable<string> system_symbols) {
// todo: actual impl
return system_symbols;
}
public static string get_display_symbol(SecurityImmutable security) {
// todo: actual impl
return security.Symbol;
}
public static IEnumerable<FutureLeg> get_flat_future_legs(SecurityImmutable sec) {
switch (sec.ContractCase) {
case ContractOneofCase.Spread: return _get_flat_future_legs(sec.Spread.Legs, 1);