RC2_HELPER_SIGNATURE
Helper method
<name>must takeselfas its first parameter.
What it means
Every method on a Strategy class is an instance method, and RaamCode has no @staticmethod or @classmethod to say otherwise. self is how a helper reaches params, symbols, OHLCV, position helpers and persistent state — a helper without it would be a function that cannot see the strategy it lives on, so the declaration is refused at the class body rather than failing later at the first self. inside it.
Why it happens
The self was never typed, or was deleted while moving a plain function onto the class:
class Bad(Strategy): trade = Symbol() sizing = FixedCapital()
def execute(self): if self.trade.is_flat: self.buy(self.trade)
def stop_for(price): # ❌ first parameter must be `self` return price * 0.98A helper that takes no parameters at all (def bump():) fails the same check.
How to fix it
Add self as the first parameter. Everything else stays positional and untyped.
class Good(Strategy): trade = Symbol() sizing = FixedCapital()
def execute(self): stop = self.stop_for(self.trade.close)
if self.trade.is_long and self.trade.close < stop: self.sell(self.trade, self.trade.position, reason="Stop hit")
if self.trade.is_flat: self.buy(self.trade)
def stop_for(self, price): # ✅ self first, then the arguments return price * 0.98execute(self) follows the same rule — it is the one method the platform calls for you.
Related
- Helper Methods — what a helper can and cannot see.
RC2_HELPER_ARITY— right signature, wrong number of arguments at the call site.RC2_HELPER_STATE_WRITE— what a helper may write back.