Exemplo n.º 1
0
        private List <OptionChain> LoadOptionsFullData(string masterFilePath, bool isAzure)
        {
            List <OptionChain> optionsData = new List <OptionChain>();
            OBJtoXML           xmltoObj    = new OBJtoXML();

            if (isAzure)
            {
                List <DateValuePair> txtFiles = ReadAllFile(masterFilePath);
                foreach (DateValuePair currentFile in txtFiles)
                {
                    optionsData.AddRange((List <OptionChain>)xmltoObj.CreateOptionsObject(optionsData, currentFile.Value, true));
                }
            }
            else
            {
                string[] txtFiles = Directory.GetFiles(masterFilePath, "*.txt*", SearchOption.AllDirectories).OrderByDescending(d => new FileInfo(d).LastWriteTime).ToArray();

                //var txtFiles = Directory.EnumerateFiles("D:\\MasterData\\Basic\\", " *.txt").OrderByDescending(x => x);
                foreach (string currentFile in txtFiles)
                {
                    optionsData.AddRange((List <OptionChain>)xmltoObj.CreateOptionsObject(optionsData, currentFile, true));
                }
            }
            return(optionsData);
        }
Exemplo n.º 2
0
        // GET: O
        public ActionResult BNNextIndex()
        {
            string        _defaultDate = string.Empty;
            List <string> dates        = GetAvaliableDates(out _defaultDate);

            GenerateBackDateURLs(dates);


            string path = ConfigurationManager.AppSettings["BNNextOptions"];

            List <OIOData.OIDetails> objforXml = new List <OIDetails>();
            OBJtoXML xmltoObj = new OBJtoXML();

            string[] txtFiles = Directory.GetFiles(path, "*.txt*", SearchOption.AllDirectories).OrderByDescending(d => new FileInfo(d).LastWriteTime).ToArray();

            //var txtFiles = Directory.EnumerateFiles("D:\\MasterData\\Basic\\", " *.txt").OrderByDescending(x => x);
            List <string>            filesList   = FilterDates(txtFiles.ToList(), _defaultDate);
            List <OIOData.OIDetails> optionsData = new List <OIDetails>();

            foreach (string currentFile in filesList)
            {
                optionsData = (List <OIOData.OIDetails>)xmltoObj.CreateOptionsObject(objforXml, currentFile);
            }
            QueryBinder dataList = new QueryBinder();

            dataList.CallOptionsNextBNData = GenerateCallData(optionsData).CallOptionsNData;
            dataList.PutOptionsNextBNData  = GeneratePutData(optionsData).PutOptionsNData;

            return(View(dataList));
        }
Exemplo n.º 3
0
        private List <OptionChain> LoadOptionsFullData()
        {
            OBJtoXML xmltoObj = new OBJtoXML();

            string[] txtFiles = Directory.GetFiles(@"D:\Q-Dashboard\MasterData\FullOptionsData\", "*.txt*", SearchOption.AllDirectories).OrderByDescending(d => new FileInfo(d).LastWriteTime).ToArray();

            //var txtFiles = Directory.EnumerateFiles("D:\\MasterData\\Basic\\", " *.txt").OrderByDescending(x => x);
            List <OptionChain> optionsData = new List <OptionChain>();

            foreach (string currentFile in txtFiles)
            {
                optionsData.AddRange((List <OptionChain>)xmltoObj.CreateOptionsObject(optionsData, currentFile));
            }
            return(optionsData);
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            OptionChainClass obj = new OptionChainClass();

            string[] dates = { "25OCT2018", "11OCT2018" };
            obj.LoadFullOptionChainData(@"D:\Analyzer\MasterData\FullOptionsData\", dates, false);

            OBJtoXML xmltoObj = new OBJtoXML();

            string[] txtFiles = Directory.GetFiles(@"D:\Analyzer\MasterData\FullOptionsData\", "*.txt*", SearchOption.AllDirectories).OrderByDescending(d => new FileInfo(d).LastWriteTime).ToArray();

            //var txtFiles = Directory.EnumerateFiles("D:\\MasterData\\Basic\\", " *.txt").OrderByDescending(x => x);
            List <OptionChain> optionsData = new List <OptionChain>();

            foreach (string currentFile in txtFiles)
            {
                optionsData.AddRange((List <OptionChain>)xmltoObj.CreateOptionsObject(optionsData, currentFile));
            }
            optionsData = optionsData.Where(x => x.SourceName == "NIFTY" || x.SourceName == "BANKNIFTY").ToList();
            optionsData = optionsData.OrderByDescending(x => x.TimeStamp).ToList();

            // optionsData=optionsData.OrderByDescending(x => Convert.ToDecimal(x.Percentage)).ToList();
        }