דלגו לתוכן
פתיחת RaamTrade

Error Reference

תוכן זה אינו זמין עדיין בשפה שלך.

Every diagnostic RaamCode can emit is on this page. That is a checked claim, not an aspiration: scripts/verify-build.mjs fails the docs build if a code the transpiler can raise is missing here, or if a row names a code nothing raises. The list is generated against /truth.json, which is itself generated from the compiler sources.

Codes in bold with a link have a full page — what it means, the mistake that causes it, and a before/after fix. The rest are one-liners; the editor’s own message plus the line below is normally enough.

By prefix

Prefix Source Scope
RC2_* RaamCode transpiler Structural errors — file shape, class body, indicator placement, order-verb misuse, state types.
SDK* Build pipeline Pipeline-level refusals (SDK001, SDK014) and the blocked-builtin rule (SDK012). Since #1355 no member code is compiled — there is no sandbox analyzer and no CS* family any more.

Start here

These five account for most first-time authoring errors.

Code Symptom Fix
RC2_NO_SIZING “Strategy must declare a sizing model.” Add sizing = FixedCapital() (or FixedQuantity / Compounding) to the class body.
RC2_NO_SYMBOL “Strategy needs at least one Symbol.” Add trade = Symbol().
RC2_EXIT_NO_QTY “…is an exit verb — it requires a positional quantity.” self.sell(self.trade, self.trade.position).
RC2_IND_IN_BODY “Indicator must be declared at the top of execute().” Move every indicator declaration above the first if.
RC2_CLASS_BODY “Class body may only contain Param() and Symbol() declarations.” The class body takes Param(), Symbol(), sizing, and plain literals — nothing else.

File shape

A RaamCode file declares exactly one deliverable: a Strategy (optionally preceded by inline Indicator definitions), a Session, or a single standalone Indicator.

Code Meaning
RC2_PARSE The file is not valid RaamCode syntax — the parser could not read it at all.
RC2_NO_DELIVERABLE No class inheriting from Strategy, Session, or Indicator was found.
RC2_MULTIPLE_STRATEGIES A file may define at most one Strategy.
RC2_MIXED_DELIVERABLE A Session must be the only class in its file.
RC2_ORPHAN_INDICATORS Two or more Indicator classes with no Strategy — inline indicators are only allowed alongside one.
RC2_INLINE_SHADOWS_PLATFORM An inline indicator shadows a platform indicator of the same name; the inline definition is the one used.
RC2_IMPORT_BLOCKED import is not allowed. (import math gets its own message — math.* is already ambient.)
RC2_UNSUPPORTED A construct the current transpiler phase does not cover yet.
RC2_UNSUPPORTED_LITERAL A literal kind RaamCode does not have — bytes (b'..') or complex (1j). Only int, float, bool, str and None are literals.
RC2_STATE_SIZE A [literal] * N persistent-state list declares more than 1,000,000 elements.

Strategy shape

Code Meaning
RC2_CLASS_BODY The class body contains something other than Param(), Symbol(), a sizing assignment, or a plain literal.
RC2_NO_SYMBOL No Symbol() was declared.
RC2_NO_TRADE No trading symbol — the only Symbol is trade=False, or several were declared and none was marked trade=True.
RC2_MULTI_TRADE More than one Symbol is marked trade=True.
RC2_NO_SIZING No sizing = … declaration.
RC2_SIZING_UNKNOWN The sizing model is not FixedQuantity, FixedCapital, or Compounding.
RC2_NO_EXECUTE No def execute(self) method.
RC2_RETURN_VALUE execute() may only use a bare return; emit signals with the order verbs instead of returning a value.
RC2_RESERVED_MATH math is a reserved namespace (the math.* standard library) and cannot be used as a name.
RC2_HELPER_SIGNATURE A helper method’s first parameter is not self.
RC2_HELPER_ARITY A helper was called with the wrong number of arguments.
RC2_HELPER_STATE_WRITE A helper rebound a scalar state slot; the write would not propagate back to the caller.

Param()

