Beispiel #1
0
        private void buttonShowChart_Click(object sender, EventArgs e)
        {
            string code = editCode.Text.Trim();

            if (code == "")
            {
                return;
            }

            int date = this.checkBoxUseTody.Checked ? 0 :
                       dtpDate.Value.Year * 10000 + dtpDate.Value.Month * 100 + dtpDate.Value.Day;

            TrendForm form = new TrendForm(code, date);

            form.Show();
        }
Beispiel #2
0
        private void UpdateTrendChart()
        {
            var bars = TrendForm.BuildBar(this.ticks, 60);

            double[] prices  = new double[bars.Length];
            long[]   volumes = new long[bars.Length];
            int[]    times   = new int[bars.Length];

            for (int i = 0; i < bars.Length; i++)
            {
                prices[i]  = bars[i].Close;
                times[i]   = bars[i].Time;
                volumes[i] = bars[i].Volume;
            }

            double pre_close   = this.ticks[0].PreClose;
            int    trading_day = this.ticks[0].TradingDay;

            trendChart1.SetData(code, trading_day, pre_close, prices, volumes, times);
        }