示例#1
0
        public static double strike(string sym)
        {
            double strk = 0.0;
            int    idx1 = Utl.pos_last_alpha(sym);

            if (sym.Length > 6)
            {
                strk = Double.Parse(sym.Substring(idx1 + 1));
            }
            return(strk);
        }
示例#2
0
        /// <summary>
        ///
        /// Does not currently support FOPs
        /// </summary>
        /// <param name="sym"></param>
        /// <returns></returns>
        public static string exDateStr(string sym)
        {
            string str  = "";
            int    idx1 = Utl.pos_first_num(sym);
            int    idx2 = Utl.pos_last_alpha(sym);



            if (sym.Length > 0 && idx1 != -1 && idx1 != -1)
            {
                str = sym.Substring(idx1, idx2 - idx1);
            }

            return(str);
        }
示例#3
0
        /// <summary>
        ///
        /// TODO: handle FOPs
        /// </summary>
        /// <param name="sym"></param>
        /// <returns></returns>
        public static string symbol(string sym)
        {
            string str  = "";
            int    idx1 = Utl.pos_first_alpha(sym);
            int    idx2 = Utl.pos_first_num(sym);

            if (idx2 == -1 && sym.Length < 6)
            {
                idx2 = Utl.pos_last_alpha(sym) + 1;
            }

            if (sym.Length > 0 && idx1 != -1 && idx1 != -1)
            {
                str = sym.Substring(idx1, idx2 - idx1);
            }
            return(str);
        }
示例#4
0
        public static int multiplier(string sym)
        {
            int amt = 0;

            // FOP
            if (Utl.startsWith(sym, "./"))
            {
                amt = 50;
            }
            else if (Utl.startsWith(sym, "."))
            {
                amt = 100;
            }
            else
            {
                amt = 1;
            }
            return(amt);
        }