Новичок
Профиль
Группа: Участник
Сообщений: 2
Регистрация: 21.12.2010
Репутация: нет Всего: нет
|
| Код | ublic Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New() MyBase.New()
'This call is required by the Windows Form Designer. InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub
'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents Login As System.Windows.Forms.Button Friend WithEvents Info As System.Windows.Forms.ListBox Friend WithEvents Quit As System.Windows.Forms.Button Friend WithEvents logout As System.Windows.Forms.Button Friend WithEvents UserID As System.Windows.Forms.TextBox Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents pwdlabel As System.Windows.Forms.Label Friend WithEvents Button2 As System.Windows.Forms.Button Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox Friend WithEvents Button6 As System.Windows.Forms.Button Friend WithEvents Button5 As System.Windows.Forms.Button Friend WithEvents Button4 As System.Windows.Forms.Button Friend WithEvents Password As System.Windows.Forms.TextBox <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.Login = New System.Windows.Forms.Button() Me.Info = New System.Windows.Forms.ListBox() Me.Quit = New System.Windows.Forms.Button() Me.UserID = New System.Windows.Forms.TextBox() Me.logout = New System.Windows.Forms.Button() Me.Label1 = New System.Windows.Forms.Label() Me.pwdlabel = New System.Windows.Forms.Label() Me.Password = New System.Windows.Forms.TextBox() Me.Button2 = New System.Windows.Forms.Button() Me.GroupBox1 = New System.Windows.Forms.GroupBox() Me.GroupBox2 = New System.Windows.Forms.GroupBox() Me.Button6 = New System.Windows.Forms.Button() Me.Button5 = New System.Windows.Forms.Button() Me.Button4 = New System.Windows.Forms.Button() Me.GroupBox1.SuspendLayout() Me.GroupBox2.SuspendLayout() Me.SuspendLayout() ' 'Login ' Me.Login.Location = New System.Drawing.Point(9, 73) Me.Login.Name = "Login" Me.Login.Size = New System.Drawing.Size(80, 24) Me.Login.TabIndex = 0 Me.Login.Text = "Login" ' 'Info ' Me.Info.Location = New System.Drawing.Point(8, 281) Me.Info.Name = "Info" Me.Info.Size = New System.Drawing.Size(535, 160) Me.Info.TabIndex = 1 ' 'Quit ' Me.Quit.Location = New System.Drawing.Point(181, 73) Me.Quit.Name = "Quit" Me.Quit.Size = New System.Drawing.Size(88, 24) Me.Quit.TabIndex = 2 Me.Quit.Text = "Exit" ' 'UserID ' Me.UserID.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper Me.UserID.Location = New System.Drawing.Point(68, 22) Me.UserID.Name = "UserID" Me.UserID.Size = New System.Drawing.Size(86, 20) Me.UserID.TabIndex = 3 ' 'logout ' Me.logout.Location = New System.Drawing.Point(95, 73) Me.logout.Name = "logout" Me.logout.Size = New System.Drawing.Size(80, 24) Me.logout.TabIndex = 4 Me.logout.Text = "Logout" ' 'Label1 ' Me.Label1.Location = New System.Drawing.Point(6, 25) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(40, 20) Me.Label1.TabIndex = 5 Me.Label1.Text = "Login" ' 'pwdlabel ' Me.pwdlabel.Location = New System.Drawing.Point(6, 51) Me.pwdlabel.Name = "pwdlabel" Me.pwdlabel.Size = New System.Drawing.Size(56, 16) Me.pwdlabel.TabIndex = 6 Me.pwdlabel.Text = "Password" ' 'Password ' Me.Password.Location = New System.Drawing.Point(68, 47) Me.Password.Name = "Password" Me.Password.PasswordChar = Global.Microsoft.VisualBasic.ChrW(42) Me.Password.Size = New System.Drawing.Size(86, 20) Me.Password.TabIndex = 7 ' 'Button2 ' Me.Button2.Location = New System.Drawing.Point(181, 32) Me.Button2.Name = "Button2" Me.Button2.Size = New System.Drawing.Size(162, 24) Me.Button2.TabIndex = 9 Me.Button2.Text = "Subscribe ARCA Imb." ' 'GroupBox1 ' Me.GroupBox1.Controls.Add(Me.Quit) Me.GroupBox1.Controls.Add(Me.Login) Me.GroupBox1.Controls.Add(Me.logout) Me.GroupBox1.Controls.Add(Me.pwdlabel) Me.GroupBox1.Controls.Add(Me.Password) Me.GroupBox1.Controls.Add(Me.UserID) Me.GroupBox1.Controls.Add(Me.Label1) Me.GroupBox1.Location = New System.Drawing.Point(8, 27) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(287, 132) Me.GroupBox1.TabIndex = 10 Me.GroupBox1.TabStop = False Me.GroupBox1.Text = "Общие" ' 'GroupBox2 ' Me.GroupBox2.Controls.Add(Me.Button6) Me.GroupBox2.Controls.Add(Me.Button5) Me.GroupBox2.Controls.Add(Me.Button4) Me.GroupBox2.Controls.Add(Me.Button2) Me.GroupBox2.Location = New System.Drawing.Point(8, 165) Me.GroupBox2.Name = "GroupBox2" Me.GroupBox2.Size = New System.Drawing.Size(535, 110) Me.GroupBox2.TabIndex = 11 Me.GroupBox2.TabStop = False Me.GroupBox2.Text = "Alert" ' 'Button6 ' Me.Button6.Location = New System.Drawing.Point(6, 62) Me.Button6.Name = "Button6" Me.Button6.Size = New System.Drawing.Size(162, 24) Me.Button6.TabIndex = 13 Me.Button6.Text = "ReSubscribe NYSE Alert" ' 'Button5 ' Me.Button5.Location = New System.Drawing.Point(6, 32) Me.Button5.Name = "Button5" Me.Button5.Size = New System.Drawing.Size(162, 24) Me.Button5.TabIndex = 12 Me.Button5.Text = "Subscribe NYSE Alert" ' 'Button4 ' Me.Button4.Location = New System.Drawing.Point(181, 62) Me.Button4.Name = "Button4" Me.Button4.Size = New System.Drawing.Size(162, 24) Me.Button4.TabIndex = 11 Me.Button4.Text = "ReSubscribe ARCA Imb." ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(552, 447) Me.Controls.Add(Me.GroupBox2) Me.Controls.Add(Me.GroupBox1) Me.Controls.Add(Me.Info) Me.Name = "Form1" Me.Text = "Scaner" Me.GroupBox1.ResumeLayout(False) Me.GroupBox1.PerformLayout() Me.GroupBox2.ResumeLayout(False) Me.ResumeLayout(False)
End Sub
#End Region
Public s2 As Integer = 0 Public s1 As Integer = 0 Public s As Integer = 0 Public j0 As Integer = 0
Public stocks(2000) As String 'Массив инструментов Public kolvo As Integer 'Число элементов массива инструментов
Public m_stock1(2000), a As GTAPINet.GTStock Public INSTR(5000) As String
Dim m_seqno As UInt32 = Convert.ToUInt32(0) Dim m_session As GTAPINet.GTSession = New GTAPINet.GTSession
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Form3.DataGridView1.Rows.Add(2000) Form3.DataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None
If GTAPINet.GTSession.gtInitialize(GTAPINet.GTSession.GTAPI_VERSION, IntPtr.Zero) <> 0 Then Exit Sub End If m_session.CreateSessionWindow(Handle, 0)
UserID.SelectedText = "TEST4"
End Sub Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing m_session.DestroySessionWindow() End Sub Private Function OnExecConnected(ByVal hSession As UInt32) As Integer Quit.Enabled = False Info.Items.Insert(0, "Exec connected") Return 0 End Function
Private Function OnExecDisconnected(ByVal hSession As UInt32) As Integer Quit.Enabled = True Info.Items.Insert(0, "Exec disconnected") Return 0 End Function Private Function OnExecMsgLoggedin(ByVal hSession As UInt32) As Integer Info.Items.Insert(0, "Exec logged in") Return 0 End Function Private Function OnSessionExecMsgErrMsg(ByVal hSession As UInt32, ByVal errmsg As GTAPINet.GTSession.GTErrMsg32) As Integer Dim strMsg As String strMsg = GTAPINet.GTSession.GetErrorMessage(errmsg) OnSessionExecMsgErrMsg = 0 End Function 'Call back функции получения данных NYSE Imbalance 'Private Function OnQuoteNyseImbalance(ByVal hSession As UInt32, ByVal nyxi32 As GTAPINet.GTSession.GTNyseImbalance32) As Integer
'Dim nyse_imb As String
'If s1 = 0 Then Form3.Show() ' s1 = s1 + 1 'nyse_imb = (nyxi32.gtime.chHour).ToString & ":" & (nyxi32.gtime.chMin).ToString & ":" & (nyxi32.gtime.chSec).ToString
'Form3.DataGridView1.Rows.Add({s1, nyse_imb, nyxi32.chDirection, nyxi32.chReason, nyxi32.chSession, nyxi32.dblBookClearPrice, nyxi32.dblClearingPrice, nyxi32.dblReferencePrice, nyxi32.dwImbalanceShares, nyxi32.dwPairedShares, nyxi32.szStock})
'Return 0 'End Function 'Call back функции получения данных NYSE alert Private Function OnQuoteNyseAlert(ByVal hSession As UInt32, ByVal alert32 As GTAPINet.GTSession.GTNyseAlert32) As Integer
Dim nyse_alert As String Dim stroka As Integer If s = 0 Then Form3.Show() s = 1 nyse_alert = (alert32.gtime.chHour).ToString & ":" & (alert32.gtime.chMin).ToString & ":" & (alert32.gtime.chSec).ToString
stroka = nyseimb(alert32.szStock) - 1
Form3.DataGridView1.Rows(stroka).Cells(0).Value = stroka + 1 Form3.DataGridView1.Rows(stroka).Cells(10).Value = nyse_alert Form3.DataGridView1.Rows(stroka).Cells(11).Value = alert32.chMsgType Form3.DataGridView1.Rows(stroka).Cells(12).Value = alert32.szStock
If alert32.chSecurityStatus = 56 Then Form3.DataGridView1.Rows(stroka).Cells(13).Value = "sell" If alert32.chSecurityStatus = 55 Then Form3.DataGridView1.Rows(stroka).Cells(13).Value = "buy"
Form3.DataGridView1.Rows(stroka).Cells(14).Value = alert32.alerts.Halts_HaltCondition Form3.DataGridView1.Rows(stroka).Cells(15).Value = alert32.alerts.Imbalance_BuyVolume Form3.DataGridView1.Rows(stroka).Cells(16).Value = alert32.alerts.Imbalance_SellVolume Form3.DataGridView1.Rows(stroka).Cells(17).Value = alert32.alerts.Indication_Adjustment Form3.DataGridView1.Rows(stroka).Cells(18).Value = alert32.alerts.Indication_AskPrice Form3.DataGridView1.Rows(stroka).Cells(19).Value = alert32.alerts.Indication_BidPrice
' Form2.DataGridView1.Rows.Add({s, nyse_alert, alert32.chMsgType, alert32.szStock, alert32.chSecurityStatus, alert32.alerts.Halts_HaltCondition, alert32.alerts.Imbalance_BuyVolume, alert32.alerts.Imbalance_SellVolume, alert32.alerts.Indication_Adjustment, alert32.alerts.Indication_AskPrice, alert32.alerts.Indication_BidPrice})
'все поля-Form2.DataGridView1.Rows.Add({s, nyse_alert, alert32.chMsgType, alert32.szStock, alert32.chFinancialStatus, alert32.chCorporateAction, alert32.chSecurityStatus, alert32.Filler, alert32.nFiller, alert32.chProductID, alert32.alerts.Halts_HaltCondition, alert32.alerts.Imbalance_Adjustment, alert32.alerts.Imbalance_BuyVolume, alert32.alerts.Imbalance_SellVolume, alert32.alerts.Indication_Adjustment, alert32.alerts.Indication_AskPrice, alert32.alerts.Indication_BidPrice})
Return 0 End Function
Private Function OnQuoteNyseAlert1(ByVal hSession As UInt32, ByVal alert32 As GTAPINet.GTSession.GTNyseAlert32) As Integer
'все поля-Form2.DataGridView1.Rows.Add({s, nyse_alert, alert32.chMsgType, alert32.szStock, alert32.chFinancialStatus, alert32.chCorporateAction, alert32.chSecurityStatus, alert32.Filler, alert32.nFiller, alert32.chProductID, alert32.alerts.Halts_HaltCondition, alert32.alerts.Imbalance_Adjustment, alert32.alerts.Imbalance_BuyVolume, alert32.alerts.Imbalance_SellVolume, alert32.alerts.Indication_Adjustment, alert32.alerts.Indication_AskPrice, alert32.alerts.Indication_BidPrice})
Return 0 End Function
'Call back функции получения данных ARCA Imbalance
Private Function OnQuoteArcaImbalance(ByVal hSession As UInt32, ByVal arca As GTAPINet.GTSession.GTArcaImbalance32) As Integer
Dim sec, min, hour, allsec, allmin, stroka As Integer Dim strtime As String If s2 = 0 Then Form3.Show() s2 = 1
allsec = Math.Round(arca.dwSourceTime / 2500)
allmin = Int(allsec / 60)
hour = Int(allmin / 24) min = allmin - 24 * hour sec = allsec - 60 * allmin strtime = hour.ToString & ":" & min.ToString & ":" & sec.ToString
' Form4.DataGridView1.Rows.Add({arcaimb(arca.szStock), strtime, arca.szStock, arca.dblPrice, arca.chAuctionType, arca.dwTotalImbalance, arca.dwVolume})
stroka = arcaimb(arca.szStock) - 1
Form3.DataGridView1.Rows(stroka).Cells(0).Value = stroka + 1 Form3.DataGridView1.Rows(stroka).Cells(20).Value = strtime Form3.DataGridView1.Rows(stroka).Cells(21).Value = arca.szStock Form3.DataGridView1.Rows(stroka).Cells(22).Value = arca.dblPrice Form3.DataGridView1.Rows(stroka).Cells(23).Value = arca.chAuctionType
If arca.dwTotalImbalance > 0 Then Form3.DataGridView1.Rows(stroka).Cells(24).Value = "buy " + arca.dwTotalImbalance.ToString If arca.dwTotalImbalance < 0 Then Form3.DataGridView1.Rows(stroka).Cells(24).Value = "sell " + (-arca.dwTotalImbalance).ToString
' Form3.DataGridView1.Rows(stroka).Cells(24).Value = arca.dwTotalImbalance Form3.DataGridView1.Rows(stroka).Cells(25).Value = arca.dwVolume
'все поля Form4.DataGridView1.Rows.Add({s2, arca.chAuctionType, arca.szStock, arca.chExchangeID, arca.chSecurityType, arca.dblPrice, arca.dwMarketImbalance, arca.dwSourceTime, arca.dwTotalImbalance, arca.dwVolume, arca.nAuctionTime})
Return 0 End Function
'Call back 2функции получения данных ARCA Imbalance
Private Function OnQuoteArcaImbalance1(ByVal hSession As UInt32, ByVal arca As GTAPINet.GTSession.GTArcaImbalance32) As Integer
If j0 = 0 Then
INSTR(1) = arca.szStock 'Присваиваем первичную информацию j0 = j0 + 1 'вывод информации m_stock1(1) = m_session.CreateStock(arca.szStock) m_stock1(1).HookGotQuoteLevel1(New GTAPINet.GTStock.PFNOnGotQuoteLevel1(AddressOf OnStockGotQuoteLevel1)) 'Level1 GoTo 1 End If For jj = 1 To j0 If arca.szStock = INSTR(jj) Then 'вывод информации 1 GoTo 1 End If Next j0 = j0 + 1 INSTR(j0) = arca.szStock m_stock1(j0) = m_session.CreateStock(arca.szStock) m_stock1(j0).HookGotQuoteLevel1(New GTAPINet.GTStock.PFNOnGotQuoteLevel1(AddressOf OnStockGotQuoteLevel1)) 'Level1
'вывод информации 2 'все поля Form4.DataGridView1.Rows.Add({s2, arca.chAuctionType, arca.szStock, arca.chExchangeID, arca.chSecurityType, arca.dblPrice, arca.dwMarketImbalance, arca.dwSourceTime, arca.dwTotalImbalance, arca.dwVolume, arca.nAuctionTime})
1: Return 0 End Function
Private Sub Login_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Login.Click Dim hSession As System.UInt32 = GTAPINet.GTSession.op_Implicit(m_session)
m_session.HookExecMsgErrMsg(New GTAPINet.GTSession.PFNOnExecMsgErrMsg(AddressOf OnSessionExecMsgErrMsg)) m_session.HookExecConnected(New GTAPINet.GTSession.PFNOnExecConnected(AddressOf OnExecConnected)) m_session.HookExecDisconnected(New GTAPINet.GTSession.PFNOnExecDisconnected(AddressOf OnExecDisconnected)) m_session.HookExecMsgLoggedin(New GTAPINet.GTSession.PFNOnExecMsgLoggedin(AddressOf OnExecMsgLoggedin)) 'm_session.HookOnQuoteNyseImbalance(New GTAPINet.GTSession.PFNOnQuoteNyseImbalance(AddressOf OnQuoteNyseImbalance))
m_session.HookOnQuoteArcaImbalance(New GTAPINet.GTSession.PFNOnQuoteArcaImbalance(AddressOf OnQuoteArcaImbalance)) ' m_session.HookOnQuoteArcaImbalance(New GTAPINet.GTSession.PFNOnQuoteArcaImbalance(AddressOf OnQuoteArcaImbalance1))
m_session.HookOnQuoteNyseAlert(New GTAPINet.GTSession.PFNOnQuoteNyseAlert(AddressOf OnQuoteNyseAlert)) 'Привязка к функции ' m_session.HookOnQuoteNyseAlert(New GTAPINet.GTSession.PFNOnQuoteNyseAlert(AddressOf OnQuoteNyseAlert1)) 'Привязка к функции GTAPINet.GTSession.gtSetExecAddress(hSession, "69.64.202.152", Convert.ToUInt16(28805)) GTAPINet.GTSession.gtSetQuoteAddress(hSession, "76.8.64.4", Convert.ToUInt16(26811)) GTAPINet.GTSession.gtSetLevel2Address(hSession, "76.8.64.4", Convert.ToUInt16(16810)) ' GTAPINet.GTSession.gtSetChartAddress(hSession, "76.8.64.4", Convert.ToUInt16(16838)) 'm_stock1 = m_session.CreateStock("AA") ' GTSession.gtSetQuoteAddress(m_session, "76.8.64.4", 16811); ' GTSession.gtSetLevel2Address(m_session, "76.8.64.4", 16810); ' GTSession.gtSetChartAddress(m_session, "76.8.64.4", 16838); 'm_stock1.HookGotQuoteLevel1(New GTAPINet.GTStock.PFNOnGotQuoteLevel1(AddressOf OnStockGotQuoteLevel1)) 'Level1 ' m_stock1.HookGotQuoteLevel2(New GTAPINet.GTStock.PFNOnGotQuoteLevel2(AddressOf OnStockGotQuoteLevel2)) 'Level2
GTAPINet.GTSession.gtLogin(m_session, UserID.Text.ToUpper(), Password.Text)
End Sub Private Sub logout_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles logout.Click
GTAPINet.GTSession.gtLogout(GTAPINet.GTSession.op_Implicit(m_session))
End Sub Private Sub Quit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Quit.Click
Dim session32 As GTAPINet.GTSession.GTSession32 = m_session.GetSession32()
If (session32.m_bLoggedIn = 1) Then Return End If
Close() End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Info.Items.Insert(0, "Subscribe NYSE Imbalance")
GTAPINet.GTSession.gtSubscribeNyseImbalance(m_session, 1)
End Sub
'ArcaImbalance Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Info.Items.Insert(0, "Subscribe ARCA Imbalance")
GTAPINet.GTSession.gtSubscribeArcaImbalance(m_session, 1)
End Sub
'NYSE Alert Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click Info.Items.Insert(0, "Subscribe NYSE Alert")
GTAPINet.GTSession.gtSubscribeNyseAlert(m_session, 1) End Sub 'NYSE ReSub Alert Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click Info.Items.Insert(0, "ReSubscribe NYSE Alert") GTAPINet.GTSession.gtSubscribeNyseAlert(m_session, 0) Form2.Close() s = 0 End Sub 'NYSE ReSub Imb 'Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) ' Info.Items.Insert(0, "ReSubscribe NYSE Imbalance")
'GTAPINet.GTSession.gtSubscribeNyseImbalance(m_session, 0)
' Form3.Close() ' s1 = 0
'End Sub
'ARCA ReSub Imb Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Info.Items.Insert(0, "ReSubscribe ARCA Imbalance")
GTAPINet.GTSession.gtSubscribeArcaImbalance(m_session, 0)
Form4.Close() s2 = 0 End Sub 'Private Function OnStockGotQuoteLevel2(ByVal hStock As UInt32, ByVal level232 As GTAPINet.GTSession.GTLevel232) As Integer 'Dim stock As GTAPINet.GTStock = New GTAPINet.GTStock(hStock) 'Dim bid As GTAPINet.GTSession.GTLevel232 'Dim ask As GTAPINet.GTSession.GTLevel232 ' bid = stock.GetBidLevel2Item(0) ' ask = stock.GetAskLevel2Item(0) ' If ((bid Is Nothing) Or (ask Is Nothing)) Then Return 0
'If (bid.dblPrice - 0.0000001 > ask.dblPrice) Then 'Dim msg As String = "BID:" + bid.dblPrice.ToString() + " ASK" + ask.dblPrice.ToString() 'Info.Items.Insert(0, msg) 'End If 'Return 0 'End Function
Public Function OnStockGotQuoteLevel1(ByVal hStock As UInt32, ByVal level132 As GTAPINet.GTSession.GTLevel132) As Integer Dim stock As GTAPINet.GTStock = New GTAPINet.GTStock(hStock) Dim Vol, Low, High, Open, Close, Bid, Asc As String
For i = 1 To 25 If level132.szStock = stocks(i) Then
Vol = level132.dwVolume.ToString Low = level132.dblLow.ToString High = level132.dblHigh.ToString Close = level132.dblClose.ToString Open = level132.dblOpen.ToString Asc = level132.dblAskPrice.ToString Bid = level132.dblBidPrice.ToString
Form3.DataGridView1.Rows(i - 1).Cells(6).Value = Bid Form3.DataGridView1.Rows(i - 1).Cells(7).Value = Asc Form3.DataGridView1.Rows(i - 1).Cells(1).Value = Open Form3.DataGridView1.Rows(i - 1).Cells(2).Value = Close Form3.DataGridView1.Rows(i - 1).Cells(3).Value = High Form3.DataGridView1.Rows(i - 1).Cells(4).Value = Low Form3.DataGridView1.Rows(i - 1).Cells(5).Value = Vol
Exit For
End If
Next
Return 0 End Function
Function arcaimb(ByVal stock As String) As Integer Dim jj As Integer jj = kolvo Do While stock <> stocks(jj) And jj <> 0
jj = jj - 1
Loop If jj = 0 Then
kolvo = kolvo + 1
stocks(kolvo) = stock ' Form3.DataGridView1.Rows.Add() Return kolvo Else Return jj
End If
End Function Function nyseimb(ByVal stock As String) As Integer Dim jj As Integer jj = kolvo Do While stock <> stocks(jj) And jj <> 0
jj = jj - 1
Loop If jj = 0 Then
kolvo = kolvo + 1 stocks(kolvo) = stock
' Form3.DataGridView1.Rows.Add(500) Return kolvo Else Return jj
End If
End Function
Public Sub Quote()
For i = 1 To 25
m_stock1(i) = m_session.CreateStock(stocks(i)) m_stock1(i).HookGotQuoteLevel1(New GTAPINet.GTStock.PFNOnGotQuoteLevel1(AddressOf OnStockGotQuoteLevel1)) 'Level1
Next End Sub
End Class |
.
|