Esempio n. 1
0
        /// <summary>
        ///   取得陣列內的MitakeQuote類別資料
        /// </summary>
        /// <param name="serial">股票流水號</param>
        /// <returns>返回值: MitakeQuote類別</returns>
        internal MitakeQuote GetQuote(int serial)
        {
            MitakeQuote cMitakeQuote = null;
            int         iIndex       = 0;

            lock (__cKeys) {
                if (__cKeys.TryGetValue(serial, out iIndex))
                {
                    cMitakeQuote = __cQuotes[iIndex];

                    if (cMitakeQuote.SymbolId.Length == 0)
                    {
                        SetSymbolInformation(cMitakeQuote, MitakeSymbolManager.GetQuoteSymbolInformation(serial));
                    }
                }
                else
                {
                    MitakeSymbolInformation cSymbolInfo = MitakeSymbolManager.GetQuoteSymbolInformation(serial);

                    int iMarketType = ((cSymbolInfo == null) ? 0 : cSymbolInfo.市場別);
                    int iCapacity   = ((iMarketType == 2) ? 16384 : 1024);
                    cMitakeQuote        = new MitakeQuote(iCapacity);
                    cMitakeQuote.Serial = serial;

                    SetSymbolInformation(cMitakeQuote, cSymbolInfo);

                    iIndex = __cQuotes.Count;
                    __cKeys.Add(serial, iIndex);
                    __cQuotes.Add(cMitakeQuote);
                }
            }
            return(cMitakeQuote);
        }
Esempio n. 2
0
                internal static void Decode(MitakeQuote stock, Mitake.Sockets.Data.PacketBuffer Buffer) {
                        int iSize = 0;
                        
                        float fPeferPrice = 0;
                        byte bNumber = 0, bMode = 0, bFlag = 0, bBuyFlag = 0;

                        iSize = Buffer.Length - 2;
                        Buffer.Position = 7;  //移動至資料結構

			int iCount = MitakeEntrust.MAX_DOM_COUNT;
			for (int i = 1; i < iCount; i++) {
                                stock.委買委賣資訊.Ask[i] = DOMPrice.EMPTY;
				stock.委買委賣資訊.Bid[i] = DOMPrice.EMPTY;
			}

                        do {
                                //取得價量旗標
                                bFlag = Buffer[0];
                                ++Buffer.Position;

                                bNumber = BitConvert.GetValue(bFlag, 0, 3);
                                ++bNumber;

                                //買賣型態(0=委買量  1=委賣量)
                                bBuyFlag = BitConvert.GetValue(bFlag, 3, 1);

				double dPrice = 0, dVolume = 0;
				if (bBuyFlag == 0) {
                                        //取得委買價模式
                                        bMode = BitConvert.GetValue(bFlag, 6, 2);
                                        dPrice = Price.GetPrice(bMode, Buffer, ref fPeferPrice);

                                        //取得委買量模式
                                        bMode = BitConvert.GetValue(bFlag, 4, 2);
                                        dVolume = Volumn.GetVolumn(bMode, Buffer);

					if (bNumber < MitakeEntrust.MAX_DOM_COUNT) {
						stock.委買委賣資訊.Bid[bNumber] = new DOMPrice(dPrice, dVolume);
					}
                                } else {
                                        //取得委賣價模式
                                        bMode = BitConvert.GetValue(bFlag, 6, 2);
                                        dPrice = Price.GetPrice(bMode, Buffer, ref fPeferPrice);

                                        //取得委賣量模式
                                        bMode = BitConvert.GetValue(bFlag, 4, 2);
                                        dVolume = Volumn.GetVolumn(bMode, Buffer);

					if (bNumber < MitakeEntrust.MAX_DOM_COUNT) {
						stock.委買委賣資訊.Ask[bNumber] = new DOMPrice(dPrice, dVolume);
					}
				}
                        } while (Buffer.Position < iSize); //End While
                        
                        ++stock.UpdateCount;
                }
Esempio n. 3
0
 private void SetSymbolInformation(MitakeQuote quote, MitakeSymbolInformation info)
 {
     if (info != null)
     {
         quote.FutureMark = info.FutureMark;
         quote.SymbolId   = info.SymbolId;
         quote.SymbolName = info.SymbolName;
         quote.市場別        = info.市場別;
         quote.警示         = info.警示;
         quote.市          = info.市;
         quote.市場分類       = info.市場分類;
         quote.產業別        = info.產業別;
         quote.證券別        = info.證券別;
     }
 }