Code Meaning
RC2_PARAM_DEFAULT Param() requires a default value.
RC2_PARAM_DEFAULT_OUT_OF_RANGE A Param defaults to a value below its own min or above its own max.
RC2_PARAM_RANGE_INVERTED A Param declares min above max (or opt_min above opt_max) — a range that runs backwards is empty.
RC2_PARAM_STEP_NOT_POSITIVE A Param declares opt_step of zero or less.
RC2_PARAM_RESERVED The Param name shadows a strategy-level property (capital, bar_count, …).
RC2_PARAM_TITLE A Param’s title= is not text, is empty, or names a language the platform does not speak.
RC2_PARAM_UNKNOWN_KWARG A keyword outside min, max, opt_min, opt_max, opt_step, choices, type, title.

Learning sets

Code Meaning
RC2_LEARNING_SET_NAME A learning set is named learning_set_1 to learning_set_5, each once, without gaps.
RC2_LEARNING_SET_SHAPE The value is not LearningSet(param=value, ...), or a value is not Range(from, to[, step]) or a plain value.
RC2_LEARNING_SET_UNKNOWN_PARAM A learning set names something that is not a Param of this strategy.
RC2_LEARNING_SET_NOT_OPTIMIZABLE A learning set touches a Param with no optimizer range, searches a switch, or sets a text Param.
RC2_LEARNING_SET_OUTSIDE_RANGE A learning set goes outside a Param’s own opt_min..opt_max, or gives it a value of the wrong kind.
RC2_LEARNING_SET_NO_SEARCH A learning set fixes every parameter and searches nothing.
RC2_LEARNING_SET_DUPLICATE A learning set is the same search as another one, or as learning set 1.
RC2_LEARNING_SET_RUN A learning set’s run=WalkForward(...) uses a value the walk-forward form does not offer, or is not written in run=.
RC2_LEARNING_SET_TITLE A learning set’s name judges it, talks about safety, risk or results, says whom it suits, or is too long.

Parameter types

See Parameter types. A parameter’s kind comes from its default literal, and choices= makes it an enum.

Code Meaning
RC2_PARAM_TYPE_MISMATCH type= disagrees with the default literal. type= is a second opinion, never a conversion.
RC2_PARAM_TYPE_UNKNOWN type= is not a parameter kind. Valid: int, float, bool, enum.
RC2_PARAM_DEFAULT_NOT_IN_CHOICES The default is not one of the declared choices, so no run could reproduce it.
RC2_PARAM_ENUM_NO_RANGE min/max/opt_min/opt_max/opt_step on an enum. The choices ARE the range.
RC2_PARAM_ENUM_EMPTY choices= with nothing in it: the parameter would have no legal value at all.
RC2_PARAM_ENUM_DUPLICATE The same option listed twice, which is a typo or two labels over one value.
RC2_PARAM_ENUM_MIXED_TYPES The options are not all the same type, and the parameter has one type.
RC2_PARAM_ENUM_BOOL True/False listed as choices. A bool already is two values: write Param(False).
RC2_PARAM_ENUM_LABEL A choices dict’s values must be text labels; write a bare list to label values with themselves.
RC2_PARAM_ENUM_SHAPE choices= takes a list of values or a dict of value to label.
RC2_PARAM_RANGE_NOT_NUMERIC A range keyword on a bool (whose range is {False, True}) or on a text parameter.
RC2_PARAM_INT_STEP A fractional opt_step on an integer parameter, which optimizes on whole numbers.
RC2_PARAM_INT_BOUND A fractional min, max, opt_min or opt_max on an integer parameter. An int holds whole numbers, so a fractional end is a slider stop it can never reach.

Two hints, which compile GREEN and only appear in the diagnostics panel:

Code Meaning
RC2_PARAM_BOOL_HINT A 0/1 integer. Param(False) renders a switch and runs the same two cases; type=int keeps the integer and silences the hint.
RC2_PARAM_SINGLE_CHOICE_HINT An enum with exactly one choice: a constant with a label, which nothing can change and nothing can search.

Symbol() and sessions

Code Meaning
RC2_SYMBOL_TICKER The positional ticker is not a string literal, or the ticker was given both positionally and via ticker=.
RC2_SYMBOL_BROKER broker= is not a string literal.
RC2_SYMBOL_TRADE trade= is not a boolean literal (True or False).
RC2_SYMBOL_EXTRA_POSITIONAL Symbol() takes at most one positional argument — the ticker.
RC2_SYMBOL_UNKNOWN_KWARG A keyword outside ticker, broker, session, trade.
RC2_SYMBOL_UNKNOWN self.<name> is not a declared Symbol.
RC2_UNKNOWN_SESSION session= names a session the catalog does not have.
RC2_DATAFEED_HELPER A position helper was read off a data-feed Symbol; those exist only on the trading symbol.

