Skip to content
Open RaamTrade

RC2_SYMBOL_EXTRA_POSITIONAL

Symbol() takes at most one positional argument (the ticker). Pass broker=, 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)