예제 #1
0
		public double GetExecutionPrice(ExecutionReport report)
		{
			double avgPx = report.AvgPx;
			if (report.OrdStatus == OrdStatus.Filled)
			{
				switch (report.Side)
				{
					case Side.Buy:
						avgPx += avgPx * this.Slippage;
						break;
					case Side.Sell:
					case Side.SellShort:
						avgPx -= avgPx * this.Slippage;
						break;
				}
			}
			return report.AvgPx = avgPx;
		}
예제 #2
0
		public OrderList Load()
		{
			lock (this)
			{
				OrderList orders = new OrderList();
				IDbCommand command = this.connection.CreateCommand();
				// TODO:
				command.CommandText = "select order from";
				IDataReader reader = command.ExecuteReader();
				while (reader.Read())
				{
					int orderId = reader.GetInt32(0);
					Type orderType = this.jW5iqEmeD[reader.GetInt32(1)];
					int instrumentId = reader.IsDBNull(2) ? -1 : reader.GetInt32(2);
					int providerId = reader.IsDBNull(3) ? -1 : reader.GetInt32(3);
					int portfolioId = reader.IsDBNull(4) ? -1 : reader.GetInt32(4);
					IOrder order = (IOrder)Activator.CreateInstance(orderType, true);
					order.Id = orderId;
					order.Instrument = InstrumentManager.Instruments.GetById(instrumentId);
					order.Provider = ProviderManager.ExecutionProviders[(byte)providerId];
					order.Portfolio = PortfolioManager.Portfolios.GetById(portfolioId);
					order.Persistent = true;
					orders.Add(order);
				}
				reader.Close();
				command.Dispose();
				FIXDbServer.LoadFIXGroups(this.connection, orders, "order.table");
				ExecutionReportList reports = new ExecutionReportList();
				IDbCommand cmd = this.connection.CreateCommand();
				cmd.CommandText = "commadn";
				IDataReader reader2 = cmd.ExecuteReader();
				while (reader2.Read())
				{
					int reportId = reader2.GetInt32(0);
					int orderId = reader2.GetInt32(1);
					ExecutionReport report = new ExecutionReport();
					report.Id = reportId;
					orders.GetById(orderId).Reports.Add(report);
					reports.Add(report);
				}
				reader2.Close();
				cmd.Dispose();
				FIXDbServer.LoadFIXGroups(this.connection, reports, "report.table");
				return orders;
			}
		}
예제 #3
0
파일: SingleOrder.cs 프로젝트: heber/FreeOQ
		internal void EmitExecutionReport(ExecutionReport report)
		{
			if ((report.OrdStatus == OrdStatus.New || report.OrdStatus == OrdStatus.PendingNew) && report.ContainsField(37))
				this.OrderID = report.OrderID;
			if (report.Text == "")
				report.Text = this.Text;
			this.CumQty = report.CumQty;
			this.LeavesQty = report.LeavesQty;
			this.AvgPx = report.AvgPx;
			this.OrdStatus = report.OrdStatus;
			if (report.ExecType == ExecType.PartialFill || report.ExecType == ExecType.Fill || report.ExecType == ExecType.Trade)
			{
				this.LastPx = report.LastPx;
				this.LastQty = report.LastQty;
				if (report.ContainsField(13))
				{
					double num1 = 0.0;
//         switch (report.CommType)
//          {
//            case CommType.PerShare:
//              num1 = report.Commission * report.LastQty;
//              break;
//            case CommType.Percent:
//              num1 = report.Commission * (report.LastPx * report.LastQty);
//              break;
//            case CommType.Absolute:
//              num1 = report.Commission;
//              break;
//          }
					SingleOrder singleOrder = this;
					double num2 = singleOrder.Commission + num1;
					singleOrder.Commission = num2;
				}
			}
			this.reports.Add(report);
			if (this.ExecutionReport != null)
			{
				this.ExecutionReport((object)this, new ExecutionReportEventArgs(report));
			}
		}
