RC2_SIG_SYMBOL
תוכן זה אינו זמין עדיין בשפה שלך.
self.<verb>targetself.<name>is not a declared Symbol. Declared:<the slots this strategy has>.
What it means
The first positional argument of every order verb is a symbol slot — one of the Symbol() names in the class body. When the name after self. is something else (a typo, a Param, a persistent-state variable), the transpiler has no slot to route the order to, and refuses. The message lists the slots the strategy actually declared, which is normally enough to spot the mistake without leaving the editor.
Why it happens
A typo’d slot name. self. makes it look like a member access that must exist, but the class body is the only place slots are created:
class Typo(Strategy): trade = Symbol() sizing = FixedCapital()
def execute(self): if self.trade.is_flat: self.buy(self.trades)Or a name that exists but isn’t a slot — here a Param, which is a number, not an instrument:
class ParamAsTarget(Strategy): period = Param(20, min=2, max=200) trade = Symbol() sizing = FixedCapital()
def execute(self): if self.trade.is_flat: self.buy(self.period)How to fix it
Name the slot exactly as the class body declares it.
class Fixed(Strategy): period = Param(20, min=2, max=200) trade = Symbol() sizing = FixedCapital()
def execute(self): sma = SMA(self.period, on=self.trade) if sma.value > 0 and self.trade.is_flat: self.buy(self.trade)Related
- Order Verbs
Symbol()RC2_SIG_DATAFEED— the target is a declared Symbol, but a data feed.RC2_SIG_UNKNOWN— the verb itself doesn’t exist.