Inheritance: AccountDataKey
Exemplo n.º 1
0
        private void AddPosition(SmartQuant.AccountData data)
        {
            Dictionary <string, ListViewItem> dictionary = this.positions[data.Account];
            string       key          = new PositionKey(data).ToString();
            ListViewItem listViewItem = (ListViewItem)null;

            if (!dictionary.TryGetValue(key, out listViewItem))
            {
                listViewItem                  = new ListViewItem(new string[4]);
                listViewItem.Name             = key;
                listViewItem.SubItems[0].Text = key;
                dictionary.Add(key, listViewItem);
            }
            this.UpdateSubItem(listViewItem, 1, data, "Qty");
            this.UpdateSubItem(listViewItem, 2, data, "LongQty");
            this.UpdateSubItem(listViewItem, 3, data, "ShortQty");
            if (!(data.Account == this.cbxAccount.SelectedItem as string))
            {
                return;
            }
            this.UpdateListView(data.Account, AccountDataViewer.ListType.Positions);
        }
Exemplo n.º 2
0
 private void AddPosition(SmartQuant.AccountData data)
 {
     Dictionary<string, ListViewItem> dictionary = this.positions[data.Account];
     string key = new PositionKey(data).ToString();
     ListViewItem listViewItem = (ListViewItem)null;
     if (!dictionary.TryGetValue(key, out listViewItem))
     {
         listViewItem = new ListViewItem(new string[4]);
         listViewItem.Name = key;
         listViewItem.SubItems[0].Text = key;
         dictionary.Add(key, listViewItem);
     }
     this.UpdateSubItem(listViewItem, 1, data, "Qty");
     this.UpdateSubItem(listViewItem, 2, data, "LongQty");
     this.UpdateSubItem(listViewItem, 3, data, "ShortQty");
     if (!(data.Account == this.cbxAccount.SelectedItem as string))
         return;
     this.UpdateListView(data.Account, AccountDataViewer.ListType.Positions);
 }