예제 #4
0
		private void lCXP6mCfhb(NewOrderSingle e)
		{
			SingleOrder singleOrder = e as SingleOrder;
			if (singleOrder.IsFilled || singleOrder.IsCancelled)
				return;
			if (e.OrderQty > 0.0)
			{
				ExecutionReport report = new ExecutionReport();
				report.TransactTime = Clock.Now;
				report.ClOrdID = e.ClOrdID;
				report.ExecType = ExecType.New;
				report.OrdStatus = OrdStatus.New;
				report.Symbol = e.Symbol;
				report.OrdType = e.OrdType;
				report.Side = e.Side;
				report.Price = e.Price;
				report.StopPx = e.StopPx;
				report.TrailingAmt = e.TrailingAmt;
				report.OrderQty = e.OrderQty;
				report.CumQty = 0.0;
				report.LeavesQty = e.OrderQty;
				report.Currency = e.Currency;
				report.Text = e.Text;
				this.JPVPJSWclF(report);
				zo21q6cy3fImtUHATQ zo21q6cy3fImtUhatq = new zo21q6cy3fImtUHATQ(this, e);
			}
			else
			{
				ExecutionReport report = new ExecutionReport();
				report.TransactTime = DateTime.Now;
				report.ClOrdID = e.ClOrdID;
				report.ExecType = ExecType.Rejected;
				report.OrdStatus = OrdStatus.Rejected;
				report.Symbol = e.Symbol;
				report.OrdType = e.OrdType;
				report.Side = e.Side;
				report.Price = e.Price;
				report.StopPx = e.StopPx;
				report.TrailingAmt = e.TrailingAmt;
				report.OrderQty = e.OrderQty;
				report.CumQty = 0.0;
				report.LeavesQty = e.OrderQty;
				report.Currency = e.Currency;
				report.Text = e.Text;
				this.JPVPJSWclF(report);
			}
		}
예제 #5
0
 protected virtual void OnExecutionReport(SingleOrder order, ExecutionReport report)
 {
 }
예제 #6
0
파일: ATSStrategy.cs 프로젝트: heber/FreeOQ
		protected override void OnExecutionReport(SingleOrder order, ExecutionReport report)
		{
			this.klBiFcxZsD.OnExecutionReport(order, report);
			this.csNiLdTRqH[order.Instrument].OnExecutionReport(order, report);
		}
예제 #7
0
		internal void CfcFBQBLXe(FIXOrderCancelReplaceRequest obj0)
		{
			SingleOrder singleOrder = this.PYBF7sahqY as SingleOrder;
			this.D7GFelmgQp();
			this.A8bFJItyyx.MyIPdEI7fi.Remove((object) obj0.OrigClOrdID);
			ExecutionReport executionReport = new ExecutionReport();
			executionReport.TransactTime = Clock.Now;
			executionReport.ClOrdID = obj0.ClOrdID;
			executionReport.OrigClOrdID = obj0.OrigClOrdID;
			executionReport.ExecType = ExecType.Replace;
			executionReport.OrdStatus = OrdStatus.Replaced;
			executionReport.Symbol = singleOrder.Symbol;
			executionReport.Side = singleOrder.Side;
			executionReport.OrdType = FIXOrdType.FromFIX(obj0.OrdType);
			executionReport.CumQty = singleOrder.CumQty;
			executionReport.OrderQty = obj0.OrderQty;
			executionReport.LeavesQty = obj0.OrderQty - singleOrder.CumQty;
			executionReport.AvgPx = singleOrder.AvgPx;
			executionReport.Price = obj0.Price;
			executionReport.StopPx = obj0.StopPx;
			executionReport.TrailingAmt = obj0.TrailingAmt;
			executionReport.Currency = singleOrder.Currency;
			executionReport.TimeInForce = FIXTimeInForce.FromFIX(obj0.TimeInForce);
			executionReport.Text = singleOrder.Text;
			this.A8bFJItyyx.JPVPJSWclF(executionReport);
			zo21q6cy3fImtUHATQ zo21q6cy3fImtUhatq = new zo21q6cy3fImtUHATQ(this.A8bFJItyyx, (FIXNewOrderSingle) singleOrder);
		}
