Exemple #1
0
		public void Add(QuoteEventArgs args)
		{
			lock (this.lockObject)
			{
				this.GetProviderCounter((IProvider)((IntradayEventArgs)args).Provider).AddQuote(((IntradayEventArgs)args).Instrument);
				this.Quotes.Increment();
			}
		}
Exemple #2
0
 private static void EmitNewQuote(object sender, QuoteEventArgs e)
 {
     if (ProviderManager.threadSafe)
     {
         Monitor.Enter(ProviderManager.dataLock);
     }
     try
     {
         if (ProviderManager.NewQuote != null)
         {
             ProviderManager.NewQuote(sender, e);
         }
     }
     finally
     {
         if (ProviderManager.threadSafe)
         {
             Monitor.Exit(ProviderManager.dataLock);
         }
     }
 }
Exemple #3
0
 private void OnNewQuote(object sender, QuoteEventArgs args)
 {
   if (!this.isRunning || !this.cbxQuotes.Checked)
     return;
   this.queue.Enqueue((Action) (() =>
   {
     Instrument local_0 = ((IntradayEventArgs) args).Instrument as Instrument;
     InstrumentRow local_1 = this.instruments[local_0] as InstrumentRow;
     if (local_1 == null)
       return;
     local_0.Add(args.Quote);
     ++local_1.Quotes;
   }));
 }
Exemple #4
0
        private static void OnNewQuote(object sender, QuoteEventArgs e)
        {
            Instrument instrument = e.Instrument as Instrument ?? InstrumentManager.Instruments[e.Instrument.Symbol, e.Provider.Name];
            if (instrument == null)
                return;

            Quote quote = e.Quote;
            if (DataManager.quoteArrayLength != 0)
            {
                QuoteArray quoteArray = DataManager.quoteArrayList[instrument];
                quoteArray.Add(quote);
                if (DataManager.quoteArrayLength != -1 && quoteArray.Count > DataManager.quoteArrayLength)
                {
                    quoteArray.RemoveAt(0);
                }
            }
            instrument.EmitNewQuote(new QuoteEventArgs(quote, instrument, e.Provider));
        }
Exemple #5
0
 private void ProviderManager_NewQuote(object sender, QuoteEventArgs args)
 {
     this.counter.Add(args);
 }
Exemple #6
0
		internal void ERTWhrXHxn(QuoteEventArgs obj0)
		{
			try
			{
				Instrument instrument = obj0.Instrument as Instrument;
				Quote quote = obj0.Quote;
				foreach (StrategyBase strategyBase in this.MU0WP1r0b1(obj0.Provider, instrument))
					strategyBase.miSxH6BDd(instrument, quote);
				this.metaMoneyManager.OnQuote(instrument, quote);
				this.OnNewQuote(instrument, quote);
			}
			catch (Exception ex)
			{
				this.x6bWBlLIvv(ex);
			}
		}
Exemple #7
0
		private void PyJFklA8yp(object obj0, QuoteEventArgs obj1)
		{
			SingleOrder singleOrder = this.PYBF7sahqY as SingleOrder;
			Quote quote = obj1.Quote;
			if (this.A8bFJItyyx.FillAtWorstQuoteRate || this.smCF4MYTNu.Bid <= this.smCF4MYTNu.Ask || quote.Bid <= quote.Ask)
			{
				switch (singleOrder.Side)
				{
					case Side.Buy:
						if (quote.Ask != this.smCF4MYTNu.Ask || quote.AskSize != this.smCF4MYTNu.AskSize)
						{
							this.Y18FFPmDy5(quote, (Trade) null, (Bar) null);
							break;
						}
						else
							break;
					case Side.Sell:
					case Side.SellShort:
						if (quote.Bid != this.smCF4MYTNu.Bid || quote.BidSize != this.smCF4MYTNu.BidSize)
						{
							this.Y18FFPmDy5(quote, (Trade) null, (Bar) null);
							break;
						}
						else
							break;
				}
			}
			else
			{
				switch (singleOrder.Side)
				{
					case Side.Buy:
						if (quote.Bid != this.smCF4MYTNu.Bid || quote.BidSize != this.smCF4MYTNu.BidSize)
						{
							this.Y18FFPmDy5(quote, (Trade) null, (Bar) null);
							break;
						}
						else
							break;
					case Side.Sell:
					case Side.SellShort:
						if (quote.Ask != this.smCF4MYTNu.Ask || quote.AskSize != this.smCF4MYTNu.AskSize)
						{
							this.Y18FFPmDy5(quote, (Trade) null, (Bar) null);
							break;
						}
						else
							break;
				}
			}
			this.smCF4MYTNu = quote;
		}
