コード例 #1
0
        public QueryBinder TodayPicker(string _defaultDate)
        {
            //Cache5
            QueryBinder           binder          = new QueryBinder();
            RBOData               objData         = new RBOData();
            List <RBOEntity>      data            = objData.RBO(_defaultDate);
            List <CompanyDetails> todayPickerData = new List <CompanyDetails>();
            BulkData              objList         = new BulkData();
            List <CompanyDetails> data1           = objList.GetBasicData(new List <Weightage>(), "All", _masterDatapathBasic, _defaultDate).Where(x => x.BasicSavedTimeStamp.Date == DateTime.Now.Date).ToList();
            int qId = data1.Max(x => x.Id);
            List <CompanyDetails> newDataList = data1.Where(x => x.Id == qId).OrderByDescending(x => Convert.ToDecimal(x.CurrentPrevdayVolumePercentage)).Take(30).ToList();

            foreach (var newItem in newDataList)
            {
                foreach (var item in data.Where(x => Convert.ToDecimal(x.BOPercentage) > 95).OrderByDescending(x => Convert.ToDecimal(x.BOPercentage)))
                {
                    if (item.Code == newItem.Code)
                    {
                        todayPickerData.Add(newItem); break;
                    }
                }
            }
            binder.PosativeData = todayPickerData.ToList();
            return(binder);
        }
コード例 #2
0
        public QueryBinder MCData(string _defaultDate)
        {
            //Cache2
            QueryBinder binder  = new QueryBinder();
            BulkData    objList = new BulkData();

            binder.MCData = objList.MCData(masterMCpath, _defaultDate);
            return(binder);
        }
コード例 #3
0
        public QueryBinder FastMovers(string _defaultDate)
        {
            //Cache3
            QueryBinder binder  = new QueryBinder();
            BulkData    objList = new BulkData();

            binder.PosativeData = objList.GetBasicData(new List <Weightage>(), "All", _masterDatapathBasic, _defaultDate);
            return(binder);
        }
コード例 #4
0
        public QueryBinder Discounting(string id, string _defaultDate)
        {
            //Cache2
            QueryBinder binder  = new QueryBinder();
            BulkData    objList = new BulkData();

            binder.PosativeData = objList.GetBasicData(new List <Weightage>(), id, _masterDatapathBasic, _defaultDate);
            binder.CheckPriceStrongOIStroing = objList.GetOpenInterestData(id, _masterDatapathOI, _defaultDate);
            return(binder);
        }
コード例 #5
0
        public QueryBinder AvgAll(string _defaultDate)
        {
            //Cache2
            QueryBinder binder = new QueryBinder();

            BulkData objList = new BulkData();

            binder.PosativeData = objList.GetBasicAvgAll(new List <Weightage>(), _masterDatapathBasic, _defaultDate).Where(x => x.Code != null).ToList();
            binder.CheckPriceStrongOIStroing = objList.GetOIAvgAll(_masterDatapathOI, _defaultDate).Where(x => x.CompanyCode != null).ToList();
            binder.AvgVolums = GenerateAvgVolumsDataForAll(binder.PosativeData, binder.CheckPriceStrongOIStroing).Where(x => x.IsBasicBuy == true || x.IsOIBuy == true).ToList();

            return(binder);
        }
コード例 #6
0
        public QueryBinder Index(string id, string _defaultDate)
        {
            //Cache2
            QueryBinder binder  = new QueryBinder();
            BulkData    objList = new BulkData();

            binder.PosativeData = objList.GetBasicData(new List <Weightage>(), id, _masterDatapathBasic, _defaultDate);
            binder.CheckPriceStrongOIStroing = objList.GetOpenInterestData(id, _masterDatapathOI, _defaultDate);
            //binder.CheckLTPHasFirstPlace = objList.GetDMAData(id, _masterDatapathDMA);
            binder.UIDetailedDMA = objList.GetConvertObjectToDMAData(id, _masterDatapathDMA, _defaultDate);
            binder.AvgVolums     = GenerateAvgVolumsData(binder.PosativeData, binder.CheckPriceStrongOIStroing);
            return(binder);
        }
