/// <summary> /// Called on each bar update event (incoming tick) /// </summary> protected override void OnBarUpdate() { // Only process entry signals on a bar by bar basis (not tick by tick) if (FirstTickOfBar) { bidAskVolume = 0; } if (Close[0] >= GetCurrentAsk()) { bidAskVolume += 1; } else //if (Close[0] <= GetCurrentBid()) { bidAskVolume -= 1; } // Use this method for calculating your indicator values. Assign a value to each // plot below by replacing 'Close[0]' with your own formula. if (bidAskVolume > 0) { AskVolume.Set(bidAskVolume); } else { BidVolume.Set(bidAskVolume); } OscLine.Set(bidAskVolume); }
public override int GetHashCode() { unchecked { int hashCode = (SecurityCode != null ? SecurityCode.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (OptionNumber != null ? OptionNumber.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (OptionCode != null ? OptionCode.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Bid.GetHashCode(); hashCode = (hashCode * 397) ^ BidVolume.GetHashCode(); hashCode = (hashCode * 397) ^ Ask.GetHashCode(); hashCode = (hashCode * 397) ^ AskVolume.GetHashCode(); hashCode = (hashCode * 397) ^ Volume.GetHashCode(); hashCode = (hashCode * 397) ^ Bid2.GetHashCode(); hashCode = (hashCode * 397) ^ BidVolume2.GetHashCode(); hashCode = (hashCode * 397) ^ Ask2.GetHashCode(); hashCode = (hashCode * 397) ^ AskVolume2.GetHashCode(); hashCode = (hashCode * 397) ^ Bid3.GetHashCode(); hashCode = (hashCode * 397) ^ BidVolume3.GetHashCode(); hashCode = (hashCode * 397) ^ Ask3.GetHashCode(); hashCode = (hashCode * 397) ^ AskVolume3.GetHashCode(); hashCode = (hashCode * 397) ^ Bid4.GetHashCode(); hashCode = (hashCode * 397) ^ BidVolume4.GetHashCode(); hashCode = (hashCode * 397) ^ Ask4.GetHashCode(); hashCode = (hashCode * 397) ^ AskVolume4.GetHashCode(); hashCode = (hashCode * 397) ^ Bid5.GetHashCode(); hashCode = (hashCode * 397) ^ BidVolume5.GetHashCode(); hashCode = (hashCode * 397) ^ Ask5.GetHashCode(); hashCode = (hashCode * 397) ^ AskVolume5.GetHashCode(); hashCode = (hashCode * 397) ^ (Greeks != null ? Greeks.GetHashCode() : 0); hashCode = (hashCode * 397) ^ OpenInterest.GetHashCode(); hashCode = (hashCode * 397) ^ Turnover.GetHashCode(); hashCode = (hashCode * 397) ^ UncoveredPositionQuantity.GetHashCode(); hashCode = (hashCode * 397) ^ PreviousSettlementPrice.GetHashCode(); hashCode = (hashCode * 397) ^ OpeningPrice.GetHashCode(); hashCode = (hashCode * 397) ^ AuctionReferencePrice.GetHashCode(); hashCode = (hashCode * 397) ^ AuctionReferenceQuantity.GetHashCode(); hashCode = (hashCode * 397) ^ HighestPrice.GetHashCode(); hashCode = (hashCode * 397) ^ LowestPrice.GetHashCode(); hashCode = (hashCode * 397) ^ LatestTradedPrice.GetHashCode(); hashCode = (hashCode * 397) ^ Change.GetHashCode(); hashCode = (hashCode * 397) ^ ChangePercentage.GetHashCode(); hashCode = (hashCode * 397) ^ PreviousClose.GetHashCode(); hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0); return(hashCode); } }
public override int GetHashCode() { int hash = 1; if (TradingDay.Length != 0) { hash ^= TradingDay.GetHashCode(); } if (InstrumentId.Length != 0) { hash ^= InstrumentId.GetHashCode(); } if (ExchangeId.Length != 0) { hash ^= ExchangeId.GetHashCode(); } if (LastPrice != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(LastPrice); } if (PreSettlementPrice != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(PreSettlementPrice); } if (PreClosePrice != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(PreClosePrice); } if (PreOpenInterest != 0) { hash ^= PreOpenInterest.GetHashCode(); } if (OpenPrice != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(OpenPrice); } if (HighestPrice != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(HighestPrice); } if (LowestPrice != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(LowestPrice); } if (Volume != 0) { hash ^= Volume.GetHashCode(); } if (TurnOver != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(TurnOver); } if (OpenInterest != 0) { hash ^= OpenInterest.GetHashCode(); } if (ClosePrice != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(ClosePrice); } if (SettlementPrice != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(SettlementPrice); } if (UpperLimitPrice != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(UpperLimitPrice); } if (LowerLimitPrice != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(LowerLimitPrice); } if (UpdateTime.Length != 0) { hash ^= UpdateTime.GetHashCode(); } if (UpdateMillisec != 0) { hash ^= UpdateMillisec.GetHashCode(); } if (AveragePrice != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(AveragePrice); } if (ActionDay.Length != 0) { hash ^= ActionDay.GetHashCode(); } if (BidPrice != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(BidPrice); } if (BidVolume != 0) { hash ^= BidVolume.GetHashCode(); } if (AskPrice != 0D) { hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(AskPrice); } if (AskVolume != 0) { hash ^= AskVolume.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }