In the following code snippet, if I don't include MsgBox("wait1"), sometimes I could not get every symbol's real time price. What cause that and how can I fix it without using msgbox? Thanks.
Private Sub GetStockQuoteDataHT()
Dim al As ArrayList = New ArrayList(StockQuoteDataHT.Keys)
For Each symbol As String In al
esignal.RequestSymbol(symbol, False)
Next
'If StockQuoteDataHT.ContainsValue("") Then
' MsgBox("wait1")
'End If
End Sub
Private Sub esignal_OnQuoteChanged(ByVal sSymbol As String) Handles esignal.OnQuoteChanged
Dim quote As IESignal.BasicQuote
quote = esignal.GetBasicQuote(sSymbol)
Dim RealTimePrice As New CPriceInfo
With RealTimePrice
.symbol = sSymbol
.ask = quote.dAsk
.bid = quote.dBid
.last = quote.dLast
.volume = quote.lLastSize
End With
StockQuoteDataHT(sSymbol) = RealTimePrice
End Sub
Private Sub GetStockQuoteDataHT()
Dim al As ArrayList = New ArrayList(StockQuoteDataHT.Keys)
For Each symbol As String In al
esignal.RequestSymbol(symbol, False)
Next
'If StockQuoteDataHT.ContainsValue("") Then
' MsgBox("wait1")
'End If
End Sub
Private Sub esignal_OnQuoteChanged(ByVal sSymbol As String) Handles esignal.OnQuoteChanged
Dim quote As IESignal.BasicQuote
quote = esignal.GetBasicQuote(sSymbol)
Dim RealTimePrice As New CPriceInfo
With RealTimePrice
.symbol = sSymbol
.ask = quote.dAsk
.bid = quote.dBid
.last = quote.dLast
.volume = quote.lLastSize
End With
StockQuoteDataHT(sSymbol) = RealTimePrice
End Sub
Comment