Exemplo n.º 1
0
        public bool downloadIntraday(string folderPath, string scriptName, bool bIsTestOn, bool bSaveData)
        {
            string interval   = ddlIntraday_Interval.SelectedValue;
            string outputsize = ddlIntraday_outputsize.SelectedValue;

            //if (StockApi.getIntraday(folderPath, scriptName, time_interval: interval, outputsize: outputsize,
            //                        bIsTestModeOn: bIsTestOn, bSaveData: bSaveData, apiKey: Session["ApiKey"].ToString()) == null)
            //{
            //if we failed to get data from alphavantage we will try to get it from yahoo online with test flag = false
            if (StockApi.getIntradayAlternate(folderPath, scriptName, time_interval: interval, outputsize: outputsize,
                                              bIsTestModeOn: bIsTestOn, bSaveData: bSaveData, apiKey: Session["ApiKey"].ToString()) == null)
            {
                textboxMessage.Text = Environment.NewLine + "Intraday data not available for selected script.";
                return(false);
            }
            //}
            return(true);
        }