Hi
I have a question about Time&Sales
What I want to achieve is to make a T&S request and get first all the historical data that is available then continue to receive real-time data. I wrote such a code (VB6) for OnTimeSalesChanged event.
Static lLastTsCount As Long
Dim lNumBars, lBar, lDiff As Long
Dim item As IESignal.TimeSalesData
lNumBars = esignal.GetNumTimeSalesBars(lTsHandle)
If lNumBars <= 0 Then Exit Sub
' how many new bars since last time?
lDiff = (lNumBars - lLastTsCount) * -1
For lBar = lDiff - 1 To 0
item = esignal.GetTimeSalesBar(lTsHandle, lBar)
sBar = FormatTS(item)
list.AddItem sBar, 0
Next lBar
lLastTsCount = lNumBars
However I see duplicate historical records (same time stamp) in list box. I guess I do something wrong when receiving historical data. I tried to find any samples that shows how to work with historical and rela-time T&S data but couldn't find one. All I found is only for real-time data.
Pls advise what I do wrong.
Thx
I have a question about Time&Sales
What I want to achieve is to make a T&S request and get first all the historical data that is available then continue to receive real-time data. I wrote such a code (VB6) for OnTimeSalesChanged event.
Static lLastTsCount As Long
Dim lNumBars, lBar, lDiff As Long
Dim item As IESignal.TimeSalesData
lNumBars = esignal.GetNumTimeSalesBars(lTsHandle)
If lNumBars <= 0 Then Exit Sub
' how many new bars since last time?
lDiff = (lNumBars - lLastTsCount) * -1
For lBar = lDiff - 1 To 0
item = esignal.GetTimeSalesBar(lTsHandle, lBar)
sBar = FormatTS(item)
list.AddItem sBar, 0
Next lBar
lLastTsCount = lNumBars
However I see duplicate historical records (same time stamp) in list box. I guess I do something wrong when receiving historical data. I tried to find any samples that shows how to work with historical and rela-time T&S data but couldn't find one. All I found is only for real-time data.
Pls advise what I do wrong.
Thx
Comment