예제 #8
0
		private void D35FmNWSPm(double obj0, double obj1)
		{
			SingleOrder singleOrder = this.PYBF7sahqY as SingleOrder;
			if (singleOrder.IsDone)
				return;
			if (obj1 < singleOrder.LeavesQty)
			{
				this.aXtFGP76FH = false;
				ExecutionReport report = new ExecutionReport();
				report.TransactTime = Clock.Now;
				report.ClOrdID = singleOrder.ClOrdID;
				report.ExecType = ExecType.PartialFill;
				report.OrdStatus = OrdStatus.PartiallyFilled;
				report.Symbol = singleOrder.Symbol;
				report.Side = singleOrder.Side;
				report.OrdType = singleOrder.OrdType;
				report.AvgPx = (singleOrder.AvgPx * singleOrder.CumQty + obj0 * obj1) / (singleOrder.CumQty + obj1);
				report.OrderQty = singleOrder.OrderQty;
				report.LastQty = obj1;
				report.CumQty = singleOrder.CumQty + obj1;
				report.LeavesQty = singleOrder.LeavesQty - obj1;
				report.LastPx = obj0;
				report.Price = singleOrder.Price;
				report.StopPx = singleOrder.StopPx;
				report.SecurityType = singleOrder.SecurityType;
				report.SecurityExchange = singleOrder.SecurityExchange;
				report.Currency = singleOrder.Currency;
				report.Text = singleOrder.Text;
				FIXCommissionData commissionData = this.A8bFJItyyx.CommissionProvider.GetCommissionData((FIXExecutionReport) report);
				report.CommType = FIXCommType.FromFIX(commissionData.CommType);
				report.Commission = commissionData.Commission;
				report.AvgPx = this.A8bFJItyyx.SlippageProvider.GetExecutionPrice(report);
				this.A8bFJItyyx.JPVPJSWclF(report);
			}
			else
			{
				this.D7GFelmgQp();
				this.A8bFJItyyx.MyIPdEI7fi.Remove((object) this.PYBF7sahqY.ClOrdID);
				this.aXtFGP76FH = true;
				obj1 = singleOrder.LeavesQty;
				ExecutionReport report = new ExecutionReport();
				report.TransactTime = Clock.Now;
				report.ClOrdID = singleOrder.ClOrdID;
				report.ExecType = ExecType.Fill;
				report.OrdStatus = OrdStatus.Filled;
				report.Symbol = singleOrder.Symbol;
				report.Side = singleOrder.Side;
				report.OrdType = singleOrder.OrdType;
				report.AvgPx = (singleOrder.AvgPx * singleOrder.CumQty + obj0 * obj1) / (singleOrder.CumQty + obj1);
				report.OrderQty = singleOrder.OrderQty;
				report.LastQty = singleOrder.LeavesQty;
				report.CumQty = singleOrder.OrderQty;
				report.LeavesQty = 0.0;
				report.LastPx = obj0;
				report.Price = singleOrder.Price;
				report.StopPx = singleOrder.StopPx;
				report.SecurityType = singleOrder.SecurityType;
				report.SecurityExchange = singleOrder.SecurityExchange;
				report.Currency = singleOrder.Currency;
				report.Text = singleOrder.Text;
				FIXCommissionData commissionData = this.A8bFJItyyx.CommissionProvider.GetCommissionData((FIXExecutionReport) report);
				report.CommType = FIXCommType.FromFIX(commissionData.CommType);
				report.Commission = commissionData.Commission;
				report.AvgPx = this.A8bFJItyyx.SlippageProvider.GetExecutionPrice(report);
				this.A8bFJItyyx.JPVPJSWclF(report);
			}
		}
