Announcement

Collapse
No announcement yet.

GetNumTimeSalesRtBars

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • GetNumTimeSalesRtBars

    I want to make sure I understand the meaning of the value returned by the function GetNumTimeSalesRtBars. This value is the total tick count that has occurred since you made the RequestTimeSales(...) Is that correct? The values below would mean there are 101,251 bars available and a total of 3,017 bars have occurred since you made the request. Correct?


    3,017
    GetNumTimeSalesRtBars(tsHandle) 'Gets number of
    'real-time bars

    101,251
    GetNumTimeSalesBars(tsHandle) 'Gets number of
    'historical bars



    tsFilter.sSymbol = sSymbol;
    tsFilter.lNumDays = 1;
    tsFilter.bQuotes = true;
    tsFilter.bTrades = true;
    tsFilter.bFilterPrice = false;
    tsFilter.dMinPrice = 0;
    tsFilter.dMaxPrice = 0;
    tsFilter.bFilterVolume = false;
    tsFilter.lVolume = 0;
    tsFilter.bFilterQuoteExchanges = false;
    tsFilter.sTradeExchangesList = 0;
    tsFilter.bFilterTradeExchanges = false;
    tsFilter.sQuoteExchangesList = 0;

  • #2
    See code snippet below. Basically, to handle real-time T&S data, you will need to keep track of how many real-time bars in previous event and subtract that by number of real-time bars in current event. Same idea of historical data as well. For further detail, you can look at our VB sample.

    To handle real-time data:

    esignal_OnTimeSalesChanged(ByVal tsHandle As Long)
    lNumRtBars = esignal.GetNumTimeSalesRtBars(tsHandle)
    lDiff = (lNumRtBars - lLastTsRtCount) * -1

    For lBar = lDiff + 1 To 0
    Format Data
    Next lBar

    lLastTsRtCount = lNumRtBars

    To handle historical data:

    esignal_OnTimeSalesChanged(ByVal tsHandle As Long)
    lNumBars = esignal.GetNumTimeSalesBars(tsHandle)

    For lBar = (lNumBars * -1) + 1 To (lLastTsCount * -1)
    Format Data
    Next lBar

    lLastTsCount = lNumBars

    Comment

    Working...
    X