Ejemplo n.º 1
0
 public AccountTransaction(Fill fill)
 {
     this.DateTime = fill.DateTime;
     this.Value = fill.CashFlow;
     this.CurrencyId = fill.CurrencyId;
     this.Text = fill.Text;
 }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 3
0
		public AccountTransaction(Fill fill)
		{
			this.dateTime = fill.dateTime;
			this.value = fill.CashFlow;
			this.currencyId = fill.currencyId;
			this.text = fill.text;
		}
Ejemplo n.º 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);
 }
Ejemplo n.º 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}";
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 7
0
		protected internal override void OnFill(Fill fill)
		{
			this.reportComponent.OnFill(fill);
		}
Ejemplo n.º 8
0
 private bool IsLong(Fill fill)
 {
     return fill.side == OrderSide.Buy;
 }
Ejemplo n.º 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)
     };
 }
Ejemplo n.º 10
0
 internal void OnExecutionReport(ExecutionReport report)
 {
     if (report.execType == ExecType.ExecTrade)
     {
         Fill fill = new Fill(report);
         report.order.portfolio.Add(fill);
     }
 }
Ejemplo n.º 11
0
 protected override void OnFill(Fill fill)
 {
     // Add fill to group.
     Log(fill, fillGroup);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 13
0
 public OnFill(Portfolio portfolio, Fill fill)
 {
     this.portfolio = portfolio;
     this.fill = fill;
 }
Ejemplo n.º 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;
		}
Ejemplo n.º 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();
 }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 17
0
 internal void Add(Fill fill)
 {
     this.detector.Add(fill);
 }
Ejemplo n.º 18
0
 internal void Add(Fill fill)
 {
     this.detector.Add(fill);
 }
Ejemplo n.º 19
0
 public void Push(Fill fill)
 {
     this.queue.Enqueue(fill);
 }
Ejemplo n.º 20
0
 public virtual void OnFill(Fill fill)
 {
 }
Ejemplo n.º 21
0
 protected internal virtual void OnFill(Fill fill)
 {
 }
Ejemplo n.º 22
0
 public void Add(Fill fill)
 {
     this.fills.Add(fill);
 }
Ejemplo n.º 23
0
 public void Push(Fill fill)
 {
     this.stack.Push(fill);
 }
Ejemplo n.º 24
0
		public void Add(Fill fill)
		{
			this.Add(new AccountTransaction(fill));
		}
Ejemplo n.º 25
0
		internal void OnFill(Portfolio portfolio, Fill fill)
		{
			this.OnEvent(new OnFill(portfolio, fill));
		}
Ejemplo n.º 26
0
 protected internal override void OnFill(Fill fill)
 {
     this.reportComponent.OnFill(fill);
 }