public DataSeriesSec(string pNam, double dltT, Exchange ex, TimeFrame1 tf, chartStyle chartSt, int ignoreTickForSum, ConnectorQuik con, WindowGL ch) { Bars = new Dictionary <DateTime, PriceClaster>(); chart = ch; connector = con; connector.Event_GetTicks += Connector_Event_GetTicks; secName = pNam; deltaTick = dltT; exchange = ex; TF = tf; ChStyle = chartSt; maxPrice = 0; minPrice = 9999999; ignoreTick = ignoreTickForSum; new Thread(() => { LoadTick(); }).Start(); }
public WindowCluster(ConnectorQuik connect) { InitializeComponent(); timer1 = new System.Windows.Forms.Timer(this.components); timer1.Interval = 50; timer1.Tick += new System.EventHandler(this.timer1_Tick); ChartGl.InitializeContexts(); Chart = new WindowGL(ChartGl, this, timer1, real); Chart.Load(); minVol = Convert.ToInt32(tbVolFilterMin.Text); maxVol = Convert.ToInt32(tbVolFilterMax.Text); ignorTickVol = Convert.ToInt32(tbIgnoreTickVol.Text); secName = cbSecurity.Text; // prevSecName = secName; prevIgnorTickVol = ignorTickVol; TF.frame = TfRange.MIN; TF.digit = 1; TFPrev = TF; connector = connect; connect.Connect(); connector.Event_GetTick += Connector_Event_GetTick; connect.Event_GetTicks += Connect_Event_GetTicks; // fg.GetControl().Anchor = AnchorStyles.Top; // Sec = new DataSeries("RTS-12.15", 10, Exchange.SPBFUT, TimeFrame.Hour, chartStyle.Cluster, ignorTickVol); // WindowGL.Sec = Sec; // if (Form1.Quik.connected) // { // } new Thread(() => { LoadTick(); }).Start(); }
private void btApply_Click(object sender, EventArgs e) { // Sec.Load = false; // ds.Load = false; minVol = Convert.ToInt32(tbVolFilterMin.Text); maxVol = Convert.ToInt32(tbVolFilterMax.Text); ignorTickVol = Convert.ToInt32(tbIgnoreTickVol.Text); secName = cbSecurity.SelectedItem.ToString(); string[] TfArg = cbTf.SelectedItem.ToString().Split(' '); switch (TfArg[1]) { case "SEC": TF.frame = TfRange.SEC; break; case "MIN": TF.frame = TfRange.MIN; break; case "HOUR": TF.frame = TfRange.HOUR; break; case "DAY": TF.frame = TfRange.DAY; break; } TF.digit = Convert.ToInt32(TfArg[0]); if (ignorTickVol != prevIgnorTickVol || secName != prevSecName || TFPrev.frame != TF.frame || TF.digit != TFPrev.digit) { while (Chart.PlotSer) { } if (Sec != null) { Sec.Dispose(); Sec = null; // if(secName == "SIH6") // Sec = new DataSeries(secName, 1, Exchange.SPBFUT, TimeFrame.M1, chartStyle.Cluster, ignorTickVol); // else Sec = new DataSeries(secName, 1, Exchange.SPBFUT, TimeFrame.M1, chartStyle.Cluster, ignorTickVol); } prevIgnorTickVol = ignorTickVol; TFPrev = TF; } if (ds != null) { ds.Dispose(); ds = null; if (Sec != null) { ds.Add(Sec); } // if (secName == "SIH6") // Sec = new DataSeries(secName, 1, Exchange.SPBFUT, TimeFrame.M1, chartStyle.Cluster, ignorTickVol); // else Sec = new DataSeries(secName, 1, Exchange.SPBFUT, TimeFrame.M1, chartStyle.Cluster, ignorTickVol); } // ds?.Dispose(); // Load_Click(sender, e); // Chart.LookSet(); // Chart.Plot(); }