circle-exclamation
This documentation page is currently under development and may be updated frequently.

treePine Script Payload Builder

πŸ“¦ jsonBuilder Library Documentation (Pine Script v6)

https://www.tradingview.com/script/ajjfscP5-jsonSignalBuilderV2/arrow-up-right

import x7s0lt1/jsonSignalBuilderV2/1

A utility library for Pine Script that builds structured JSON strings for webhook alerts and external integrations.


✨ Example Use Case

You can easily create payload objects like this:

Using this code in Pine Script:


🧩 Library Functions

πŸ”Ή str(key, val)

Returns a "key": "value" string pair.

πŸ”Ή num(key, val)

Returns a "key": numericValue pair.

πŸ”Ή bool(key, val)

Returns a "key": true/false boolean pair.

πŸ”Ή raw(key, val)

Returns a raw value. Use it for arrays, nested JSON, or preformatted values.

πŸ”Ή object(pair1, ..., pair20)

Combines up to 20 preformatted pairs into a valid JSON object.


πŸ’‘ Pro Tips

  • Always use json.raw when inserting arrays or nested objects.

  • You can skip unused slots by simply passing an empty string "".

  • The object() function returns a full JSON string with braces {}.


πŸ“˜ Full Example

Last updated