Esempio n. 4
0
		internal static void Decode(MitakeQuote stock, Mitake.Sockets.Data.PacketBuffer Buffer) {
			int iSize = Buffer.Length - 2;
			byte bSType = Buffer.Data[6];

			Buffer.Position = 9;

			//取得時間
			//if ((bSType & 0x80) == 0) {
			//        iTime = Time.GetTime(Buffer);
			//} else {
			//        iTime = Time.GetOther(Buffer);
			//}

			//取得價量旗標與戳合類型
			byte bFlag = Buffer[0];
			++Buffer.Position;

			stock.戳合類型 = BitConvert.GetValue(bFlag, 2, 2);
		}
Esempio n. 5
0
                internal static void Decode(MitakeQuote stock, Mitake.Sockets.Data.PacketBuffer Buffer) {
                        float fReferPrice = 0;
                        byte bMode = 0, bFlag = 0;

                        Buffer.Position = 7;                   //移動至資料結構 
                        bFlag = Buffer.Data[Buffer.Position];
                        ++Buffer.Position;

                        //取得參考價模式
                        bMode = BitConvert.GetValue(bFlag, 6, 2);
                        stock.ReferPrice = Price.GetPrice(bMode, Buffer, ref fReferPrice);
                                
                        //取得參考價模式
                        bMode = BitConvert.GetValue(bFlag, 4, 2);
                        stock.漲停價 = Price.GetPrice(bMode, Buffer, ref fReferPrice);
                                
                        //取得參考價模式
                        bMode = BitConvert.GetValue(bFlag, 2, 2);
                        stock.跌停價 = Price.GetPrice(bMode, Buffer, ref fReferPrice);

                        ++stock.UpdateCount;
                }
Esempio n. 6
0
                /// <summary>
		///   取得陣列內的MitakeQuote類別資料
                /// </summary>
                /// <param name="serial">股票流水號</param>
		/// <returns>返回值: MitakeQuote類別</returns>
		internal MitakeQuote GetQuote(int serial) {
			MitakeQuote cMitakeQuote = null;
			int iIndex = 0;
			lock (__cKeys) {
				if (__cKeys.TryGetValue(serial, out iIndex)) {
					cMitakeQuote = __cQuotes[iIndex];

					if (cMitakeQuote.SymbolId.Length == 0) {
						SetSymbolInformation(cMitakeQuote, MitakeSymbolManager.GetQuoteSymbolInformation(serial));
					}
				} else {
					MitakeSymbolInformation cSymbolInfo = MitakeSymbolManager.GetQuoteSymbolInformation(serial);

					int iMarketType = ((cSymbolInfo == null) ? 0 : cSymbolInfo.市場別);
					int iCapacity = ((iMarketType == 2) ? 16384 : 1024);
					cMitakeQuote = new MitakeQuote(iCapacity);
					cMitakeQuote.Serial = serial;

					SetSymbolInformation(cMitakeQuote, cSymbolInfo);

					iIndex = __cQuotes.Count;
					__cKeys.Add(serial, iIndex);
					__cQuotes.Add(cMitakeQuote);
				}
			}
			return cMitakeQuote;
		}
Esempio n. 7
0
		private void SetSymbolInformation(MitakeQuote quote, MitakeSymbolInformation info) {
			if (info != null) {
				quote.FutureMark = info.FutureMark;
				quote.SymbolId = info.SymbolId;
				quote.SymbolName = info.SymbolName;
				quote.市場別 = info.市場別;
				quote.警示 = info.警示;
				quote.下市 = info.下市;
				quote.市場分類 = info.市場分類;
				quote.產業別 = info.產業別;
				quote.證券別 = info.證券別;
			}
		}
