Ejemplo n.º 1
0
		private void zYSWMuDaZ6(object obj0, TransactionEventArgs obj1)
		{
			try
			{
				Transaction transaction = obj1.Transaction;
				if (this.statisticsPerInstrumentEnabled)
					this.portfolios[transaction.Instrument].Add(transaction);
				this.strategies[transaction.Strategy].CpbdZ1YMZ(transaction);
				this.OnTransactionAdded(transaction);
			}
			catch (Exception ex)
			{
				this.x6bWBlLIvv(ex);
			}
		}
Ejemplo n.º 2
0
 private void wFewIKaO9(object obj0, TransactionEventArgs obj1)
 {
   this.OnTransactionAdded(obj1.Transaction);
 }
Ejemplo n.º 3
0
		private void o38yaR1giJ(object obj0, TransactionEventArgs obj1)
		{
			lock (this)
			{
				if (!this.followChanges)
					return;
				this.tempPortfolio.Add(obj1.Transaction);
				this.tempPortfolio.Monitored = true;
				switch (obj1.Transaction.Side)
				{
					case Side.Buy:
						this.currentAccount -= FreeQuant.Instruments.Currency.Convert(obj1.Transaction.Value, obj1.Transaction.Currency, this.portfolio.Account.Currency);
						this.allocation += FreeQuant.Instruments.Currency.Convert(obj1.Transaction.Value, obj1.Transaction.Currency, this.portfolio.Account.Currency);
						this.allocationLong += FreeQuant.Instruments.Currency.Convert(obj1.Transaction.Value, obj1.Transaction.Currency, this.portfolio.Account.Currency);
						this.isAllocationLong = true;
						break;
					case Side.Sell:
						this.currentAccount += FreeQuant.Instruments.Currency.Convert(obj1.Transaction.Value, obj1.Transaction.Currency, this.portfolio.Account.Currency);
						this.allocation -= FreeQuant.Instruments.Currency.Convert(obj1.Transaction.Value, obj1.Transaction.Currency, this.portfolio.Account.Currency);
						this.allocationLong -= FreeQuant.Instruments.Currency.Convert(obj1.Transaction.Value, obj1.Transaction.Currency, this.portfolio.Account.Currency);
						this.isAllocationLong = true;
						break;
					case Side.BuyMinus:
						this.currentAccount -= FreeQuant.Instruments.Currency.Convert(obj1.Transaction.Value, obj1.Transaction.Currency, this.portfolio.Account.Currency);
						this.allocation += FreeQuant.Instruments.Currency.Convert(obj1.Transaction.Value, obj1.Transaction.Currency, this.portfolio.Account.Currency);
						this.allocationShort += FreeQuant.Instruments.Currency.Convert(obj1.Transaction.Value, obj1.Transaction.Currency, this.portfolio.Account.Currency);
						this.isAllocationShort = true;
						break;
					case Side.SellShort:
						this.currentAccount += FreeQuant.Instruments.Currency.Convert(obj1.Transaction.Value, obj1.Transaction.Currency, this.portfolio.Account.Currency);
						this.allocation -= FreeQuant.Instruments.Currency.Convert(obj1.Transaction.Value, obj1.Transaction.Currency, this.portfolio.Account.Currency);
						this.allocationShort -= FreeQuant.Instruments.Currency.Convert(obj1.Transaction.Value, obj1.Transaction.Currency, this.portfolio.Account.Currency);
						this.isAllocationShort = true;
						break;
				}
				if (this.isRoundTripsOnly)
				{
					if (!this.tempPortfolio.Positions.Contains(obj1.Transaction.Instrument))
					{
						this.roundTripList.CloseOpenRoundTrip(obj1.Transaction.Instrument, obj1.Transaction.Price, obj1.Transaction.DateTime);
						if (obj1.Transaction.Side == Side.Buy)
							this.shortRoundTripList.CloseOpenRoundTrip(obj1.Transaction.Instrument, obj1.Transaction.Price, obj1.Transaction.DateTime);
						else
							this.longRoundTripList.CloseOpenRoundTrip(obj1.Transaction.Instrument, obj1.Transaction.Price, obj1.Transaction.DateTime);
					}
					else if (this.tempPortfolio.Positions[obj1.Transaction.Instrument].Transactions.Count == 1)
					{
						PositionSide local_0 = PositionSide.Short;
						if (obj1.Transaction.Side == Side.Buy)
							local_0 = PositionSide.Long;
						RoundTrip local_1 = new RoundTrip(this.tempPortfolio.Positions[obj1.Transaction.Instrument], obj1.Transaction.Instrument, local_0, obj1.Transaction.Amount, obj1.Transaction.Price, obj1.Transaction.Price, obj1.Transaction.DateTime, obj1.Transaction.DateTime, RoundTripStatus.Opened);
						this.roundTripList.AddOpenRoundTrip(local_1);
						if (obj1.Transaction.Side == Side.Buy)
							this.longRoundTripList.AddOpenRoundTrip(local_1);
						else
							this.shortRoundTripList.AddOpenRoundTrip(local_1);
					}
					else
					{
						this.isRoundTripsOnly = false;
						this.EmitRoundTripsFinished();
					}
				}
				if (this.isRoundTripsOnly)
					this.roundTripList.UpdateOpenRoundTrips();
				this.currentAccount -= obj1.Transaction.Cost;
				this.cost += obj1.Transaction.Cost;
				if (this.isRoundTripsOnly)
				{
					this.EmitRoundTripsUpdated();
					this.EmitRoundTripStatisticChanged();
				}
				if (!this.waitingForStart)
					return;
				this.waitingForStart = false;
				this.awaitTime = this.GetIntervalEnd(obj1.Transaction.DateTime, this.timeInterval);
				this.awaitHandler = new ReminderEventHandler(this.JKNyi7SDXu);
				Clock.AddReminder(this.awaitHandler, this.awaitTime, (object)null);
			}
		}
Ejemplo n.º 4
0
 private void OnTransactionAdded(object sender, TransactionEventArgs e)
 {
 }
Ejemplo n.º 5
0
 private void OnTransactionAdded(object sender, TransactionEventArgs e)
 {
 }
Ejemplo n.º 6
0
 private void Portfolio_TransactionAdded(object sender, TransactionEventArgs args)
 {
     this.portfolio.Add(args.Transaction.Clone() as FreeQuant.Instruments.Transaction);
 }
Ejemplo n.º 7
0
 private void portfolio_TransactionAdded(object sender, TransactionEventArgs args)
 {
 }