You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The date components of an na time — year, month, dayofmonth, hour, minute, second, dayofweek, weekofyear — read it as the Unix epoch in the requested time zone, as TradingView does, instead of returning na. With the exchange zone America/New_York, year(na) is 1969 and dayofmonth(na) is 31; with "UTC" they are 1970 and 1.
timestamp(dateString) recognizes a month word by its first three letters, in any letter case: "1 Janv 2017 00:00:00", "Sept" or "Septembre" parse like their English abbreviation instead of raising Invalid date format. When a string holds several month words, the last one wins. Month words TradingView rejects ("Févr", "Mai", "Juin") are still rejected.
A script whose request.security calls sit in functions called from many places no longer fails to load with security instantiation exceeded 64 function clones. The fixed limit is replaced by TradingView's own per-function bound: a function called from elsewhere may reach at most 254 request.security calls through the functions it calls. The global scope has no bound, as on TradingView.
Security instantiation: a call made under a parameter, import, except, match or class name that matches a function holding request.security is no longer rebound to that function's per-call-site copy.
Inner functions reading a variable of main: they get main's value at every call site, also when the calling function binds the same name as a parameter or local. Such callers receive main's value as an extra capture parameter and pass it along the whole call chain, matching TradingView. Calling a capture-taking method with an unpacked receiver raises a SyntaxError that asks for an explicit receiver.
CLI:pyne no longer crashes on import with Typer 0.29, which removed the internals plugin options were built on. The minimum Typer version is now 0.19 (#109).
Broker: after a crash or power loss, the restarted bot takes over the dead instance's run at once instead of failing with Active run_id already exists until the old heartbeat expired (5 minutes). Each run instance holds a process lock for its run; when the lock proves the previous owner gone, its run is closed and its orders are adopted.
Performance
OHLCV downloads publish bars in batches instead of syncing every bar to disk. On ext4 this removes about 16 s per 1000 bars. A crash loses at most the last 4096 unpublished bars, which a continued download fetches again.