Quote from Reitberg:
Bob, thanks for uploading the files.
I don't want to be a baby and ask for the step by step "how to," but I actually have no idea how to use this stuff. If you wouldn't mind explaining how to use these files, it would be greatly appreciated. Thanks.
you can unzip files, then-as i mentioned before-make sure that in TWS(demo or not) -clock on tab CONFIGURE-> API-> ActiveX enable-check this box. then-you can start project1.exe file. if TWS control are installed on your computer-then you will be able to see data in this demo programm.
as i said before-if you want to look into code-you need VB6 installed(can be found on kazaa)
if you dont know anything-i simply cannot explain every line. even if i do-it not going to give you anything.
here is all code from those files-
Option Explicit
Dim vol(3) As Single
Dim id(3) As Long
Dim symbol(3) As String
Dim stockId(3) As Integer
Dim secType(3) As String
Dim expiry As String
Dim strike As Long
Dim right As String
Dim exchange(3) As String
Dim curency As String
Dim port As Long
Dim i As Integer
Private Sub cmd_Click()
Dim i As Integer
For i = LBound(symbol) To UBound(symbol)
Tws1.reqMktData id(i), UCase(symbol(i)), secType(i), expiry, strike, right, exchange(i), curency
Next
End Sub
Private Sub Form_Load()
For i = LBound(id) To UBound(id)
id(i) = i
secType(i) = "STK"
exchange(i) = "SMART"
expiry = ""
strike = 0
right = ""
curency = ""
Next
port = 7496
symbol(0) = "AMAT"
symbol(1) = "KLAC"
symbol(2) = "BEAS"
symbol(3) = "ALTR"
For i = LBound(symbol) To UBound(symbol)
lblStock(i) = symbol(i)
Next
Form1.Tws1.Connect "", port, 1
End Sub
Private Sub Tws1_tickPrice(ByVal id As Long, ByVal tickType As Long, ByVal price As Double)
stockId(id) = 1
txt(id) = Format(price, "0.00")
End Sub
Private Sub Tws1_tickSize(ByVal id As Long, ByVal tickType As Long, ByVal size As Long)
' vol(id) = vol(id) + (size * 100)
If tickType = 5 Then
lblVol(id) = size * 100
End If
End Sub
that about it.......