示例#1
0
        public DataManagerExtends(SelectView1 parentcontrol, List <string> allassets)
        {
            InitializeComponent();

            if (File.Exists(ListAssets.Instance().Path))
            {
                AllAssets = ListAssets.Instance().LoadListAssets(ListAssets.Instance().Path);
            }

            _parentControl = parentcontrol;

            AssetList = allassets;
        }
示例#2
0
        public GridDataAssets(SelectView1 parentcontrol, List <string> allassets)
        {
            InitializeComponent();

            _parentControl = parentcontrol;

            /*if (File.Exists(ListAssets.Instance().Path))
             *  AllAssets = ListAssets.Instance().LoadListAssets(ListAssets.Instance().Path);*/
            AllAssets = new List <Assets>();
            int position = 0;

            foreach (string asset in allassets)
            {
                BarData bar = frmMain.GetLastBarData(asset);
                AllAssets.Add(new Assets()
                {
                    Close     = (decimal)bar.ClosePrice,
                    High      = (decimal)bar.HighPrice,
                    Last      = (decimal)bar.ClosePrice,
                    Low       = (decimal)bar.LowPrice,
                    Open      = (decimal)bar.OpenPrice,
                    Position  = position,
                    Symbol    = bar.Symbol,
                    Time      = bar.TradeDate.Date.ToString(),
                    Trades    = 0,
                    Variation = bar.OpenPrice != 0?(decimal)((bar.ClosePrice - bar.OpenPrice) * 100 / bar.OpenPrice):0
                });
                position++;
            }

            AssetList = allassets;

            radGridView1.Rows.CollectionChanged += RowsCollectionChanged;

            //Tested by example, should works!
            //radGridView1.VirtualMode = true;
        }