private void tb_AccountAna_Click(object sender, EventArgs e) { if (Account == null) { MessageBox.Show("当前没有登陆任何账号,请选择一个账号进行分析"); FormAccount formAccount = new FormAccount(DataCenter.Default.AccountManager, ""); DialogResult result = formAccount.ShowDialog(); if (result == DialogResult.OK) { this.Account = formAccount.SelectedAccount; string code = null; if (Account.CurrentTradeInfo.Count > 0) { code = Account.CurrentTradeInfo[Account.CurrentTradeInfo.Count - 1].InstrumentID; } if (code != null) { chartComponent.Controller.Change(code, Account.Time); } else { chartComponent.Controller.Change(Account.Time); } } else { return; } } FormAccountAna formAccountAna = new FormAccountAna(Account, this.chartComponent); formAccountAna.TopMost = true; formAccountAna.Show(); }
private void accountButton_Click(object sender, EventArgs e)//进入账号界面 { FormAccount formAccount = new FormAccount(this, currentClient); this.Hide(); formAccount.ShowDialog(); }
private void tb_Trade_Click(object sender, EventArgs e) { if (!chartComponent.ConnectedServer) { if (this.marketTrader == null) { //弹出交易账号选择界面 FormAccount formAccount = new FormAccount(DataCenter.Default.AccountManager, FormAccount.PATH_MOCK); DialogResult result = formAccount.ShowDialog(); if (result == DialogResult.OK) { chartComponent.Account = formAccount.SelectedAccount; IAccount account = chartComponent.Account; if (account.Time > 0) { string code = null; if (account.CurrentTradeInfo.Count > 0) { code = account.CurrentTradeInfo[account.CurrentTradeInfo.Count - 1].InstrumentID; } if (code != null) { chartComponent.Controller.Change(code, account.Time); } else { chartComponent.Controller.Change(account.Time); } } account.BindRealTimeReader(this.chartComponent.Controller.CurrentRealTimeDataReader); this.marketTrader = new Plugin_MarketTrader_Simu(account, this.chartComponent.DataCenter.AccountManager, formAccount.SelectedAccountPath, formAccount.SelectedAccountName); } else { return; } } } FormTrade formTrade = new FormTrade(marketTrader, chartComponent.Controller.CurrentNavigater); formTrade.TopMost = true; formTrade.Show(); }
private void btnCreate_Click(object sender, EventArgs e) { Form formAccount = new FormAccount(); formAccount.ShowDialog(); }