Пример #1
0
 public AccountTransaction(Fill fill)
 {
     this.DateTime = fill.DateTime;
     this.Value = fill.CashFlow;
     this.CurrencyId = fill.CurrencyId;
     this.Text = fill.Text;
 }
Пример #2
0
 public void Add(Fill fill)
 {
     Fill fill2 = this.FillSet.Peek();
     if (fill2 == null || (this.IsLong(fill2) && this.IsLong(fill)) || (!this.IsLong(fill2) && !this.IsLong(fill)))
     {
         this.FillSet.Push(fill);
         this.leavesQty = fill.Qty;
         return;
     }
     double num = fill.Qty;
     while (num > 0.0 && (fill2 = this.FillSet.Peek()) != null)
     {
         if (this.leavesQty > num)
         {
             this.AddTrade(this.CreateTrade(fill2, fill, num));
             this.leavesQty -= Math.Round(num, 5);
             num = 0.0;
         }
         else
         {
             this.AddTrade(this.CreateTrade(fill2, fill, this.leavesQty));
             this.FillSet.Pop();
             num -= Math.Round(this.leavesQty, 5);
         }
     }
     if (num > 0.0)
     {
         this.leavesQty = num;
         this.FillSet.Push(fill);
     }
 }
Пример #3
0
		public AccountTransaction(Fill fill)
		{
			this.dateTime = fill.dateTime;
			this.value = fill.CashFlow;
			this.currencyId = fill.currencyId;
			this.text = fill.text;
		}
Пример #4
0
 public FillViewItem(Fill fill)
   : base(new string[5])
 {
     this.Fill = fill;
     this.SubItems[0].Text = fill.DateTime.ToString();
     this.SubItems[3].Text = fill.Price.ToString(fill.Instrument.PriceFormat);
     this.SubItems[4].Text = fill.Qty.ToString();
     this.ImageIndex = 2;
     this.BackColor = Color.FromArgb((int)byte.MaxValue, (int)byte.MaxValue, 230);
 }
Пример #5
0
 public FillView(Fill fill, Pad pad)
 {
     this.fill = fill;
     this.pad = pad;
     BuyColor = Color.Blue;
     SellColor = Color.Red;
     SellShortColor = Color.Yellow;
     TextEnabled = true;
     ToolTipEnabled = true;
     ToolTipFormat = "{0} {2} {1} @ {3} {4} {5}";
 }
Пример #6
0
 public void Add(Fill fill)
 {
     this.fills.Add(fill);
     if (this.qty == 0.0)
     {
         this.entry = fill;
     }
     if (fill.Side == OrderSide.Buy)
     {
         this.qtyBought += fill.qty;
     }
     else
     {
         this.qtySold += fill.qty;
     }
     this.amount = this.qtyBought - this.qtySold;
     if (this.amount > 0.0)
     {
         this.qty = this.amount;
         return;
     }
     this.qty = -this.amount;
 }
Пример #7
0
		protected internal override void OnFill(Fill fill)
		{
			this.reportComponent.OnFill(fill);
		}
Пример #8
0
 private bool IsLong(Fill fill)
 {
     return fill.side == OrderSide.Buy;
 }
Пример #9
0
 private TradeInfo CreateTrade(Fill oppFill, Fill Fill, double qty)
 {
     return new TradeInfo
     {
         EntryDate = oppFill.DateTime,
         EntryPrice = oppFill.Price,
         EntryCost = oppFill.Commission * qty / oppFill.Qty,
         ExitDate = Fill.DateTime,
         ExitPrice = Fill.Price,
         ExitCost = Fill.Commission * qty / Fill.Qty,
         Qty = qty,
         IsLong = this.IsLong(oppFill)
     };
 }
Пример #10
0
 internal void OnExecutionReport(ExecutionReport report)
 {
     if (report.execType == ExecType.ExecTrade)
     {
         Fill fill = new Fill(report);
         report.order.portfolio.Add(fill);
     }
 }
