ctx_helpers module¶
Numba-compiled context helper functions for portfolio simulation.
col_has_free_cash_nb function¶
Check whether a column has free cash.
col_has_orders_nb function¶
Check whether there is any order in a column.
col_in_long_position_nb function¶
Check whether a column is in a long position.
col_in_position_nb function¶
Check whether a column is in a position.
col_in_short_position_nb function¶
Check whether a column is in a short position.
get_allocation_nb function¶
Get allocation of the current column in the current group.
get_cash_nb function¶
Get cash of the current column or group with cash sharing.
get_col_allocation_nb function¶
Get allocation of a column in its group.
get_col_cash_nb function¶
Get cash of a column.
get_col_debt_nb function¶
Get debt of a column.
get_col_entry_trade_records_nb function¶
Get entry trade records of a column up to this point.
get_col_exit_trade_records_nb function¶
Get exit trade records of a column up to this point.
get_col_free_cash_nb function¶
Get free cash of a column.
get_col_last_order_nb function¶
Get the last order in a column.
get_col_leverage_nb function¶
Get leverage of a column.
get_col_limit_info_nb function¶
Get limit order information of a column.
get_col_limit_target_price_nb function¶
Get target price of limit order in a column.
get_col_locked_cash_nb function¶
Get locked cash of a column.
get_col_order_count_nb function¶
Get number of order records for a column.
get_col_order_records_nb function¶
Get order records for a column.
get_col_position_nb function¶
Get position of a column.
get_col_position_records_nb function¶
Get position records of a column up to this point.
get_col_position_value_nb function¶
Get position value of a column.
get_col_sl_info_nb function¶
Get SL order information of a column.
get_col_sl_target_price_nb function¶
Get target price of SL order in a column.
get_col_tp_info_nb function¶
Get TP order information of a column.
get_col_tp_target_price_nb function¶
Get target price of TP order in a column.
get_col_tsl_info_nb function¶
Get TSL/TTP order information of a column.
get_col_tsl_target_price_nb function¶
Get target price of TSL/TTP order in a column.
get_col_val_price_nb function¶
Get valuation price of a column.
get_col_value_nb function¶
Get value of a column.
get_debt_nb function¶
Get debt of the current column.
get_entry_trade_records_nb function¶
Get entry trade records of the current column up to this point.
get_exit_trade_records_nb function¶
Get exit trade records of the current column up to this point.
get_free_cash_nb function¶
Get free cash of the current column or group with cash sharing.
get_group_cash_nb function¶
Get cash of a group.
get_group_free_cash_nb function¶
Get free cash of a group.
get_group_position_value_nb function¶
Get position value of a group.
get_group_value_nb function¶
Get value of a group.
get_last_order_nb function¶
Get the last order in the current column.
get_leverage_nb function¶
Get leverage of the current column.
get_limit_info_nb function¶
Get limit order information of the current column.
get_limit_target_price_nb function¶
Get target price of limit order in the current column.
get_locked_cash_nb function¶
Get locked cash of the current column.
get_n_active_positions_nb function¶
Get the number of active positions in the current group (regardless of cash sharing).
To calculate across all groups, set all_groups to True.
get_order_count_nb function¶
Get number of order records for the current column.
get_order_records_nb function¶
Get order records for the current column.
get_position_nb function¶
Get position of the current column.
get_position_records_nb function¶
Get position records of the current column up to this point.
get_position_value_nb function¶
Get position value of the current column.
get_sl_info_nb function¶
Get SL order information of the current column.
get_sl_target_price_nb function¶
Get target price of SL order in the current column.
get_tp_info_nb function¶
Get TP order information of the current column.
get_tp_target_price_nb function¶
Get target price of TP order in the current column.
get_tsl_info_nb function¶
Get TSL/TTP order information of the current column.
get_tsl_target_price_nb function¶
Get target price of TSL/TTP order in the current column.
get_val_price_nb function¶
Get valuation price of the current column.
get_value_nb function¶
Get value of the current column or group with cash sharing.
group_has_free_cash_nb function¶
Check whether a group has free cash.
has_free_cash_nb function¶
Check whether the current column or group with cash sharing has free cash.
has_orders_nb function¶
Check whether there is any order in the current column.
in_long_position_nb function¶
Check whether the current column is in a long position.
in_position_nb function¶
Check whether the current column is in a position.
in_short_position_nb function¶
Check whether the current column is in a short position.
order_closed_position_nb function¶
Check whether the order has closed out an existing position.
order_decreased_position_nb function¶
Check whether the order has decreased or closed an existing position.
order_filled_nb function¶
Check whether the order was filled.
order_increased_position_nb function¶
Check whether the order has opened or increased an existing position.
order_opened_position_nb function¶
Check whether the order has opened a new position.
order_reversed_position_nb function¶
Check whether the order has reversed an existing position.
stop_group_sim_nb function¶
Stop the simulation of a group.
stop_sim_nb function¶
Stop the simulation of the current group.