Back to Webhook Messages
Webhook Messages

Invalid Formula Syntax

A formula value (leading "=") could not be parsed. Use only supported operators and reference top-level payload fields as signal.. Allowed functions: abs, ceil, floor, max, min, round. See invalid-formula-syntax in the reference manual.

TradersPost could not parse the text after the leading = in one of your JSON fields. The substring after = must be a valid formula using only the supported operators (for example arithmetic and comparison — see invalid formula operator for the full list), and property access must use the signal.<key> form (including nested objects such as signal.extras.ATR).

Where formulas are supported

  • Top-level keys other than ticker, action, test, and cancel—those four must always be sent as literal JSON values (no leading =).
  • Inside takeProfit and stopLoss only, on sub-fields that accept formulas the same way (values starting with =).

For any other nested object or array path, send literals only, or compute the value in an allowed location and reference it with signal.<key> (nested object values under keys like extras can be read from formulas even though those nested keys cannot themselves contain = formulas).

Allowed functions

Only these may be called in a formula: abs, ceil, floor, max, min, round. Calling any other function (for example sqrt()) produces an error such as:

The formula in field x calls "sqrt()", which is not a supported function. Allowed functions are: abs, ceil, floor, max, min, round.

Common causes

  • Empty formula — the value is exactly = with nothing after it.
  • Tokens outside the supported set — stray characters, mismatched parentheses, or operators not listed under invalid formula operator.
  • Wrong reference shape — use signal.limitPrice, not limitPrice alone. Bare identifiers (without the signal. prefix) are reported as invalid formula reference or invalid formula dependency, depending on context. Nested object keys can use signal.extras.ATR or signal.extras["ATR"].
  • Unknown function — only the six math functions above are registered.

Typical error details (webhook log)

The formula in field limitPrice is empty.

The formula in field limitPrice has invalid syntax. Check that the expression uses valid operators and references only existing payload fields.

The formula in field x calls "sqrt()", which is not a supported function. Allowed functions are: abs, ceil, floor, max, min, round.

Example — incomplete formula

{
  "ticker": "SPY",
  "action": "buy",
  "closePrice": "450.25",
  "limitPrice": "="
}

Example — incomplete expression

{
  "ticker": "SPY",
  "action": "buy",
  "limitPrice": "=signal.closePrice +"
}

Correct

{
  "ticker": "SPY",
  "action": "buy",
  "closePrice": "450.25",
  "limitPrice": "=signal.closePrice + 0.5"
}

Supported operators (summary)

Arithmetic (+, -, *, /, %), comparison (==, !=, <, >, <=, >=), logical (and, or, not), ternary (?:), string concatenation (~), and containment (in, not in). The complete picture is under invalid formula operator.

Fix the expression, resend the webhook, and check the detailed line in the request log if the error persists.

Ready to put Invalid Formula Syntax 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.