PINE LIBRARY
GBB_lib_webhook

Library "GBB_lib_webhook"
buildPayload(action, comment)
buildPayload
description Builds a JSON string containing standard OHLCV market data
and a custom action label, ready to be passed to alert().
Special characters in `action` and `comment` are automatically
escaped so the resulting JSON is always valid.
Parameters:
action (string): (string) Signal label sent in the payload. Typical values:
"BUY", "SELL", "CLOSE". Any string is accepted.
comment (string): (string) Optional free-text field (signal name, setup
description, etc.). Defaults to an empty string.
Returns: (string) A JSON object string with the fields: action, ticker,
exchange, interval, price, open, high, low, volume, time, comment.
buildPayloadFull(action, comment, qty, sl, tp, strategy)
buildPayloadFull
description Builds an extended JSON string that includes all standard
OHLCV fields plus position-sizing and strategy metadata.
Numeric fields (qty, sl, tp) are serialised as JSON numbers
when provided, or as JSON null when omitted (na).
String fields are escaped to ensure valid JSON output.
Parameters:
action (string): (string) Signal label. Typical values: "BUY", "SELL", "CLOSE".
comment (string): (string) Optional free-text description. Defaults to "".
qty (float): (float) Position size or quantity. Pass na to omit (serialised as null).
sl (float): (float) Stop-loss price level. Pass na to omit (serialised as null).
tp (float): (float) Take-profit price level. Pass na to omit (serialised as null).
strategy (string): (string) Strategy identifier (e.g. "EMA_Cross"). Defaults to "".
Returns: (string) A JSON object string with the fields: action, ticker,
exchange, interval, price, open, high, low, volume, time, comment,
qty, sl, tp, strategy.
sendSignal(condition, action, comment)
sendSignal
description Fires a TradingView alert containing a basic JSON payload
whenever `condition` is true. Alert frequency is set to
once_per_bar_close.
Parameters:
condition (bool): (bool) Trigger condition.
action (string): (string) Signal label.
comment (string): (string) Optional description. Defaults to "".
Returns: void
sendSignalFull(condition, action, comment, qty, sl, tp, strategy)
sendSignalFull
description Fires a TradingView alert containing an extended JSON payload
whenever `condition` is true. Alert frequency is set to
once_per_bar_close.
Parameters:
condition (bool): (bool) Trigger condition.
action (string): (string) Signal label.
comment (string): (string) Optional description. Defaults to "".
qty (float): (float) Position size. Pass na to omit. Defaults to na.
sl (float): (float) Stop-loss price. Pass na to omit. Defaults to na.
tp (float): (float) Take-profit price. Pass na to omit. Defaults to na.
strategy (string): (string) Strategy name. Defaults to "".
Returns: void
buildPayload(action, comment)
buildPayload
description Builds a JSON string containing standard OHLCV market data
and a custom action label, ready to be passed to alert().
Special characters in `action` and `comment` are automatically
escaped so the resulting JSON is always valid.
Parameters:
action (string): (string) Signal label sent in the payload. Typical values:
"BUY", "SELL", "CLOSE". Any string is accepted.
comment (string): (string) Optional free-text field (signal name, setup
description, etc.). Defaults to an empty string.
Returns: (string) A JSON object string with the fields: action, ticker,
exchange, interval, price, open, high, low, volume, time, comment.
buildPayloadFull(action, comment, qty, sl, tp, strategy)
buildPayloadFull
description Builds an extended JSON string that includes all standard
OHLCV fields plus position-sizing and strategy metadata.
Numeric fields (qty, sl, tp) are serialised as JSON numbers
when provided, or as JSON null when omitted (na).
String fields are escaped to ensure valid JSON output.
Parameters:
action (string): (string) Signal label. Typical values: "BUY", "SELL", "CLOSE".
comment (string): (string) Optional free-text description. Defaults to "".
qty (float): (float) Position size or quantity. Pass na to omit (serialised as null).
sl (float): (float) Stop-loss price level. Pass na to omit (serialised as null).
tp (float): (float) Take-profit price level. Pass na to omit (serialised as null).
strategy (string): (string) Strategy identifier (e.g. "EMA_Cross"). Defaults to "".
Returns: (string) A JSON object string with the fields: action, ticker,
exchange, interval, price, open, high, low, volume, time, comment,
qty, sl, tp, strategy.
sendSignal(condition, action, comment)
sendSignal
description Fires a TradingView alert containing a basic JSON payload
whenever `condition` is true. Alert frequency is set to
once_per_bar_close.
Parameters:
condition (bool): (bool) Trigger condition.
action (string): (string) Signal label.
comment (string): (string) Optional description. Defaults to "".
Returns: void
sendSignalFull(condition, action, comment, qty, sl, tp, strategy)
sendSignalFull
description Fires a TradingView alert containing an extended JSON payload
whenever `condition` is true. Alert frequency is set to
once_per_bar_close.
Parameters:
condition (bool): (bool) Trigger condition.
action (string): (string) Signal label.
comment (string): (string) Optional description. Defaults to "".
qty (float): (float) Position size. Pass na to omit. Defaults to na.
sl (float): (float) Stop-loss price. Pass na to omit. Defaults to na.
tp (float): (float) Take-profit price. Pass na to omit. Defaults to na.
strategy (string): (string) Strategy name. Defaults to "".
Returns: void
Bibliothèque Pine
Dans l'esprit TradingView, l'auteur a publié ce code Pine sous forme de bibliothèque open source afin que d'autres programmeurs Pine de notre communauté puissent le réutiliser. Bravo à l'auteur! Vous pouvez utiliser cette bibliothèque à titre privé ou dans d'autres publications open source, mais la réutilisation de ce code dans des publications est régie par nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Bibliothèque Pine
Dans l'esprit TradingView, l'auteur a publié ce code Pine sous forme de bibliothèque open source afin que d'autres programmeurs Pine de notre communauté puissent le réutiliser. Bravo à l'auteur! Vous pouvez utiliser cette bibliothèque à titre privé ou dans d'autres publications open source, mais la réutilisation de ce code dans des publications est régie par nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.