@@ -117,6 +117,7 @@ def __init__(
117
117
method : StreamingMethod = StreamingMethod .AccountUpdate ,
118
118
base_url = '' ,
119
119
data_url = '' ,
120
+ data_feed = 'iex' ,
120
121
* args ,
121
122
** kwargs ):
122
123
try :
@@ -128,7 +129,7 @@ def __init__(
128
129
self .conn = Stream (api_key ,
129
130
api_secret ,
130
131
base_url ,
131
- data_feed = 'iex' )
132
+ data_feed = data_feed )
132
133
self .instrument = instrument
133
134
self .method = method
134
135
self .q = q
@@ -610,18 +611,20 @@ def _resample(df):
610
611
response = response [~ response .index .duplicated ()]
611
612
return response
612
613
613
- def streaming_prices (self , dataname , timeframe , tmout = None ):
614
+ def streaming_prices (self ,
615
+ dataname , timeframe , tmout = None , data_feed = 'iex' ):
614
616
q = queue .Queue ()
615
617
kwargs = {'q' : q ,
616
618
'dataname' : dataname ,
617
619
'timeframe' : timeframe ,
620
+ 'data_feed' : data_feed ,
618
621
'tmout' : tmout }
619
622
t = threading .Thread (target = self ._t_streaming_prices , kwargs = kwargs )
620
623
t .daemon = True
621
624
t .start ()
622
625
return q
623
626
624
- def _t_streaming_prices (self , dataname , timeframe , q , tmout ):
627
+ def _t_streaming_prices (self , dataname , timeframe , q , tmout , data_feed ):
625
628
if tmout is not None :
626
629
_time .sleep (tmout )
627
630
@@ -639,7 +642,8 @@ def _t_streaming_prices(self, dataname, timeframe, q, tmout):
639
642
instrument = dataname ,
640
643
method = method ,
641
644
base_url = self .p .base_url ,
642
- data_url = os .environ .get ("DATA_PROXY_WS" , '' ))
645
+ data_url = os .environ .get ("DATA_PROXY_WS" , '' ),
646
+ data_feed = data_feed )
643
647
644
648
streamer .run ()
645
649
0 commit comments