예제 #1
0
 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;
     }
 }
예제 #2
0
파일: ProfitLoss.cs 프로젝트: theprofe8/nt8
        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));
        }
예제 #3
0
        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;
        }