コード例 #7
0
        public QueryBinder TopVolumes(string _defaultDate)
        {
            //Cache4
            QueryBinder           binder  = new QueryBinder();
            BulkData              objList = new BulkData();
            List <CompanyDetails> data    = objList.GetBasicData(new List <Weightage>(), "All", _masterDatapathBasic, _defaultDate).Where(x => x.BasicSavedTimeStamp.Date == DateTime.Now.Date).ToList();
            int qId = data.Max(x => x.Id);

            binder.PosativeData = data.Where(x => x.Id == qId).OrderByDescending(x => Convert.ToDecimal(x.CurrentPrevdayVolumePercentage)).Take(20).ToList();
            // binder.NegativeData = data.Where(x => x.Id == qId).OrderBy(x => Convert.ToDecimal(x.CurrentPrevdayVolumePercentage)).Take(5).ToList();

            return(binder);
        }
コード例 #8
0
        public QueryBinder BankNifty(string _defaultDate)
        {
            //Cache1
            QueryBinder      binder        = new QueryBinder();
            WeightageClass   obj           = new WeightageClass();
            List <Weightage> weightageData = new List <Weightage>();

            weightageData = obj.WeightageBNData(_bankNiftyPath);
            BulkData objList = new BulkData();

            binder.PosativeData = objList.GetBasicData(weightageData, _bankNiftyIndexStocks, _masterDatapathBasic, _defaultDate);
            List <OIDetails>     objx = new List <OIDetails>();
            List <UIDetailedDMA> objy = new List <UIDetailedDMA>();

            binder.CheckPriceStrongOIStroing = objx;
            binder.UIDetailedDMA             = objy;
            return(binder);
        }
コード例 #9
0
ファイル: BulkData.cs プロジェクト: vtadivaka/V05252019
        public List <MCData> MCData(string path, string _defaultDate)
        {
            BulkData obj = new BulkData();
            // BulkEntity data = obj.AnalyzerData("BHARTIARTL");
            ////test to read data
            OBJtoXML      xmltoObj = new OBJtoXML();
            List <MCData> data     = new List <MCData>();

            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);

            foreach (string currentFile in filesList)
            {
                data = (List <MCData>)xmltoObj.CreateObject(data, currentFile, false); break;
            }
            return(data);
        }
コード例 #10
0
ファイル: BulkData.cs プロジェクト: vtadivaka/V05252019
        public List <string> GetCodes(string basicfilePath, string ioFilePath, string _defaultDate)
        {
            List <string> objList     = new List <string>();
            BulkData      obj         = new BulkData();
            OBJtoXML      xmltoObj    = new OBJtoXML();
            BulkEntity    datafromXML = new BulkEntity();

            datafromXML.BasicData = new List <CompanyDetails>();
            string[]      txtFiles  = Directory.GetFiles(basicfilePath, "*.txt*", SearchOption.AllDirectories).OrderByDescending(d => new FileInfo(d).LastWriteTime).ToArray();
            List <string> filesList = FilterDates(txtFiles.ToList(), _defaultDate);

            foreach (string currentFile in filesList)
            {
                datafromXML.BasicData.AddRange((List <CompanyDetails>)xmltoObj.CreateObject(datafromXML.BasicData, currentFile, false)); break;
            }

            foreach (var item in datafromXML.BasicData)
            {
                if (!(objList.Contains(item.Code)))
                {
                    objList.Add(item.Code);
                }
            }



            datafromXML.OIData = new List <OIDetails>();
            var txtFilesOIDetails = Directory.EnumerateFiles(ioFilePath, "*.txt").OrderByDescending(d => new FileInfo(d).LastWriteTime).ToArray();

            foreach (string currentFile in txtFilesOIDetails)
            {
                datafromXML.OIData.AddRange((List <OIDetails>)xmltoObj.CreateObject(datafromXML.OIData, currentFile, false)); break;
            }

            foreach (var item in datafromXML.OIData)
            {
                if (!(objList.Contains(item.CompanyCode)))
                {
                    objList.Add(item.CompanyCode);
                }
            }
            return(objList);
        }
