@@ -12,6 +12,8 @@ class StooqDailyReader(_DailyBaseReader):
1212 symbols : string, array-like object (list, tuple, Series), or DataFrame
1313 Single stock symbol (ticker), array-like object of symbols or
1414 DataFrame with index containing stock symbols.
15+ start: string, date which to start interval at YYYYMMDD.
16+ end: string, date which to end interval at YYYYMMDD.
1517 retry_count : int, default 3
1618 Number of times to retry query request.
1719 pause : int, default 0.1
@@ -21,7 +23,7 @@ class StooqDailyReader(_DailyBaseReader):
2123 Number of symbols to download consecutively before initiating pause.
2224 session : Session, default None
2325 requests.sessions.Session instance to be used
24-
26+ freq: string, d, w, m ,q, y for daily, weekly, monthly, quarterly, yearly
2527
2628 Notes
2729 -----
@@ -33,17 +35,20 @@ def url(self):
3335 """API URL"""
3436 return 'https://stooq.com/q/d/l/'
3537
36- def _get_params (self , symbol , country = "US" ):
38+ def _get_params (self , symbol , country = 'US' ):
3739 symbol_parts = symbol .split ("." )
3840 if len (symbol_parts ) == 1 :
3941 symbol = "." .join ([symbol , country ])
4042 else :
4143 if symbol_parts [1 ].lower () not in ['de' , 'hk' , 'hu' , 'jp' ,
4244 'pl' , 'uk' , 'us' ]:
43- symbol = "." .join ([symbol , "US" ])
45+ symbol = "." .join ([symbol , 'US' ])
4446
4547 params = {
4648 's' : symbol ,
47- 'i' : "d"
49+ 'i' : self .freq or 'd' ,
50+ 'd1' : self .start .strftime ('%Y%m%d' ),
51+ 'd2' : self .end .strftime ('%Y%m%d' )
4852 }
53+
4954 return params
0 commit comments