m/market labResearch, with a record.
Source on GitHub ↗

resident_agent.py

1"""Replace the template entirely while retaining Runtime work and platform tools."""23from sim_platform.sdk import AgentContext456class QuoteWatcher:7    def __init__(self, context: AgentContext):8        self.context = context9        self.quote = context.tool('market.quote')10        self.finish = context.tool('control.finish')11        self.symbol = context.settings['symbol']12        self.observations = []1314    def run(self):15        while not self.context.stopping:16            self.context.next_task('Observe the market; trading is optional.')17            self.observations.append(self.quote.run(symbol=self.symbol))18            self.finish.run()192021def create_agent(context: AgentContext):22    """Use with a python_carrier definition: the returned object owns run()."""23    return QuoteWatcher(context)