| [gw0] darwin -- Python 3.12.12 /Users/cao/.pyenv/versions/3.12.12/bin/python3.12
|
| [1m [31mtests/test_buy_trader_long_short_payload.py [0m:885: in test_full_bundle_execution_with_mocked_alpaca
|
| [0mresult = executor.execute_job(payload) [90m [39;49;00m
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [90m [39;49;00m
|
| BuyTraderExecutor = <class 'rtrader.services.buy_trader_executor.BuyTraderExecutor'>
|
| buy_calls = []
|
| executor = <rtrader.services.buy_trader_executor.BuyTraderExecutor object at 0x1280340e0>
|
| mock_broker = <MagicMock id='4966685568'>
|
| mock_buy_market = <function TestEndToEndPlaceOrderToAlpaca.test_full_bundle_execution_with_mocked_alpaca.<locals>.mock_buy_market at 0x127fdd8a0>
|
| mock_get_quote = <function TestEndToEndPlaceOrderToAlpaca.test_full_bundle_execution_with_mocked_alpaca.<locals>.mock_get_quote at 0x127fdc720>
|
| mock_short = <function TestEndToEndPlaceOrderToAlpaca.test_full_bundle_execution_with_mocked_alpaca.<locals>.mock_short at 0x127fdd9e0>
|
| payload = {'audit': {'account_nick': 'yuchao', 'broker_backend': 'alpaca', 'requested_by': 'test', 'trading_day': '2026-07-09', ...nd': 'alpaca', 'buy_trader': {'account_nick': 'yuchao', 'broker_backend': 'alpaca'}, 'requested_by': 'test', ...}, ...}
|
| self = <tests.test_buy_trader_long_short_payload.TestEndToEndPlaceOrderToAlpaca object at 0x1244fb8f0>
|
| short_calls = []
|
| [1m [31mrtrader/services/buy_trader_executor.py [0m:1056: in execute_job
|
| [0mvol_5d = _get_symbol_vol_5d(entry_copy[ [33m" [39;49;00m [33msymbol [39;49;00m [33m" [39;49;00m], trading_day) [90m [39;49;00m
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [90m [39;49;00m
|
| _entry_meta = {'account_nick': 'yuchao', 'allocation_pct': 0.3, 'allocation_slots': 6, 'order_type': 'long', ...}
|
| _trigger_injected = False
|
| account_equity = 1.0
|
| allocation_amount = 9800.0
|
| allocation_floor = 0.05
|
| allocation_floor_pct = 0.05
|
| allocation_pct = 1.0
|
| allocation_plan = []
|
| base_entry_amount = 1470.0
|
| broker = <MagicMock id='4966685568'>
|
| bundle_cap = 200000.0
|
| bundle_symbol_count = 6
|
| calculate_all_sector_trend_stats_objects = <MagicMock name='calculate_all_sector_trend_stats_objects' id='4966614416'>
|
| calculate_sector_exposure = <MagicMock name='calculate_sector_exposure' id='4966618256'>
|
| deadline_info = 'no_deadline'
|
| effective_buying_power = 9800.0
|
| entry = {'allocation_pct': 0.15, 'metadata': {'account_nick': 'yuchao', 'allocation_pct': 0.3, 'allocation_slots': 6, 'order_type': 'long', ...}, 'order_sequence': 1, 'symbol': 'AAPL', ...}
|
| entry_amount = 1470.0
|
| entry_copy = {'allocation_pct': 0.15, 'metadata': {'account_nick': 'yuchao', 'allocation_pct': 0.3, 'allocation_slots': 6, 'order_type': 'long', ...}, 'order_sequence': 1, 'symbol': 'AAPL', ...}
|
| entry_pct = 0.15
|
| existing_exposure = {}
|
| gap_days = 0
|
| get_daily_ranking_scores = <MagicMock name='get_daily_ranking_scores' id='4966622096'>
|
| get_option_bias_cache = <MagicMock name='get_option_bias_cache' id='4966625888'>
|
| get_sector_position_multiplier = <MagicMock name='get_sector_position_multiplier' id='4966641264'>
|
| get_strategy_budget = <MagicMock name='get_strategy_budget' id='4966594176'>
|
| h5_accounts = []
|
| h5_enabled = True
|
| instrument_buying_power = 10000.0
|
| instrument_preference = 'stock'
|
| is_capitulation = False
|
| is_short_job = False
|
| job = BuyTraderJob(job_id='test_job_12345', symbol='AAPL', metadata={'source': 'trader_eod_top_pick', 'workflow': 'trader_eo...': {'symbol_rank': 3, 'allocation_pct': 0.4, 'allocation_slots': 6, 'order_type': 'short', 'account_nick': 'yuchao'}}])
|
| metadata_allocation = None
|
| min_gap_threshold = 3
|
| next_candidate = datetime.date(2026, 7, 10)
|
| next_trading_day = datetime.date(2026, 7, 10)
|
| option_bias_cache = {}
|
| option_buying_power = 10000.0
|
| payload = {'audit': {'account_nick': 'yuchao', 'broker_backend': 'alpaca', 'requested_by': 'test', 'trading_day': '2026-07-09', ...nd': 'alpaca', 'buy_trader': {'account_nick': 'yuchao', 'broker_backend': 'alpaca'}, 'requested_by': 'test', ...}, ...}
|
| plan_allocation_pct = 1.0
|
| planned_sum = 0.0
|
| position_size_cap = 33333.333333333336
|
| ranking_scores_cache = {}
|
| safety_factor = 0.98
|
| sector_mult_result = <MagicMock id='4966767440'>
|
| sector_sizing_enabled = True
|
| self = <rtrader.services.buy_trader_executor.BuyTraderExecutor object at 0x1280340e0>
|
| sequence = 1
|
| stock_buying_power = 10000.0
|
| strat_budget = StrategyBudget(total=100000, eod_budget=100000, scalp_budget=10000, squeeze_budget=10000, scalp_pct=0.1, eod_pct=0.9, ...ct=0.1, spy_regime='disabled', spy_regime_confidence=None, spy_r2=None, account_equity=None, account_buying_power=None)
|
| symbol_entries = [{'allocation_pct': 0.15, 'metadata': {'account_nick': 'yuchao', 'allocation_pct': 0.3, 'allocation_slots': 6, 'order_... 'allocation_pct': 0.4, 'allocation_slots': 6, 'order_type': 'short', ...}, 'order_sequence': 6, 'symbol': 'QID', ...}]
|
| trading_day = datetime.date(2026, 7, 9)
|
| trading_day_str = '2026-07-09'
|
| trend_stats_cache = {}
|
| vol_5d = None
|
| vol_baseline = 0.02
|
| vol_multiplier = 1.0
|
| vol_scaling_enabled = True
|
| [1m [31mrtrader/services/buy_trader_executor.py [0m:189: in _get_symbol_vol_5d
|
| [0m [94mwith [39;49;00m [96mopen [39;49;00m(snapshot_path) [94mas [39;49;00m f: [90m [39;49;00m
|
| ^^^^^^^^^^^^^^^^^^^ [90m [39;49;00m
|
| [1m [31mE Failed: Timeout (>60.0s) from pytest-timeout. [0m
|
| find_snapshot_json = <function find_snapshot_json at 0x120dee8e0>
|
| snapshot_path = PosixPath('/Users/cao/mnt/silverssd/minio-mirror/data/snapshots/2026-07-09/AAPL.json')
|
| symbol = 'AAPL'
|
| trading_day = datetime.date(2026, 7, 9)
|