Example #1
0
        public AskSize ParseAskSize()
        {
            var r = new AskSize();

            lineno++;
            r.Label = GetLabel("Size");
            if (curr.kw == RegKeywords.Fee)
            {
                r.Fee = GetDecimal();
            }
            if (curr.kw == RegKeywords.AllowLastYear)
            {
                r.AllowLastYear = GetBool();
            }
            r.list = new List <AskSize.Size>();
            if (curr.indent == 0)
            {
                return(r);
            }
            var startindent = curr.indent;

            while (curr.indent == startindent)
            {
                var i = new AskSize.Size();
                if (curr.kw != RegKeywords.None)
                {
                    throw GetException("unexpected line in Size");
                }
                i.Description = GetLine();
                i.SmallGroup  = i.Description;
                if (curr.indent <= startindent)
                {
                    r.list.Add(i);
                    continue;
                }
                var ind = curr.indent;
                while (curr.indent == ind)
                {
                    if (curr.kw != Parser.RegKeywords.SmallGroup)
                    {
                        throw GetException("unexpected line in Size");
                    }
                    i.SmallGroup = GetString(i.Description);
                }
                r.list.Add(i);
            }
            var q = r.list.GroupBy(mi => mi.SmallGroup).Where(g => g.Count() > 1).Select(g => g.Key).ToList();

            if (q.Any())
            {
                throw GetException("Duplicate SmallGroup in Sizes: " + string.Join(",", q));
            }
            return(r);
        }
Example #2
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] = Formula;
     return(m_cellValues);
 }
Example #3
0
 public void Output(StringBuilder sb, AskSize ask)
 {
     AddValueNoCk(0, sb, "AskSize", "");
     AddValueCk(1, sb, "Label", ask.Label ?? "Size");
     AddValueCk(1, sb, "Fee", ask.Fee);
     AddValueCk(1, sb, "AllowLastYear", ask.AllowLastYear);
     foreach (var q in ask.list)
     {
         AddValueCk(1, sb, q.Description);
         AddValueCk(2, sb, "SmallGroup", q.SmallGroup ?? q.Description);
     }
     sb.AppendLine();
 }
Example #4
0
 public override Int32 GetHashCode()
 {
     unchecked
     {
         var hashCode = BidExchange.GetHashCode();
         hashCode = (hashCode * 397) ^ AskExchange.GetHashCode();
         hashCode = (hashCode * 397) ^ BidPrice.GetHashCode();
         hashCode = (hashCode * 397) ^ AskPrice.GetHashCode();
         hashCode = (hashCode * 397) ^ BidSize.GetHashCode();
         hashCode = (hashCode * 397) ^ AskSize.GetHashCode();
         hashCode = (hashCode * 397) ^ Timestamp.GetHashCode();
         return(hashCode);
     }
 }
