public Form1() { myTimer = new System.Windows.Forms.Timer(); myTimer.Tick += new EventHandler(myTimer_Callback); InitializeComponent(); play_state = false; my_instrument_data = new instrument_data(); mytrades = new trades_all(); mytrade = new trades_s(); cd = new candle_data(); pos = 0; comboBox1.Items.Add("1秒1根"); comboBox1.Items.Add("2秒1根"); comboBox1.Items.Add("2.5秒1根"); comboBox1.SelectedIndex = 1; changeplaystate(play_state); //reset_timer(); }
private void button4_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog1 = new OpenFileDialog { InitialDirectory = @"", Title = "Browse Text Files", CheckFileExists = true, CheckPathExists = true, DefaultExt = "csv", Filter = "csv files (*.csv)|*.csv", FilterIndex = 2, RestoreDirectory = true, ReadOnlyChecked = true, ShowReadOnly = true }; if (openFileDialog1.ShowDialog() == DialogResult.OK) { string fn = openFileDialog1.FileName; instrument_data new_id = new instrument_data(); if (new_id.try_parse(fn)) { my_instrument_data = new_id; label1.Text = new_id.instrument_name; init_candle(); mytrades = new trades_all(); pos = 0; mytrade = new trades_s(); //draw_candle(); } else { label1.Text = "UNknown"; } } }