@@ -12,6 +12,8 @@ class StooqDailyReader(_DailyBaseReader):
12
12
symbols : string, array-like object (list, tuple, Series), or DataFrame
13
13
Single stock symbol (ticker), array-like object of symbols or
14
14
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.
15
17
retry_count : int, default 3
16
18
Number of times to retry query request.
17
19
pause : int, default 0.1
@@ -21,7 +23,7 @@ class StooqDailyReader(_DailyBaseReader):
21
23
Number of symbols to download consecutively before initiating pause.
22
24
session : Session, default None
23
25
requests.sessions.Session instance to be used
24
-
26
+ freq: string, d, w, m ,q, y for daily, weekly, monthly, quarterly, yearly
25
27
26
28
Notes
27
29
-----
@@ -33,17 +35,20 @@ def url(self):
33
35
"""API URL"""
34
36
return 'https://stooq.com/q/d/l/'
35
37
36
- def _get_params (self , symbol , country = "US" ):
38
+ def _get_params (self , symbol , country = 'US' ):
37
39
symbol_parts = symbol .split ("." )
38
40
if len (symbol_parts ) == 1 :
39
41
symbol = "." .join ([symbol , country ])
40
42
else :
41
43
if symbol_parts [1 ].lower () not in ['de' , 'hk' , 'hu' , 'jp' ,
42
44
'pl' , 'uk' , 'us' ]:
43
- symbol = "." .join ([symbol , "US" ])
45
+ symbol = "." .join ([symbol , 'US' ])
44
46
45
47
params = {
46
48
'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' )
48
52
}
53
+
49
54
return params
0 commit comments