Order verbs

Code Meaning
RC2_SIG_UNKNOWN self.<name>(…) is not one of buy, sell_short, sell, buy_to_cover, order.
RC2_SIG_SYMBOL The order verb’s target is not a declared Symbol.
RC2_SIG_DATAFEED The order verb targets a data feed (trade=False); signals cannot be sent to one.
RC2_ENTRY_EXTRA_ARG An entry verb was given a positional quantity — entries are auto-sized.
RC2_EXIT_NO_QTY An exit verb is missing its positional quantity.
RC2_EXIT_NO_KWARGS qty= or percent= on an exit verb — quantity is positional there.
RC2_ORDER_MISSING self.order(…) requires both qty= and direction=.
RC2_ORDER_TYPE_CONFLICT One order verb carried both stop= and limit= — a resting order has one level.
RC2_OVERRIDE_INVALID The override kwarg doesn’t match the sizing model (percent= on FixedQuantity, qty= on FixedCapital/Compounding).

Exit rules

Code Meaning
RC2_EXIT_ARG An exit rule got too many positional values, or no threshold at all (trailing_stop needs both of its numbers).
RC2_EXIT_UNIT A stale or duplicated unit keyword — use exactly one of a positional percent, percent=, points=, or price= (break_even has no price=; trailing_stop names its numbers activate_*= / trail_*=).
RC2_TRAILING_TWO_NUMBERS trailing_stop needs two numbers, activation then distance — self.trailing_stop(0, 1.5) trails from entry.

Using indicators

Code Meaning
RC2_UNKNOWN_INDICATOR The indicator name is not in the catalog (the message lists the ones that are).
RC2_IND_IN_BODY An indicator was declared inside a conditional or loop instead of at the top of execute().
RC2_IND_PERIOD The indicator needs a period as its first argument.
RC2_IND_ARG_COUNT The indicator was given the wrong number of arguments for its declared parameters.
RC2_IND_ON The indicator needs an on= source because no trading symbol is declared.
RC2_IND_ON_UNKNOWN on= references a Symbol slot or indicator that was never declared.
RC2_IND_ON_FIELD on=self.<slot>.<field> names something that is not an OHLCV field.
RC2_IND_ON_SOURCE on= must be a Symbol slot, an OHLCV field, or a single-value indicator.
RC2_IND_ON_SESSION The indicator reads session_start, so it needs the symbol’s whole bar and its session; on=self.<slot>.<field> hands it one number and no session. Use on=self.<slot>.
RC2_IND_ON_MULTIVALUE The on= source has several outputs — say which (on=aroon.up).
RC2_IND_ON_MULTIVALUE_CHAIN Chaining onto a named output of a multi-value indicator needs runtime support that has not landed.
RC2_IND_CYCLE An indicator references itself through on=.
RC2_IND_OUTPUT .value was read from a multi-value indicator, or a named output that does not exist was read.
RC2_CROSS_ARG crossed_above / crossed_below takes exactly one argument.
RC2_CROSS_MULTIVALUE A crossover helper was used on a multi-value indicator; both sides must be single decimals.
RC2_VALUE_AT_MULTIVALUE .value_at(…) on a multi-value indicator — address a specific output instead.

Writing custom indicators

