protected override void OnExecutionUpdate(Cbi.ExecutionEventArgs executionUpdate) { if (executionUpdate.Operation == Cbi.Operation.Add && executionUpdate.Execution.Instrument == Instrument && executionUpdate.Execution.Account.Name == AccountName) { CurrentValue += executionUpdate.Execution.Quantity; } }
protected override void OnExecutionUpdate(Cbi.ExecutionEventArgs executionUpdate) { if (executionUpdate.Execution.Account.Name != AccountName || executionUpdate.Execution.Instrument != Instrument) { return; } executions.Add(executionUpdate.Execution); realizedPL = Cbi.SystemPerformance.Calculate(executions).AllTrades.TradesPerformance.Currency.CumProfit; CurrentValue = realizedPL + (position == null ? 0 : position.GetUnrealizedProfitLoss(Cbi.PerformanceUnit.Currency)); }
protected override void OnExecutionUpdate(Cbi.ExecutionEventArgs executionUpdate) { if (executionUpdate.Execution.Account.Name != AccountName || (executionUpdate.Execution.Instrument.MasterInstrument.InstrumentType != InstrumentType.Stock && executionUpdate.Execution.Instrument != Instrument) || (executionUpdate.Execution.Instrument.MasterInstrument.InstrumentType == InstrumentType.Stock && executionUpdate.Execution.Instrument.FullName != Instrument.FullName)) { return; } executions.Add(executionUpdate.Execution); CurrentValue = Cbi.SystemPerformance.Calculate(executions).AllTrades.TradesPerformance.Currency.CumProfit; }