예제 #9
0
 internal static void SendOrder(SingleOrder order)
 {
     if (order.Provider == null)
         throw new ApplicationException("order.Provider == null");
     if (order.Persistent)
         OrderManager.server.AddOrder(order);
     OrderManager.orders.Add(order);
     OrderManager.EmitNewOrder(order);
     if (order.OCAGroup != "" && (int)order.Provider.Id != 4 && OrderManager.oca.Contains((object)order.OCAGroup))
     {
         ExecutionReport report = new ExecutionReport();
         report.TransactTime = DateTime.Now;
         report.ClOrdID = order.ClOrdID;
         report.OrigClOrdID = order.ClOrdID;
         report.ExecType = ExecType.Rejected;
         report.OrdStatus = OrdStatus.Rejected;
         report.Symbol = order.Symbol;
         report.Side = order.Side;
         report.OrdType = order.OrdType;
         report.Currency = order.Currency;
         report.Text = "" + order.OCAGroup;
         OrderManager.ExecutionReport(null, new ExecutionReportEventArgs(report));
     }
     else
         order.Provider.SendNewOrderSingle((NewOrderSingle)order);
 }
예제 #10
0
 protected override void OnExecutionReport(SingleOrder order, ExecutionReport report)
 {
   this.XSvR57mV5s.OnExecutionReport(order, report);
 }
예제 #11
0
파일: FQProvider.cs 프로젝트: heber/FreeOQ
    private void EmitExecutionReport(OrderRecord record, OrdStatus ordStatus, double lastPx, int lastQty, string text, CommType commType, double commission)
    {
      FreeQuant.FIX.ExecutionReport report = new FreeQuant.FIX.ExecutionReport();
      report.TransactTime = Clock.Now;
      report.ClOrdID = ((FIXNewOrderSingle) record.Order).ClOrdID;
      report.OrigClOrdID = ((FIXNewOrderSingle) record.Order).ClOrdID;
      report.OrderID = record.Order.OrderID;
      report.Symbol = ((FIXNewOrderSingle) record.Order).Symbol;
      report.SecurityType = ((FIXNewOrderSingle) record.Order).SecurityType;
      report.SecurityExchange = ((FIXNewOrderSingle) record.Order).SecurityExchange;
      report.Currency = ((FIXNewOrderSingle) record.Order).Currency;
      report.CommType = commType;
      report.Commission = commission;
      report.Side = ((NewOrderSingle) record.Order).Side;
      if (ordStatus == OrdStatus.Replaced)
      {
				report.OrdType = record.Order.ReplaceOrder.ContainsField(40) ? record.Order.ReplaceOrder.OrdType : ((NewOrderSingle) record.Order).OrdType;
				report.TimeInForce = record.Order.ReplaceOrder.ContainsField(59) ? record.Order.ReplaceOrder.TimeInForce : ((NewOrderSingle) record.Order).TimeInForce;
				report.OrderQty = record.Order.ReplaceOrder.ContainsField(38) ? record.Order.ReplaceOrder.OrderQty : ((FIXNewOrderSingle) record.Order).OrderQty;
				report.Price = record.Order.ReplaceOrder.ContainsField(44) ? record.Order.ReplaceOrder.Price : ((FIXNewOrderSingle) record.Order).Price;
				report.StopPx = record.Order.ReplaceOrder.ContainsField(99) ? record.Order.ReplaceOrder.StopPx : ((FIXNewOrderSingle) record.Order).StopPx;
        record.LeavesQty = (int) report.OrderQty - record.CumQty;
      }
      else
      {
        report.OrdType = ((NewOrderSingle) record.Order).OrdType;
        report.TimeInForce = ((NewOrderSingle) record.Order).TimeInForce;
        report.OrderQty = ((FIXNewOrderSingle) record.Order).OrderQty;
        report.Price = ((FIXNewOrderSingle) record.Order).Price;
        report.StopPx = ((FIXNewOrderSingle) record.Order).StopPx;
      }
      report.LastPx = lastPx;
      report.LastQty = (double) lastQty;
      if (ordStatus == OrdStatus.Undefined)
      {
        record.AddFill(lastPx, lastQty);
        ordStatus = record.LeavesQty <= 0 ? OrdStatus.Filled : OrdStatus.PartiallyFilled;
      }
      report.AvgPx = record.AvgPx;
      report.CumQty = (double) record.CumQty;
      report.LeavesQty = (double) record.LeavesQty;
      report.ExecType = this.GetExecType(ordStatus);
      report.OrdStatus = ordStatus;
      report.Text = text;
      this.EmitExecutionReport(report);
    }
