Module ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias alias Assign NameStore Call NameLoad Str ClassDef bases NameLoad body Assign NameStore Dict Str Str Str Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad FunctionDef arguments args NameParam defaults body If CompareNotIn Str AttributeLoad NameLoad attr body Assign SubscriptStore AttributeLoad NameLoad attr Index Str AttributeLoad NameLoad attr decorator_list Assign AttributeStore NameLoad attr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam defaults AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad If NameLoad body For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad NameLoad NameLoad NameLoad Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr ListLoad If NameLoad body For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore BinOpBitOr Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults AttributeLoad NameLoad attr body Assign SubscriptStore AttributeLoad AttributeLoad NameLoad attr attr Index NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args defaults body Assign AttributeStore NameLoad attr AttributeStore NameLoad attr AttributeStore NameLoad attr NameLoad decorator_list With Call NameLoad NameStore body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr If CompareEq AttributeLoad NameLoad attr Str body FunctionDef arguments args defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list orelse FunctionDef arguments args defaults body Pass decorator_list For TupleStore NameStore NameStore AttributeLoad NameLoad attr body If CompareEq NameLoad NameLoad body Expr Call NameLoad NameLoad orelse If CompareEq NameLoad NameLoad body Expr Call NameLoad NameLoad orelse If CompareEq NameLoad NameLoad body Expr Call NameLoad Expr Call NameLoad Call NameLoad NameLoad Expr Yield Call AttributeLoad NameLoad attr NameLoad NameLoad AttributeLoad NameLoad attr orelse If CompareEq NameLoad NameLoad body Expr Call NameLoad NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad AttributeLoad NameLoad attr Expr Yield NameLoad If NameLoad body Expr Yield NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Yield NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body Assign NameStore AttributeLoad NameLoad attr Return BoolOpAnd CompareIsNot NameLoad NameLoad CompareLtE NameLoad NameLoad decorator_list Assign NameStore ListComp NameLoad comprehension NameStore NameLoad Call NameLoad NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad ListComp NameLoad comprehension NameStore AttributeLoad NameLoad attr Call NameLoad NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign SubscriptStore SubscriptLoad NameLoad Index Str Index Str AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign SubscriptStore SubscriptLoad NameLoad Index Str Index Str NameLoad If NameLoad body Assign SubscriptStore SubscriptLoad NameLoad Index Str Index Str NameLoad Return TupleLoad NameLoad NameLoad decorator_list decorator_list
N/A contextlib2 ExitStack logbook Logger Processor pandas.tslib normalize_date zipline.protocol BarData zipline.utils.api_support ZiplineAPI six viewkeys zipline.gens.sim_engine BAR DAY_START DAY_END MINUTE_END N/A log N/A Logger Trade Simulation AlgorithmSimulator N/A object N/A N/A EMISSION_TO_PERF_KEY_MAP N/A minute daily minute_perf daily_perf __init__ N/A N/A self algo sim_params data_portal clock benchmark_source universe_func N/A N/A N/A N/A self sim_params sim_params N/A N/A self env N/A algo trading_environment N/A N/A self data_portal data_portal N/A N/A self algo algo N/A N/A self algo_start N/A normalize_date N/A N/A self sim_params first_open N/A N/A self current_data N/A N/A self _create_bar_data universe_func N/A N/A self simulation_dt None N/A N/A self previous_dt N/A self algo_start N/A N/A self clock clock N/A N/A self benchmark_source benchmark_source inject_algo_dt N/A N/A record N/A N/A N/A N/A algo_dt N/A record extra N/A N/A N/A N/A record extra N/A algo_dt N/A self simulation_dt N/A N/A N/A self processor N/A Processor inject_algo_dt N/A get_simulation_dt N/A N/A self N/A N/A N/A N/A self simulation_dt N/A _create_bar_data N/A N/A self universe_func N/A N/A N/A N/A BarData data_portal N/A self data_portal simulation_dt_func N/A self get_simulation_dt data_frequency N/A N/A self sim_params data_frequency universe_func universe_func N/A transform N/A N/A self N/A N/A N/A 
        Main generator work loop.
         N/A algo N/A self algo every_bar N/A N/A dt_to_use current_data handle_data N/A N/A self current_data N/A N/A algo event_manager handle_data N/A N/A N/A self simulation_dt dt_to_use N/A N/A N/A algo on_dt_changed dt_to_use N/A blotter N/A algo blotter N/A perf_tracker N/A algo perf_tracker N/A N/A new_transactions new_commissions N/A N/A blotter get_transactions current_data N/A transaction new_transactions N/A N/A N/A N/A perf_tracker process_transaction transaction N/A order N/A N/A blotter orders N/A N/A transaction order_id N/A N/A N/A perf_tracker process_order order N/A new_commissions N/A N/A commission new_commissions N/A N/A N/A N/A perf_tracker process_commission commission N/A N/A handle_data algo current_data dt_to_use N/A new_orders N/A blotter new_orders N/A N/A blotter new_orders N/A N/A new_orders N/A N/A new_order new_orders N/A N/A N/A N/A perf_tracker process_order new_order N/A N/A N/A self algo portfolio_needs_update True N/A N/A N/A self algo account_needs_update True N/A N/A N/A self algo performance_needs_update True N/A once_a_day N/A N/A midnight_dt current_data data_portal N/A N/A self current_data N/A self data_portal N/A N/A positions N/A N/A N/A algo perf_tracker position_tracker positions N/A position_assets N/A N/A N/A algo asset_finder retrieve_all positions N/A N/A self simulation_dt midnight_dt N/A N/A N/A algo on_dt_changed midnight_dt N/A N/A N/A self _cleanup_expired_assets midnight_dt position_assets N/A perf_tracker N/A algo perf_tracker N/A assets_we_care_about N/A N/A viewkeys N/A N/A perf_tracker position_tracker positions N/A viewkeys N/A N/A algo blotter open_orders N/A assets_we_care_about N/A N/A splits N/A N/A data_portal get_splits assets_we_care_about midnight_dt N/A splits N/A N/A N/A N/A N/A algo blotter process_splits splits N/A N/A N/A N/A perf_tracker position_tracker handle_splits splits N/A N/A N/A algo before_trading_start current_data N/A handle_benchmark N/A N/A date benchmark_source N/A N/A self benchmark_source N/A N/A N/A N/A N/A algo perf_tracker all_benchmark_returns N/A date N/A N/A benchmark_source get_value date N/A on_exit N/A N/A N/A N/A N/A N/A self benchmark_source N/A self current_data N/A self data_portal None N/A N/A N/A ExitStack stack N/A N/A N/A N/A stack callback on_exit N/A N/A N/A stack enter_context N/A self processor N/A N/A N/A stack enter_context N/A ZiplineAPI N/A self algo N/A N/A N/A algo data_frequency minute N/A execute_order_cancellation_policy N/A N/A N/A N/A N/A N/A N/A N/A algo blotter execute_cancel_policy DAY_END N/A N/A execute_order_cancellation_policy N/A N/A N/A N/A N/A N/A N/A N/A dt action N/A self clock N/A N/A N/A action BAR N/A N/A N/A every_bar dt N/A N/A N/A action DAY_START N/A N/A N/A once_a_day dt N/A N/A N/A action DAY_END N/A N/A N/A execute_order_cancellation_policy N/A N/A handle_benchmark N/A normalize_date dt N/A N/A N/A N/A self _get_daily_message dt algo N/A algo perf_tracker N/A N/A N/A action MINUTE_END N/A N/A N/A handle_benchmark dt N/A N/A minute_msg daily_msg N/A N/A self _get_minute_message dt algo N/A algo perf_tracker N/A N/A minute_msg N/A daily_msg N/A N/A N/A daily_msg N/A risk_message N/A N/A N/A algo perf_tracker handle_simulation_end N/A N/A risk_message N/A _cleanup_expired_assets N/A N/A self dt position_assets N/A N/A N/A 
        Clear out any assets that have expired before starting a new sim day.

        Performs two functions:

        1. Finds all assets for which we have open orders and clears any
           orders whose assets are on or after their auto_close_date.

        2. Finds all assets for which we have positions and generates
           close_position events for any assets that have reached their
           auto_close_date.
         N/A algo N/A self algo past_auto_close_date N/A N/A asset N/A N/A N/A acd N/A asset auto_close_date N/A N/A N/A acd None N/A acd dt N/A N/A assets_to_clear N/A asset N/A asset position_assets N/A past_auto_close_date asset N/A perf_tracker N/A algo perf_tracker N/A data_portal N/A self data_portal N/A asset assets_to_clear N/A N/A N/A N/A perf_tracker process_close_position asset dt data_portal N/A blotter N/A algo blotter N/A assets_to_cancel N/A set N/A asset N/A asset N/A blotter open_orders N/A past_auto_close_date asset N/A asset assets_to_cancel N/A N/A N/A N/A blotter cancel_all_orders_for_asset asset N/A _get_daily_message N/A N/A self dt algo perf_tracker N/A N/A N/A 
        Get a perf message for the given datetime.
         N/A perf_message N/A N/A perf_tracker handle_market_close_daily dt N/A self data_portal N/A N/A N/A perf_message N/A daily_perf N/A recorded_vars N/A algo recorded_vars N/A perf_message N/A _get_minute_message N/A N/A self dt algo perf_tracker N/A N/A N/A 
        Get a perf message for the given datetime.
         N/A rvars N/A algo recorded_vars N/A N/A minute_message daily_message N/A N/A perf_tracker handle_minute_close dt N/A self data_portal N/A N/A N/A minute_message N/A minute_perf N/A recorded_vars rvars N/A daily_message N/A N/A N/A N/A daily_message N/A daily_perf N/A recorded_vars rvars N/A N/A minute_message daily_message N/A N/A