Пример #11
0
 protected override void OnFill(Fill fill)
 {
     // Add fill to group.
     Log(fill, fillGroup);
 }
Пример #12
0
 public void Add(Fill fill)
 {
     this.fills.Add(fill);
     Instrument instrument = fill.instrument;
     bool flag = false;
     Position position = this.positionByInstrument[instrument.Id];
     if (position == null)
     {
         position = new Position(this, instrument);
         this.positionByInstrument[instrument.Id] = position;
         this.positions.Add(position);
         flag = true;
     }
     if (position.qty == 0.0)
     {
         flag = true;
     }
     position.Add(fill);
     this.account.Add(fill);
     if (flag)
     {
         this.framework.eventServer.OnPositionOpened(this, position);
         this.framework.eventServer.OnPositionChanged(this, position);
     }
     else
     {
         this.framework.eventServer.OnPositionChanged(this, position);
         if (position.qty == 0.0)
         {
             this.framework.eventServer.OnPositionClosed(this, position);
         }
     }
     this.framework.eventServer.OnFill(this, fill);
     if (this.parent != null)
     {
         this.parent.Add(fill);
     }
     this.statistics.Add(fill);
 }
Пример #13
0
 public OnFill(Portfolio portfolio, Fill fill)
 {
     this.portfolio = portfolio;
     this.fill = fill;
 }
Пример #14
0
		public Fill(Fill fill)
		{
			this.dateTime = fill.dateTime;
			this.order = fill.order;
			this.instrument = fill.instrument;
			this.currencyId = fill.currencyId;
			this.side = fill.side;
			this.qty = fill.qty;
			this.price = fill.price;
			this.commission = fill.commission;
			this.text = fill.text;
		}
Пример #15
0
 public void EnsureVisible(Fill fill)
 {
     if (fill.DateTime < MainSeries.FirstDateTime)
         return;
     int num = Math.Max(MainSeries.GetIndex(fill.DateTime, IndexOption.Prev), 0);
     int val2 = this.lastIndex - this.firstIndex + 1;
     int lastIndex = Math.Max(Math.Min(MainSeries.Count - 1, num + val2 / 5), val2);
     SetIndexInterval(lastIndex - val2 + 1, lastIndex);
     this.pads[0].SetSelectedObject(fill);
     this.polosaDate = MainSeries.GetDateTime(MainSeries.GetIndex(fill.DateTime, IndexOption.Prev));
     this.contentUpdated = true;
     Invalidate();
 }
Пример #16
0
 public void DrawFill(Fill fill, int padNumber)
 {
     lock (this.lockObject)
     {
         if (!this.volumePadShown && padNumber > 1)
             --padNumber;
         FillView view = new FillView(fill, this.pads[padNumber]);
         this.pads[padNumber].AddPrimitive(view);
         view.SetInterval(this.leftDateTime, this.rightDateTime);
     }
 }
Пример #17
0
 internal void Add(Fill fill)
 {
     this.detector.Add(fill);
 }
Пример #18
0
 internal void Add(Fill fill)
 {
     this.detector.Add(fill);
 }
Пример #19
0
 public void Push(Fill fill)
 {
     this.queue.Enqueue(fill);
 }
Пример #20
0
 public virtual void OnFill(Fill fill)
 {
 }
Пример #21
0
 protected internal virtual void OnFill(Fill fill)
 {
 }
Пример #22
0
 public void Add(Fill fill)
 {
     this.fills.Add(fill);
 }
Пример #23
0
 public void Push(Fill fill)
 {
     this.stack.Push(fill);
 }
Пример #24
0
		public void Add(Fill fill)
		{
			this.Add(new AccountTransaction(fill));
		}
Пример #25
0
		internal void OnFill(Portfolio portfolio, Fill fill)
		{
			this.OnEvent(new OnFill(portfolio, fill));
		}
Пример #26
0
 protected internal override void OnFill(Fill fill)
 {
     this.reportComponent.OnFill(fill);
 }