private void SetData() { if (Request.IsAjaxRequest()) { try { var form = Request.Form; DATA = form.ToDictionary(); //JsonConvert.DeserializeObject<Dictionary<string, string>>(form); } catch (Exception e) { var ex = e.Message; DATA = new Dictionary <string, string>(); } } else { DATA = Request.Form.ToDictionary(); } var dataUrls = GetDataFromRawUrl(Request.RawUrl); if (!Equals(dataUrls, null)) { foreach (var item in dataUrls) { DATA.Add(item.Key, item.Value); } } }
public AutoTreader(ref Archive ARCHIVE, ref OpenRatesBlotter ORBlotter, ref OpenDealsBlotter ODBlotter, ref OpenSettingsBlotter OSBlotter, ref Account ACCOUNT) { this.ARCHIVE = ARCHIVE; this.ODBlotter = ODBlotter; this.ORBlotter = ORBlotter; this.OSBlotter = OSBlotter; this.ACCOUNT = ACCOUNT; this.ANALYSIS = new Analysis(ref ARCHIVE, ref ACCOUNT); foreach (TimeFrame TFrame in ARCHIVE.LTFrames) { DATA.Add(TFrame, new ConcurrentDictionary <string, ChartPointPredition>()); } }
public OpenDealsBlotter(string TOKEN, string USERID) { this.TOKEN = TOKEN; this.USERID = USERID; DATABASE = new DataBase(USERID); string[] SArray = Directory.GetFiles(DATABASE.Directory_Deals); foreach (string s in SArray) { string DealID = Path.GetFileNameWithoutExtension(s); Deals Ds = DATABASE.Load_Deals(DealID); if (Ds != null && Ds.DealReference == DealID) { DATA.Add(Ds); } } }
public bool Load(string product, TimeFrame TFrame, int deep, int ahead, int count) { if (DLSCPoints.ContainsKey(product)) //if up to date, refresh data base and return { DLSCPoints[product] = ARCHIVE.GetDATA(TFrame, product); return(false); } else { DLSCPoints.Add(product, ARCHIVE.GetDATA(TFrame, product)); } List <ChartPointsPredition> LDCPsPoints = DATABASE.Load_ChartPointsPrediction(product, ABBREVIATIONS.ToString(TFrame), deep, ahead); int iPosition = DLSCPoints[product].Count - count; if (LDCPsPoints == null || LDCPsPoints.Count == 0) { DATA.Add(product, new List <ChartPointsPredition>()); } else { if (LDCPsPoints.Count > count) { LDCPsPoints.RemoveRange(0, LDCPsPoints.Count - count); } for (int i = 0; i < LDCPsPoints.Count; i++) { LDCPsPoints[i].Prognosis(0); } DATA.Add(product, LDCPsPoints); } return(true); }