-
Notifications
You must be signed in to change notification settings - Fork 0
/
frmTickNet.cs
721 lines (655 loc) · 29.9 KB
/
frmTickNet.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using CQG;
using Microsoft.Win32;
using MySql.Data.MySqlClient;
namespace TickNet
{
public partial class frmTickNet : Form
{
// The CQGCEL object, which encapsulates the main functionality of CQG API
// [field: System.CLSCompliant(false)]
private List<string> symNames = new List<string>();
private uint ticks = 0;
private string m_sInfo = "";
private uint m_qroup_ID = 0;
private RegistryKey regKey;
private string MyConString;
//"PASSWORD=EU8bKrrmJ9AHJApw;"; //6w7muMhJunuD49nn;";
//private CQG.CQGCEL m_CEL;
private int m_NotStarted = 0;
private string m_Hour;
private string m_Min;
private string m_Sec;
private string m_Month;
private string m_Day;
private string m_Year;
private string m_tableName;
private string m_path ;
private string m_selectedSym = "";
// CQGCEL line time
private DateTime m_LineTime;
private frmFilePath fp;
private MySqlConnection connection;
private MySqlCommand command;
private List<String> queryList;
private Mutex MySQL_Thread_Mutex;
private Semaphore MySQL_Thread_Semaphore;
private bool isCanceled;
private uint requests;
private frmWait f_wait;
private CQGConnector connector;
private bool isNewTrade;
private bool firstTride;
private double PrevTradePrice;
private double PrevTradeVol;
private DateTime PrevTradeTime;
public frmTickNet()
{
InitializeComponent();
}
private void frmTickNet_Load(object sender, EventArgs e)
{
ConnectionDlg conDlg = new ConnectionDlg();
if (conDlg.ShowDialog() == DialogResult.OK)
{
MyConString = "SERVER=" + conDlg.Host + ";" +
"DATABASE=cqg_info;" +
"UID=" + conDlg .Login+ ";" + "PASSWORD="+conDlg.Password;
}
else
{
this.Close();
}
regKey = Registry.CurrentUser;
regKey = regKey.CreateSubKey("Software\\TickNet");
txtSymbol.Text = regKey.GetValue("Symbol").ToString();
requests = 1;
setTableDate();
//fp = new frmFilePath();
//m_path = fp.GetFP();
//LoadFields();
btnCancel.Enabled = false;
btnStop.Enabled = false;
this.Text += " " + System.Convert.ToDateTime(DateTime.Now).ToString("dd/MM/yyyy HH:mm:ss"); //form text
SetToolTip();
MySQL_Thread_Mutex = new Mutex(false, "MySQL_Thread_Mutex");
MySQL_Thread_Semaphore = new Semaphore(0, 999999);
//MySQL_Thread_Semaphore.
isCanceled = false;
f_wait = new frmWait();
queryList = new List<string>();
}
private void setTableDate()
{
m_Hour = System.DateTime.Now.Hour.ToString();
m_Min = System.DateTime.Now.Minute.ToString();
m_Sec = System.DateTime.Now.Second.ToString();
m_Month = System.DateTime.Now.Month.ToString();
m_Day = System.DateTime.Now.Day.ToString();
m_Year = System.DateTime.Now.Year.ToString();
}
private void SetToolTip()
{
ToolTip tt = new ToolTip();
tt.SetToolTip(this.btnStart, "Run TickNet real time data collection");
tt.SetToolTip(this.btnCancel, "Cancel the symbol run");
tt.SetToolTip(this.btnStop, "Stop the symbol run");
tt.SetToolTip(this.btnExit, "Close and Exit TickNet");
tt.SetToolTip(this.lbxCurrentFields, "select data fields for data collection");
tt.SetToolTip(this.txtSymbol, "Enter symbol name");
tt.SetToolTip(this.nudDOMDepth, "Select DOM level");
}
private void Start_CEL()
{/*
try
{
m_CEL = new CQGCEL();
m_CEL.CELStarted += new _ICQGCELEvents_CELStartedEventHandler(CEL_CELStarted);
m_CEL.DataConnectionStatusChanged += new _ICQGCELEvents_DataConnectionStatusChangedEventHandler(CEL_DataConnectionStatusChanged);
m_CEL.DataError += new _ICQGCELEvents_DataErrorEventHandler(CEL_DataError);
m_CEL.IncorrectSymbol += new _ICQGCELEvents_IncorrectSymbolEventHandler(CEL_IncorrectSymbol);
m_CEL.InstrumentSubscribed += new _ICQGCELEvents_InstrumentSubscribedEventHandler(CEL_InstrumentSubscribed);
//m_CEL.InstrumentDOMChanged += new _ICQGCELEvents_InstrumentDOMChangedEventHandler(CEL_InstrumentDOMChanged);
m_CEL.InstrumentDOMChanged += this.CEL_InstrumentDOMChanged;
m_CEL.APIConfiguration.CollectionsThrowException = false;
m_CEL.APIConfiguration.ReadyStatusCheck = eReadyStatusCheck.rscOff;
m_CEL.APIConfiguration.TimeZoneCode = eTimeZone.tzCentral;
m_CEL.APIConfiguration.DefaultInstrumentSubscriptionLevel = eDataSubscriptionLevel.dsQuotesAndBBA;
//m_CEL.APIConfiguration.SnapshotPeriod = Convert.ToInt32(txtSnapshotPeriod.Text);
m_CEL.APIConfiguration.DOMUpdatesMode = eDOMUpdatesMode.domUMDynamic;
//m_CEL.APIConfiguration.DOMUpdatesPeriod = Convert.ToInt32(txtDOMUpdatePeriod.Text);
//m_ver = m_CEL.Environment.CELVersion.ToString();
m_CEL.Startup();
}
catch (Exception ex)
{
modErrorHandler.ShowError("ticknet", "Start_CEL", ex);
}*/
connector = new CQGConnector();
connector.addStartedListener(CEL_CELStarted);
connector.addDataConnectionStatusChangedListener(CEL_DataConnectionStatusChanged);
connector.addDataErrorListener(CEL_DataError);
connector.addIncorrectSymbolListener(CEL_IncorrectSymbol);
connector.addInstrumentSubscribedListener(CEL_InstrumentSubscribed);
connector.addInstrumentDOMChangedListene(CEL_InstrumentDOMChanged);
}
/// <summary>
/// Sets the new time
/// </summary>
/// <returns>
/// New time value
/// </returns>
public DateTime LineTime
{
set
{
m_LineTime = value;
}
}
private void CEL_InstrumentDOMChanged(CQGInstrument instrument, CQGDOMQuotes prevAsks, CQGDOMQuotes prevBids)
{
ticks += 1;
if (!isCanceled)
{
tsAskDpth.Text = Convert.ToString(instrument.DOMAsks.Count);
tsBidDpth.Text = Convert.ToString(instrument.DOMBids.Count);
if (!firstTride)
{
if ((instrument.Trade.Price != PrevTradePrice) || (instrument.Trade.Volume != PrevTradeVol) || (instrument.Timestamp != PrevTradeTime))
{
isNewTrade = true;
}
else
{
isNewTrade = false;
}
PrevTradePrice = instrument.Trade.Price;
PrevTradeVol = instrument.Trade.Volume;
PrevTradeTime = instrument.Timestamp;
}
else
{
PrevTradePrice = instrument.Trade.Price;
PrevTradeVol = instrument.Trade.Volume;
PrevTradeTime = instrument.Timestamp;
}
firstTride = false;
String _query = QueryBuilder.InsertData(m_tableName, instrument, Convert.ToInt32(nudDOMDepth.Value), m_qroup_ID,isNewTrade);
RunSQL(_query, "InsertData");
m_qroup_ID +=1;
}
else
{
RunSQL("DROP TABLE IF EXISTS " + m_tableName, "flush");
//m_CEL.Shutdown();
connector.CQG_Stop();
//isCanceled = false;
}
}
private void CEL_CELStarted()
{
try
{
connector.ICEL.NewInstrument(m_selectedSym);
// MessageBox.Show(m_ver);
}
catch (Exception ex)
{
modErrorHandler.ShowError("ticknet", "Start_CEL", ex);
}
}
/// <summary>
/// This event is fired, when an instrument is resolved and subscribed
//' Description: Occurs when an instrument is resolved and subscribed
//'
//' Parameters:
//' symbol_ (string) <in> - the symbol used in the btnSubscribe function
//' Instrument (CQGInstrument) <in> - the subscribed CQGInstrument
public void CEL_InstrumentSubscribed(string symbol, CQG.ICQGInstrument instrument)
{
try
{
if (instrument == null)
{
// Failed to subscribe instrument
//lblSymbolStatus.Text = "Not Valid";
return;
}
System.Drawing.Color BackCol;
BackCol = System.Drawing.Color.FromArgb(0, 255, 0);
//lblSymbolStatus.Text = "Not Valid";
lblSymbolStatus.BackColor = BackCol;
instrument.DataSubscriptionLevel = eDataSubscriptionLevel.dsQuotesAndDOM;
//lblSymbolStatus.Text = "Valid";
}
catch (Exception ex)
{
modErrorHandler.ShowError("ticknet", "CEL_InstrumentSubscribed", ex);
}
}
/// <summary>
/// This event is fired, when a not tradable symbol name is passed to the NewInstrument method.
/// </summary>
/// <param name="symbl">
/// The name of the incorrect symbol, i.e., what was passed to the NewInstrument method.
/// </param>
public void CEL_IncorrectSymbol(string symbol)
{
try
{
System.Drawing.Color BackCol;
BackCol = System.Drawing.Color.FromArgb(255,0 ,0);
//lblSymbolStatus.Text = "Not Valid";
lblSymbolStatus.BackColor = BackCol;
}
catch (Exception ex)
{
modErrorHandler.ShowError("ticknet", "CEL_IncorrectSymbol", ex);
}
}
/// <summary>
/// Shuts down CEL.
/// </summary>
/// <param name="sender">
/// The source of the event.
/// </param>
/// <param name="e">
/// A CancelEventArgs that contains the event data.
/// </param>
private void frmTickNet_FormClosing(object sender, FormClosingEventArgs e)
{
connector.CQG_Stop();
}
private void lnkCM_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
try
{
System.Diagnostics.Process.Start("iexplore.exe", "Coming soon"); // "http://www.calm-markets.co.uk/index.php");
}
catch (Exception ex)
{
modErrorHandler.ShowError("frmTickNet", "lnkCM_LinkClicked", ex);
}
}
/// <summary>
/// This event is fired, when CQGCEL detects some abnormal discrepancy between data expected and data received.
/// </summary>
/// <param name="cqg_error">
/// The object, in which the error has occurred.
/// </param>
/// <param name="error_description">
/// The string, describing the error.
/// </param>
private void CEL_DataError(object cqg_error, string error_description)
{
try
{
if (cqg_error is CQGError)
{
CQGError cqgErr = (CQGError)cqg_error;
if (cqgErr.Code == 102)
{
error_description += " Restart the application.";
}
else if (cqgErr.Code == 125)
{
error_description += " Turn on CQG Client and restart the application.";
}
}
MessageBox.Show(error_description, "TickNet", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
modErrorHandler.ShowError("CQGConnection.cs", "CEL_DataError", ex);
}
}
/// <summary>
/// This event is fired, when some changes occur in the connection with CQG data server.
/// </summary>
/// <param name="newStatus">
/// The current status of the connection with the data server.
/// </param>
private void CEL_DataConnectionStatusChanged(CQG.eConnectionStatus new_status)
{
System.Drawing.Color BackCol;
try
{
if (new_status == eConnectionStatus.csConnectionUp)
{
BackCol = System.Drawing.Color.FromArgb(0, 209, 15);
m_NotStarted = 1;
m_sInfo = "UP";
nudDOMDepth.Enabled = false;
btnCancel.Enabled = true;
btnStop.Enabled = true;
btnStart.Enabled = false;
}
else if (new_status == eConnectionStatus.csConnectionDelayed)
{
BackCol = System.Drawing.Color.FromArgb(205, 114, 0);
m_sInfo = "De";
m_NotStarted = 0;
nudDOMDepth.Enabled = false;
btnCancel.Enabled = false;
btnStop.Enabled = false;
btnStart.Enabled = true;
}
else
{
BackCol = System.Drawing.Color.FromArgb(255, 0, 0);
m_sInfo = "Do";
m_NotStarted = 0;
nudDOMDepth.Enabled = true;
btnCancel.Enabled = false;
btnStop.Enabled = false;
btnStart.Enabled = true;
}
lblDataConnStatus.BackColor = BackCol;
lblDataConnStatus.Text = m_sInfo;
}
catch (Exception ex)
{
modErrorHandler.ShowError("frmTickNet", "CEL_DataConnectionStatusChanged", ex);
}
}
public int systemStatus()
{
return m_NotStarted;
}
private void btnStart_Click(object sender, EventArgs e)
{
m_selectedSym = txtSymbol.Text;
if (String.IsNullOrEmpty(m_selectedSym))
{
DialogResult result = MessageBox.Show("NO Symbol?", "Data symbol error", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
}
else
{
/*
ThreadPool.QueueUserWorkItem(new WaitCallback(delegate(object unused)
{
Start_CEL();
}));
*/
setTableDate();
isCanceled = false;
isNewTrade = true;
m_qroup_ID = 0;
firstTride = true;
Start_CEL();
//if (m_NotStarted == 0)
//{
// MessageBox.Show("CQG is not running, System will exit", "Exit", MessageBoxButtons.OK, MessageBoxIcon.Question);
// this.Dispose();
// this.Close();
//}
//if (m_NotStarted == 1) //&& m_BadSymbol == 1)
//{
//string table = BuildTable();
int symbolLen = m_selectedSym.Length;
m_tableName = m_selectedSym.Substring(5, symbolLen - 5) + "_" + m_Month + "_" + m_Day + "_" + m_Year + "_" + m_Hour + "_" + m_Min + "_" + m_Sec;
String table = QueryBuilder.createTable(m_tableName);
//CreateTable(table);
RunSQL(table, "flush");
btnStop.Enabled = true;
btnCancel.Enabled = true;
btnStart.Enabled = false;
//m_CEL.Environment.LineTime.ToString();
//}
}
}
private string BuildTable()
{
//try
//{
int symbolLen = m_selectedSym.Length;
m_tableName = m_selectedSym.Substring(5, symbolLen - 5) +"_"+ m_Month +"_"+ m_Day +"_"+ m_Year +"_"+ m_Hour +"_"+ m_Min +"_"+ m_Sec;
string buildQuery = "";
buildQuery += "CREATE TABLE " + m_tableName;
buildQuery += "(index_id INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,";
buildQuery += " symbol VARCHAR(20), ";
StringBuilder sb = new StringBuilder();
foreach (object objItem in lbxCurrentFields.SelectedItems)
{
if (sb.Length > 0) sb.Append("\n");
buildQuery += " " + objItem.ToString() + " VARCHAR(10),";
}
if (nudDOMDepth.Value > 1)
{
for (int index = 1; index < nudDOMDepth.Value; index++)
{
buildQuery += "DOMBidVol_" + index.ToString() + " VARCHAR(10),";
buildQuery += "DOMAskVol_" + index.ToString() + " VARCHAR(10),";
buildQuery += "DOMBid_" + index.ToString() + " VARCHAR(10),";
buildQuery += "DOMAsk_" + index.ToString() + " VARCHAR(10),";
}
}
buildQuery += " ts VARCHAR(30) DEFAULT 'no timestamp') ";
//MessageBox.Show(buildQuery);
return buildQuery;
//}
//catch (Exception ex)
//{
// modErrorHandler.ShowError("ticknet", "CreateTable", ex);
// return 0;
//}
}
private void RunSQL(string query, string functionName) //was CreateTable()
{
requests += 1;
toolStripStatusRequests.Text = Convert.ToString(requests);
//toolStripLoad.Step = (int)requests;
//MySQL_Thread_Semaphore.WaitOne(0);
ThreadPool.QueueUserWorkItem(new WaitCallback(delegate(object unused)
{
MySQL_Thread_Mutex.WaitOne();
if (connection == null)
{
connection = new MySqlConnection(MyConString);
connection.Open();
}
else
{
if (connection.State == ConnectionState.Closed)
{
connection.Open();
}
}
try
{
String goupedQuery = "";
if (queryList.Count <= 200)
{
queryList.Add(query);
if (functionName != "flush")
return;
}
foreach (string s in queryList)
{
goupedQuery += s;
}
queryList.Clear();
command = connection.CreateCommand();
command.CommandText = "SET AUTOCOMMIT=0;";
command.ExecuteNonQuery();
command.CommandText = goupedQuery;
//command.ExecuteNonQuery();
command.ExecuteScalar();
command.CommandText = "commit;";
command.ExecuteScalar();
}
catch (Exception ex)
{
modErrorHandler.ShowError("ticknet", functionName,
ex);
//connection = new MySqlConnection(MyConString);
}
finally
{
requests -= 1;
toolStripStatusRequests.Text = Convert.ToString(requests);
//toolStripLoad.Step = (int)requests;
//f_wait.requestsLable.Text =
// toolStripStatusRequests.Text;
MySQL_Thread_Mutex.ReleaseMutex();
//MySQL_Thread_Semaphore.Release();
}
}));
//connection.Close();
}
public void InsertData(string query) //CQGTimedBar timedBar, long recordIndex, CQGTimedBarsRequest req, string timeInt, string runDate, string sQL)
{
MySqlConnection connection = new MySqlConnection(MyConString);
MySqlCommand command = connection.CreateCommand();
try
{
command.CommandText = query;
connection.Open();
command.ExecuteNonQuery();
}
catch (Exception ex)
{
modErrorHandler.ShowError("ticknet", "InsertData", ex);
}
connection.Close();
}
private void btnExit_Click(object sender, EventArgs e)
{
try
{
ExitTheApp();
}
catch (Exception ex)
{
modErrorHandler.ShowError("btnExit_Click", "btnStop_Click", ex);
}
}
private void btnStop_Click(object sender, EventArgs e)
{
m_selectedSym = txtSymbol.Text;
DialogResult result = DialogResult;
try
{
result = MessageBox.Show("This action will close & stop the run for symbol: " + m_selectedSym + " Continue ?", "STOP", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
//m_CEL.Shutdown();
connector.CQG_Stop();
//f_wait.ShowDialog();
btnCancel.Enabled = false;
btnStart.Enabled = true;
btnStop.Enabled = false;
ticks = 0;
RunSQL("","flush");
}
}
catch (Exception ex)
{
modErrorHandler.ShowError("frmTickNet", "btnStop_Click", ex);
}
}
private void btnCancel_Click(object sender, EventArgs e)
{
m_selectedSym = txtSymbol.Text;
//string query = "DROP TABLE IF EXISTS " + m_tableName;
DialogResult result = DialogResult;
try
{
if (String.IsNullOrEmpty(m_selectedSym))
{
result = MessageBox.Show("Stop data collection?", "STOP", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
}
else
{
result = MessageBox.Show("This action will cancel the data run and all data will be lost for symbol : " + m_selectedSym + " Continue ?", "CANCEL", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
isCanceled = true;
//RunSQL(query, "RunSQL");
btnStart.Enabled = true;
btnStop.Enabled = false;
btnCancel.Enabled = false;
ticks = 0;
}
// DropTable(); change for runSQL() above
}
}
catch (Exception ex)
{
modErrorHandler.ShowError("frmTickNet", "btnCancel_Click", ex);
}
}
private void LoadFields()
{
//Default all fields selected
ReadFile rf = new ReadFile();
//fp.ShowDialog(this);
List<string> parsedData = rf.parseCSV(m_path);
for (int indx = 0; indx < parsedData.Count; indx++)
{
lbxCurrentFields.Items.Add(parsedData[indx]);
lbxCurrentFields.SelectedIndex = indx;
}
}
private void filePathToolStripMenuItem_Click(object sender, EventArgs e)
{
frmFilePath fp = new frmFilePath();
fp.Show();
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
ExitTheApp();
}
private void ExitTheApp()
{
m_selectedSym = txtSymbol.Text;
DialogResult result = DialogResult;
try
{
if (String.IsNullOrEmpty(m_selectedSym))
{
result = MessageBox.Show("Exit without running?", "Exit", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
}
else
{
result = MessageBox.Show("This action will terminate & close this run for symbol: " + m_selectedSym + " Continue ?", "Close & Exit", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
}
if (result == DialogResult.Yes)
{
//f_wait.ShowDialog();
//MySQL_Thread_Semaphore.WaitOne();
//RunSQL("","flush");
if (!isCanceled)
RunSQL("", "flush");
this.Dispose();
this.Close();
}
}
catch (Exception ex)
{
modErrorHandler.ShowError("frmTickNet", "ExitTheApp", ex);
}
}
private void btnStart_Validated(object sender, EventArgs e)
{
}
private void statusStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
}
private void frmTickNet_FormClosed(object sender, FormClosedEventArgs e)
{
regKey = Registry.CurrentUser;
regKey = regKey.CreateSubKey("Software\\TickNet");
regKey.SetValue("Symbol", txtSymbol.Text);
}
}//class
}//namespace