Exemple #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            OpenFileDialog od = new OpenFileDialog();

            od.CheckFileExists  = true;
            od.CheckPathExists  = true;
            od.DefaultExt       = "*.EPF";
            od.Filter           = "TickFiles|*.EPF";
            od.InitialDirectory = "c:\\program files\\tradelink\\tickdata\\";
            od.Multiselect      = false;
            od.ShowDialog();
            BarList   bl = BarListImpl.FromEPF(od.FileName);
            ChartImpl c  = new ChartImpl(bl, false);

            c.Symbol = bl.Symbol;
            try
            {
                c.StartPosition = FormStartPosition.Manual;
                c.Location      = Chartographer.Properties.Settings.Default.chartstart;
            }
            catch (NullReferenceException) { }
            newChartData += new BarListUpdated(c.NewBarList);
            c.Move       += new EventHandler(c_Move);
            c.Icon        = Chartographer.Properties.Resources.chart;
            if (maxchartbox.Checked)
            {
                c.WindowState = FormWindowState.Maximized;
            }
            if (blackbackground.Checked)
            {
                c.BackColor = Color.Black;
            }
            c.Show();
        }
Exemple #2
0
        public void FromEPF()
        {
            // get sample tick data
            BarList bl = BarListImpl.FromEPF("FTI20070926.EPF");

            // verify expected number of 5min bars exist (78 in 9:30-4p)
            Assert.AreEqual(83, bl.Count);
        }
Exemple #3
0
        public void NegativeBars()
        {
            // get sample tick data
            BarList bl = BarListImpl.FromEPF("FTI20070926.EPF");

            // verify expected number of 5min bars exist (78 in 9:30-4p)
            Assert.AreEqual(83, bl.Count);
            // verify that 5th bar from end is same as 77th bar
            Assert.AreEqual(bl[-5].High, bl[77].High);
            Assert.AreEqual(bl[-5].Open, bl[77].Open);
            Assert.AreEqual(bl[-5].Low, bl[77].Low);
            Assert.AreEqual(bl[-5].Close, bl[77].Close);
            Assert.AreEqual(bl[-5].Bardate, bl[77].Bardate);
            Assert.AreEqual(bl[-5].Bartime, bl[77].Bartime);
        }