@@ -45,14 +45,14 @@ class YahooDailyReader(_DailyBaseReader):
4545 'm' for monthly.
4646 get_actions : bool, default False
4747 If True, adds Dividend and Split columns to dataframe.
48- adjust_dividends: bool, default false
48+ adjust_dividends: bool, default true
4949 If True, adjusts dividends for splits.
5050 """
5151
5252 def __init__ (self , symbols = None , start = None , end = None , retry_count = 3 ,
5353 pause = 0.1 , session = None , adjust_price = False ,
5454 ret_index = False , chunksize = 1 , interval = 'd' ,
55- get_actions = False , adjust_dividends = False ):
55+ get_actions = False , adjust_dividends = True ):
5656 super (YahooDailyReader , self ).__init__ (symbols = symbols ,
5757 start = start , end = end ,
5858 retry_count = retry_count ,
@@ -187,11 +187,11 @@ def split_ratio(row):
187187 splits ['Splits' ] = splits ['SplitRatio' ]
188188 prices = prices .join (splits ['Splits' ], how = 'outer' )
189189
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
192192 adj = prices ['Splits' ].sort_index (ascending = False ).fillna (
193193 1 ).cumprod ()
194- prices ['Dividends' ] = prices ['Dividends' ] * adj
194+ prices ['Dividends' ] = prices ['Dividends' ] / adj
195195
196196 return prices
197197
0 commit comments