Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions polygon/rest/models/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class MinuteSnapshot:
volume: Optional[float] = None
vwap: Optional[float] = None
otc: Optional[bool] = None
timestamp: Optional[int] = None
transactions: Optional[int] = None

@staticmethod
def from_dict(d):
Expand All @@ -28,6 +30,8 @@ def from_dict(d):
d.get("v", None),
d.get("vw", None),
d.get("otc", None),
d.get("t", None),
d.get("n", None),
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
"l": 6.42,
"o": 6.49,
"v": 2671,
"vw": 6.4604
"vw": 6.4604,
"t": 1684428600000,
"n": 5
},
"prevDay": {
"c": 0.29,
Expand Down Expand Up @@ -81,7 +83,9 @@
"l": 4.2107,
"o": 4.2107,
"v": 1012,
"vw": 4.2107
"vw": 4.2107,
"t": 1684428600000,
"n": 5
},
"prevDay": {
"c": 0.1953,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
"l": 160.3,
"o": 160.71,
"v": 197226,
"vw": 160.5259
"vw": 160.5259,
"t": 1684428600000,
"n": 5
},
"prevDay": {
"c": 163.64,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
"l": 20.506,
"o": 20.506,
"v": 5000,
"vw": 20.5105
"vw": 20.5105,
"t": 1684428600000,
"n": 5
},
"prevDay": {
"c": 20.63,
Expand Down
4 changes: 4 additions & 0 deletions test_rest/test_snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ def test_get_snapshot_all(self):
close=20.506,
volume=5000,
vwap=20.5105,
timestamp=1684428600000,
transactions=5,
),
prev_day=Agg(
open=20.79,
Expand Down Expand Up @@ -257,6 +259,8 @@ def test_get_snapshot_ticker(self):
close=160.3,
volume=197226,
vwap=160.5259,
timestamp=1684428600000,
transactions=5,
),
prev_day=Agg(
open=159.25,
Expand Down