chore: Add fill_kind to ITradeLogRow
This commit is contained in:
1 parent
197c915968
commit
c00a71fdfa
5 files changed
+16
-4
No files matched your search
@@ -159,8 +159,8 @@ namespace bts.daemons {
|
||||
|
||||
var fills_tl = fills_filtered.Select(
|
||||
f => new TradeLogRow(f, sc_data.sec_md_map[f.SecurityKey].security));
|
||||
var m_fills_tl = man_fills_filtered.Select(
|
||||
m => new TradeLogRow(m, sc_data.sec_md_map[m.SecurityKey].security));
|
||||
var m_fills_tl = man_fills_filtered.Select(m => new TradeLogRow(
|
||||
m, sc_data.sec_md_map[m.SecurityKey].security, Fill.Types.FillKind.Standard));
|
||||
var merged_fills = fills_tl.Concat(m_fills_tl).ToList();
|
||||
Log.Ui.info($"ReportDaemon posting {merged_fills.Count} trades");
|
||||
_bus.post(SparkTags.TradeLogTag, merged_fills);
|
||||
|
||||
@@ -18,7 +18,8 @@ namespace mbts {
|
||||
uint account_id,
|
||||
bool is_day_trade,
|
||||
DateTime time_entered,
|
||||
string trader
|
||||
string trader,
|
||||
Fill.Types.FillKind fill_kind = Fill.Types.FillKind.Standard
|
||||
) {
|
||||
this.order_key = order_key;
|
||||
this.key = String.Empty;
|
||||
@@ -39,6 +40,7 @@ namespace mbts {
|
||||
this.time_entered = time_entered;
|
||||
this.trader = trader;
|
||||
this.fill_status = Fill.Types.FillStatus.Active;
|
||||
this.fill_kind = fill_kind;
|
||||
}
|
||||
|
||||
public int order_key { get; }
|
||||
@@ -59,6 +61,7 @@ namespace mbts {
|
||||
public bool is_day_trade { get; }
|
||||
public DateTime time_entered { get; }
|
||||
public string trader { get; }
|
||||
public Fill.Types.FillKind fill_kind { get; }
|
||||
public Fill.Types.FillStatus fill_status { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ namespace mbts {
|
||||
bool is_day_trade { get; }
|
||||
DateTime time_entered { get; }
|
||||
string trader { get; }
|
||||
Fill.Types.FillKind fill_kind { get; }
|
||||
Fill.Types.FillStatus fill_status { get; }
|
||||
bool is_active => fill_status != Fill.Types.FillStatus.Busted;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,11 @@ namespace mbts {
|
||||
using System;
|
||||
|
||||
public class TradeLogRow : ITradeLogRow {
|
||||
public TradeLogRow(ManualFill m_fill, SecurityImmutable sec) {
|
||||
public TradeLogRow(
|
||||
ManualFill m_fill,
|
||||
SecurityImmutable sec,
|
||||
Fill.Types.FillKind fill_kind = Fill.Types.FillKind.Standard
|
||||
) {
|
||||
order_key = m_fill.RecordId;
|
||||
key = $"ManualFill_{m_fill.RecordId}";
|
||||
security_key = m_fill.SecurityKey;
|
||||
@@ -34,6 +38,7 @@ namespace mbts {
|
||||
expiration.HasValue ? expiration.Value : DateTime.MinValue);
|
||||
security_strike = new SecurityStrike(security_expiration, strike);
|
||||
fill_status = Fill.Types.FillStatus.Active;
|
||||
this.fill_kind = fill_kind;
|
||||
}
|
||||
|
||||
public TradeLogRow(Fill fill, SecurityImmutable sec) {
|
||||
@@ -63,6 +68,7 @@ namespace mbts {
|
||||
expiration.HasValue ? expiration.Value : DateTime.MinValue);
|
||||
security_strike = new SecurityStrike(security_expiration, strike);
|
||||
fill_status = fill.FillStatus;
|
||||
fill_kind = fill.FillKind;
|
||||
}
|
||||
|
||||
public int order_key { get; }
|
||||
@@ -83,6 +89,7 @@ namespace mbts {
|
||||
public bool is_day_trade { get; }
|
||||
public DateTime time_entered { get; }
|
||||
public string trader { get; }
|
||||
public Fill.Types.FillKind fill_kind { get; }
|
||||
public Fill.Types.FillStatus fill_status { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ message MultiThreadedWindows {
|
||||
optional bool slide_report = 11 [ default = true ];
|
||||
optional bool combo_report = 12 [ default = true ];
|
||||
optional bool reconcile_report = 13 [ default = true ];
|
||||
optional bool day_fills = 14 [ default = true ];
|
||||
}
|
||||
|
||||
message LadderKnobs {
|
||||
|
||||
Reference in new issue
Block a user