Invalid Formula Operator
A formula uses a disallowed operator. Exponentiation (**), ranges (..), and regex matching (matches) are not allowed. Use arithmetic (+, -, *, /, %), comparison (==, !=, , =), logical (and, or, not), ternary (?:), string concatenation (~), containment (in, not in), and signal. for payload values.
This message appears when a formula (a value that starts with =) uses an operator TradersPost explicitly disallows:
**— exponentiation (use repeated*instead if you need a power)..— rangesmatches— regular-expression matching
Those three operators are rejected for this error. Prefer these operators instead:
- Arithmetic:
+,-,*,/,%(modulo) - Comparison:
==,!=,<,>,<=,>= - Logical:
and,or,not(and&&/||where applicable) - Ternary:
?: - String concatenation:
~ - Containment:
in,not in - References: payload values as
signal.<key>(for examplesignal.limitPrice), including nested objects with dot or bracket notation (signal.extras.ATRorsignal.extras["ATR"])
Other expression forms may still parse without triggering this message. Syntax and reference problems use different codes (see invalid formula syntax and invalid formula reference).
Invalid examples (these use a disallowed operator):
{
"ticker": "SPY",
"action": "buy",
"x": "=2 ** 10"
}
{
"ticker": "SPY",
"action": "buy",
"x": "=1..5"
}
{
"ticker": "SPY",
"action": "buy",
"symbol": "SPY",
"x": "=signal.symbol matches \"/SPY/\""
}
Valid examples using allowed operators:
{
"ticker": "SPY",
"action": "buy",
"x": "=signal.ticker == \"SPY\""
}
{
"ticker": "SPY",
"action": "buy",
"closePrice": "450.25",
"limitPrice": "=signal.closePrice + 0.5"
}
{
"ticker": "SPY",
"action": "buy",
"venue": "NYSE",
"x": "=signal.venue in [\"NYSE\", \"AMEX\"]"
}
For where = is permitted on the payload, see invalid formula syntax.
Ready to put Invalid Formula Operator to work?
Free 7-day trial
Set-up in 3 minutes
Paper account for testing
By continuing, you agree to the TradersPost Terms of Service and Privacy Policy. This site is protected by reCAPTCHA.