Ejemplo n.º 1
0
 public override int GetHashCode( )
 {
     unchecked
     {
         int hashCode = OpenPrice.GetHashCode( );
         hashCode = (hashCode * 397) ^ CurrentPrice.GetHashCode( );
         hashCode = (hashCode * 397) ^ TodaysHigh.GetHashCode( );
         hashCode = (hashCode * 397) ^ TodaysLow.GetHashCode( );
         hashCode = (hashCode * 397) ^ BuyVolume.GetHashCode( );
         hashCode = (hashCode * 397) ^ SellVolume.GetHashCode( );
         return(hashCode);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Ch != null)
         {
             hashCode = hashCode * 59 + Ch.GetHashCode();
         }
         if (Chp != null)
         {
             hashCode = hashCode * 59 + Chp.GetHashCode();
         }
         if (Lp != null)
         {
             hashCode = hashCode * 59 + Lp.GetHashCode();
         }
         if (Ask != null)
         {
             hashCode = hashCode * 59 + Ask.GetHashCode();
         }
         if (Bid != null)
         {
             hashCode = hashCode * 59 + Bid.GetHashCode();
         }
         if (OpenPrice != null)
         {
             hashCode = hashCode * 59 + OpenPrice.GetHashCode();
         }
         if (HighPrice != null)
         {
             hashCode = hashCode * 59 + HighPrice.GetHashCode();
         }
         if (LowPrice != null)
         {
             hashCode = hashCode * 59 + LowPrice.GetHashCode();
         }
         if (PrevClosePrice != null)
         {
             hashCode = hashCode * 59 + PrevClosePrice.GetHashCode();
         }
         if (Volume != null)
         {
             hashCode = hashCode * 59 + Volume.GetHashCode();
         }
         return(hashCode);
     }
 }