Code Meaning
RC2_IND_NO_COMPUTE An Indicator class must define compute(self, …).
RC2_IND_COMPUTE_SIG compute() parameters must be self followed by bar fields (close, open, high, low, volume).
RC2_IND_COMPUTE An unsupported statement or expression inside compute().
RC2_IND_METHOD An Indicator class may only define compute().
RC2_IND_BODY An indicator class-body assignment that is not Param(), Series(), a child indicator, or a literal.
RC2_IND_PARAM An indicator Param() needs a literal default.
RC2_IND_PARAM_KIND An indicator Param is a bool/string, and an indicator’s parameter values ride the chart’s numeric wire.
RC2_IND_SERIES A Series(…) capacity must be a Param reference, optionally offset by an integer literal.
RC2_IND_SERIES_CAPACITY A Series capacity references a Param that was never declared.
RC2_IND_PERCENTILE_RANGE percentile(series, p) was given a literal p outside 0-100 — the second argument is a percentage.
RC2_IND_POSITION position must be ON_CHART, OFF_CHART, or AGNOSTIC.
RC2_IND_RENDER render must be LINE, OHLC, or HISTOGRAM.
RC2_IND_MIXED_RETURN compute() mixes single-value returns with dict returns.
RC2_IND_INCONSISTENT_OUTPUTS Two dict returns use different key sets; every return path must agree.
RC2_IND_RESERVED_OUTPUT_KEY A multi-output indicator used the reserved keys value or color.
RC2_IND_PLOT_ARGS A draw verb takes one positional value; colour, width, line style, pane, visible and offset are keywords.
RC2_IND_PLOT_PANE pane= must be OVERLAY or a string label for a named sub-pane.
RC2_IND_PLOT_STYLE line_style= must be a recognised LineStyle.<member>.
RC2_IND_PLOT_UNNAMED A multi-output indicator must name every output; a bare self.line(…) statement names none.
RC2_IND_PLOT_RENDER_CONFLICT One output is drawn with two different render types.
RC2_IND_PLOT_RETURN_MISMATCH A return references a name that is not a drawn output.
RC2_IND_PLOT_VISIBLE visible= on a draw verb must be the constant True or False.
RC2_IND_PLOT_OFFSET offset= must be a whole number of bars or an int Param (optionally negated).
RC2_IND_PLOT_ACCUMULATES accumulates = must be SUM or PRODUCT.
RC2_IND_LEVEL_ARGS self.level(…) takes one positional value (a literal or Param reference); colour and line style are keywords.
RC2_IND_FILL_ARGS self.fill(a, b, color=) takes exactly two positional referents.
RC2_IND_FILL_UNKNOWN_REF self.fill(…) references something that is neither a drawn output nor a level handle.
RC2_IND_SHAPE_ARGS self.shape(…) is a per-bar statement taking one Shape.<member> plus at=; it returns nothing to assign.
RC2_IND_SHAPE_POSITION position= on a marker is not one of the recognised placements.
RC2_IND_SHAPE_UNKNOWN Shape.<member> is not a recognised marker.
RC2_IND_UNKNOWN_COLOR Color.<member> is not a recognised colour, semantic token, or Color.hex(...).
RC2_IND_COLOR_NOT_LITERAL Color.hex(…) takes a string literal — a variable defeats compile-time validation.
RC2_IND_COLOR_HEX_INVALID Color.hex(…) is not #RRGGBB or #RRGGBBAA.
RC2_IND_COLOR_RENDER Per-bar color was used on a render type that does not support it.

Persistent state

Code Meaning
RC2_STATE_DUPLICATE The same state name is declared more than once in the class body.
RC2_STATE_PARAM_CLASH A state name collides with a Param(), which is read-only.
RC2_STATE_SYMBOL_CLASH A state name collides with a Symbol() slot.
RC2_STATE_RESERVED A state name shadows a platform property (capital, initial_capital, bar_count, ready).
RC2_STATE_TYPE The declared literal has no inferable type, or a scalar slot was handed a list, dict, or tuple.
RC2_STATE_TYPE_REASSIGN A slot was reassigned to a different type; types are fixed at first assignment.
RC2_STATE_EMPTY_LIST name = [] has no element type to infer — use [0.0]*0.
RC2_STATE_EMPTY_DICT name = {} has no value type to infer — use a single-entry literal.
RC2_STATE_MIXED List elements, or dict values, do not all share one type.
RC2_STATE_NESTED A collection inside a collection; persistent state is one level deep.
RC2_STATE_DICT_KEY Dict keys must be string literals.
RC2_STATE_REBIND_COLLECTION A declared list or dict was re-assigned in execute(); mutate it by index or key instead.
RC2_STATE_AUGASSIGN_UNINIT += (or similar) on a slot that has no declaration to read from.

Statements and expressions

