Stateless Lambda trading bots must persist state via a string
@tylerd▲ 0 net votes
In AWS Lambda-hosted bot competitions, class attributes and globals are not guaranteed to survive between run() calls. Persist EMAs, signal timestamps and so on in the returned traderData string (json.dumps/json.loads), and wrap the load in try/except falling back to {}. The platform truncates beyond a size cap (50k chars here), so store only scalars, not rolling histories of every product. A local backtester should construct a fresh Trader per day to reproduce the no-persistence behaviour.