예제 #12
0
		private ExecutionReport feHpgokAEH([In] SingleOrder obj0)
		{
			ExecutionReport executionReport = new ExecutionReport();
			executionReport.TransactTime = Clock.Now;
			executionReport.ExecID = DateTime.Now.ToString();
			executionReport.ClOrdID = obj0.ClOrdID;
			executionReport.OrderID = obj0.OrderID;
			executionReport.ExecTransType = ExecTransType.New;
			executionReport.Symbol = obj0.Symbol;
			executionReport.SecurityType = obj0.SecurityType;
			executionReport.SecurityExchange = obj0.SecurityExchange;
			executionReport.Currency = obj0.Currency;
			executionReport.TimeInForce = obj0.TimeInForce;
			executionReport.Side = obj0.Side;
			executionReport.OrdType = obj0.OrdType;
			executionReport.Price = obj0.Price;
			executionReport.StopPx = obj0.StopPx;
			executionReport.OrderQty = obj0.OrderQty;
			this.fU8pNJpaT5[obj0].Add(executionReport);
			return executionReport;
		}
예제 #13
0
		public void onMessage(QuickFix.FIX43.ExecutionReport report, SessionID sessionID)
		{
			FreeQuant.FIX.ExecutionReport report1 = new FreeQuant.FIX.ExecutionReport();
			if (report.isSetOrderID())
				report1.OrderID = report.getOrderID().getValue();
			if (report.isSetSecondaryOrderID())
				report1.SecondaryOrderID = report.getSecondaryOrderID().getValue();
			if (report.isSetClOrdID())
				report1.ClOrdID = report.getClOrdID().getValue();
			if (report.isSetOrigClOrdID())
				report1.OrigClOrdID = report.getOrigClOrdID().getValue();
			if (report.isSetListID())
				report1.ListID = report.getListID().getValue();
			if (report.isSetExecID())
				report1.ExecID = report.getExecID().getValue();
			if (report.isSetExecRefID())
				report1.ExecRefID = report.getExecRefID().getValue();
			if (report.isSetExecType())
				((FIXExecutionReport)report1).ExecType = report.getExecType().getValue();
			if (report.isSetOrdStatus())
				((FIXExecutionReport)report1).OrdStatus = report.getOrdStatus().getValue();
			if (report.isSetOrdRejReason())
				report1.OrdRejReason = report.getOrdRejReason().getValue();
			if (report.isSetExecRestatementReason())
				report1.ExecRestatementReason = report.getExecRestatementReason().getValue();
			if (report.isSetAccount())
				report1.Account = report.getAccount().getValue();
			if (report.isSetSettlmntTyp())
				report1.SettlType = report.getSettlmntTyp().getValue();
			if (report.isSetSymbol())
				report1.Symbol = report.getSymbol().getValue();
			if (report.isSetSymbolSfx())
				report1.SymbolSfx = report.getSymbolSfx().getValue();
			if (report.isSetSecurityID())
				report1.SecurityID = report.getSecurityID().getValue();
			if (report.isSetSecurityType())
				report1.SecurityType = report.getSecurityType().getValue();
			if (report.isSetMaturityMonthYear())
				report1.MaturityMonthYear = report.getMaturityMonthYear().getValue();
			if (report.isSetStrikePrice())
				report1.StrikePrice = report.getStrikePrice().getValue();
			if (report.isSetOptAttribute())
				report1.OptAttribute = report.getOptAttribute().getValue();
			if (report.isSetContractMultiplier())
				report1.ContractMultiplier = report.getContractMultiplier().getValue();
			if (report.isSetCouponRate())
				report1.CouponRate = report.getCouponRate().getValue();
			if (report.isSetSecurityExchange())
				report1.SecurityExchange = report.getSecurityExchange().getValue();
			if (report.isSetIssuer())
				report1.Issuer = report.getIssuer().getValue();
			if (report.isSetEncodedIssuerLen())
				report1.EncodedIssuerLen = report.getEncodedIssuerLen().getValue();
			if (report.isSetEncodedIssuer())
				report1.EncodedIssuer = report.getEncodedIssuer().getValue();
			if (report.isSetSecurityDesc())
				report1.SecurityDesc = report.getSecurityDesc().getValue();
			if (report.isSetEncodedSecurityDescLen())
				report1.EncodedSecurityDescLen = report.getEncodedSecurityDescLen().getValue();
			if (report.isSetEncodedSecurityDesc())
				report1.EncodedSecurityDesc = report.getEncodedSecurityDesc().getValue();
			if (report.isSetSide())
				((FIXExecutionReport)report1).Side = report.getSide().getValue();
			if (report.isSetOrderQty())
				report1.OrderQty = report.getOrderQty().getValue();
			if (report.isSetCashOrderQty())
				report1.CashOrderQty = report.getCashOrderQty().getValue();
			if (report.isSetOrdType())
				((FIXExecutionReport)report1).OrdType = report.getOrdType().getValue();
			if (report.isSetPrice())
				report1.Price = report.getPrice().getValue();
			if (report.isSetStopPx())
				report1.StopPx = report.getStopPx().getValue();
			if (report.isSetDiscretionInst())
				report1.DiscretionInst = report.getDiscretionInst().getValue();
			if (report.isSetDiscretionOffset())
				report1.DiscretionOffsetValue = report.getDiscretionOffset().getValue();
			if (report.isSetCurrency())
				report1.Currency = report.getCurrency().getValue();
			if (report.isSetComplianceID())
				report1.ComplianceID = report.getComplianceID().getValue();
			if (report.isSetTimeInForce())
				((FIXExecutionReport)report1).TimeInForce = report.getTimeInForce().getValue();
			if (report.isSetEffectiveTime())
				report1.EffectiveTime = report.getEffectiveTime().getValue();
			if (report.isSetExpireDate())
				report1.ExpireDate = DateTime.Parse(report.getExpireDate().getValue());
			if (report.isSetExpireTime())
				report1.ExpireTime = report.getExpireTime().getValue();
			if (report.isSetExecInst())
				report1.ExecInst = report.getExecInst().getValue();
			if (report.isSetLastPx())
				report1.LastPx = report.getLastPx().getValue();
			if (report.isSetLastSpotRate())
				report1.LastSpotRate = report.getLastSpotRate().getValue();
			if (report.isSetLastForwardPoints())
				report1.LastForwardPoints = report.getLastForwardPoints().getValue();
			if (report.isSetLastMkt())
				report1.LastMkt = report.getLastMkt().getValue();
			if (report.isSetTradingSessionID())
				report1.TradingSessionID = report.getTradingSessionID().getValue();
			if (report.isSetLastCapacity())
				report1.LastCapacity = report.getLastCapacity().getValue();
			if (report.isSetLeavesQty())
				report1.LeavesQty = report.getLeavesQty().getValue();
			if (report.isSetCumQty())
				report1.CumQty = report.getCumQty().getValue();
			if (report.isSetAvgPx())
				report1.AvgPx = report.getAvgPx().getValue();
			if (report.isSetDayOrderQty())
				report1.DayOrderQty = report.getDayOrderQty().getValue();
			if (report.isSetDayCumQty())
				report1.DayCumQty = report.getDayCumQty().getValue();
			if (report.isSetDayAvgPx())
				report1.DayAvgPx = report.getDayAvgPx().getValue();
			if (report.isSetGTBookingInst())
				report1.GTBookingInst = report.getGTBookingInst().getValue();
			if (report.isSetTradeDate())
				report1.TradeDate = DateTime.Parse(report.getTradeDate().getValue());
			if (report.isSetTransactTime())
				report1.TransactTime = report.getTransactTime().getValue();
			if (report.isSetCommission())
				report1.Commission = report.getCommission().getValue();
			if (report.isSetCommType())
				((FIXExecutionReport)report1).CommType = report.getCommType().getValue();
			if (report.isSetGrossTradeAmt())
				report1.GrossTradeAmt = report.getGrossTradeAmt().getValue();
			if (report.isSetSettlCurrAmt())
				report1.SettlCurrAmt = report.getSettlCurrAmt().getValue();
			if (report.isSetSettlCurrency())
				report1.SettlCurrency = report.getSettlCurrency().getValue();
			if (report.isSetHandlInst())
				report1.HandlInst = report.getHandlInst().getValue();
			if (report.isSetMinQty())
				report1.MinQty = report.getMinQty().getValue();
			if (report.isSetMaxFloor())
				report1.MaxFloor = report.getMaxFloor().getValue();
			if (report.isSetMaxShow())
				report1.MaxShow = report.getMaxShow().getValue();
			if (report.isSetText())
				report1.Text = report.getText().getValue();
			if (report.isSetEncodedTextLen())
				report1.EncodedTextLen = report.getEncodedTextLen().getValue();
			if (report.isSetEncodedText())
				report1.EncodedText = report.getEncodedText().getValue();
			if (report.isSetOrderQty2())
				report1.OrderQty2 = report.getOrderQty2().getValue();
			if (report.isSetMultiLegReportingType())
				report1.MultiLegReportingType = report.getMultiLegReportingType().getValue();
			if (this.grxym6Rmr == null)
				return;
			this.grxym6Rmr((object)this, new ExecutionReportEventArgs(report1));
		}
