Example #1
0
        public static void ParameterParser()
        {
            Framework.Logger(2, "Parameter Parsing Test");

            /*
             *      MACDF:8-16,2; MACDS:12-24,2; MACDSG:7-9; EMA:26; STOK:3; STOKS:2; STOD:3;
             *      MACDF:12; macds:26; MACDSG: 9 ; EMA: 26 ; STOK:3 ; STOKS:2 ; STOD:3
             *      P: 14
             *      IN: *.CSV ; OUT: *.CSV
             */

            string opt  = "MACDF:8-14,2; MACDS:12-16,2; MACDSG:7-9; EMA:26; STOK:3; STOKS:2-3,0.2; STOD:3; FLAG:TRUE";
            string val1 = "MACDF:12; macds:26; MACDSG: 9 ; EMA: 26 ; STOK:3 ; STOKS:2 ; STOD:3; TRUE-RANGE:TRUE";

            ParameterParser pp1 = new ParameterParser(opt);
            ParameterParser pp2 = new ParameterParser(val1);
            ParameterParser pp3 = new ParameterParser("IN: *.CSV ; OUT: *.CSV");

            double v1 = pp1.GetDouble("flag", -1);
            string v  = "";

            Framework.Logger(0, "started opt with: " + opt);
            while (pp1.GetOptimizationParameters(ref v))
            {
                Framework.Logger(0, v);
            }

            Framework.Logger(0, "started opt with: " + val1);
            while (pp2.GetOptimizationParameters(ref v))
            {
                Framework.Logger(0, v);
            }

            string infile  = pp3.GetString("in", null);
            string outfile = pp3.GetString("out", null);
        }