Example #5
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);
 }
        public override int GetHashCode()
        {
            unchecked
            {
                var hash = 17;
                hash = hash * 29 + RequestId != null?RequestId.GetHashCode() : 0;

                hash = hash * 29 + Symbol.GetHashCode();
                hash = hash * 29 + ExchangeId.GetHashCode();
                hash = hash * 29 + SecurityType.GetHashCode();
                hash = hash * 29 + (Last.HasValue ? Last.GetHashCode() : 0);
                hash = hash * 29 + (TradeSize.HasValue ? TradeSize.GetHashCode() : 0);
                hash = hash * 29 + (TradedMarket.HasValue ? TradedMarket.GetHashCode() : 0);
                hash = hash * 29 + (TradeDate.HasValue ? TradeDate.GetHashCode() : 0);
                hash = hash * 29 + (TradeTime.HasValue ? TradeTime.GetHashCode() : 0);
                hash = hash * 29 + (Open.HasValue ? Open.GetHashCode() : 0);
                hash = hash * 29 + (High.HasValue ? High.GetHashCode() : 0);
                hash = hash * 29 + (Low.HasValue ? Low.GetHashCode() : 0);
                hash = hash * 29 + (Close.HasValue ? Close.GetHashCode() : 0);
                hash = hash * 29 + (Bid.HasValue ? Bid.GetHashCode() : 0);
                hash = hash * 29 + (BidMarket.HasValue ? BidMarket.GetHashCode() : 0);
                hash = hash * 29 + (BidSize.HasValue ? BidSize.GetHashCode() : 0);
                hash = hash * 29 + (Ask.HasValue ? Ask.GetHashCode() : 0);
                hash = hash * 29 + (AskMarket.HasValue ? AskMarket.GetHashCode() : 0);
                hash = hash * 29 + (AskSize.HasValue ? AskSize.GetHashCode() : 0);
                hash = hash * 29 + (Volume.HasValue ? Volume.GetHashCode() : 0);
                hash = hash * 29 + (PDayVolume.HasValue ? PDayVolume.GetHashCode() : 0);
                hash = hash * 29 + (UpVolume.HasValue ? UpVolume.GetHashCode() : 0);
                hash = hash * 29 + (DownVolume.HasValue ? DownVolume.GetHashCode() : 0);
                hash = hash * 29 + (NeutralVolume.HasValue ? NeutralVolume.GetHashCode() : 0);
                hash = hash * 29 + (TradeCount.HasValue ? TradeCount.GetHashCode() : 0);
                hash = hash * 29 + (UpTrades.HasValue ? UpTrades.GetHashCode() : 0);
                hash = hash * 29 + (DownTrades.HasValue ? DownTrades.GetHashCode() : 0);
                hash = hash * 29 + (NeutralTrades.HasValue ? NeutralTrades.GetHashCode() : 0);
                hash = hash * 29 + (VWAP.HasValue ? VWAP.GetHashCode() : 0);
                hash = hash * 29 + (MutualDiv.HasValue ? MutualDiv.GetHashCode() : 0);
                hash = hash * 29 + (SevenDayYield.HasValue ? SevenDayYield.GetHashCode() : 0);
                hash = hash * 29 + (OpenInterest.HasValue ? OpenInterest.GetHashCode() : 0);
                hash = hash * 29 + (Settlement.HasValue ? Settlement.GetHashCode() : 0);
                hash = hash * 29 + (SettlementDate.HasValue ? SettlementDate.GetHashCode() : 0);
                hash = hash * 29 + (ExpirationDate.HasValue ? ExpirationDate.GetHashCode() : 0);
                hash = hash * 29 + (Strike.HasValue ? Strike.GetHashCode() : 0);
                return(hash);
            }
        }
 public override int GetHashCode()
 {
     unchecked
     {
         var hash = 17;
         hash = hash * 29 + Symbol.GetHashCode();
         hash = hash * 29 + MMID.GetHashCode();
         hash = hash * 29 + Bid.GetHashCode();
         hash = hash * 29 + Ask.GetHashCode();
         hash = hash * 29 + BidSize.GetHashCode();
         hash = hash * 29 + AskSize.GetHashCode();
         hash = hash * 29 + BidTime.GetHashCode();
         hash = hash * 29 + BidSize.GetHashCode();
         hash = hash * 29 + Date.GetHashCode();
         hash = hash * 29 + ConditionCode.GetHashCode();
         hash = hash * 29 + AskTime.GetHashCode();
         hash = hash * 29 + BidInfoValid.GetHashCode();
         hash = hash * 29 + AskInfoValid.GetHashCode();
         hash = hash * 29 + EndOfMessageGroup.GetHashCode();
         return(hash);
     }
 }
Example #8
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hash = 17;
         hash = hash * 29 + Symbol.GetHashCode();
         hash = hash * 29 + MostRecentTrade.GetHashCode();
         hash = hash * 29 + MostRecentTradeSize.GetHashCode();
         hash = hash * 29 + MostRecentTradeTime.GetHashCode();
         hash = hash * 29 + MostRecentTradeMarketCenter.GetHashCode();
         hash = hash * 29 + TotalVolume.GetHashCode();
         hash = hash * 29 + Bid.GetHashCode();
         hash = hash * 29 + BidSize.GetHashCode();
         hash = hash * 29 + Ask.GetHashCode();
         hash = hash * 29 + AskSize.GetHashCode();
         hash = hash * 29 + Open.GetHashCode();
         hash = hash * 29 + High.GetHashCode();
         hash = hash * 29 + Low.GetHashCode();
         hash = hash * 29 + Close.GetHashCode();
         hash = hash * 29 + MessageContents.GetHashCode();
         hash = hash * 29 + MostRecentTradeConditions.GetHashCode();
         return(hash);
     }
 }
