ctx_helpers module¶
Numba-compiled helper functions for portfolio simulation.
any_order_nb function¶
Check whether there is any order in the current column.
get_allocation_nb function¶
Get asset value of the current column.
get_asset_value_nb function¶
Get asset value of the current column.
get_cash_nb function¶
Get cash of the current column or group with cash sharing.
get_entry_trade_records_nb function¶
Get entry trade records up to this point.
get_exit_trade_records_nb function¶
Get exit trade records up to this point.
get_free_cash_nb function¶
Get free cash of the current column or group with cash sharing.
get_last_order_nb function¶
Get the last order in the current column.
get_limit_target_price_nb function¶
Get limit target price.
get_n_active_positions_nb function¶
Get the number of active positions in the current group (regardless of cash sharing).
get_order_records_nb function¶
Get order records up to this point.
get_position_records_nb function¶
Get position records up to this point.
get_sl_target_price_nb function¶
Get SL target price.
get_tp_target_price_nb function¶
Get TP target price.
get_tsl_target_price_nb function¶
Get TSL/TTP target price.
get_value_nb function¶
Get value of the current column or group with cash sharing.
has_free_cash_nb function¶
Check whether the current column or group with cash sharing has free cash.
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 an existing position.
order_filled_nb function¶
Check whether the order was filled.
order_increased_position_nb function¶
Check whether the order has 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.