private string BuildDescription(ISpoofingRuleBreach ruleBreach) { var volumeInPosition = ruleBreach.Trades.VolumeInStatus(OrderStatus.Filled); var volumeSpoofed = ruleBreach.CancelledTrades.VolumeNotInStatus(OrderStatus.Filled); var description = $"Spoofing Rule Breach. Traded ({ruleBreach.MostRecentTrade.OrderDirection.GetDescription()}) security {ruleBreach.Security?.Name} with a fulfilled trade volume of {volumeInPosition} and a cancelled trade volume of {volumeSpoofed}. The cancelled volume was traded in the opposite position to the most recent fulfilled trade and is therefore considered to be supporting evidence of spoofing."; return(description); }
public async Task Send(ISpoofingRuleBreach ruleBreach) { if (ruleBreach == null) { this.Logger?.LogInformation( "SpoofingRuleMessageSender Send received a null rule breach for op ctx. Returning."); return; } var description = this.BuildDescription(ruleBreach); await this.Send(ruleBreach, description); }