private void Security_TradeCompleted(object sender, TradeCompletedEventArgs e) { TradeExecuted?.Invoke(this, new TradedPriceEventArgs(e.TradeDetail)); }
/// <summary> /// Helper to execute TradeExecuted event on a separate thread /// </summary> /// <param name="trade">Trade that was executed</param> /// <returns>Task being executed on. This allows the caller to await the call</returns> protected Task OnTradeExecuted(Trade trade) { return(Task.Run(() => TradeExecuted?.Invoke(this, trade))); }