예제 #1
0
파일: Instrument.cs 프로젝트: 9045857/Sew
 private void SetStrategiesFromFiles(List <Strategy> strategies, List <string> puths)
 {
     foreach (string puth in puths)
     {
         Strategy strategy = StrategyRepParse.ParseCreateStrategy(puth);
         strategies.Add(strategy);
     }
 }
예제 #2
0
        private static List <Instrument> ParseInstruments(string path)
        {
            Dictionary <InstrumentTypes, List <string> > instrumentPaths = GetInstrumentsPaths(path);

            List <Instrument> instruments = new List <Instrument>();

            foreach (KeyValuePair <InstrumentTypes, List <string> > instrumentPath in instrumentPaths)
            {
                List <Strategy> strategies = new List <Strategy>();
                foreach (string strategyPath in instrumentPath.Value)
                {
                    Strategy strategy = StrategyRepParse.ParseCreateStrategy(strategyPath);
                    strategies.Add(strategy);
                }

                Instrument instrument = new Instrument(instrumentPath.Key, strategies);
                instruments.Add(instrument);
            }

            return(instruments);
        }