Example #9
0
        private AskSize asksize; // To support old Registration Documents
        void ParseSection()
        {
            switch (curr.kw)
            {
            case RegKeywords.AskParents:
            case RegKeywords.AnswersNotRequired:
            case RegKeywords.AskSMS:
            case RegKeywords.AskDoctor:
            case RegKeywords.AskInsurance:
            case RegKeywords.AskEmContact:
            case RegKeywords.AskAllergies:
            case RegKeywords.AskChurch:
            case RegKeywords.AskTylenolEtc:
            case RegKeywords.AskCoaching:
                set.AskItems.Add(ParseAsk());
                break;

            case RegKeywords.SpecialScript:
                set.SpecialScript = GetString();
                break;

            case RegKeywords.AskSuggestedFee:
                set.AskItems.Add(ParseAskSuggestedFee());
                break;

            case RegKeywords.AskTickets:
                set.AskItems.Add(ParseAskTickets());
                break;

            case RegKeywords.AskRequest:
                set.AskItems.Add(ParseAskRequest());
                break;

            case RegKeywords.AskHeader:
                set.AskItems.Add(ParseAskHeader());
                break;

            case RegKeywords.AskInstruction:
                set.AskItems.Add(ParseAskInstruction());
                break;

            case RegKeywords.Dropdown:
            case RegKeywords.AskOptions:
            case RegKeywords.ExtraOptions:
            case RegKeywords.Dropdown1:
            case RegKeywords.Dropdown2:
            case RegKeywords.Dropdown3:
                set.AskItems.Add(ParseAskDropdown());
                break;

            case RegKeywords.MenuItems:
                var m = ParseAskMenu();
                if (m.list.Count > 0)
                {
                    set.AskItems.Add(m);
                }
                break;

            case RegKeywords.ExtraQuestions:
                set.AskItems.Add(ParseAskExtraQuestions());
                break;

            case RegKeywords.Text:
                set.AskItems.Add(ParseAskText());
                break;

            case RegKeywords.Checkboxes:
            case RegKeywords.Checkboxes2:
                set.AskItems.Add(ParseAskCheckboxes());
                break;

            case RegKeywords.YesNoQuestions:
                set.AskItems.Add(ParseAskYesNoQuestions());
                break;

            case RegKeywords.AskGradeOptions:
            case RegKeywords.GradeOptions:
                set.AskItems.Add(ParseAskGradeOptions());
                break;

            case RegKeywords.AskSize:
                asksize = ParseAskSize();
                if (asksize.list.Count > 0)
                {
                    set.AskItems.Add(asksize);
                }
                break;

            case RegKeywords.MemberOnly:
                set.MemberOnly = GetBool();
                break;

            case RegKeywords.AskMedical:
                GetBool();
                break;

            case RegKeywords.AskDonation:
                set.AskDonation = GetBool();
                break;

            case RegKeywords.NoReqBirthYear:
                set.NoReqBirthYear = GetBool();
                break;

            case RegKeywords.NotReqDOB:
                set.NotReqDOB = GetBool();
                break;

            case RegKeywords.NotReqAddr:
                set.NotReqAddr = GetBool();
                break;

            case RegKeywords.NotReqPhone:
                set.NotReqPhone = GetBool();
                break;

            case RegKeywords.NotReqGender:
                set.NotReqGender = GetBool();
                break;

            case RegKeywords.NotReqMarital:
                set.NotReqMarital = GetBool();
                break;

            case RegKeywords.NotReqCampus:
                set.NotReqCampus = GetBool();
                break;

            case RegKeywords.NotReqZip:
                set.NotReqZip = GetBool();
                break;

            case RegKeywords.DonationFundId:
                set.DonationFundId = GetNullInt();
                break;

            case RegKeywords.AccountingCode:
                set.AccountingCode = GetString();
                break;

            case RegKeywords.DonationLabel:
                set.DonationLabel = GetString();
                break;

            case RegKeywords.ExtraValueFeeName:
                set.ExtraValueFeeName = GetString();
                break;

            case RegKeywords.GroupToJoin:
                set.GroupToJoin = GetString();
                break;

            case RegKeywords.AddAsProspect:
                set.AddAsProspect = GetBool();
                break;

            case RegKeywords.LinkGroupsFromOrgs:
                set.LinkGroupsFromOrgs = (from i in curr.value.Split(',')
                                          where i.ToInt() > 0
                                          select i.ToInt()).ToList();
                lineno++;
                break;

            case RegKeywords.ValidateOrgs:
                set.ValidateOrgs = curr.value;
                lineno++;
                break;

            case RegKeywords.Terms:
                ParseTerms();
                break;

            case RegKeywords.Instructions:
                ParseInstructions();
                break;

            case RegKeywords.Confirmation:
                ParseConfirmation();
                break;

            case RegKeywords.ConfirmationTrackingCode:
                ParseTrackingCode();
                break;

            case RegKeywords.Reminder:
                ParseReminder();
                break;

            case RegKeywords.SupportEmail:
                ParseSupport();
                break;

            case RegKeywords.SenderEmail:
                ParseSender();
                break;

            case RegKeywords.AgeGroups:
                ParseAgeGroups();
                break;

            case RegKeywords.OrgMemberFees:
            case RegKeywords.OrgFees:
                ParseOrgFees();
                break;

            case RegKeywords.VoteTags:
                ParseVoteTags();
                break;

            case RegKeywords.Shell:
                set.Shell = GetString();
                break;

            case RegKeywords.ShellBs:
                set.ShellBs = GetString();
                break;

            case RegKeywords.Fee:
                set.Fee = GetDecimal();
                break;

            case RegKeywords.TimeOut:
                set.TimeOut = GetNullInt();
                break;

            case RegKeywords.DisallowAnonymous:
                set.DisallowAnonymous = GetBool();
                break;

            case RegKeywords.FinishRegistrationButton:
                set.FinishRegistrationButton = GetString();
                break;


            // BEGIN support for old Registration Documents
            case RegKeywords.Title:
                GetString();
                break;

            case RegKeywords.GiveOrgMembAccess:
                GetBool();
                break;

            case RegKeywords.UseBootstrap:
                GetBool();
                break;

            case RegKeywords.AskGrade:
                GetBool();
                GetLabel("Grade");
                break;

            case RegKeywords.AskShirtSize:
                GetBool();
                asksize = new AskSize {
                    Label = "Size"
                };
                set.AskItems.Add(asksize);
                break;

            case RegKeywords.ShirtSizes:
                asksize.list = ParseShirtSizes();
                break;

            case RegKeywords.AllowLastYearShirt:
                asksize.AllowLastYear = GetBool();
                break;

            case RegKeywords.ShirtFee:
                GetDecimal();
                break;
            // END support for old Registration Documents

            case RegKeywords.Deposit:
                set.Deposit = GetDecimal();
                break;

            case RegKeywords.ExtraFee:
                set.ExtraFee = GetDecimal();
                break;

            case RegKeywords.MaximumFee:
                set.MaximumFee = GetDecimal();
                break;

            case RegKeywords.AllowOnlyOne:
                set.AllowOnlyOne = GetBool();
                break;

            case RegKeywords.OtherFeesAdded:
            case RegKeywords.OtherFeesAddedToOrgFee:
                set.OtherFeesAddedToOrgFee = GetBool();
                break;

            case RegKeywords.IncludeOtherFeesWithDeposit:
                set.IncludeOtherFeesWithDeposit = GetBool();
                break;

            case RegKeywords.ApplyMaxToOtherFees:
                set.ApplyMaxToOtherFees = GetBool();
                break;

            case RegKeywords.AllowReRegister:
                set.AllowReRegister = GetBool();
                break;

            case RegKeywords.AllowSaveProgress:
                set.AllowSaveProgress = GetBool();
                break;

            case RegKeywords.TargetExtraValues:
                set.TargetExtraValues = GetBool();
                break;

            case RegKeywords.TimeSlotLockDays:
                set.TimeSlotLockDays = GetNullInt();
                break;

            case RegKeywords.TimeSlots:
                set.TimeSlots = ParseTimeSlots();
                if (set.TimeSlotLockDays.HasValue)
                {
                    set.TimeSlots.TimeSlotLockDays = set.TimeSlotLockDays;
                }
                break;
            }
        }