Esempio n. 8
0
                private static void Decoder(MitakeQuote stock, Mitake.Sockets.Data.PacketBuffer Buffer) {
                        float fReferPrice = 0;
                        byte bMode = 0, bModule = 0, bPVFlag = 0, bFlag = 0;

                        int iSize = Buffer.Length - 2;
                        Buffer.Position = 7;

                        do {
                                bFlag = Buffer[0];  //移動至資料結構
                                ++Buffer.Position;

                                //取得(價/量)旗標 0=量  1=價
                                bPVFlag = BitConvert.GetValue(bFlag, 5, 1);

                                //取得參考價或是成交量模式
                                bMode = BitConvert.GetValue(bFlag, 6, 2);
                                bModule = BitConvert.GetValue(bFlag, 0, 6);

                                switch (bModule) {
                                        case 2: //累計買量
                                                stock.累計買量 = Volumn.GetVolumn(bMode, Buffer);
                                                break;
                                        case 3: //累計賣量
                                                stock.累計賣量 = Volumn.GetVolumn(bMode, Buffer);
                                                break;
                                        case 4: //即時單筆買進巨量
                                                stock.單筆買進巨量 = Volumn.GetVolumn(bMode, Buffer);
                                                break;
                                        case 5: //即時單筆賣出巨量
                                                stock.單筆賣出巨量 = Volumn.GetVolumn(bMode, Buffer);
                                                break;
                                        case 6: //(即時)累計買進巨量
                                                stock.累計買進巨量 = Volumn.GetVolumn(bMode, Buffer);
                                                break;
                                        case 7: //(即時)累計賣出巨量
                                                stock.累計賣出巨量 = Volumn.GetVolumn(bMode, Buffer);
                                                break;
                                        case 8: //即時)量幅,小數兩位(每3筆送一次)
                                                stock.即時量幅 = (float)(Volumn.GetVolumn(bMode, Buffer) * 0.01);
                                                break;
                                        case 9: //(即時)買氣,0~100,賣氣=100-買氣(每3筆送一次)
                                                stock.買進量百分比 = (byte)Volumn.GetVolumn(bMode, Buffer);
                                                break;
                                        case 15: //昨日總成交量
                                                stock.昨日總成交量 = Volumn.GetVolumn(bMode, Buffer);
                                                break;
                                        case 17: //買進成交筆數(股票與選擇權共用)
                                                stock.買進成交筆數 = Volumn.GetVolumn(bMode, Buffer);
                                                break;
                                        case 18: //賣出成交筆數(股票與選擇權共用)
                                                stock.賣出成交筆數 = Volumn.GetVolumn(bMode, Buffer);
                                                break;
                                        case 19: //總成交合約數(股票與選擇權共用)
                                                stock.總成交合約數 = Volumn.GetVolumn(bMode, Buffer);
                                                break;
                                        case 20: //買進累計委託筆數
                                                stock.買進累計委託筆數 = Volumn.GetVolumn(bMode, Buffer);
                                                break;
                                        case 21: //買進累計委託合約量
                                                stock.買進累計委託合約量 = Volumn.GetVolumn(bMode, Buffer);
                                                break;
                                        case 22: //賣出累計委託筆數
                                                stock.賣出累計委託筆數 = Volumn.GetVolumn(bMode, Buffer);
                                                break;
                                        case 23: //賣出累計委託合約量
                                                stock.賣出累計委託合約量 = Volumn.GetVolumn(bMode, Buffer);
                                                break;
                                        case 24: //未平倉合約數(收盤後)
                                                stock.未平倉合約數 = Volumn.GetVolumn(bMode, Buffer);
                                                break;
                                        case 25: //選擇權:委託買進總口數
                                                stock.委託買進總口數 = Volumn.GetVolumn(bMode, Buffer);
                                                break;
                                        case 26: //選擇權:委託賣出總口數
                                                stock.委託賣出總口數 = Volumn.GetVolumn(bMode, Buffer);
                                                break;
                                        case 27: //選擇權:總成交筆數 
                                                stock.總成交筆數 = Volumn.GetVolumn(bMode, Buffer);
                                                break;
                                        case 32: //(即時)均價(每10筆送一次)
                                                stock.即時均價 = Price.GetPrice(bMode, Buffer, ref fReferPrice);
                                                break;
                                        case 40: //昨日最高價
                                                stock.昨日最高價 = Price.GetPrice(bMode, Buffer, ref fReferPrice);
                                                break;
                                        case 41: //昨日最低價
                                                stock.昨日最低價 = Price.GetPrice(bMode, Buffer, ref fReferPrice);
                                                break;
                                        case 42: //今日開盤價
                                                stock.Open = Price.GetPrice(bMode, Buffer, ref fReferPrice);
                                                break;
                                        case 43: //今日最高價
                                                stock.High = Price.GetPrice(bMode, Buffer, ref fReferPrice);
                                                break;
                                        case 44: //今日最低價
                                                stock.Low = Price.GetPrice(bMode, Buffer, ref fReferPrice);
                                                break;
                                        case 45: //今日收盤價
                                                stock.Close = Price.GetPrice(bMode, Buffer, ref fReferPrice);
                                                break;
                                        case 54: //結算價(收盤後)
                                                stock.結算價 = Price.GetPrice(bMode, Buffer, ref fReferPrice);
                                                break;
                                        default: //其他屬於盤後資料(已經不計入範圍內)
                                                if (bPVFlag == 0)
                                                        Volumn.GetVolumn(bMode, Buffer);
                                                else
                                                        Price.GetPrice(bMode, Buffer, ref fReferPrice);
                                                break;
                                }//end switch
                        } while (Buffer.Position < iSize);//end while

                        ++stock.UpdateCount;
                }
