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
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.