public WnFCandles GetCandles(string s, int p, CommodityType type = CommodityType.None, WnFDbConnectionWrapper wrpper = null) { QuandlChart ch = new QuandlChart(p, s, "WIKI", wrpper); int err = ch.GetCandles(); if (err < 0) { ch.FillCandles(_MAX_JSON); } else if (err > 0) { ch.FillCandles(_MAX_JSON); } return(ch); }
public void GetCandles(string s, int p, CommodityType type, ref Dictionary <CandlePeriod, WnFCandles> dic, WnFDbConnectionWrapper wrpper = null) { WnFCandles ch = new QuandlChart(p, s, "WIKI", wrpper); if (((QuandlChart)ch).GetCandles() > 0) { ch.FillCandles(_MAX_JSON); } dic[(CandlePeriod)p] = ch; }
public bool Check(out int _err, out WnFCandles _c) { _err = 0; _c = null; _akeyfile = string.Empty; _apikeys = LoadAPIKeys(out _akeyfile); _url_fstr = string.Empty; if (_akeyfile == string.Empty) { _err = (int)APIError.APIKeyFile; return(false); } else if (_apikeys.Count == 0) { _err = (int)APIError.APIKeyLength; return(false); } else if (!ReadURLString("Candles", out _url_fstr)) { _err = (int)APIError.APIUrlFormat; return(false); } else { string symbol, database; if (!ReadURLString("DatabaseDefault", out database) || !ReadURLString("DatasetDefault", out symbol)) { _err = (int)APIError.APIUrlFormat; return(false); } _ch = new QuandlChart((int)CandlePeriod.D, symbol, database); _err = _ch.GetCandles(); if (_err < 0) { return(false); } else if (_err > 0) { _ch.FillCandles(_MAX_JSON); } if (_ch.DOHLCV.Rows.Count == 0) { _err = (int)APIError.Unknown; return(false); } else { _c = _ch; } } return(true); }