Skip to content
Open RaamTrade

RC2_SIG_UNKNOWN

Unknown signal method self.<name>. Supported: buy, sell_short, sell, buy_to_cover, order.

What it means

The order vocabulary is a closed set of five verbs, and self.<something>(...) that isn’t one of them (and isn’t an exit rule or a helper method you defined) has nowhere to go. RaamCode does not fall back to “maybe it’s a method on the base class” — an unrecognised verb is refused, because the alternative is a call that compiles and silently never trades.

The five, in full: buy and sell_short open; sell and buy_to_cover close; order is the raw form for pyramiding and hedging.

Why it happens

Almost always a verb borrowed from another platform. There is no self.close() — closing is directional, and the language makes you say which side you are closing:

class CloseVerb(Strategy):
trade = Symbol()
sizing = FixedCapital()
def execute(self):
sma = SMA(20, on=self.trade)
if self.trade.is_flat:
self.buy(self.trade)
if self.trade.is_long and sma.value > 0:
self.close(self.trade)

self.exit(...), self.enter_long(...), self.flatten() and friends land here for the same reason.

How to fix it

Close a long with sell, a short with buy_to_cover — with an explicit quantity, since exits are never auto-sized.

class ExplicitExit(Strategy):
trade = Symbol()
sizing = FixedCapital()
def execute(self):
sma = SMA(20, on=self.trade)
if self.trade.is_flat:
self.buy(self.trade)
if self.trade.is_long and sma.value > 0:
self.sell(self.trade, self.trade.position, reason="exit")

If you wanted a stop rather than a decision, that is an exit rule, not a verb: self.stop_loss(2.0).