Is there a way to retrieve a quote valid ‘as-of’ a time point using q-sql? Here is my problem: we are thinking of storing market quotes in splayed partitioned tables (one table per instrument). Given an in-memory table of trades, what would be the best way to retrieve the quote information (bid/offer) from the disk? The aj join works fine (aj[date
time;select from trades;select date, time, bid, offer from mdata_instrument]) if quotes for all instruments are stored in the same table but we will have one table per instrument. If we create an API utility function retrieving the right quote for a given instrument, date and time, what is the best way of replicating the as-of behaviour of the aj join in this function? This function would determine which table to query based on the instrument passed to it but I am not sure how to retrieve the ‘most recent’ quote.
Thanks in advance