Esempio n. 9
0
                internal static void Decode(MitakeQuote stock, PacketBuffer buffer) {
			DateTime cTime;
                        bool isHave = false;
			int iSerial = 0;
			float fReferPrice = 0;
                        byte bType = 0, bMode = 0, bVType = 0, bFlag = 0;
                        MitakeQuoteTick cTick = null;

                        int iSize = buffer.Length - 2;
                        byte bSType = buffer.Data[6];

			buffer.Position = 7;

                        if ((bSType & 0xf) == 11) {
                                iSerial = ((buffer[0] << 8) + buffer[1]);
                                buffer.Position = 9;
                        } else {
                                iSerial = (buffer[0] << 16) + (buffer[1] << 8) + buffer[2];
                                buffer.Position = 10;
                        }

                        do {
                                //取得類型
                                bType = BitConvert.GetValue(buffer[0], 7, 1);

                                //取得時間
                                if ((bSType & 0x80) == 0) {
                                        cTime = Time.GetTime(buffer);
                                } else {
                                        cTime = Time.GetOther(buffer);
                                }

                                isHave = stock.GetMitakeTick(iSerial, ref cTick);
                                cTick.Time = cTime;

                                bFlag = buffer[0]; //取得價量旗標
                                ++buffer.Position;

                                cTick.類型 = bType;  //類型  0=即時  1=盤後(此封包為盤後封包)

                                //買賣型態(0=無法區分  1=買盤量  2=賣盤量)
                                bVType = BitConvert.GetValue(bFlag, 2, 2);
                                cTick.買賣盤 = bVType;

                                //取得成交價模式
                                bMode = BitConvert.GetValue(bFlag, 6, 2);
                                cTick.Price = Price.GetPrice(bMode, buffer, ref fReferPrice);
                                Decode_S31.CalculatePrice(stock, iSerial, cTick.Price); //計算 開盤 最高 最低

                                //取得單量模式
                                bMode = BitConvert.GetValue(bFlag, 4, 2);
                                cTick.Single = Volumn.GetVolumn(bMode, buffer);

                                //取得委買價
				cTick.Bid = new DOMPrice(cTick.Price - EntrustPrice(BitConvert.GetValue(bFlag, 1, 1), buffer), cTick.Bid.Size);

                                //取得委賣價
				cTick.Ask = new DOMPrice(cTick.Price + EntrustPrice(BitConvert.GetValue(bFlag, 0, 1), buffer), cTick.Ask.Size);

                                if (!isHave) {
                                        stock.今日總成交額 += cTick.Price * cTick.Single;
                                }

                                if (iSerial > stock.即時資訊.Serial) {
                                        Decode_S31.CalculateEntrust(stock, cTick); //計算第一檔委買賣
                                }

                                ++iSerial;
                        } while (buffer.Position < iSize);//End While
		}
