cleanup: Remove redundant type VolSurfaceSymbolStructure
There is an identical type (in terms of prop types and corresponding proto indices) called VolSurfaceSymbolRelationship that is used in more places.
This commit is contained in:
1 parent
30615f3429
commit
2e133ea182
5 files changed
+16
-44
No files matched your search
@@ -17,8 +17,8 @@ namespace mbts.analytics {
|
||||
public VolSurfaceEnums.VolSurfaceModel vol_surface_model;
|
||||
// [ProtoBuf.ProtoMember(20)]
|
||||
// public List<string> symbols;
|
||||
[ProtoBuf.ProtoMember(25)]
|
||||
public List<VolSurfaceSymbolStructure> symbol_structure_list;
|
||||
// [ProtoBuf.ProtoMember(25)]
|
||||
// public List<VolSurfaceSymbolRelationship> symbol_structure_list;
|
||||
[ProtoBuf.ProtoMember(30)]
|
||||
public VolSurfaceWingSettings wing_settings;
|
||||
[ProtoBuf.ProtoMember(40)]
|
||||
@@ -62,7 +62,7 @@ namespace mbts.analytics {
|
||||
/// Some symbols could use other symbols's market data ex
|
||||
/// spx using es's
|
||||
[ProtoBuf.ProtoMember(160)]
|
||||
public List<VolSurfaceSymbolStructure> symbol_implied_vol_marketdata_source_list;
|
||||
public List<VolSurfaceSymbolRelationship> symbol_implied_vol_marketdata_source_list;
|
||||
[ProtoBuf.ProtoMember(170)]
|
||||
public List<Tuple<string, VolSurfaceEnums.VolSurfacePricingModel>> symbol_pricing_model_map;
|
||||
[ProtoBuf.ProtoMember(180)]
|
||||
|
||||
@@ -14,7 +14,6 @@ namespace mbts.analytics {
|
||||
strangle = new() { strike_vol_movement_pairs = new() },
|
||||
full_rotation = new() { strike_vol_movement_pairs = new() },
|
||||
atm_shift = new() { strike_vol_movement_pairs = new() },
|
||||
symbol_structure_list = new(),
|
||||
wing_settings = new() {
|
||||
explicit_slope_wing_settings = new(),
|
||||
implicit_slope_wing_settings = new(),
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
using ProtoBuf;
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace mbts.analytics;
|
||||
|
||||
[ProtoContract(Name = "VolSurfaceSymbolRelationship")]
|
||||
public class VolSurfaceSymbolRelationship {
|
||||
[ProtoMember(10)]
|
||||
public string symbol;
|
||||
[ProtoMember(20)]
|
||||
public List<string> connected_symbols;
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace mbts.analytics
|
||||
{
|
||||
[ProtoBuf.ProtoContract(Name = "VolSurfaceSymbolStructure")]
|
||||
public class VolSurfaceSymbolStructure
|
||||
{
|
||||
[ProtoBuf.ProtoMember(10)]
|
||||
public string master_symbol;
|
||||
[ProtoBuf.ProtoMember(20)]
|
||||
public List<string> slave_symbol_list;
|
||||
}
|
||||
|
||||
[ProtoBuf.ProtoContract(Name = "VolSurfaceSymbolRelationship")]
|
||||
public class VolSurfaceSymbolRelationship
|
||||
{
|
||||
[ProtoBuf.ProtoMember(10)]
|
||||
public string symbol;
|
||||
[ProtoBuf.ProtoMember(20)]
|
||||
public List<string> connected_symbols;
|
||||
}
|
||||
}
|
||||
@@ -546,20 +546,6 @@ namespace mbts.analytics {
|
||||
return polynomial_str;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Transforms <paramref name="implied_vol_md_source"/> to a map of symbols -> md source
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// An <see cref="IDictionary{string, string}"/> whose keys are slave symbols and whose
|
||||
/// values are the corresponding master symbols
|
||||
/// </returns>
|
||||
public static IDictionary<string, string> flatten_implied_vol_md_source(
|
||||
IEnumerable<VolSurfaceSymbolStructure> implied_vol_md_source) =>
|
||||
implied_vol_md_source.empty_if_null()
|
||||
.SelectMany(s => s.slave_symbol_list
|
||||
.Select(i => (i, s.master_symbol)))
|
||||
.ToDictionary();
|
||||
|
||||
public static double restrict_bw_min_and_max(
|
||||
double v, double min, double max) => v.max(min).min(max);
|
||||
|
||||
|
||||
Reference in new issue
Block a user