analysis module¶
Numba-compiled functions for portfolio analysis.
align_init_cash_nb function¶
Align initial cash to the maximum negative free cash flow.
Adds 1 for easier computing returns.
allocations_nb function¶
Get allocations per column.
asset_flow_nb function¶
Get asset flow series per column.
Returns the total transacted amount of assets at each time step.
asset_pnl_nb function¶
Get asset (realized and unrealized) PnL series per column/group.
asset_returns_nb function¶
Get asset return series per column/group.
asset_value_grouped_nb function¶
Get asset value series per group.
asset_value_nb function¶
Get asset value series per column.
assets_nb function¶
Get asset series per column.
Returns the current position at each time step.
cash_deposits_grouped_nb function¶
Get cash deposit series per group.
cash_deposits_nb function¶
Get cash deposit series per column.
cash_flow_grouped_nb function¶
Get cash flow series per group.
cash_flow_nb function¶
Get (free) cash flow series per column.
cash_grouped_nb function¶
cash_grouped_nb(
target_shape,
cash_flow_grouped,
group_lens,
init_cash_grouped,
cash_deposits_grouped=0.0
)
Get cash series per group.
cash_nb function¶
Get cash series per column.
get_asset_pnl_nb function¶
Get asset PnL from the input and output asset value, and the cash flow.
get_asset_return_nb function¶
Get asset return from the input and output asset value, and the cash flow.
get_free_cash_diff_nb function¶
Get updated debt and free cash flow.
get_long_size_nb function¶
Get long size.
get_short_size_nb function¶
Get short size.
gross_exposure_nb function¶
Get gross exposure per column/group.
init_cash_grouped_nb function¶
Get initial cash per group.
init_cash_nb function¶
Get initial cash per column.
init_position_value_nb function¶
Get initial position value per column.
init_value_grouped_nb function¶
Get initial value per group.
init_value_nb function¶
Get initial value per column.
long_assets_nb function¶
Get long-only assets.
market_value_grouped_nb function¶
Get market value per group.
market_value_nb function¶
Get market value per column.
returns_nb function¶
Get return series per column/group.
short_assets_nb function¶
Get short-only assets.
sum_grouped_nb function¶
Squeeze each group of columns into a single column using sum operation.
total_profit_grouped_nb function¶
Get total profit per group.
total_profit_nb function¶
total_profit_nb(
target_shape,
close,
order_records,
col_map,
init_position=0.0,
init_price=nan,
cash_earnings=0.0
)
Get total profit per column.
A much faster version than the one based on value_nb().
value_nb function¶
Get portfolio value series per column/group.