Ejemplo n.º 3
0
 public string[] GetCells()
 {
     m_cellValues[0]  = Symbol;
     m_cellValues[1]  = LastTradePrice.ToString(this.PriceFormat);
     m_cellValues[2]  = LastTradeSize.ToString();
     m_cellValues[3]  = BidSize.ToString();
     m_cellValues[4]  = Bid.ToString(this.PriceFormat);
     m_cellValues[5]  = Ask.ToString(this.PriceFormat);
     m_cellValues[6]  = AskSize.ToString();
     m_cellValues[7]  = TotalVolume.ToString();
     m_cellValues[8]  = OpenPrice.ToString(this.PriceFormat);
     m_cellValues[9]  = HighPrice.ToString(this.PriceFormat);
     m_cellValues[10] = LowPrice.ToString(this.PriceFormat);
     m_cellValues[11] = ClosePrice.ToString(this.PriceFormat);
     return(m_cellValues);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Put out some text information on this object.
 /// </summary>
 /// <param name="fullPrint">Show full or partial information only.</param>
 /// <returns></returns>
 public virtual string Print(bool fullPrint)
 {
     if (Symbol != Symbol.Empty)
     {
         return(string.Format("Symbol {0} Type {1}, Open {2} ", Symbol.Name, Type.ToString(), OpenPrice.ToString()));
     }
     else
     {
         return("Order not initialized.");
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Print order information.
 /// </summary>
 public override string Print(bool fullPrint)
 {
     if (Symbol != Symbol.Emtpy)
     {
         return(string.Format("Symbol {0} Type {1}, Open {2} at {3}", Symbol.Name, Type.ToString(), OpenPrice.ToString(), LocalOpenTime.ToString()));
     }
     else
     {
         return("Order not initialized.");
     }
 }
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = (StockExchange != null
                                 ? StockExchange.GetHashCode()
                                 : 0);
         hashCode = (hashCode * 397) ^ (TradeSector != null
                                 ? TradeSector.GetHashCode()
                                 : 0);
         hashCode = (hashCode * 397) ^ (SecurityCode != null
                                 ? SecurityCode.GetHashCode()
                                 : 0);
         hashCode = (hashCode * 397) ^ (SecurityName != null
                                 ? SecurityName.GetHashCode()
                                 : 0);
         hashCode = (hashCode * 397) ^ (SecurityClass != null
                                 ? SecurityClass.GetHashCode()
                                 : 0);
         hashCode = (hashCode * 397) ^ HasOptions.GetHashCode();
         hashCode = (hashCode * 397) ^ (SecurityStatus != null
                                 ? SecurityStatus.GetHashCode()
                                 : 0);
         hashCode = (hashCode * 397) ^ (Currency != null
                                 ? Currency.GetHashCode()
                                 : 0);
         hashCode = (hashCode * 397) ^ LimitUpPrice.GetHashCode();
         hashCode = (hashCode * 397) ^ LimitDownPrice.GetHashCode();
         hashCode = (hashCode * 397) ^ LotSize.GetHashCode();
         hashCode = (hashCode * 397) ^ (LotFlag != null
                                 ? LotFlag.GetHashCode()
                                 : 0);
         hashCode = (hashCode * 397) ^ (SuspendedFlag != null
                                 ? SuspendedFlag.GetHashCode()
                                 : 0);
         hashCode = (hashCode * 397) ^ (SecuritySubClass != null
                                 ? SecuritySubClass.GetHashCode()
                                 : 0);
         hashCode = (hashCode * 397) ^ (UnderlyinSecurityCode != null
                                 ? UnderlyinSecurityCode.GetHashCode()
                                 : 0);
         hashCode = (hashCode * 397) ^ (SecurityLevel != null
                                 ? SecurityLevel.GetHashCode()
                                 : 0);
         hashCode = (hashCode * 397) ^ PreviousClose.GetHashCode();
         hashCode = (hashCode * 397) ^ OpenPrice.GetHashCode();
         hashCode = (hashCode * 397) ^ Turnover.GetHashCode();
         hashCode = (hashCode * 397) ^ HighPrice.GetHashCode();
         hashCode = (hashCode * 397) ^ LowPrice.GetHashCode();
         hashCode = (hashCode * 397) ^ LastPrice.GetHashCode();
         hashCode = (hashCode * 397) ^ CurrentBidPrice.GetHashCode();
         hashCode = (hashCode * 397) ^ CurrentAskPrice.GetHashCode();
         hashCode = (hashCode * 397) ^ Volume.GetHashCode();
         hashCode = (hashCode * 397) ^ PERatio.GetHashCode();
         hashCode = (hashCode * 397) ^ BuyVolume1.GetHashCode();
         hashCode = (hashCode * 397) ^ SellVolume1.GetHashCode();
         hashCode = (hashCode * 397) ^ BuyPrice2.GetHashCode();
         hashCode = (hashCode * 397) ^ BuyVolume2.GetHashCode();
         hashCode = (hashCode * 397) ^ SellPrice2.GetHashCode();
         hashCode = (hashCode * 397) ^ SellVolume2.GetHashCode();
         hashCode = (hashCode * 397) ^ BuyPrice3.GetHashCode();
         hashCode = (hashCode * 397) ^ BuyVolume3.GetHashCode();
         hashCode = (hashCode * 397) ^ SellPrice3.GetHashCode();
         hashCode = (hashCode * 397) ^ SellVolume3.GetHashCode();
         hashCode = (hashCode * 397) ^ BuyPrice4.GetHashCode();
         hashCode = (hashCode * 397) ^ BuyVolume4.GetHashCode();
         hashCode = (hashCode * 397) ^ SellPrice4.GetHashCode();
         hashCode = (hashCode * 397) ^ SellVolume4.GetHashCode();
         hashCode = (hashCode * 397) ^ BuyPrice5.GetHashCode();
         hashCode = (hashCode * 397) ^ BuyVolume5.GetHashCode();
         hashCode = (hashCode * 397) ^ SellPrice5.GetHashCode();
         hashCode = (hashCode * 397) ^ SellVolume5.GetHashCode();
         return(hashCode);
     }
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Returns true if SingleQuote instances are equal
        /// </summary>
        /// <param name="other">Instance of SingleQuote to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(SingleQuote other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Ch == other.Ch ||
                     Ch != null &&
                     Ch.Equals(other.Ch)
                     ) &&
                 (
                     Chp == other.Chp ||
                     Chp != null &&
                     Chp.Equals(other.Chp)
                 ) &&
                 (
                     Lp == other.Lp ||
                     Lp != null &&
                     Lp.Equals(other.Lp)
                 ) &&
                 (
                     Ask == other.Ask ||
                     Ask != null &&
                     Ask.Equals(other.Ask)
                 ) &&
                 (
                     Bid == other.Bid ||
                     Bid != null &&
                     Bid.Equals(other.Bid)
                 ) &&
                 (
                     OpenPrice == other.OpenPrice ||
                     OpenPrice != null &&
                     OpenPrice.Equals(other.OpenPrice)
                 ) &&
                 (
                     HighPrice == other.HighPrice ||
                     HighPrice != null &&
                     HighPrice.Equals(other.HighPrice)
                 ) &&
                 (
                     LowPrice == other.LowPrice ||
                     LowPrice != null &&
                     LowPrice.Equals(other.LowPrice)
                 ) &&
                 (
                     PrevClosePrice == other.PrevClosePrice ||
                     PrevClosePrice != null &&
                     PrevClosePrice.Equals(other.PrevClosePrice)
                 ) &&
                 (
                     Volume == other.Volume ||
                     Volume != null &&
                     Volume.Equals(other.Volume)
                 ));
        }