public AccountTransaction(Fill fill) { this.DateTime = fill.DateTime; this.Value = fill.CashFlow; this.CurrencyId = fill.CurrencyId; this.Text = fill.Text; }
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); } }
public AccountTransaction(Fill fill) { this.dateTime = fill.dateTime; this.value = fill.CashFlow; this.currencyId = fill.currencyId; this.text = fill.text; }
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); }
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}"; }
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; }
protected internal override void OnFill(Fill fill) { this.reportComponent.OnFill(fill); }
private bool IsLong(Fill fill) { return fill.side == OrderSide.Buy; }
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) }; }
internal void OnExecutionReport(ExecutionReport report) { if (report.execType == ExecType.ExecTrade) { Fill fill = new Fill(report); report.order.portfolio.Add(fill); } }
protected override void OnFill(Fill fill) { // Add fill to group. Log(fill, fillGroup); }
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); }
public OnFill(Portfolio portfolio, Fill fill) { this.portfolio = portfolio; this.fill = fill; }
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; }
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(); }
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); } }
internal void Add(Fill fill) { this.detector.Add(fill); }
public void Push(Fill fill) { this.queue.Enqueue(fill); }
public virtual void OnFill(Fill fill) { }
protected internal virtual void OnFill(Fill fill) { }
public void Add(Fill fill) { this.fills.Add(fill); }
public void Push(Fill fill) { this.stack.Push(fill); }
public void Add(Fill fill) { this.Add(new AccountTransaction(fill)); }
internal void OnFill(Portfolio portfolio, Fill fill) { this.OnEvent(new OnFill(portfolio, fill)); }