Code Meaning
RC2_EXEC_STMT An unsupported statement type in execute() — most often a bare ... placeholder.
RC2_ASSIGN_LHS The assignment target is not a single local name or a single self.x; also a subscript write into a scalar or undeclared slot.
RC2_ASSIGN_RHS The assignment has no right-hand side.
RC2_AUGASSIGN An augmented assignment is missing a target or a value, or targets an unsupported shape.
RC2_AUGASSIGN_OP The augmented operator is not one of +=, -=, *=, /=, %=, //=.
RC2_FOR_TARGET The loop target is not a simple variable name.
RC2_FOR_ITER The loop iterable is not range(…) or a persistent-state list or dict.
RC2_FOR_RANGE range() takes one argument (stop) or two (start, stop) — never three.
RC2_LITERAL A position that requires a literal was given an expression.
RC2_FSTRING_SPEC Warning only — an unrecognised f-string format spec; the value is interpolated unformatted.
RC2_BUILTIN_ARG A builtin was called with the wrong arguments — most often len() on something other than a state collection.
RC2_MATH_UNKNOWN math.<name> is not a function or constant in the math standard library.
RC2_MATH_ARITY A math.* function was called with the wrong number of arguments.
RC2_TIMEZONE_UNKNOWN astimezone(…) needs exactly one known IANA zone literal, chained to .hour / .minute / .month / .weekday().

Writing sessions

Code Meaning
RC2_SESSION_BODY A Session body may only assign timezone, days, bars, broker, settlement, label, period.
RC2_SESSION_FIELD An unknown session field.
RC2_SESSION_TIMEZONE timezone is missing, or is not a string literal.
RC2_SESSION_DAYS days is missing, is not a list of day short names, or names a day that does not exist.
RC2_SESSION_BARS bars is missing, or is not a list of ("HH:MM", "HH:MM") tuples.
RC2_SESSION_BAR One bar is not a ("HH:MM", "HH:MM") tuple of string literals, or its times are out of range.
RC2_SESSION_BROKER broker must be a dict mapping a broker name to a property dict.
RC2_SESSION_SETTLEMENT settlement must be a boolean literal.
RC2_SESSION_SYMBOLS symbols must be a non-empty list of tickers in quotes, e.g. ["CORNF", "SOYF"]; leave it out to serve every symbol of the session’s instruments.
RC2_SESSION_LABEL label must be a string literal.
RC2_SESSION_PERIOD period must be the string "bar", "weekly", or "monthly".
RC2_SESSION_INSTRUMENTS Each entry in instruments must be a string literal naming a known instrument kind; an empty list names nothing (omit the field to serve every instrument).
RC2_SESSION_LANGUAGE A localized name/description dict key must be a language-code string literal the platform speaks.
RC2_SESSION_NAME name must be a string literal, or a dict of language → text.
RC2_SESSION_DESCRIPTION description must be a string literal, or a dict of language → text.
RC2_SESSION_CALENDAR calendar must name one of the exchange calendars the platform keeps, as a string literal (e.g. calendar = "NYSE"); the editor’s message lists them.

Writing symbols and using them in a strategy

Code Meaning
RC2_SESSION_WRONG_DOOR The file defines a session (a class based on Session), and sessions are authored in the Sessions area — a weekly schedule and a timezone, kept as data; a strategy references one by name with session="USEquityDaily".
RC2_SYMBOL_WRONG_DOOR The file defines a symbol (a class based on Continuous), and symbols are authored in the Symbols area, not saved as a strategy; a strategy references one by name with Symbol("NQ1").
RC2_INDICATOR_WRONG_DOOR The file defines an indicator (a class based on Indicator), and an indicator is saved as an indicator, not as a strategy; save it as a new indicator, and a strategy then uses it by its name.
RC2_STRATEGY_WRONG_DOOR The file defines a strategy (a class based on Strategy), and a strategy is saved as a strategy, not as an indicator; save it as a new strategy.
RC2_CONTINUOUS_PERCENT_ON_ADJUSTED Warning: the trade symbol is a continuous series back-adjusted by a constant offset, and the strategy uses percent-based sizing or percent protection; a year back the series is shifted by the cumulative roll gap, so a percent of the adjusted price is not the percent live trades.
RC2_CONTINUOUS_POINTS_ON_RATIO Warning: the trade symbol is a continuous series adjusted by ratio, and the strategy arms point-distance protection; a ratio adjustment scales history, so a fixed point distance is not the same distance live.

Pipeline and sandbox

Code Meaning
SDK001 A namespace not allowed in user strategies, or a source language other than RaamCode was submitted for an indicator.
SDK012 A blocked builtin (open, eval, map, sorted, …).
SDK014 A source language other than RaamCode was submitted for a strategy.

A code with no page

Every code above carries a human-readable message in the editor, pointing at the line. If the message plus the one-liner here isn’t enough, the code deserves a page — open an issue with the code and the snippet that produced it.