def create_equity_curve(all_holdings):
 curve = pd.DataFrame(all_holdings)
 curve.set_index('datetime', inplace=True)
 curve['returns'] = curve['equity'].pct_change()
 curve.iloc[(0, 3)] = 0
 curve['networth'] = (1.0 + curve['returns']).cumprod()
 return curve

def create_equity_curve ( all_holdings ) : curve = pd . DataFrame ( all_holdings ) curve . set_index ( 'datetime' , inplace = True ) curve [ 'returns' ] = curve [ 'equity' ] . pct_change ( ) curve . iloc [ ( 0 , 3 ) ] = 0 curve [ 'networth' ] = ( 1.0 + curve [ 'returns' ] ) . cumprod ( ) return curve
args: all_holdings : 账号资金历史。 returns: pd .