setup
This function is called right before the algorithm begins, and initializes several runtime parameters like the symbols to watch and what interval data is needed.
Syntax
Fields
Description
stats(Stats)
The Stats object that contains the watchlist and other configurations
account(Account)
The Account object that contains the users account information
broker_hub_cb(Callable)
The callback function that the broker calls every time it fetches new data. Defaults to None
def setup(self, stats: Stats, account: Account, broker_hub_cb: Callable = None) -> None:
Returns
This method does not return anything.
Raises
- An
Exception
is raised if there is an error during setup.