Login Page - Create Account

Support Board


Date/Time: Wed, 30 Apr 2025 11:07:03 +0000



Post From: Persistent SCDateTime reset on last bar

[2025-04-29 04:29:23]
User200641 - Posts: 8
I have a manual looping study that plots levels from the overnight and rth session. During some debug, I found the persistent SCDateTime object used to define my rth start time was being reset to 1899/12/30 00:00:00 on the last bar before resolving itself. It only does this on the last bar and values calculated throughout the study are correct.

I created another persistent SCDateTime to store current_trading_date_rth_start for the next run to see if the SCDateTime object was being updated somewhere in the code. This storage persistent SCDateTime also exhibited the same behavior, being set to 1899/12/30 00:00:00.

Is this intended/known behavior and if so how can I avoid my SCDateTime objects from being zeroed out on the last bar?

Thanks