コード例 #11
0
ファイル: BulkData.cs プロジェクト: vtadivaka/V05252019
        public List <CompanyDetails> GetBasicAvgAll(List <Weightage> weightageData, string path, string _defaultDate)
        {
            List <CompanyDetails> queryData = new List <CompanyDetails>();
            BulkData obj = new BulkData();
            // BulkEntity data = obj.AnalyzerData("BHARTIARTL");
            ////test to read data
            OBJtoXML   xmltoObj    = new OBJtoXML();
            BulkEntity datafromXML = new BulkEntity();

            datafromXML.BasicData = new List <CompanyDetails>();
            string[]      txtFiles  = Directory.GetFiles(path, "*.txt*", SearchOption.AllDirectories).OrderByDescending(d => new FileInfo(d).LastWriteTime).ToArray();
            List <string> filesList = FilterDates(txtFiles.ToList(), _defaultDate);

            foreach (string currentFile in filesList)
            {
                datafromXML.BasicData.AddRange((List <CompanyDetails>)xmltoObj.CreateObject(datafromXML.BasicData, currentFile, false));
            }

            queryData = datafromXML.BasicData.OrderByDescending(x => x.BasicSavedTimeStamp).ToList();
            return(queryData);
        }
コード例 #12
0
ファイル: BulkData.cs プロジェクト: vtadivaka/V05252019
        public List <Rank> GetDMAData(string code, string path, string _defaultDate)
        {
            BulkData obj = new BulkData();
            // BulkEntity data = obj.AnalyzerData("BHARTIARTL");
            ////test to read data
            OBJtoXML   xmltoObj    = new OBJtoXML();
            BulkEntity datafromXML = new BulkEntity();

            datafromXML.DMAData = new List <Rank>();
            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);

            foreach (string currentFile in filesList)
            {
                datafromXML.DMAData.AddRange((List <Rank>)xmltoObj.CreateObject(datafromXML.DMAData, currentFile, false));
            }
            List <Rank> queryData = datafromXML.DMAData.Where(x => x.SourceName == code).OrderByDescending(x => x.RankSavedTimeStamp).ToList();

            return(queryData);
        }
コード例 #13
0
ファイル: BulkData.cs プロジェクト: vtadivaka/V05252019
        public List <OIDetails> GetOpenInterestData(string code, string path, string _defaultDate)
        {
            BulkData obj = new BulkData();
            // BulkEntity data = obj.AnalyzerData("BHARTIARTL");
            ////test to read data
            OBJtoXML   xmltoObj    = new OBJtoXML();
            BulkEntity datafromXML = new BulkEntity();

            datafromXML.OIData = new List <OIDetails>();
            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);

            foreach (string currentFile in filesList)
            {
                datafromXML.OIData.AddRange((List <OIDetails>)xmltoObj.CreateObject(datafromXML.OIData, currentFile, false));
                if (code == "Discounting")
                {
                    break;
                }
            }
            List <OIDetails> queryData = new List <OIDetails>();

            if (code == "Discounting")
            {
                queryData = datafromXML.OIData.OrderByDescending(x => x.OISavedTimeStamp).ToList();
            }
            else
            {
                queryData = datafromXML.OIData.Where(x => x.CompanyCode == code).OrderByDescending(x => x.OISavedTimeStamp).ToList();
            }

            //return BankNiftyMoving(queryData);
            return(queryData);
        }