Exemple #8
0
 internal void EmitNewQuote(QuoteEventArgs e)
 {
     this.Quote = e.Quote;
     if (this.NewQuote != null)
     {
         this.NewQuote(this, e);
     }
 }
Exemple #9
0
		public void OnNewQuote(object sender, QuoteEventArgs args)
		{
			if (((IntradayEventArgs)args).Instrument != this.instrument)
				return;
			if (((DataArray)DataManager.Quotes[this.instrument]).Count == 1 && ((DataArray)DataManager.Trades[this.instrument]).Count == 0)
				this.isFirstTime = true;
			DateTime lastDateTime = ((DataArray)DataManager.Quotes[this.instrument]).LastDateTime;
			int num = ((DataArray)DataManager.Quotes[this.instrument]).Count - 2;
			while (num >= 0 && DataManager.Quotes[this.instrument][num].DateTime == lastDateTime)
				--num;
			if (num < 0)
				return;
//			DataManager.Quotes[this.instrument][num].DateTime;
			if (lastDateTime >= this.lastUpdateDate)
			{
				if (this.isFirstTime)
				{
					this.pad.SetRangeX((double)(((DataArray)DataManager.Quotes[this.instrument]).LastDateTime.Ticks - 9000000000L), (double)((DataArray)DataManager.Quotes[this.instrument]).LastDateTime.Ticks);
					this.isFirstTime = false;
				}
				else
					this.pad.SetRangeX((double)((DataArray)DataManager.Quotes[this.instrument]).LastDateTime.Ticks + this.pad.XMin - (double)this.lastUpdateDate.Ticks, (double)((DataArray)DataManager.Quotes[this.instrument]).LastDateTime.Ticks + (this.pad.XMax - (double)this.lastUpdateDate.Ticks));
			}
			this.lastUpdateDate = lastDateTime;
		}
Exemple #10
0
 private static void EmitNewQuote(object sender, QuoteEventArgs e)
 {
     if (ProviderManager.threadSafe)
         Monitor.Enter(ProviderManager.dataLock);
     try
     {
         if (ProviderManager.NewQuote != null)
             ProviderManager.NewQuote(sender, e);
     }
     finally
     {
         if (ProviderManager.threadSafe)
             Monitor.Exit(ProviderManager.dataLock);
     }
 }
Exemple #11
0
 private void ProviderManager_NewQuote(object sender, QuoteEventArgs args)
 {
   lock (this)
   {
     ++this.countQuote;
     ++this.countMarketDataTotal;
   }
 }
Exemple #12
0
 private void marketDataProvider_NewQuote(object sender, QuoteEventArgs args)
 {
     FreeQuant.Instruments.Instrument instrument = args.Instrument as FreeQuant.Instruments.Instrument;
     List<StrategyRunner> list = (List<StrategyRunner>)null;
     if (!this.instrumentTable.TryGetValue(instrument, out list))
         return;
     foreach (StrategyRunner strategyRunner in list)
     {
         if (strategyRunner.Enabled)
             strategyRunner.SetNewQuote(instrument, args.Quote);
     }
 }
Exemple #13
0
 protected virtual void OnNewQuote(object sender, QuoteEventArgs args)
 {
     if (((IntradayEventArgs)args).Provider != this.marketDataProvider)
         return;
     QuoteViewRow quoteViewRow;
     bool flag;
     lock (this.lockObject)
         flag = this.quoteRows.TryGetValue(((IntradayEventArgs)args).Instrument, out quoteViewRow);
     if (!flag)
         return;
     if (this.eventQueue.Enabled)
         this.eventQueue.Enqueue(new MarketDataUpdateItem((MarketDataViewRow)quoteViewRow, args.Quote, (Trade)null, (Bar)null));
     else
         quoteViewRow.Update(args.Quote, (Trade)null, (Bar)null);
     this.instrumentPad.OnNewQuote(sender, args);
 }