예제 #14
0
		internal void JPVPJSWclF(ExecutionReport report)
		{
      if (this.ExecutionReport != null)
      this.ExecutionReport(this, new ExecutionReportEventArgs(report));
		}
예제 #15
0
		public virtual void SendNewOrderSingle(NewOrderSingle order)
		{
			if (this.IsConnected)
			{
				this.application.Send((FIXNewOrderSingle)order);
			}
			else
			{
				ExecutionReport report = new ExecutionReport();
				report.TransactTime = Clock.Now;
				report.ClOrdID = order.ClOrdID;
				report.ExecType = FreeQuant.FIX.ExecType.Rejected;
				report.OrdStatus = FreeQuant.FIX.OrdStatus.Rejected;
				report.Symbol = order.Symbol;
				report.SecurityType = order.SecurityType;
				report.SecurityExchange = order.SecurityExchange;
				report.Currency = order.Currency;
				report.Side = order.Side;
				report.OrdType = order.OrdType;
				report.TimeInForce = order.TimeInForce;
				report.OrderQty = order.OrderQty;
				report.Price = order.Price;
				report.StopPx = order.StopPx;
				report.LastPx = 0.0;
				report.LastQty = 0.0;
				report.AvgPx = 0.0;
				report.CumQty = 0.0;
				report.LeavesQty = order.OrderQty;
				report.Text = BeAEwTZGlZaeOmY5cm.J00weU3cM6(4016);
				if (this.q8X4lYTN4C != null)
					this.q8X4lYTN4C((object)this, new ExecutionReportEventArgs(report));
				if (this.j4t4Wyi2Ea == null)
					return;
				this.j4t4Wyi2Ea(new ProviderErrorEventArgs((IProvider)this, -1, -1, BeAEwTZGlZaeOmY5cm.J00weU3cM6(4070)));
			}
		}
