public async void TestGetSMA() { IndicatorBLL indBll = new IndicatorBLL(this.s3_bucket_name, this.tempTickerFolder); var smaResult = await indBll.GetSMA("CCL", 20, 20100101); Console.WriteLine(ObjectHelper.ToJson(smaResult)); }
public async Task <ActionResult> Get_SMA(string code, int period, int start = 0, int end = 0, string type = "day") { IndicatorBLL bll = new IndicatorBLL(this.s3_bucket_name, this.local_temp_folder); IndSingleValueEntity[] resultList; if (type.ToLower() == "day") { resultList = await bll.GetSMA(code, period, start, end); } else if (type.ToLower() == "week") { resultList = await bll.GetSMA(code, period, start, end, "week"); } else { return(BadRequest($"Wrong type input: {type}")); } return(Ok(resultList)); }