get_history() ticks, filtering by EVENT_TYPE

igorg
igorg Advocate

Migrating from get_timeseries() to get_history()

get_timeseries() - automatically filters out some ticks, but get_history() returns everything + EVENT_TYPE field. Is there a way to modify the query so it filters out the ticks with certain event types?

For example below, get_timeseries() does NOT return the ticks with "auction" event type.

image.png

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @igorg

    Thank you for reaching out to us.

    I checked the document and found that:

    image.png

    *As indicated in the table above, the "trade" event types currently has four possible subtypes that can be returned. Behind the scenes, trade, auction, settlement price and mkt. condition event types are stored as the same trade event types in the time series database.

    The API can't filter the auction subtype from the trade event type.

  • igorg
    igorg Advocate

    Could you provide a link to the document you mentioned? And an example on how to set eventType parameter to 'quote' or 'correction'.

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    To set the event types, you need to use the HistoricalPricing API in the content layer.

    It supports the following values:

     |  CORRECTION = <EventTypes.CORRECTION: 'correction'>
    |
    | QUOTE = <EventTypes.QUOTE: 'quote'>
    |
    | TRADE = <EventTypes.TRADE: 'trade'>

    You can access the API docs for the full document. It is in the Reference page of the /data/historical-pricing/v1 API,