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
Pine腳本庫
秉持TradingView一貫精神,作者已將此Pine代碼以開源函式庫形式發佈,方便我們社群中的其他Pine程式設計師重複使用。向作者致敬!您可以在私人專案或其他開源發表中使用此函式庫,但在公開發表中重用此代碼須遵守社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
Pine腳本庫
秉持TradingView一貫精神,作者已將此Pine代碼以開源函式庫形式發佈,方便我們社群中的其他Pine程式設計師重複使用。向作者致敬!您可以在私人專案或其他開源發表中使用此函式庫,但在公開發表中重用此代碼須遵守社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。