Esempio n. 10
0
		internal static void Decode(MitakeQuote stock, Mitake.Sockets.Data.PacketBuffer Buffer) {
			DateTime cTime;
			float fReferPrice = 0;
			double dAskP = 0, dAskV = 0, dBidP = 0, dBidV = 0, dPrice = 0, dVolume = 0, dSingle = 0;
			byte bType = 0, bMode = 0, bPType = 0, bVType = 0, bFlag = 0, b類型 = 0, b買賣盤 = 0, b價格類型 = 0;

			int iSerial = 0, iSize = Buffer.Length - 2;
			byte bSType = Buffer.Data[6];

			Buffer.Position = 7;

			//取得序號
			if ((bSType & 0xf) == 1) {
				iSerial = (Buffer[0] << 8) + Buffer[1];
				Buffer.Position = 9;
			} else {
				iSerial = (Buffer[0] << 16) + (Buffer[1] << 8) + Buffer[2];
				Buffer.Position = 10;
			}

			//取得類型
			bType = BitConvert.GetValue(Buffer[0], 7, 1);

			//取得時間
			if ((bSType & 0x80) == 0) {
				cTime = Time.GetTime(Buffer);
			} else {
				cTime = Time.GetOther(Buffer);
			}

			do {
				//取得價量旗標
				bFlag = Buffer[0];
				++Buffer.Position;

				b類型 = bType;  //類型  0=即時  1=盤後

				//判斷是否是單量(1110B)
				if (BitConvert.GetValue(bFlag, 0, 4) == 0xe) {
					//買賣型態(0=無法區分買賣盤量  1=買量  2=賣量)
					bVType = BitConvert.GetValue(bFlag, 6, 2);
					b買賣盤 = bVType;

					bMode = BitConvert.GetValue(bFlag, 4, 2);
					dSingle = Volumn.GetVolumn(bMode, Buffer);
				} else {
					//買賣型態(0=無法確定 1=買盤 2=賣盤 3=委託買賣)
					bVType = BitConvert.GetValue(bFlag, 2, 2);

					//價位型態(0=一般成交價 1=開 2=高 3=低)
					//如果買賣型態為委託買賣(0=委買 1=委賣)
					bPType = BitConvert.GetValue(bFlag, 0, 2);

					//取得成交價或委託價模式
					bMode = BitConvert.GetValue(bFlag, 6, 2);

					switch (bVType) {
						case 3: //委買委賣格式
							if (bPType == 0) {
								dBidP = Price.GetPrice(bMode, Buffer, ref fReferPrice);

								//取得委買量模式
								bMode = BitConvert.GetValue(bFlag, 4, 2);
								dBidV = Volumn.GetVolumn(bMode, Buffer);
							} else {
								dAskP = Price.GetPrice(bMode, Buffer, ref fReferPrice);

								//取得委賣量模式
								bMode = BitConvert.GetValue(bFlag, 4, 2);
								dAskV = Volumn.GetVolumn(bMode, Buffer);
							}
							break;
						default: //一般成交格式
							b價格類型 = bPType;
							dPrice = Price.GetPrice(bMode, Buffer, ref fReferPrice);

							CalculatePrice(stock, iSerial, dPrice);

							bMode = BitConvert.GetValue(bFlag, 4, 2);
							dVolume = Volumn.GetVolumn(bMode, Buffer);
							break;
					}
				}
			} while (Buffer.Position < iSize); //End While

			MitakeQuoteTick cTick = null;
			bool bHave = stock.GetMitakeTick(iSerial, ref cTick);
			MitakeQuoteTick cPrevTick = stock.GetPreviousTick(iSerial);
			if (bHave) {
				cTick.Time = cTime;
				cTick.Ask = new DOMPrice(dAskP, dAskV);
				cTick.Bid = new DOMPrice(dBidP, dBidV);
			} else {
				cTick.類型 = b類型;
				cTick.買賣盤 = b買賣盤;
				cTick.價格類型 = b價格類型;
				cTick.Time = cTime;
				cTick.Price = dPrice;
				cTick.Volume = dVolume;
				cTick.Single = dSingle;
				cTick.Ask = (dAskP == 0 && dAskV == 0 && cPrevTick != null) ? cPrevTick.Ask : new DOMPrice(dAskP, dAskV);
				cTick.Bid = (dBidP == 0 && dBidV == 0 && cPrevTick != null) ? cPrevTick.Bid : new DOMPrice(dBidP, dBidV);

				if (dPrice > 0 && dVolume > 0) {  //如果有價量才計算成交金額與更換最新的即時資訊訊息
					stock.今日總成交額 += cTick.Price * cTick.Single;
					if (iSerial > stock.即時資訊.Serial) {
						stock.今日總成交量 = cTick.Volume;
						stock.即時資訊 = cTick;
					}
				}
			}

			//填入委託價格第一檔
			CalculateEntrust(stock, cTick);

			//計算委託價格買賣盤
			MitakeEntrust.ComparePrice(cTick, cPrevTick);
			++stock.UpdateCount;
		}