예제 #16
0
 public void SendExecutionReport(IExecutionService service, ExecutionReport report)
 {
     this.orders[report.OrderID].EmitExecutionReport(report);
     service.Send((FIXExecutionReport)report);
     this.EmitExecutionReport(report);
 }
예제 #17
0
파일: Strategy.cs 프로젝트: heber/FreeOQ
 protected override void OnExecutionReport(SingleOrder order, ExecutionReport report)
 {
   Instrument instrument = order.Instrument;
   this.HeHpDewVKD.OnExecutionReport(order, report);
   this.A6MpF2380O.OnExecutionReport(order, report);
   this.entries[instrument].OnExecutionReport(order, report);
   this.exits[instrument].OnExecutionReport(order, report);
 }
예제 #18
0
 private void EmitExecutionReport(ExecutionReport report)
 {
     if (this.ExecutionReport != null)
     {
         this.ExecutionReport(this, new ExecutionReportEventArgs(report));
     }
 }
예제 #19
0
		internal void XNWFfvowtr()
		{
			this.D7GFelmgQp();
			this.A8bFJItyyx.MyIPdEI7fi.Remove((object) this.PYBF7sahqY.ClOrdID);
			SingleOrder singleOrder = this.PYBF7sahqY as SingleOrder;
			ExecutionReport executionReport = new ExecutionReport();
			executionReport.TransactTime = Clock.Now;
			executionReport.ClOrdID = singleOrder.ClOrdID;
			executionReport.OrigClOrdID = singleOrder.ClOrdID;
			executionReport.ExecType = ExecType.Cancelled;
			executionReport.OrdStatus = OrdStatus.Cancelled;
			executionReport.Symbol = singleOrder.Symbol;
			executionReport.Side = singleOrder.Side;
			executionReport.OrdType = singleOrder.OrdType;
			executionReport.AvgPx = singleOrder.AvgPx;
			executionReport.LeavesQty = singleOrder.LeavesQty;
			executionReport.CumQty = singleOrder.CumQty;
			executionReport.OrderQty = singleOrder.OrderQty;
			executionReport.Price = singleOrder.Price;
			executionReport.StopPx = singleOrder.StopPx;
			executionReport.Currency = singleOrder.Currency;
			executionReport.Text = singleOrder.Text;
			this.A8bFJItyyx.JPVPJSWclF(executionReport);
		}