コード例 #14
0
ファイル: RBOData.cs プロジェクト: vtadivaka/V05252019
        public List <RBOEntity> RBO(string _defaultDate)
        {
            List <RBOEntity> objRBOEntityList     = new List <RBOEntity>();
            string           _masterDatapathBasic = ConfigurationManager.AppSettings["MasterDatapathBasic"];
            string           _masterDatapathDMA   = ConfigurationManager.AppSettings["MasterDatapathDMA"];

            BulkData   obj         = new BulkData();
            OBJtoXML   xmltoObj    = new OBJtoXML();
            BulkEntity datafromXML = new BulkEntity();

            datafromXML.BasicData = new List <CompanyDetails>();
            int RBOcount = 173;

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

            List <string> filesList = FilterDates(txtFiles.ToList(), _defaultDate);

            foreach (string currentFile in filesList)
            {
                if (checkIsValidFileForRBO(currentFile))
                {
                    datafromXML.BasicData.AddRange((List <CompanyDetails>)xmltoObj.CreateObject(datafromXML.BasicData, currentFile, false));
                    if (RBOcount == datafromXML.BasicData.Count)
                    {
                        break;
                    }
                    else
                    {
                        datafromXML.BasicData = new List <CompanyDetails>();
                    }
                }
            }

            //test to read data
            datafromXML.DMAData = new List <Rank>();
            var txtDMAFiles = Directory.EnumerateFiles(_masterDatapathDMA, "*.txt").OrderByDescending(d => new FileInfo(d).LastWriteTime).ToArray();

            foreach (string currentFile in txtDMAFiles)
            {
                if (checkIsValidFileForRBO(currentFile))
                {
                    datafromXML.DMAData.AddRange((List <Rank>)xmltoObj.CreateObject(datafromXML.DMAData, currentFile, false));
                    break;
                }
            }

            RBOEntity objEntity;

            foreach (var basicData in datafromXML.BasicData.Where(x => x.Code != null))
            {
                objEntity             = new RBOEntity();
                objEntity.Code        = basicData.Code;
                objEntity.LTPValue    = basicData.lastPrice;
                objEntity.LTPDate     = basicData.BasicSavedTimeStamp;
                objEntity.low52       = basicData.low52;
                objEntity.high52      = basicData.high52;
                objEntity.TotalVolume = basicData.TotalVolume;
                objEntity.CurrentPrevdayVolumePercentage = basicData.CurrentPrevdayVolumePercentage;

                objEntity.BOPercentage = Math.Round(((Convert.ToDecimal(objEntity.LTPValue) * 100) / Convert.ToDecimal(objEntity.high52)), 2).ToString();
                var     dmaData  = datafromXML.DMAData.Where(x => x.SourceName == basicData.Code).ToList();
                decimal rboValue = 0.0M;
                decimal ltpValue = 0.0M;
                int     count    = 0;
                foreach (var itemDma in dmaData)
                {
                    if (itemDma.Day != "LTP")
                    {
                        rboValue = rboValue + Convert.ToDecimal(itemDma.Value); count++;
                    }
                    else
                    {
                        ltpValue = Convert.ToDecimal(itemDma.Value);
                    }
                }
                decimal rboAvgValue   = rboValue / count;
                decimal rboPercentage = ((ltpValue - rboAvgValue) * 100) / ltpValue;
                objEntity.RangeBoundPercentage = Math.Round(rboPercentage, 2).ToString();
                objRBOEntityList.Add(objEntity);
            }
            return(objRBOEntityList);
        }