Esempio n. 11
0
                //計算第一檔委買賣
                internal static void CalculateEntrust(MitakeQuote stock, MitakeQuoteTick tick) {
                        //if (Time.ConvertForTotalSeconds(Turnover.Time) <= 50400) {  //14:00以下的委買委賣量 才算有交割資料
			if (tick.Ask.Price > 0 && tick.Ask.Size > 0) {
				stock.委買委賣資訊.Ask[0] = tick.Ask;
			}

			if (tick.Bid.Price > 0 && tick.Bid.Size > 0) {
				stock.委買委賣資訊.Bid[0] = tick.Bid;
			}
                        //}
                }
Esempio n. 12
0
                //計算個股(開盤價 最高價 最低價)
                internal static void CalculatePrice(MitakeQuote quote, int serial, double price) {
                        if (price == 0) return;
                        quote.Open = ((serial == 1) ? price : quote.Open);
                        quote.High = ((quote.High == 0) ? price : ((price > quote.High) ? price : quote.High));
                        quote.Low = ((quote.Low == 0) ? price : ((price < quote.Low) ? price : quote.Low));
			quote.Close = price;
                }
Esempio n. 13
0
                internal static void Decode(MitakeQuote quote, PacketBuffer Buffer) {
                        byte bFlag = 0;
                        int iFormatIndex = 7;
                        float fReferPrice = 0;
			double[,] dPrices = new double[2,5];
			double[,] dVolumes = new double[2,5];

                        int iSize = Buffer.Length - 1;
                        if (iSize == 0) { //如果長度為0表示此回補已經回補完畢
                                return;
                        }
                        
                        Buffer.Position = 15; //移動至資料結構

			quote.即時資訊.Time = Time.GetTime(Buffer);

                        bFlag = Buffer.Data[iFormatIndex++];
                        quote.ReferPrice = Price.GetPrice(BitConvert.GetValue(bFlag, 6, 2), Buffer, ref fReferPrice);
                        quote.即時資訊.Price = Price.GetPrice(BitConvert.GetValue(bFlag, 4, 2), Buffer, ref fReferPrice);
                        dPrices[0, 0] = Price.GetPrice(BitConvert.GetValue(bFlag, 2, 2), Buffer, ref fReferPrice);
			dPrices[1, 0] = Price.GetPrice(BitConvert.GetValue(bFlag, 0, 2), Buffer, ref fReferPrice);

                        bFlag = Buffer.Data[iFormatIndex++];
                        quote.即時資訊.Volume = Volumn.GetVolumn(BitConvert.GetValue(bFlag, 6, 2), Buffer);
                        quote.今日總成交量 = quote.即時資訊.Volume;
                        quote.即時資訊.Single = Volumn.GetVolumn(BitConvert.GetValue(bFlag, 4, 2), Buffer);
                        dVolumes[0, 0] = Volumn.GetVolumn(BitConvert.GetValue(bFlag, 2, 2), Buffer);
			dVolumes[1, 0] = Volumn.GetVolumn(BitConvert.GetValue(bFlag, 0, 2), Buffer);

                        bFlag = Buffer.Data[iFormatIndex++];
                        quote.Open = Price.GetPrice(BitConvert.GetValue(bFlag, 6, 2), Buffer, ref fReferPrice);
                        quote.High = Price.GetPrice(BitConvert.GetValue(bFlag, 4, 2), Buffer, ref fReferPrice);
                        quote.Low = Price.GetPrice(BitConvert.GetValue(bFlag, 2, 2), Buffer, ref fReferPrice);
                        quote.昨日最高價 = Price.GetPrice(BitConvert.GetValue(bFlag, 0, 2), Buffer, ref fReferPrice);

                        bFlag = Buffer.Data[iFormatIndex++];
                        quote.昨日最低價 = Price.GetPrice(BitConvert.GetValue(bFlag, 6, 2), Buffer, ref fReferPrice);
                        quote.昨日總成交量 = Volumn.GetVolumn(BitConvert.GetValue(bFlag, 4, 2), Buffer);
                        quote.未平倉合約數 = Volumn.GetVolumn(BitConvert.GetValue(bFlag, 2, 2), Buffer);
                        dPrices[0, 1] = Price.GetPrice(BitConvert.GetValue(bFlag, 0, 2), Buffer, ref fReferPrice);

                        bFlag = Buffer.Data[iFormatIndex++];
			dPrices[0, 2] = Price.GetPrice(BitConvert.GetValue(bFlag, 6, 2), Buffer, ref fReferPrice);
                        dPrices[0, 3] = Price.GetPrice(BitConvert.GetValue(bFlag, 4, 2), Buffer, ref fReferPrice);
			dPrices[0, 4] = Price.GetPrice(BitConvert.GetValue(bFlag, 2, 2), Buffer, ref fReferPrice);
			dPrices[1, 1] = Price.GetPrice(BitConvert.GetValue(bFlag, 0, 2), Buffer, ref fReferPrice);

                        bFlag = Buffer.Data[iFormatIndex++];
			dPrices[1, 2] = Price.GetPrice(BitConvert.GetValue(bFlag, 6, 2), Buffer, ref fReferPrice);
			dPrices[1, 3] = Price.GetPrice(BitConvert.GetValue(bFlag, 4, 2), Buffer, ref fReferPrice);
			dPrices[1, 4] = Price.GetPrice(BitConvert.GetValue(bFlag, 2, 2), Buffer, ref fReferPrice);
                        dVolumes[0, 1] = Volumn.GetVolumn(BitConvert.GetValue(bFlag, 0, 2), Buffer);

                        bFlag = Buffer.Data[iFormatIndex++];
			dVolumes[0, 2] = Volumn.GetVolumn(BitConvert.GetValue(bFlag, 6, 2), Buffer);
			dVolumes[0, 3] = Volumn.GetVolumn(BitConvert.GetValue(bFlag, 4, 2), Buffer);
			dVolumes[0, 4] = Volumn.GetVolumn(BitConvert.GetValue(bFlag, 2, 2), Buffer);
			dVolumes[1, 1] = Volumn.GetVolumn(BitConvert.GetValue(bFlag, 0, 2), Buffer);

                        bFlag = Buffer.Data[iFormatIndex++];
			dVolumes[1, 2] = Volumn.GetVolumn(BitConvert.GetValue(bFlag, 6, 2), Buffer);
			dVolumes[1, 3] = Volumn.GetVolumn(BitConvert.GetValue(bFlag, 4, 2), Buffer);
			dVolumes[1, 4] = Volumn.GetVolumn(BitConvert.GetValue(bFlag, 2, 2), Buffer);
                        quote.即時均價 = Price.GetPrice(BitConvert.GetValue(bFlag, 0, 2), Buffer, ref fReferPrice);

                        iFormatIndex = Buffer.Position;
                        Buffer.Position += 2;

                        bFlag = Buffer.Data[iFormatIndex++];
                        quote.累計買量 = Volumn.GetVolumn(BitConvert.GetValue(bFlag, 6, 2), Buffer);
                        quote.累計賣量 = Volumn.GetVolumn(BitConvert.GetValue(bFlag, 4, 2), Buffer);
                        quote.單筆買進巨量 = Volumn.GetVolumn(BitConvert.GetValue(bFlag, 2, 2), Buffer);
                        quote.單筆賣出巨量 = Volumn.GetVolumn(BitConvert.GetValue(bFlag, 0, 2), Buffer);

                        bFlag = Buffer.Data[iFormatIndex++];
                        quote.累計買進巨量 = Volumn.GetVolumn(BitConvert.GetValue(bFlag, 6, 2), Buffer);
                        quote.累計賣出巨量 = Volumn.GetVolumn(BitConvert.GetValue(bFlag, 4, 2), Buffer);
                        quote.即時量幅 = (float)(Volumn.GetVolumn(BitConvert.GetValue(bFlag, 2, 2), Buffer) * 0.01);
                        quote.買進量百分比 = (byte)Volumn.GetVolumn(BitConvert.GetValue(bFlag, 0, 2), Buffer);

			for (int i = 0; i < 5; i++) {
				quote.委買委賣資訊.Bid[i] = new DOMPrice(dPrices[0, i], dVolumes[0, i]);
				quote.委買委賣資訊.Ask[i] = new DOMPrice(dPrices[1, i], dVolumes[1, i]);
			}
			quote.即時資訊.Bid = quote.委買委賣資訊.Bid[0];
			quote.即時資訊.Ask = quote.委買委賣資訊.Ask[0];

			++quote.UpdateCount;
		}