コード例 #1
0
        /// <summary>
        /// UPDATE TICK ONLINE 
        /// </summary>
        /// <param name="Tick"></param>
        public void UpdateTickMT4(Business.Tick Tick)
        {
            //Recive Tick From DDE
            if (Market.IsOpen)
            {
                //Find Symbol In List Market.QuoteList
                if (Market.QuoteList != null)
                {
                    //MarketQuoteList !=null
                    //
                    bool Flag = Business.Market.QuoteSymbols.ContainsKey(Tick.SymbolName);

                    if (Flag)
                    {
                        Business.QuoteSymbol newQuoteSymbol = new QuoteSymbol();
                        newQuoteSymbol = Business.Market.QuoteSymbols[Tick.SymbolName];
                        newQuoteSymbol.Update(Tick);
                    }
                    else
                    {
                        Business.QuoteSymbol newQuoteSymbol = new QuoteSymbol();
                        newQuoteSymbol.Name = Tick.SymbolName;

                        newQuoteSymbol.RefSymbol = this.GetSymbol(Tick.SymbolName);
                        if (newQuoteSymbol.RefSymbol.Count > 0)
                        {
                            Market.QuoteList.Add(newQuoteSymbol);
                            Business.Market.QuoteSymbols.Add(Tick.SymbolName, newQuoteSymbol);
                            newQuoteSymbol.Update(Tick);
                        }
                    }
                }   //End If Check Maraket.QuoteList != Null
                else
                {
                    //quote list is null
                    //
                    Market.QuoteList = new List<QuoteSymbol>();
                    Business.QuoteSymbol newQuoteSymbol = new QuoteSymbol();
                    newQuoteSymbol.Name = Tick.SymbolName;
                    newQuoteSymbol.RefSymbol = this.GetSymbol(Tick.SymbolName);

                    if (newQuoteSymbol.RefSymbol.Count > 0)
                    {
                        Market.QuoteList.Add(newQuoteSymbol);
                        Business.Market.QuoteSymbols.Add(Tick.SymbolName, newQuoteSymbol);
                        newQuoteSymbol.Update(Tick);
                    }
                }
                //End Else Check Market.QuoteList != Null
            }
            //End If Check Market.IsOpen
        }
コード例 #2
0
        /// <summary>
        /// UPDATE TICK ONLINE 
        /// </summary>
        /// <param name="Tick"></param>
        public void UpdateTick(Business.Tick Tick)
        {
            //Recive Tick From DDE
            if (Market.IsOpen)
            {
                //Find Symbol In List Market.QuoteList
                if (Market.QuoteList != null)
                {
                    //MarketQuoteList !=null
                    //
                    bool Flag = false;
                    int count = Market.QuoteList.Count;
                    for (int i = 0; i < count; i++)
                    {
                        if (Business.Market.QuoteList[i] == null)
                        {
                            Business.Market.QuoteList.RemoveAt(i);
                            i--;
                            count = Business.Market.QuoteList.Count;
                            continue;
                        }

                        if (Market.QuoteList[i].Name == Tick.SymbolName)
                        {
                            if (Market.QuoteList[i].RefSymbol.Count > 0)
                            {
                                Market.QuoteList[i].Update(Tick);
                            }
                            Flag = true;
                            break;
                        }
                    }

                    if (Flag == false)
                    {
                        Business.QuoteSymbol newQuoteSymbol = new QuoteSymbol();
                        newQuoteSymbol.Name = Tick.SymbolName;
                        //newQuoteSymbol.TickValue = Tick;
                        newQuoteSymbol.RefSymbol = this.GetReferenceSymbol(Tick.SymbolName);
                        //newQuoteSymbol.RefSymbol = this.GetSymbol(Tick.SymbolName);
                        if (newQuoteSymbol.RefSymbol.Count > 0)
                        {
                            Market.QuoteList.Add(newQuoteSymbol);
                            newQuoteSymbol.Update(Tick);
                        }
                    }
                }   //End If Check Maraket.QuoteList != Null
                else
                {
                    //quote list is null
                    //
                    Market.QuoteList = new List<QuoteSymbol>();
                    Business.QuoteSymbol newQuoteSymbol = new QuoteSymbol();
                    newQuoteSymbol.Name = Tick.SymbolName;
                    //newQuoteSymbol.TickValue = Tick;
                    newQuoteSymbol.RefSymbol = this.GetReferenceSymbol(Tick.SymbolName);
                    //newQuoteSymbol.RefSymbol = this.GetSymbol(Tick.SymbolName);
                    if (newQuoteSymbol.RefSymbol.Count > 0)
                    {
                        Market.QuoteList.Add(newQuoteSymbol);
                        newQuoteSymbol.Update(Tick);
                    }
                }
                //End Else Check Market.QuoteList != Null
            }
            //End If Check Market.IsOpen
        }