@@ -45,14 +45,14 @@ class YahooDailyReader(_DailyBaseReader):
45
45
'm' for monthly.
46
46
get_actions : bool, default False
47
47
If True, adds Dividend and Split columns to dataframe.
48
- adjust_dividends: bool, default false
48
+ adjust_dividends: bool, default true
49
49
If True, adjusts dividends for splits.
50
50
"""
51
51
52
52
def __init__ (self , symbols = None , start = None , end = None , retry_count = 3 ,
53
53
pause = 0.1 , session = None , adjust_price = False ,
54
54
ret_index = False , chunksize = 1 , interval = 'd' ,
55
- get_actions = False , adjust_dividends = False ):
55
+ get_actions = False , adjust_dividends = True ):
56
56
super (YahooDailyReader , self ).__init__ (symbols = symbols ,
57
57
start = start , end = end ,
58
58
retry_count = retry_count ,
@@ -187,11 +187,11 @@ def split_ratio(row):
187
187
splits ['Splits' ] = splits ['SplitRatio' ]
188
188
prices = prices .join (splits ['Splits' ], how = 'outer' )
189
189
190
- if 'DIVIDEND' in types and self .adjust_dividends :
191
- # Adjust dividends to deal with splits
190
+ if 'DIVIDEND' in types and not self .adjust_dividends :
191
+ # dividends are adjusted automatically by Yahoo
192
192
adj = prices ['Splits' ].sort_index (ascending = False ).fillna (
193
193
1 ).cumprod ()
194
- prices ['Dividends' ] = prices ['Dividends' ] * adj
194
+ prices ['Dividends' ] = prices ['Dividends' ] / adj
195
195
196
196
return prices
197
197
0 commit comments