Ejemplo n.º 1
0
        private void createADMLiveInfoLine(OptionSpreadManager optionSpreadManager,
                                           SaveOutputFile sof)
        {
            StringBuilder csvLine = new StringBuilder();

            //optionSpreadManager.admPositionImportWebListForCompare

            for (int instrumentCount = 0;
                 instrumentCount < optionSpreadManager.admPositionImportWebListForCompare.Count;
                 instrumentCount++)
            {
                //if (optionSpreadManager.admPositionImportWebListForCompare[instrumentCount].exclude)
                if (optionSpreadManager.zeroPriceContractList.Contains(
                        optionSpreadManager.admPositionImportWebListForCompare[instrumentCount].cqgSymbol))
                {
                    csvLine.Clear();

                    csvLine.Append(optionSpreadManager.admPositionImportWebListForCompare[instrumentCount].cqgSymbol);
                    csvLine.Append(",true,false,");

                    sof.writeTextLineFile(csvLine.ToString());
                }
                else if (optionSpreadManager.exceptionContractList.Contains(
                             optionSpreadManager.admPositionImportWebListForCompare[instrumentCount].cqgSymbol))
                {
                    csvLine.Clear();

                    csvLine.Append(optionSpreadManager.admPositionImportWebListForCompare[instrumentCount].cqgSymbol);
                    csvLine.Append(",false,true,");

                    sof.writeTextLineFile(csvLine.ToString());
                }
            }
        }
Ejemplo n.º 2
0
        public void readADMExcludeContractInfo(OptionSpreadManager optionSpreadManager)
        {
            StringBuilder admFileName = new StringBuilder();

            admFileName.Append(optionSpreadManager.initializationParmsSaved.idPortfolioGroup);
            admFileName.Append("_");
            admFileName.Append(TradingSystemConstants.FCM_EXCLUDE_CONTRACT_INFO_FILE);

            String fileName = System.IO.Path.Combine(Directory.GetCurrentDirectory(), TradingSystemConstants.INITIALIZE_CONFIG_DIRECTORY,
                                                     admFileName.ToString());

            SaveOutputFile sof = new SaveOutputFile();

            sof.openReadFile(fileName);

            String line = sof.readStoredADMStrategyInfoList_1Line();

            //int spreadId = -1;

            while (line != null)
            {
                List <String> separatedLine = readSeparatedLine(line, ',');

                if (separatedLine.Count <= 2)
                {
                    optionSpreadManager.zeroPriceContractList.Add(separatedLine[0]);
                }
                else if (separatedLine.Count > 2)
                {
                    if (Convert.ToBoolean(separatedLine[1]))
                    {
                        optionSpreadManager.zeroPriceContractList.Add(separatedLine[0]);
                    }
                    else if (Convert.ToBoolean(separatedLine[2]))
                    {
                        optionSpreadManager.exceptionContractList.Add(separatedLine[0]);
                    }
                }

                //spreadId =
                //    readLineFillADMLiveStrategyInfo(optionSpreadManager.liveADMStrategyInfoList, separatedLine, spreadId);

                line = sof.readStoredADMStrategyInfoList_1Line();
            }

            sof.closeReadingStreams();
        }
Ejemplo n.º 3
0
        public void saveADMStrategyInfo(OptionSpreadManager optionSpreadManager)
        {
            String dir = System.IO.Path.Combine(Directory.GetCurrentDirectory(), TradingSystemConstants.INITIALIZE_CONFIG_DIRECTORY);

            SaveOutputFile sof = new SaveOutputFile(dir);

            StringBuilder admFileName = new StringBuilder();

            admFileName.Append(optionSpreadManager.initializationParmsSaved.idPortfolioGroup);
            admFileName.Append("_");
            admFileName.Append(TradingSystemConstants.FCM_EXCLUDE_CONTRACT_INFO_FILE);


            sof.createConfigFile(admFileName.ToString());

            ////sof.writeTextLineFile("test");

            createADMLiveInfoLine(optionSpreadManager, sof);

            sof.closeAndSaveFile();
        }