コード例 #1
0
        public List <OptionChain> LoadFullOptionChainData(string filepathtoSave, string[] dates, bool isLoadAll, string masterDataStaticBankNifty, string masterDataStaticNifty, string liveMarketUrl)
        {
            List <OptionChain> chainData = new List <OptionChain>();
            string             _masterDataStaticBankNifty = masterDataStaticBankNifty;
            string             _masterDataStaticNifty     = masterDataStaticNifty;
            List <SourceList>  listofSources = StrikeSource.Sources(_masterDataStaticBankNifty, _masterDataStaticNifty, dates[0], dates[1], isLoadAll);

            foreach (var item in listofSources)
            {
                //string url = "https://www.nseindia.com/live_market/dynaContent/live_watch/option_chain/optionKeys.jsp?segmentLink=17&instrument=OPTIDX&symbol=BANKNIFTY&date=XXXDATE";
                string url = liveMarketUrl;
                url = url.Replace("OPTIDX", item.instrument).Replace("BANKNIFTY", item.symbol).Replace("XXXDATE", item.date);
                chainData.Add(GenerateOptionChain(url, item.SourceName, item.date, item.instrument));
            }
            return(chainData);
            //TVR -- this logic need to move to ApiLoader/Service part
            //OBJtoXML xmltoObj = new OBJtoXML();
            //xmltoObj.CreateOptionsXML(chainData, filepathtoSave, "LoadFullOptionChainData");
        }
コード例 #2
0
        public void LoadFullOptionChainData(string filepathtoSave, string[] dates, bool isLoadAll)
        {
            List <OptionChain> chainData = new List <OptionChain>();
            string             _masterDataStaticBankNifty = ConfigurationManager.AppSettings["MasterDataStaticBankNifty"];
            string             _masterDataStaticNifty     = ConfigurationManager.AppSettings["MasterDataStaticNifty"];
            // List<SourceList> listofSources = StrikeSource.Sources(_masterDataStaticBankNifty, _masterDataStaticNifty, "25OCT2018", "11OCT2018");
            List <SourceList> listofSources = StrikeSource.Sources(_masterDataStaticBankNifty, _masterDataStaticNifty, dates[0], dates[1], isLoadAll);

            foreach (var item in listofSources)
            {
                string url = "https://www.nseindia.com/live_market/dynaContent/live_watch/option_chain/optionKeys.jsp?segmentLink=17&instrument=OPTIDX&symbol=BANKNIFTY&date=XXXDATE";
                url = url.Replace("OPTIDX", item.instrument).Replace("BANKNIFTY", item.symbol).Replace("XXXDATE", item.date);
                chainData.Add(GenerateOptionChain(url, item.SourceName, item.date, item.instrument));
            }

            OBJtoXML xmltoObj = new OBJtoXML();

            xmltoObj.CreateOptionsXML(chainData, filepathtoSave, "LoadFullOptionChainData");
        }