File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change
1
+ from polygon import WebSocketClient
2
+ from polygon .websocket .models import WebSocketMessage , Feed , Market
3
+ from typing import List
4
+
5
+ client = WebSocketClient (feed = Feed .Business , market = Market .Stocks , verbose = True )
6
+
7
+ # FMV
8
+ client .subscribe ("FMV.*" ) # all ticker symbols
9
+ # client.subscribe("FMV.TSLA")
10
+ # client.subscribe("FMV.AAPL")
11
+ # client.subscribe("FMV.NVDA")
12
+
13
+
14
+ def handle_msg (msgs : List [WebSocketMessage ]):
15
+ for m in msgs :
16
+ print (m )
17
+
18
+
19
+ client .run (handle_msg )
Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ def parse_single(data: Dict[str, Any]):
35
35
return IndexValue .from_dict (data )
36
36
elif event_type == EventType .LaunchpadValue .value :
37
37
return LaunchpadValue .from_dict (data )
38
+ elif event_type == EventType .BusinessFairMarketValue .value :
39
+ return FairMarketValue .from_dict (data )
38
40
return None
39
41
40
42
Original file line number Diff line number Diff line change @@ -351,7 +351,7 @@ class FairMarketValue:
351
351
352
352
@staticmethod
353
353
def from_dict (d ):
354
- return LaunchpadValue (
354
+ return FairMarketValue (
355
355
event_type = d .get ("ev" , None ),
356
356
fmv = d .get ("fmv" , None ),
357
357
ticker = d .get ("sym" , None ),
@@ -375,6 +375,7 @@ def from_dict(d):
375
375
Level2Book ,
376
376
IndexValue ,
377
377
LaunchpadValue ,
378
+ FairMarketValue ,
378
379
]
379
380
],
380
381
)
You can’t perform that action at this time.
0 commit comments