コード例 #15
0
ファイル: BulkData.cs プロジェクト: vtadivaka/V05252019
        public List <CompanyDetails> GetBasicData(List <Weightage> weightageData, string companyCode, string path, string _defaultDate)
        {
            List <CompanyDetails> returnData = new List <CompanyDetails>();

            if (companyCode == "Discounting")
            {
                BulkData obj = new BulkData();
                // BulkEntity data = obj.AnalyzerData("BHARTIARTL");
                ////test to read data
                OBJtoXML   xmltoObj    = new OBJtoXML();
                BulkEntity datafromXML = new BulkEntity();
                datafromXML.BasicData = new List <CompanyDetails>();
                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);
                foreach (string currentFile in filesList)
                {
                    datafromXML.BasicData.AddRange((List <CompanyDetails>)xmltoObj.CreateObject(datafromXML.BasicData, currentFile, false)); break;
                }
                List <CompanyDetails> queryData = new List <CompanyDetails>();
                returnData = datafromXML.BasicData.OrderBy(x => x.BasicSavedTimeStamp).ToList();
            }
            else if (companyCode == "All")
            {
                BulkData obj = new BulkData();
                // BulkEntity data = obj.AnalyzerData("BHARTIARTL");
                ////test to read data
                OBJtoXML   xmltoObj    = new OBJtoXML();
                BulkEntity datafromXML = new BulkEntity();
                datafromXML.BasicData = new List <CompanyDetails>();
                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);
                foreach (string currentFile in filesList)
                {
                    datafromXML.BasicData.AddRange((List <CompanyDetails>)xmltoObj.CreateObject(datafromXML.BasicData, currentFile, false));
                }
                List <CompanyDetails> queryData = new List <CompanyDetails>();
                queryData  = datafromXML.BasicData.OrderBy(x => x.BasicSavedTimeStamp).ToList();
                returnData = CalcFastMoversForAll(companyCode, queryData.Where(x => x.TotalVolume != null && x.totalBuyQuantity != "1" && x.totalSellQuantity != "1").ToList());
            }
            else if (companyCode.Split(',')[0].ToUpper() == "BANKNIFTY")
            {
                BulkData   obj         = new BulkData();
                OBJtoXML   xmltoObj    = new OBJtoXML();
                BulkEntity datafromXML = new BulkEntity();
                datafromXML.BasicData = new List <CompanyDetails>();
                string[] txtFiles = Directory.GetFiles(path, "*.txt*", SearchOption.AllDirectories).OrderByDescending(d => new FileInfo(d).LastWriteTime).ToArray();

                List <string> filesList = FilterDates(txtFiles.ToList(), _defaultDate);
                foreach (string currentFile in filesList)
                {
                    datafromXML.BasicData.AddRange((List <CompanyDetails>)xmltoObj.CreateObject(datafromXML.BasicData, currentFile, false));
                }
                List <CompanyDetails> queryData = new List <CompanyDetails>();
                queryData  = datafromXML.BasicData.OrderBy(x => x.BasicSavedTimeStamp).ToList();
                returnData = CalcFastMoversForBankNifty(weightageData, companyCode, queryData.Where(x => x.TotalVolume != null && x.totalBuyQuantity != "1" && x.totalSellQuantity != "1").ToList());
            }
            else
            {
                BulkData obj = new BulkData();
                // BulkEntity data = obj.AnalyzerData("BHARTIARTL");
                ////test to read data
                OBJtoXML   xmltoObj    = new OBJtoXML();
                BulkEntity datafromXML = new BulkEntity();
                datafromXML.BasicData = new List <CompanyDetails>();
                string[]      txtFiles  = Directory.GetFiles(path, "*.txt*", SearchOption.AllDirectories).OrderByDescending(d => new FileInfo(d).LastWriteTime).ToArray();
                List <string> filesList = FilterDates(txtFiles.ToList(), _defaultDate);
                foreach (string currentFile in filesList)
                {
                    datafromXML.BasicData.AddRange((List <CompanyDetails>)xmltoObj.CreateObject(datafromXML.BasicData, currentFile, false));
                }
                List <CompanyDetails> queryData = new List <CompanyDetails>();
                queryData  = datafromXML.BasicData.OrderBy(x => x.BasicSavedTimeStamp).ToList();
                returnData = CalcFastMoversBasedOnCode(queryData.Where(x => x.TotalVolume != null && x.totalBuyQuantity != "1" && x.totalSellQuantity != "1" && x.Code == companyCode).ToList());
            }

            return(returnData);
        }