@@ -11,17 +11,37 @@ function symbolTypeMap() {
1111}
1212
1313// options: limit, offset
14+ /*
15+ * @deprecated Will be removed in a future release, and will be removed from the Polygon API. Please use historicTradesV2 instead.
16+ */
1417function historicTrades ( symbol , date , options = { } ) {
18+ console . warn ( 'Calling deprecated function historicTrades. Please use historicTradesV2 instead.' )
1519 const path = `/historic/trades/${ symbol } /${ toDateString ( date ) } `
1620 return this . polygonHttpRequest ( path , options )
1721}
1822
23+ // options: limit, timestamp, timestamp_limit, reverse
24+ function historicTradesV2 ( symbol , date , options = { } ) {
25+ const path = `/ticks/stocks/trades/${ symbol } /${ toDateString ( date ) } `
26+ return this . polygonHttpRequest ( path , options , null , null , 'v2' )
27+ }
28+
1929// options: limit, offset
30+ /*
31+ * @deprecated Will be removed in a future release, and will be removed from the Polygon API. Please use historicQuotesV2 instead.
32+ */
2033function historicQuotes ( symbol , date , options = { } ) {
34+ console . warn ( 'Calling deprecated function historicQuotes. Please use historicQuotesV2 instead.' )
2135 const path = `/historic/quotes/${ symbol } /${ toDateString ( date ) } `
2236 return this . polygonHttpRequest ( path , options )
2337}
2438
39+ // options: limit, timestamp, timestamp_limit, reverse
40+ function historicQuotesV2 ( symbol , date , options = { } ) {
41+ const path = `ticks/stocks/nbbo/${ symbol } /${ toDateString ( date ) } `
42+ return this . polygonHttpRequest ( path , options , null , null , 'v2' )
43+ }
44+
2545// size: 'day', 'minute'
2646// options: from, to, limit, unadjusted
2747function historicAggregates ( size , symbol , options = { } ) {
@@ -70,7 +90,9 @@ module.exports = {
7090 exchanges,
7191 symbolTypeMap,
7292 historicTrades,
93+ historicTradesV2,
7394 historicQuotes,
95+ historicQuotesV2,
7496 historicAggregates,
7597 historicAggregatesV2,
7698 lastTrade,
0 commit comments