II would like to get historical time and sales data about NI225_M.
but I can't get MOC(market on close data) at 15:10.
Is wrong this source code ?
Private Sub esignal_OnTimeSalesChanged(ByVal lHandle As Integer) Handles esignal.OnTimeSalesChanged
If lHandle = tsHandle Then
If esignal.IsTimeSalesReady(lHandle) Then
StatusLabel.Text = "History Complete"
Else
StatusLabel.Text = "Receiving Data"
End If
Dim tick As IESignal.TimeSalesData
Dim lNumBars As Long = esignal.GetNumTimeSalesBars(lHandle)
tick = esignal.GetTimeSalesBar(lHandle, -(lNumBars - 1))
log_print1(Str$(tick.dtTime.Year) & "-" & Str$(tick.dtTime.Month) & "-" & _
Str$(tick.dtTime.Day) & " " & Str$(tick.dtTime.Hour) & ":" & Str$(tick.dtTime.Minute) & ":" & _
Str$(tick.dtTime.Second) & " Price:" & Str$(tick.dPrice) & " Size:" & Str$(tick.lSize))
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim uname = "XXXXXXXX"
Dim sname = "NI225_M M8-OSM"
esignal.SetApplication(uname)
UsernameTextBox.Enabled = False
ConnectButton.Enabled = False
SymbolTextBox.Enabled = True
GetTimeSalesButton.Enabled = True
If esignal.IsEntitled <> 1 Then
MessageBox.Show("IsEntitled returned false. Can't send request.")
StatusLabel.Text = "Not Entitled"
Return
End If
Dim filter As IESignal.TimeSalesFilter
If tsHandle <> -1 Then
esignal.ReleaseTimeSales(tsHandle)
End If
filter = New IESignal.TimeSalesFilter
filter.bFilterPrice = False
filter.bFilterQuoteExchanges = False
filter.bFilterTradeExchanges = False
filter.bFilterVolume = False
filter.bQuotes = False
filter.bTrades = True
filter.lNumDays = 1
filter.sSymbol = sname
tsHandle = esignal.RequestTimeSales(filter)
End Sub
but I can't get MOC(market on close data) at 15:10.
Is wrong this source code ?
Private Sub esignal_OnTimeSalesChanged(ByVal lHandle As Integer) Handles esignal.OnTimeSalesChanged
If lHandle = tsHandle Then
If esignal.IsTimeSalesReady(lHandle) Then
StatusLabel.Text = "History Complete"
Else
StatusLabel.Text = "Receiving Data"
End If
Dim tick As IESignal.TimeSalesData
Dim lNumBars As Long = esignal.GetNumTimeSalesBars(lHandle)
tick = esignal.GetTimeSalesBar(lHandle, -(lNumBars - 1))
log_print1(Str$(tick.dtTime.Year) & "-" & Str$(tick.dtTime.Month) & "-" & _
Str$(tick.dtTime.Day) & " " & Str$(tick.dtTime.Hour) & ":" & Str$(tick.dtTime.Minute) & ":" & _
Str$(tick.dtTime.Second) & " Price:" & Str$(tick.dPrice) & " Size:" & Str$(tick.lSize))
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim uname = "XXXXXXXX"
Dim sname = "NI225_M M8-OSM"
esignal.SetApplication(uname)
UsernameTextBox.Enabled = False
ConnectButton.Enabled = False
SymbolTextBox.Enabled = True
GetTimeSalesButton.Enabled = True
If esignal.IsEntitled <> 1 Then
MessageBox.Show("IsEntitled returned false. Can't send request.")
StatusLabel.Text = "Not Entitled"
Return
End If
Dim filter As IESignal.TimeSalesFilter
If tsHandle <> -1 Then
esignal.ReleaseTimeSales(tsHandle)
End If
filter = New IESignal.TimeSalesFilter
filter.bFilterPrice = False
filter.bFilterQuoteExchanges = False
filter.bFilterTradeExchanges = False
filter.bFilterVolume = False
filter.bQuotes = False
filter.bTrades = True
filter.lNumDays = 1
filter.sSymbol = sname
tsHandle = esignal.RequestTimeSales(filter)
End Sub
Comment