client-js icon indicating copy to clipboard operation
client-js copied to clipboard

Incorrect trades order when pagination: true

Open tradingproject19 opened this issue 1 year ago • 4 comments

Hello,

I am facing an ordering issue.

const globalFetchOptions = { pagination: true, // trace: true, }; const rest = restClient( "APIKEY", "https://api.polygon.io", globalFetchOptions );

client.stocks .trades(ticker, { "timestamp.gte": String(from * 1000 * 1000), "timestamp.lte": String(to * 1000 * 1000), limit: limit, sort: "timestamp", order: "asc", }) .then((data) => { console.log(data.results[0], data.results[data.results.length - 1], 'api results outof order'); });

When I set pagination to true in restClient, then the final output is not in correct order.

tradingproject19 avatar Oct 10 '23 21:10 tradingproject19

I'll check this out thanks for reporting.

justinpolygon avatar Oct 10 '23 21:10 justinpolygon

Thank you so much.

tradingproject19 avatar Oct 10 '23 22:10 tradingproject19

@justinpolygon is there an update on this?

tradingproject19 avatar Oct 12 '23 14:10 tradingproject19

Hey, @tradingproject19 -- I'm still checking with out and will reply later today.

justinpolygon avatar Oct 12 '23 16:10 justinpolygon