Jun-27-2022, 06:24 PM
I'm having problems with my program so I added a tracer (?) line to print out some variables at the beginning of every iteration [loop]:
In case it matters, I'm using Jupyter Notebook for this.
if current_date != current_date_prev: #debug print(f'current_date is {current_date}, common date is {datetime.utcfromtimestamp(current_date*86400).strftime("%Y-%m-%d")}, trade status is {trade_status}, and control flag is {control_flag}.') current_date_prev = current_dateHere's a segment of the output:
Output:current_date is 14692, common date is 2010-03-24, trade status is INCEPTION, and control flag is find_spread.
current_date is 14693, common date is 2010-03-25, trade status is IN_TRADE, and control flag is update_long.
current_date is 14694, common date is 2010-03-26, trade status is IN_TRADE, and control flag is update_long.
current_date is 14697, common date is 2010-03-29, trade status is IN_TRADE, and control flag is update_long.
current_date is 14698, common date is 2010-03-30, trade status is IN_TRADE, and control flag is update_long.
current_date is 14699, common date is 2010-03-31, trade status is IN_TRADE, and control flag is update_long.
current_date is 14700, common date is 2010-04-01, trade status is IN_TRADE, and control flag is update_long.
current_date is 14704, common date is 2010-04-05, trade status is IN_TRADE, and control flag is update_long.
current_date is 14705, common date is 2010-04-06, trade status is IN_TRADE, and control flag is update_long.
current_date is 14706, common date is 2010-04-07, trade status is IN_TRADE, and control flag is update_long.
current_date is 14707, common date is 2010-04-08, trade status is INCEPTION, and control flag is find_spread.
current_date is 14733, common date is 2010-05-04, trade status is INCEPTION, and control flag is find_spread.
current_date is 14734, common date is 2010-05-05, trade status is IN_TRADE, and control flag is update_long.
current_date is 14735, common date is 2010-05-06, trade status is IN_TRADE, and control flag is update_long.
current_date is 14736, common date is 2010-05-07, trade status is IN_TRADE, and control flag is update_long.
Periodically, I get blank lines as seen after current_date 14698. Do you have any idea why that might be the case? The task should be as repetitive as it looks. I get roughly 3500 of these tracer lines total (from 2007 through 2021).In case it matters, I'm using Jupyter Notebook for this.