RC2_SIG_DATAFEED
Symbol
<slot>is a data feed (trade=False); signals cannot target it.
What it means
Order verbs take a slot as their first argument, and that slot must be the trading symbol. A data feed has no position book, no sizing, and — in the general case — no broker binding a subscriber could route an order to. It is there to be read.
The transpiler checks the target before anything else about the call, so this fires whatever else the order says.
Why it happens
The feed is the symbol the signal was about, so it is the one under your fingers when you write the order:
class OrderTheFeed(Strategy): trade = Symbol(trade=True) spy = Symbol(ticker="SPY") sizing = FixedCapital()
def execute(self): spy_sma = SMA(50, on=self.spy) if self.spy.close > spy_sma.value: self.buy(self.spy)How to fix it
Aim the order at the trading slot. The feed keeps its job — supplying the condition.
class FeedFiltered(Strategy): trade = Symbol(trade=True) spy = Symbol(ticker="SPY") sizing = FixedCapital()
def execute(self): spy_sma = SMA(50, on=self.spy) if self.spy.close > spy_sma.value and self.trade.is_flat: self.buy(self.trade)If you actually meant to trade SPY itself, then SPY is the trading symbol: move trade=True onto that slot (and take it off the other one — two trading slots is RC2_MULTI_TRADE).
Related
- Order Verbs
Symbol()— data feedsRC2_DATAFEED_HELPER— reading a position property off a feed, rather than ordering against it.RC2_SIG_SYMBOL— the target isn’t a Symbol at all.