PINE LIBRARY
업데이트됨 GB_JSON_Lib

Library "GB_JSON_Lib"
Alert payload string builders for GB-RMBP+ strategy.
N8N JSON entries/exits, Autoview key=value strings, PineConnector CSV.
n8n_entry_json(act, mode_lower, ticker, tf, price_now, lev, sug_lev, sl_price, liq_price, order_pct, tp1, tp1p, tp1a, tp2, tp2p, tp2a, tp3, tp3p, tp3a, tp4, tp4p, tp4a, tp5, tp5p, tp5a, tp6, tp6p, tp6a)
Build the N8N entry-side JSON payload, byte-identical to v1.0.77 output.
Parameters:
act (simple string): "buy" or "sell"
mode_lower (simple string): Execution mode in lowercase (stealth/hybrid/visible)
ticker (simple string): syminfo.ticker
tf (simple string): timeframe.period
price_now (float): close
lev (float): Final effective leverage used for the order
sug_lev (float): Suggested leverage from risk-loss calculation
sl_price (float): Stop-loss price (or 0 if none)
liq_price (float): Calculated liquidation price
order_pct (float): Order size as % of equity
tp1 (float)
tp1p (float)
tp1a (bool)
tp2 (float)
tp2p (float)
tp2a (bool)
tp3 (float)
tp3p (float)
tp3a (bool)
tp4 (float)
tp4p (float)
tp4a (bool)
tp5 (float)
tp5p (float)
tp5a (bool)
tp6 (float)
tp6p (float)
tp6a (bool)
Returns: JSON string
n8n_tp_exit_json(act, ticker, tp_idx, tp_pct, pos_size)
Build per-TP exit JSON payload.
Parameters:
act (simple string): "closelong" or "closeshort"
ticker (simple string): syminfo.ticker
tp_idx (int): TP number 1..6
tp_pct (float): Exit % for this TP
pos_size (float): math.abs(strategy.position_size)
Returns: JSON string
n8n_close_json(act, ticker)
Build a full-position close JSON payload.
Parameters:
act (simple string): "closelong" or "closeshort"
ticker (simple string): syminfo.ticker
Returns: JSON string
n8n_order_pct(qty, price, lev, equity)
Compute order size as percentage of equity.
Parameters:
qty (float): Final order quantity
price (float): Current close
lev (float): Effective leverage
equity (float): strategy.equity
Returns: Rounded percentage to 4 decimals
av_entry_str(user, side, exchange, lev, symbol, ccy, testing)
Build Autoview entry command string.
Uses Pine placeholder '{{strategy.order.contracts}}' for the quantity.
Parameters:
user (simple string): Acct identifier
side (simple string): "long" or "short"
exchange (simple string): Exchange name
lev (float): Leverage value
symbol (simple string): Symbol string
ccy (simple string): "currency" or "contracts"
testing (simple string): "" or " d=1"
Returns: Autoview-formatted command string
av_exit_str(user, side, exchange, symbol, ccy, testing, is_short)
Build Autoview exit command string. Short exits append "%" to qty per v1.0.77.
Parameters:
user (simple string): Acct identifier
side (simple string): "long" or "short"
exchange (simple string): Exchange name
symbol (simple string): Symbol string
ccy (simple string): "currency" or "contracts"
testing (simple string): "" or " d=1"
is_short (simple bool): True if this is a short exit (appends "%")
Returns: Autoview-formatted command string
pc_alert_str(licence_id, symbol)
Build PineConnector CSV alert payload.
Uses Pine placeholders for action and contracts.
Parameters:
licence_id (int): Numeric license ID
symbol (simple string): Symbol with optional suffix (e.g. "EURUSD.a")
Returns: CSV-formatted command string
Alert payload string builders for GB-RMBP+ strategy.
N8N JSON entries/exits, Autoview key=value strings, PineConnector CSV.
n8n_entry_json(act, mode_lower, ticker, tf, price_now, lev, sug_lev, sl_price, liq_price, order_pct, tp1, tp1p, tp1a, tp2, tp2p, tp2a, tp3, tp3p, tp3a, tp4, tp4p, tp4a, tp5, tp5p, tp5a, tp6, tp6p, tp6a)
Build the N8N entry-side JSON payload, byte-identical to v1.0.77 output.
Parameters:
act (simple string): "buy" or "sell"
mode_lower (simple string): Execution mode in lowercase (stealth/hybrid/visible)
ticker (simple string): syminfo.ticker
tf (simple string): timeframe.period
price_now (float): close
lev (float): Final effective leverage used for the order
sug_lev (float): Suggested leverage from risk-loss calculation
sl_price (float): Stop-loss price (or 0 if none)
liq_price (float): Calculated liquidation price
order_pct (float): Order size as % of equity
tp1 (float)
tp1p (float)
tp1a (bool)
tp2 (float)
tp2p (float)
tp2a (bool)
tp3 (float)
tp3p (float)
tp3a (bool)
tp4 (float)
tp4p (float)
tp4a (bool)
tp5 (float)
tp5p (float)
tp5a (bool)
tp6 (float)
tp6p (float)
tp6a (bool)
Returns: JSON string
n8n_tp_exit_json(act, ticker, tp_idx, tp_pct, pos_size)
Build per-TP exit JSON payload.
Parameters:
act (simple string): "closelong" or "closeshort"
ticker (simple string): syminfo.ticker
tp_idx (int): TP number 1..6
tp_pct (float): Exit % for this TP
pos_size (float): math.abs(strategy.position_size)
Returns: JSON string
n8n_close_json(act, ticker)
Build a full-position close JSON payload.
Parameters:
act (simple string): "closelong" or "closeshort"
ticker (simple string): syminfo.ticker
Returns: JSON string
n8n_order_pct(qty, price, lev, equity)
Compute order size as percentage of equity.
Parameters:
qty (float): Final order quantity
price (float): Current close
lev (float): Effective leverage
equity (float): strategy.equity
Returns: Rounded percentage to 4 decimals
av_entry_str(user, side, exchange, lev, symbol, ccy, testing)
Build Autoview entry command string.
Uses Pine placeholder '{{strategy.order.contracts}}' for the quantity.
Parameters:
user (simple string): Acct identifier
side (simple string): "long" or "short"
exchange (simple string): Exchange name
lev (float): Leverage value
symbol (simple string): Symbol string
ccy (simple string): "currency" or "contracts"
testing (simple string): "" or " d=1"
Returns: Autoview-formatted command string
av_exit_str(user, side, exchange, symbol, ccy, testing, is_short)
Build Autoview exit command string. Short exits append "%" to qty per v1.0.77.
Parameters:
user (simple string): Acct identifier
side (simple string): "long" or "short"
exchange (simple string): Exchange name
symbol (simple string): Symbol string
ccy (simple string): "currency" or "contracts"
testing (simple string): "" or " d=1"
is_short (simple bool): True if this is a short exit (appends "%")
Returns: Autoview-formatted command string
pc_alert_str(licence_id, symbol)
Build PineConnector CSV alert payload.
Uses Pine placeholders for action and contracts.
Parameters:
licence_id (int): Numeric license ID
symbol (simple string): Symbol with optional suffix (e.g. "EURUSD.a")
Returns: CSV-formatted command string
릴리즈 노트
v2Updated:
n8n_entry_json(act, mode_lower, ticker, tf, price_now, lev, sug_lev, sl_price, liq_price, order_pct, tp1, tp1p, tp1a, tp2, tp2p, tp2a, tp3, tp3p, tp3a, tp4, tp4p, tp4a, tp5, tp5p, tp5a, tp6, tp6p, tp6a)
Build the N8N entry-side JSON payload, byte-identical to v1.0.77 output.
Parameters:
act (string): "buy" or "sell"
mode_lower (string): Execution mode in lowercase (stealth/hybrid/visible)
ticker (string): syminfo.ticker
tf (string): timeframe.period
price_now (float): close
lev (float): Final effective leverage used for the order
sug_lev (float): Suggested leverage from risk-loss calculation
sl_price (float): Stop-loss price (or 0 if none)
liq_price (float): Calculated liquidation price
order_pct (float): Order size as % of equity
tp1 (float)
tp1p (float)
tp1a (bool)
tp2 (float)
tp2p (float)
tp2a (bool)
tp3 (float)
tp3p (float)
tp3a (bool)
tp4 (float)
tp4p (float)
tp4a (bool)
tp5 (float)
tp5p (float)
tp5a (bool)
tp6 (float)
tp6p (float)
tp6a (bool)
Returns: JSON string
n8n_tp_exit_json(act, ticker, tp_idx, tp_pct, pos_size)
Build per-TP exit JSON payload.
Parameters:
act (string): "closelong" or "closeshort"
ticker (string): syminfo.ticker
tp_idx (int): TP number 1..6
tp_pct (float): Exit % for this TP
pos_size (float): math.abs(strategy.position_size)
Returns: JSON string
n8n_close_json(act, ticker)
Build a full-position close JSON payload.
Parameters:
act (string): "closelong" or "closeshort"
ticker (string): syminfo.ticker
Returns: JSON string
av_entry_str(user, side, exchange, lev, symbol, ccy, testing)
Build Autoview entry command string.
Uses Pine placeholder '{{strategy.order.contracts}}' for the quantity.
Parameters:
user (string): Acct identifier
side (string): "long" or "short"
exchange (string): Exchange name
lev (float): Leverage value
symbol (string): Symbol string
ccy (string): "currency" or "contracts"
testing (string): "" or " d=1"
Returns: Autoview-formatted command string
av_exit_str(user, side, exchange, symbol, ccy, testing, is_short)
Build Autoview exit command string. Short exits append "%" to qty per v1.0.77.
Parameters:
user (string): Acct identifier
side (string): "long" or "short"
exchange (string): Exchange name
symbol (string): Symbol string
ccy (string): "currency" or "contracts"
testing (string): "" or " d=1"
is_short (bool): True if this is a short exit (appends "%")
Returns: Autoview-formatted command string
pc_alert_str(licence_id, symbol)
Build PineConnector CSV alert payload.
Uses Pine placeholders for action and contracts.
Parameters:
licence_id (int): Numeric license ID
symbol (string): Symbol with optional suffix (e.g. "EURUSD.a")
Returns: CSV-formatted command string
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
파인 라이브러리
트레이딩뷰의 진정한 정신에 따라, 작성자는 이 파인 코드를 오픈소스 라이브러리로 게시하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 경의를 표합니다! 이 라이브러리는 개인적으로 사용하거나 다른 오픈소스 게시물에서 사용할 수 있지만, 이 코드의 게시물 내 재사용은 하우스 룰에 따라 규제됩니다.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.