public void Add(Fill fill)
{
Fill fill2 = this.interface0_0.Peek();
if (fill2 == null)
{
this.instrument_0 = fill.Instrument;
this.timeSeries_0.Clear();
this.timeSeries_0.Add(this.portfolio_0.framework.Clock.DateTime, this.method_4(this.instrument_0));
}
if (fill2 != null && (!this.method_3(fill2) || !this.method_3(fill)) && (this.method_3(fill2) || this.method_3(fill)))
{
if (this.fill_0 != null)
{
fill = this.method_1(fill);
}
double num = fill.Qty;
while (num > 0.0 && (fill2 = this.interface0_0.Peek()) != null)
{
if (fill2.Qty > num)
{
this.fill_0 = new Fill(fill);
return;
}
this.BotEqOqmKI(this.method_2(fill2, fill, fill2.Qty));
this.interface0_0.Pop();
this.double_0 -= Math.Round(fill2.Qty, 5);
num -= Math.Round(fill2.Qty, 5);
if (this.double_0 > 0.0 && num > 0.0)
{
fill = this.method_0(fill, num);
}
}
if (num > 0.0)
{
this.double_0 = num;
Fill fill3 = this.method_0(fill, num);
this.interface0_0.Push(fill3);
}
if (this.fill_0 != null)
{
this.fill_0 = null;
}
return;
}
this.interface0_0.Push(fill);
this.double_0 += fill.Qty;
}