Back to Webhook Messages
Webhook Messages

Invalid Formula Nested

Formulas are supported on top-level fields (except ticker, action, test, and cancel, which are literals) and on supported takeProfit/stopLoss sub-fields. Other nested objects and arrays use literals only.

A string starting with = appeared outside the locations where formulas are supported. Supported locations are:

  • Top-level keys other than ticker, action, test, and cancel (those four use literals only), and
  • Specific sub-fields inside takeProfit and stopLoss objects.

Other nested objects or arrays (meta, tags, custom objects, arrays of legs, and so on) should contain literals only. Put computed values on the top level (or inside takeProfit / stopLoss where supported) and reference them with signal.<key>.

Typical error detail (webhook log)

Formulas are only supported on top-level fields and in the nested takeProfit/stopLoss objects.

Example (meta is not a supported formula location)

{
  "ticker": "SPY",
  "action": "buy",
  "limitPrice": "100",
  "meta": {
    "note": "=signal.limitPrice + 1"
  }
}

Fix: move the computed value to the top level (or send a literal)

{
  "ticker": "SPY",
  "action": "buy",
  "limitPrice": "100",
  "metaNote": "=signal.limitPrice + 1",
  "meta": {
    "note": "set from metaNote in your upstream system if needed"
  }
}

Allowed nested example (takeProfit)

{
  "ticker": "SPY",
  "action": "buy",
  "limitPrice": "100",
  "takeProfit": {
    "limitPrice": "=signal.limitPrice + 10"
  }
}

Relocate any = expression into a supported field, or send literals in nested structures.

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