RFQ work to identify the spreads
This commit is contained in:
1 parent
18ac85a454
commit
b42504d827
3 files changed
+16
-7
No files matched your search
@@ -404,8 +404,10 @@ namespace BCG {
|
||||
sprText += p.contract.product + " " +
|
||||
p.contract.expiration.ToShortDateString() + " " + p.contract.strike.ToString() + " " +
|
||||
(p.contract.isCall ? "C" : "P") + " " + p.position.ToString() + ";";
|
||||
SpreadInterpreter.interpret(sprText, out detail, out summary);
|
||||
|
||||
Type spread_type;
|
||||
SpreadInterpreter.interpret(sprText, out detail, out summary, out spread_type);
|
||||
if (spread_type != null)
|
||||
bts.Log.Gen.info($"{spread_type.ToString()}");
|
||||
}
|
||||
|
||||
private void myResizeToFitControls() {
|
||||
|
||||
@@ -6,19 +6,24 @@ namespace BCG {
|
||||
public static class SpreadInterpreter {
|
||||
public static void interpret(string bts_spread_def, out string detail) {
|
||||
string summary;
|
||||
interpret(bts_spread_def, out detail, out summary);
|
||||
Type spread_type;
|
||||
interpret(bts_spread_def, out detail, out summary, out spread_type);
|
||||
}
|
||||
|
||||
public static void interpret(string blueSpreadDetail, out string detail, out string summary) {
|
||||
public static void interpret(string blueSpreadDetail, out string detail, out string summary,
|
||||
out Type spread_type) {
|
||||
string symbol;
|
||||
List<string> symbols;
|
||||
SingleSpreadLeg[] legs;
|
||||
string longSpec;
|
||||
interpret(blueSpreadDetail, out symbol, out symbols, out legs, out detail, out summary, out longSpec);
|
||||
interpret(blueSpreadDetail, out symbol, out symbols, out legs, out detail,
|
||||
out summary, out longSpec, out spread_type);
|
||||
}
|
||||
|
||||
public static void interpret(string bts_spread_text, out string symbol, out List<string> symbols,
|
||||
out SingleSpreadLeg[] legs, out string detail, out string summary, out string longSpec) {
|
||||
out SingleSpreadLeg[] legs, out string detail, out string summary, out string longSpec,
|
||||
out Type spread_type) {
|
||||
spread_type = null;
|
||||
if (String.IsNullOrEmpty(bts_spread_text)) {
|
||||
symbol = String.Empty;
|
||||
symbols = new List<string>();
|
||||
@@ -78,6 +83,7 @@ namespace BCG {
|
||||
}
|
||||
|
||||
ISpreadSpec spec = SpreadFinder.getSpec(legs);
|
||||
spread_type = spec.GetType();
|
||||
longSpec = spec.longDescription;
|
||||
summary = string.Concat(summary, " ", spec.longDescription);
|
||||
detail = symbols.Count == 1 ? String.Concat(symbols[0], detail) : detail;
|
||||
|
||||
@@ -52,7 +52,8 @@ namespace BCG {
|
||||
string symbol;
|
||||
List<string> symbols;
|
||||
SingleSpreadLeg[] legs;
|
||||
SpreadInterpreter.interpret(ContractUtilities.add_offset_to_spreadleg_exps(bts_spread_def), out symbol, out symbols, out legs, out spread_detail, out spread_summary, out spread_type);
|
||||
Type spread_type_type;
|
||||
SpreadInterpreter.interpret(ContractUtilities.add_offset_to_spreadleg_exps(bts_spread_def), out symbol, out symbols, out legs, out spread_detail, out spread_summary, out spread_type, out spread_type_type);
|
||||
expirations = get_expirations(legs);
|
||||
strikes = get_strikes(legs);
|
||||
get_leg_ratios(legs, out n_contracts, out leg_ratio);
|
||||
|
||||
Reference in new issue
Block a user