RC2_SYMBOL_EXTRA_POSITIONAL
Symbol()takes at most one positional argument (the ticker). Passbroker=,session=,trade=as keyword arguments.
What it means
Symbol() has exactly one positional slot, and it means ticker. Everything else is keyword-only. There is no positional order to memorise, which is deliberate: a slot declaration is read far more often than it is written, and Symbol("SPY", "tradestation") would leave every reader guessing whether the second string is a broker, a session, or an exchange.
Why it happens
Habit from broker APIs and other DSLs, where a symbol constructor takes a positional tuple:
class PositionalBroker(Strategy): trade = Symbol("SPY", "tradestation") sizing = FixedCapital()
def execute(self): if self.trade.is_flat: self.buy(self.trade)How to fix it
Keep the ticker positional if you like it that way; name everything else.
class NamedArgs(Strategy): trade = Symbol("SPY", broker="tradestation", session=USEquityDaily) sizing = FixedCapital()
def execute(self): if self.trade.is_flat: self.buy(self.trade)Related
Symbol()RC2_SYMBOL_TICKER— the one positional arg, given twice or given as something other than a string literal.RC2_ENTRY_EXTRA_ARG— the same “that’s a kwarg, not a positional” rule on the order verbs.