public void SetData(float p_price, float p_min, float p_max) { info = new TradeAnalysation(p_price, 0, 0.08f); min = p_min; max = p_max; }
public void Load() { XmlDocument doc = new XmlDocument(); try { doc.Load(URL); _content.Clear(); XmlElement root = doc.DocumentElement; foreach (XmlElement xmlItem in root.GetElementsByTagName("item")) { WalletItem item = new WalletItem(); DateTime.TryParse(xmlItem.GetAttribute("date"), out item.date); item.data = TradeAnalysation.Load(xmlItem); //bool.TryParse(xmlItem.GetAttribute("buy"), out item.buy); float.TryParse(xmlItem.GetAttribute("share_res"), out item.share[(int)VolumeOwner.RESERVE_BTC]); float.TryParse(xmlItem.GetAttribute("share_spec"), out item.share[(int)VolumeOwner.SPECULATION]); _content.Add(item); } _money.Load(root); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show("Failed to load wallet!"); Save(); } }
private void drawPanel_MouseClick(object sender, MouseEventArgs e) { if (MarkTool.Checked) { TradeAnalysation ana = new TradeAnalysation(GetValue(e.Location.Y), 0, 0.8f); AddMarker(GetDate(e.Location.X), ana, true); MarkTool.Checked = false; } }
public void Init(DateTime date, TradeAnalysation data, bool custom) { this.data = data; this.date = date; this.custom = custom; SetMark(Color.Black); InitLineList(); }
//---------------------- controll functions public void AddMarker(DateTime date, TradeAnalysation data, bool custom) { TradeMarker newMarker = new TradeMarker(); newMarker.Init(date, data, custom); RegisterMarker(newMarker); RefreshGraph(); SaveMarker(); }
public void Load(XmlElement el) { date = DateTime.Parse(el.GetAttribute("date")); data = TradeAnalysation.Load(el); bool.TryParse(el.GetAttribute("custom"), out custom); bool.TryParse(el.GetAttribute("visible"), out visible); mark.Load((XmlElement)el.GetElementsByTagName("mark")[0]); InitLineList(); int i = 0; foreach (XmlElement e in el.GetElementsByTagName("line")) { lines[i++].Load(e); } }