예제 #20
0
		public ExecutionReportEventArgs(ExecutionReport report) : this(null, report)
		{
		}
예제 #21
0
		internal void mhsWZDndbE(StrategyBase obj0, ExecutionReport obj1)
		{
			IExecutionService service = (IExecutionService)null;
			switch (this.metaStrategyMode)
			{
				case MetaStrategyMode.Simulation:
					service = ServiceManager.ExecutionSimulator;
					break;
				case MetaStrategyMode.Live:
					service = obj0.ExecutionService;
					break;
			}
			OrderManager.SellSide.SendExecutionReport(service, obj1);
		}
예제 #22
0
		public ExecutionReportEventArgs(NewOrderSingle order, ExecutionReport report)
		{
 			this.Order = order;
			this.ExecutionReport = report;
		}
예제 #23
0
 internal void RM9EmoIgF(ExecutionReport obj0)
 {
   this.MetaStrategyBase.mhsWZDndbE(this, obj0);
 }
예제 #24
0
		public virtual void OnExecutionReport(SingleOrder order, ExecutionReport report)
		{
		}
예제 #25
0
 internal void a9XY5Muph(SingleOrder obj0, ExecutionReport obj1)
 {
   this.OnExecutionReport(obj0, obj1);
 }
예제 #26
0
		public void SendNewOrderSingle(NewOrderSingle order)
		{
			if (this.IsConnected)
			{
				if (this.Latency == 0)
					this.lCXP6mCfhb(order);
				else
					Clock.AddReminder(new ReminderEventHandler(this.MxtPRD9hCH), DateTime.Now.AddMilliseconds(this.Latency), order);
			}
			else
			{
				ExecutionReport report = new ExecutionReport();
				report.TransactTime = DateTime.Now;
				report.ClOrdID = order.ClOrdID;
				report.ExecType = ExecType.Rejected;
				report.OrdStatus = OrdStatus.Rejected;
				report.Symbol = order.Symbol;
				report.SecurityType = order.SecurityType;
				report.SecurityExchange = order.SecurityExchange;
				report.Currency = order.Currency;
				report.Side = order.Side;
				report.OrdType = order.OrdType;
				report.TimeInForce = order.TimeInForce;
				report.OrderQty = order.OrderQty;
				report.Price = order.Price;
				report.StopPx = order.StopPx;
				report.LastPx = 0.0;
				report.LastQty = 0.0;
				report.AvgPx = 0.0;
				report.CumQty = 0.0;
				report.LeavesQty = order.OrderQty;
				report.Text = "text";
				this.JPVPJSWclF(report);
			}
		}