StocksDeveloperAlertsLibrary "StocksDeveloperAlerts"
AutoTrader Web alert builder by Stocks Developer — turn TradingView alerts into real broker orders across many accounts and brokers. Ready-made functions for single orders, options the easy way, 8 option structures (straddle/strangle/spreads/iron condor/iron fly), custom multi-leg, account or group targeting, and your own risk limits. No alert-text typing. stocksdeveloper.in
order(symbol, exchange, producttype, tradetype, account, group, lots, quantity, ordertype, price, triggerprice, validity, amo, optiontype, strike, expiry, spothint, usespot, onslicefailure, risk, extra)
Build an alert message for a single order (stock, futures or one option leg). This is the full builder; equity() and option() are shorter wrappers over it. Set exactly one of account/group and exactly one of lots/quantity. Add optiontype to make it an option order.
Parameters:
symbol (string) : (series string) Broker-independent symbol, e.g. "NIFTY", "BANKNIFTY", "SBIN". For options, pass the underlier (e.g. "NIFTY"), not a full contract.
exchange (string) : (series string) Exchange code, e.g. "NSE"/"BSE" for stocks, "NFO" for options and futures.
producttype (string) : (series string) INTRADAY, DELIVERY, NORMAL or MTF.
tradetype (string) : (series string) BUY or SELL.
account (string) : (series string) Place in this single account. Set this OR group.
group (string) : (series string) Place in every live account in this group. Set this OR account.
lots (int) : (series int) Number of lots. Set this OR quantity.
quantity (int) : (series int) Exact quantity. Set this OR lots.
ordertype (string) : (series string) MARKET (default), LIMIT, STOP_LOSS or SL_MARKET.
price (float) : (series float) Limit price (required for LIMIT).
triggerprice (float) : (series float) Trigger price (for stop-loss orders).
validity (string) : (series string) DAY (default) or IOC.
amo (bool) : (series bool) true for an after-market order.
optiontype (string) : (series string) CE for a call, PE for a put. Adding this makes it an option order.
strike (string) : (series string) ATM (default), ATM+1 / ATM-2, OTM / OTM2, ITM / ITM2, or an exact strike like "24500". Requires optiontype.
expiry (string) : (series string) weekly (default), next, monthly, or an exact date like "10-JUL-2026". Requires optiontype.
spothint (string) : (series string) Advanced: a spot price to help option-strike selection.
usespot (bool) : (series bool) Advanced: use the spot hint for strike selection.
onslicefailure (string) : (series string) Advanced: continue (default), alert or retry, if a large order that was auto-split has a slice fail.
risk (string) : (series string) A risk block from risk() — for example risk=atw.risk(maxloss=5000).
extra (string) : (series string) Advanced: any extra "key=value" lines to pass through unchanged (one per line).
Returns: (series string) The ready-to-send alert message.
equity(symbol, exchange, producttype, tradetype, account, group, lots, quantity, ordertype, price, triggerprice, validity, amo, risk, extra)
Build an alert for a single stock or futures order (no option fields). Set exactly one of account/group and exactly one of lots/quantity.
Parameters:
symbol (string) : (series string) Broker-independent symbol, e.g. "SBIN".
exchange (string) : (series string) Exchange code, e.g. "NSE" or "NFO".
producttype (string) : (series string) INTRADAY, DELIVERY, NORMAL or MTF.
tradetype (string) : (series string) BUY or SELL.
account (string) : (series string) Single account. Set this OR group.
group (string) : (series string) Group of accounts. Set this OR account.
lots (int) : (series int) Number of lots. Set this OR quantity.
quantity (int) : (series int) Exact quantity. Set this OR lots.
ordertype (string) : (series string) MARKET (default), LIMIT, STOP_LOSS or SL_MARKET.
price (float) : (series float) Limit price (required for LIMIT).
triggerprice (float) : (series float) Trigger price (for stop-loss orders).
validity (string) : (series string) DAY (default) or IOC.
amo (bool) : (series bool) true for an after-market order.
risk (string) : (series string) A risk block from risk().
extra (string) : (series string) Extra "key=value" lines to pass through unchanged.
Returns: (series string) The ready-to-send alert message.
option(symbol, exchange, producttype, tradetype, optiontype, strike, expiry, account, group, lots, quantity, ordertype, price, triggerprice, validity, amo, spothint, usespot, risk, extra)
Build an option order the easy way — give the underlier and pick the strike + expiry; no need to type the full option symbol. Set exactly one of account/group and exactly one of lots/quantity.
Parameters:
symbol (string) : (series string) The underlier, e.g. "NIFTY", "BANKNIFTY".
exchange (string) : (series string) Options exchange code, e.g. "NFO".
producttype (string) : (series string) INTRADAY, DELIVERY, NORMAL or MTF.
tradetype (string) : (series string) BUY or SELL.
optiontype (string) : (series string) CE for a call, PE for a put.
strike (string) : (series string) ATM (default), ATM+1 / ATM-2, OTM / OTM2, ITM / ITM2, or an exact strike like "24500".
expiry (string) : (series string) weekly (default), next, monthly, or an exact date like "10-JUL-2026".
account (string) : (series string) Single account. Set this OR group.
group (string) : (series string) Group of accounts. Set this OR account.
lots (int) : (series int) Number of lots. Set this OR quantity.
quantity (int) : (series int) Exact quantity. Set this OR lots.
ordertype (string) : (series string) MARKET (default), LIMIT, STOP_LOSS or SL_MARKET.
price (float) : (series float) Limit price (required for LIMIT).
triggerprice (float) : (series float) Trigger price (for stop-loss orders).
validity (string) : (series string) DAY (default) or IOC.
amo (bool) : (series bool) true for an after-market order.
spothint (string) : (series string) Advanced: a spot price to help strike selection.
usespot (bool) : (series bool) Advanced: use the spot hint for strike selection.
risk (string) : (series string) A risk block from risk().
extra (string) : (series string) Extra "key=value" lines to pass through unchanged.
Returns: (series string) The ready-to-send alert message.
straddle(symbol, exchange, producttype, account, group, lots, quantity, expiry, direction, ordertype, price, onlegfailure, risk, extra)
Straddle — buy (or sell) a call and a put at the money. direction "BUY" = long straddle, "SELL" = short straddle.
Parameters:
symbol (string) : (series string) The underlier, e.g. "NIFTY".
exchange (string) : (series string) Options exchange code, e.g. "NFO".
producttype (string) : (series string) INTRADAY, DELIVERY, NORMAL or MTF.
account (string) : (series string) Single account. Set this OR group.
group (string) : (series string) Group of accounts. Set this OR account.
lots (int) : (series int) Number of lots. Set this OR quantity.
quantity (int) : (series int) Exact quantity. Set this OR lots.
expiry (string) : (series string) weekly (default), next, monthly, or an exact date.
direction (string) : (series string) BUY (default) builds the structure as named; SELL flips every leg.
ordertype (string) : (series string) MARKET (default) or LIMIT.
price (float) : (series float) Limit price (required for LIMIT).
onlegfailure (string) : (series string) alert (default), cancel or continue, if one leg cannot be placed.
risk (string) : (series string) A risk block from risk().
extra (string) : (series string) Extra "key=value" lines to pass through unchanged.
Returns: (series string) The ready-to-send alert message.
strangle(symbol, exchange, producttype, account, group, lots, quantity, width, expiry, direction, ordertype, price, onlegfailure, risk, extra)
Strangle — buy (or sell) an out-of-the-money call and put, each 'width' strikes out. direction "BUY" = long strangle, "SELL" = short strangle.
Parameters:
symbol (string) : (series string) The underlier, e.g. "NIFTY".
exchange (string) : (series string) Options exchange code, e.g. "NFO".
producttype (string) : (series string) INTRADAY, DELIVERY, NORMAL or MTF.
account (string) : (series string) Single account. Set this OR group.
group (string) : (series string) Group of accounts. Set this OR account.
lots (int) : (series int) Number of lots. Set this OR quantity.
quantity (int) : (series int) Exact quantity. Set this OR lots.
width (int) : (series int) How far out of the money the legs sit, in strike steps (default 2).
expiry (string) : (series string) weekly (default), next, monthly, or an exact date.
direction (string) : (series string) BUY (default) or SELL (flips every leg).
ordertype (string) : (series string) MARKET (default) or LIMIT.
price (float) : (series float) Limit price (required for LIMIT).
onlegfailure (string) : (series string) alert (default), cancel or continue.
risk (string) : (series string) A risk block from risk().
extra (string) : (series string) Extra "key=value" lines to pass through unchanged.
Returns: (series string) The ready-to-send alert message.
bullCall(symbol, exchange, producttype, account, group, lots, quantity, width, expiry, direction, ordertype, price, onlegfailure, risk, extra)
Bull call spread — buy a call at the money and sell a call 'width' strikes out. Use direction "SELL" to reverse.
Parameters:
symbol (string) : (series string) The underlier, e.g. "NIFTY".
exchange (string) : (series string) Options exchange code, e.g. "NFO".
producttype (string) : (series string) INTRADAY, DELIVERY, NORMAL or MTF.
account (string) : (series string) Single account. Set this OR group.
group (string) : (series string) Group of accounts. Set this OR account.
lots (int) : (series int) Number of lots. Set this OR quantity.
quantity (int) : (series int) Exact quantity. Set this OR lots.
width (int) : (series int) Distance between the two strikes, in strike steps (default 2).
expiry (string) : (series string) weekly (default), next, monthly, or an exact date.
direction (string) : (series string) BUY (default) or SELL (flips every leg).
ordertype (string) : (series string) MARKET (default) or LIMIT.
price (float) : (series float) Limit price (required for LIMIT).
onlegfailure (string) : (series string) alert (default), cancel or continue.
risk (string) : (series string) A risk block from risk().
extra (string) : (series string) Extra "key=value" lines to pass through unchanged.
Returns: (series string) The ready-to-send alert message.
bearPut(symbol, exchange, producttype, account, group, lots, quantity, width, expiry, direction, ordertype, price, onlegfailure, risk, extra)
Bear put spread — buy a put at the money and sell a put 'width' strikes out. Use direction "SELL" to reverse.
Parameters:
symbol (string) : (series string) The underlier, e.g. "NIFTY".
exchange (string) : (series string) Options exchange code, e.g. "NFO".
producttype (string) : (series string) INTRADAY, DELIVERY, NORMAL or MTF.
account (string) : (series string) Single account. Set this OR group.
group (string) : (series string) Group of accounts. Set this OR account.
lots (int) : (series int) Number of lots. Set this OR quantity.
quantity (int) : (series int) Exact quantity. Set this OR lots.
width (int) : (series int) Distance between the two strikes, in strike steps (default 2).
expiry (string) : (series string) weekly (default), next, monthly, or an exact date.
direction (string) : (series string) BUY (default) or SELL (flips every leg).
ordertype (string) : (series string) MARKET (default) or LIMIT.
price (float) : (series float) Limit price (required for LIMIT).
onlegfailure (string) : (series string) alert (default), cancel or continue.
risk (string) : (series string) A risk block from risk().
extra (string) : (series string) Extra "key=value" lines to pass through unchanged.
Returns: (series string) The ready-to-send alert message.
bullPut(symbol, exchange, producttype, account, group, lots, quantity, width, expiry, direction, ordertype, price, onlegfailure, risk, extra)
Bull put spread (credit) — sell a put at the money and buy a put 'width' strikes out. Use direction "SELL" to reverse.
Parameters:
symbol (string) : (series string) The underlier, e.g. "NIFTY".
exchange (string) : (series string) Options exchange code, e.g. "NFO".
producttype (string) : (series string) INTRADAY, DELIVERY, NORMAL or MTF.
account (string) : (series string) Single account. Set this OR group.
group (string) : (series string) Group of accounts. Set this OR account.
lots (int) : (series int) Number of lots. Set this OR quantity.
quantity (int) : (series int) Exact quantity. Set this OR lots.
width (int) : (series int) Distance between the two strikes, in strike steps (default 2).
expiry (string) : (series string) weekly (default), next, monthly, or an exact date.
direction (string) : (series string) BUY (default) or SELL (flips every leg).
ordertype (string) : (series string) MARKET (default) or LIMIT.
price (float) : (series float) Limit price (required for LIMIT).
onlegfailure (string) : (series string) alert (default), cancel or continue.
risk (string) : (series string) A risk block from risk().
extra (string) : (series string) Extra "key=value" lines to pass through unchanged.
Returns: (series string) The ready-to-send alert message.
bearCall(symbol, exchange, producttype, account, group, lots, quantity, width, expiry, direction, ordertype, price, onlegfailure, risk, extra)
Bear call spread (credit) — sell a call at the money and buy a call 'width' strikes out. Use direction "SELL" to reverse.
Parameters:
symbol (string) : (series string) The underlier, e.g. "NIFTY".
exchange (string) : (series string) Options exchange code, e.g. "NFO".
producttype (string) : (series string) INTRADAY, DELIVERY, NORMAL or MTF.
account (string) : (series string) Single account. Set this OR group.
group (string) : (series string) Group of accounts. Set this OR account.
lots (int) : (series int) Number of lots. Set this OR quantity.
quantity (int) : (series int) Exact quantity. Set this OR lots.
width (int) : (series int) Distance between the two strikes, in strike steps (default 2).
expiry (string) : (series string) weekly (default), next, monthly, or an exact date.
direction (string) : (series string) BUY (default) or SELL (flips every leg).
ordertype (string) : (series string) MARKET (default) or LIMIT.
price (float) : (series float) Limit price (required for LIMIT).
onlegfailure (string) : (series string) alert (default), cancel or continue.
risk (string) : (series string) A risk block from risk().
extra (string) : (series string) Extra "key=value" lines to pass through unchanged.
Returns: (series string) The ready-to-send alert message.
ironCondor(symbol, exchange, producttype, account, group, lots, quantity, width, wing, expiry, direction, ordertype, price, onlegfailure, risk, extra)
Iron condor — sell a call and a put 'width' strikes out, and buy a call and a put 'width'+'wing' strikes out as protection. direction "BUY" builds this credit condor; "SELL" reverses it.
Parameters:
symbol (string) : (series string) The underlier, e.g. "NIFTY".
exchange (string) : (series string) Options exchange code, e.g. "NFO".
producttype (string) : (series string) INTRADAY, DELIVERY, NORMAL or MTF.
account (string) : (series string) Single account. Set this OR group.
group (string) : (series string) Group of accounts. Set this OR account.
lots (int) : (series int) Number of lots. Set this OR quantity.
quantity (int) : (series int) Exact quantity. Set this OR lots.
width (int) : (series int) How far out the sold legs sit, in strike steps (default 2).
wing (int) : (series int) Extra distance out to the protective legs, in strike steps (defaults to width).
expiry (string) : (series string) weekly (default), next, monthly, or an exact date.
direction (string) : (series string) BUY (default) or SELL (flips every leg).
ordertype (string) : (series string) MARKET (default) or LIMIT.
price (float) : (series float) Limit price (required for LIMIT).
onlegfailure (string) : (series string) alert (default), cancel or continue.
risk (string) : (series string) A risk block from risk().
extra (string) : (series string) Extra "key=value" lines to pass through unchanged.
Returns: (series string) The ready-to-send alert message.
ironFly(symbol, exchange, producttype, account, group, lots, quantity, wing, expiry, direction, ordertype, price, onlegfailure, risk, extra)
Iron fly — sell a call and a put at the money, and buy a call and a put 'wing' strikes out as protection. direction "BUY" builds this credit fly; "SELL" reverses it.
Parameters:
symbol (string) : (series string) The underlier, e.g. "NIFTY".
exchange (string) : (series string) Options exchange code, e.g. "NFO".
producttype (string) : (series string) INTRADAY, DELIVERY, NORMAL or MTF.
account (string) : (series string) Single account. Set this OR group.
group (string) : (series string) Group of accounts. Set this OR account.
lots (int) : (series int) Number of lots. Set this OR quantity.
quantity (int) : (series int) Exact quantity. Set this OR lots.
wing (int) : (series int) How far out the protective legs sit, in strike steps (default 2).
expiry (string) : (series string) weekly (default), next, monthly, or an exact date.
direction (string) : (series string) BUY (default) or SELL (flips every leg).
ordertype (string) : (series string) MARKET (default) or LIMIT.
price (float) : (series float) Limit price (required for LIMIT).
onlegfailure (string) : (series string) alert (default), cancel or continue.
risk (string) : (series string) A risk block from risk().
extra (string) : (series string) Extra "key=value" lines to pass through unchanged.
Returns: (series string) The ready-to-send alert message.
leg(optiontype, strike, tradetype, multiplier)
Build one option leg string for use with multiLeg(), e.g. atw.leg("CE", "ATM+2", "SELL", 2) -> "CE ATM+2 SELL x2".
Parameters:
optiontype (string) : (series string) CE for a call, PE for a put.
strike (string) : (series string) ATM, ATM+2, OTM2, ITM1, or an exact strike like "24500".
tradetype (string) : (series string) BUY or SELL for this leg.
multiplier (int) : (series int) Size multiplier for this leg (default 1).
Returns: (series string) The leg descriptor.
multiLeg(symbol, exchange, producttype, legs, account, group, lots, quantity, expiry, ordertype, price, onlegfailure, risk, extra)
Build an alert for a fully custom multi-leg order from a list of legs (1 to 10) made with leg(). Set exactly one of account/group and exactly one of lots/quantity.
Parameters:
symbol (string) : (series string) The underlier, e.g. "NIFTY".
exchange (string) : (series string) Options exchange code, e.g. "NFO".
producttype (string) : (series string) INTRADAY, DELIVERY, NORMAL or MTF.
legs (array) : (array) The legs, e.g. array.from(atw.leg("PE","ATM-2","SELL"), atw.leg("PE","ATM-6","BUY")).
account (string) : (series string) Single account. Set this OR group.
group (string) : (series string) Group of accounts. Set this OR account.
lots (int) : (series int) Number of lots. Set this OR quantity.
quantity (int) : (series int) Exact quantity. Set this OR lots.
expiry (string) : (series string) weekly (default), next, monthly, or an exact date.
ordertype (string) : (series string) MARKET (default) or LIMIT.
price (float) : (series float) Limit price (required for LIMIT).
onlegfailure (string) : (series string) alert (default), cancel or continue.
risk (string) : (series string) A risk block from risk().
extra (string) : (series string) Extra "key=value" lines to pass through unchanged.
Returns: (series string) The ready-to-send alert message.
riskLimits(maxloss, forceexit, entrywindow, blockExpiry)
Build a risk-limits block to attach to any order via risk=. Example: risk=atw.riskLimits(maxloss=5000). These are your own limits; see the Alert Automation guide for exactly how each one behaves.
Parameters:
maxloss (float) : (series float) Maximum day loss for the account, in your account currency.
forceexit (string) : (series string) A square-off time as "HH:mm", e.g. "15:15".
entrywindow (string) : (series string) An allowed entry-time window "HH:mm-HH:mm", e.g. "09:30-14:30".
blockExpiry (bool) : (series bool) Block new entries on the instrument's expiry day.
Returns: (series string) The risk lines, ready to pass as risk=. Perpustakaan

Perpustakaan

StrategyWebhookJsonOverview
Open-source Pine library that builds JSON strings for strategy alert_message webhooks. Use it when a strategy should send structured trade signals to an external webhook receiver instead of plain alert text.
What it does
The library formats JSON payloads for three actions:
• open — new position (side, volume, stop loss, take profit, symbol, price)
• close — close by signal id
• modify — update stop loss and take profit for an existing signal id
Each payload includes secret, signalId, action, and symbol (from syminfo.ticker). Optional fields are omitted when not applicable. Strings are JSON-escaped.
Delivery modes (Mode enum)
• LocalOnly — returns an empty string (no JSON in alert_message)
• CloudOnly — returns JSON for webhook alerts
• Both — same as CloudOnly for alert_message output
How to use
1. Import the library into your strategy.
2. Call init(secret, mode) once and store the result in a var Config.
3. Pass the result of openMsg, closeMsg, or modifyMsg to strategy.entry, strategy.close, or strategy.exit via the alert_message parameter.
4. Create a strategy alert and set the webhook URL in TradingView alert settings (TradingView Plus or higher required for webhook URL field).
Example pattern
var cfg = init("YOUR_SECRET", Mode.CloudOnly)
strategy.entry("Long", strategy.long,
alert_message = openMsg(cfg, "Long", "buy", 0.1, sl, tp))
strategy.close("Long",
alert_message = closeMsg(cfg, "Long"))
Requirements
• Pine Script v6
• A strategy script (not an indicator)
• Webhook URL configured on the alert, not inside this library
Notes
signalId should be stable and unique per logical order so close and modify can target the correct open. The secret is included in the JSON body for authentication at the receiver. Perpustakaan

ZT_Webhook_LibCompanion library for the Alpha Flow Zone Trader (AFZT) invite-only indicator. Provides the AFZT webhook payload encoders — formats the AFZT|... pipe-delimited strings the Core script sends in its alert() messages on entry, breakeven, close, and S-event signals.
Exports:
• encode_entry_v1038 — entry-event payload (zone code, base type, confidence, touch count, zone age, entry & stop prices).
• encode_be_v1038 — breakeven-event payload.
• encode_close_v1038 / encode_close_v1041 / encode_close_v1043_v2 — close-event payloads with progressively richer telemetry (R-multiple, MFE/MAE, zone metadata, stop/BE/TP masks, ATR/risk/zone-width).
• encode_signal_v1 / encode_signal_v2 — S-Event signal payload with filter masks (v2 adds 4 upstream ML features: sweep flag, trend bias, HTF direction, liquidity distance).
All exports are pure string-formatting functions — no plots, no alerts, no state mutation. Perpustakaan

Perpustakaan

Perpustakaan

GBB_lib_webhookLibrary "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 Perpustakaan

MaidongAlertLibraryLibrary "MaidongAlertLibrary"
Maidong Alert Library is a Pine Script library built to standardize alert formatting and dispatch across signals, order blocks, setups, and analysis modules.
Instead of building alert text separately inside each part of an indicator, this library centralizes message construction, time formatting, directional labeling, and frequency handling into one reusable component.
Core features:
- Supports `Signal`, `Setup`, `Analysis`, and `Order Block Signal`
- Supports `Bullish` and `Bearish` directional alerts
- Supports both compact and detailed alert output
- Supports timezone-aware timestamp formatting
- Supports common TradingView alert frequency modes
This library is useful when:
- Your script contains multiple modules that all need alerts
- You want a consistent alert format across your ecosystem
- You want to separate alert formatting from indicator logic
AlertSender(condition, alertSetting, alertName, alertType, detectionType, setupData, frequency, utcZone, moreInfo, message, o, h, l, c, entry, tp, sl, distal, proximal)
Parameters:
condition (bool)
alertSetting (string)
alertName (string)
alertType (string)
detectionType (string)
setupData (string)
frequency (string)
utcZone (string)
moreInfo (string)
message (string)
o (float)
h (float)
l (float)
c (float)
entry (float)
tp (float)
sl (float)
distal (float)
proximal (float) Perpustakaan

OrderTicketBuilderLibrary "OrderTicketBuilder"
Assembles broker order ticket payloads as JSON strings.
BuildTicket(licenseId, symbol, action, orderType, tradeType, size, price, tp, sl, risk, trailPrice, trailOffset)
BuildTicket assembles a JSON order ticket string for downstream execution.
Parameters:
licenseId (string) : License identifier
symbol (string) : Symbol to trade
action (string) : "MRKT" or "PENDING"
orderType (string) : "BUY" or "SELL"
tradeType (string) : "SPREAD" or "SINGLE"
size (float) : (Optional) Trade size
price (float) : (Optional) Price for pending orders
tp (float) : (Optional) Take profit
sl (float) : (Optional) Stop loss
risk (float) : (Optional) Percent risk if size unspecified
trailPrice (float) : (Optional) Trailing-stop trigger price
trailOffset (float) : (Optional) Trailing-stop offset
Returns: JSON order ticket string Perpustakaan

SimTradeIndicatorsLibrary "SimTradeIndicators"
SimTrade indicator library — exact parity with Python pipeline (TA-Lib + pandas_ta).
Each function replicates the formula used in base.py / signals.py so that
TradingView charts match the GPU hunt / validator / live engine outputs.
Formula sources:
TA-Lib → RSI, ATR, EMA, MACD, CCI, Stoch, WILLR, MFI, ADX, PSAR, OBV, BBANDS, AROON, PPO, AD
pandas_ta → SuperTrend, Vortex, Ichimoku, Donchian, HMA, TSI, CMF, EFI, CHOP, Heikin-Ashi
Manual → Keltner (EMA+ATR Wilder), TTM Squeeze, Chandelier Exit, VWAP reset, Pivot Points
Known intentional deviations (documented):
- Stoch trigger 11 uses Full %D (double-smoothed), not single %K
- OBV filter 206 uses windowed 800-bar OBV (GPU-aligned, not cumulative)
- Pivot Points use rolling window, not session-based (see pivot_pp notes)
- EMA has longer warmup in TA-Lib (~50 bars unstable period) vs TW (from bar 1); steady-state identical
smma(src, length)
SMMA / Wilder RMA. alpha = 1/length. Matches talib "RMA" used for ATR/RSI internally.
Parameters:
src (float) : Source series
length (simple int) : Period
Returns: RMA value
hma(src, length)
HMA (Hull Moving Average). HMA = WMA(2·WMA(N/2) − WMA(N), √N). Matches pandas_ta.hma.
Parameters:
src (float) : Source series
length (simple int) : Period
Returns: HMA value
dema(src, length)
DEMA (Double EMA) = 2·EMA − EMA(EMA). Matches talib.DEMA.
Parameters:
src (float) : Source series
length (simple int) : Period
Returns: DEMA value
tema(src, length)
TEMA (Triple EMA) = 3·EMA − 3·EMA² + EMA³. Matches talib.TEMA.
Parameters:
src (float) : Source series
length (simple int) : Period
Returns: TEMA value
atr_wilder(length)
ATR using Wilder RMA. Identical to talib.ATR and TW ta.atr.
Parameters:
length (simple int) : Period (default 14)
Returns: ATR value
atr_percentile_pct(length, lookback)
ATR percentile rank over a rolling window. Matches Python vol_filter 201.
Logic: for each bar count how many ATR values in are <= current ATR,
return that fraction as 0..100. Warmup bars (< lookback + length) return 50.0.
Parameters:
length (simple int) : ATR period / Wilder RMA (default 14). Matches params .
lookback (simple int) : Rolling window for percentile rank (default 30). Matches params .
Returns: Percentile rank 0..100 (pass filter when >= pct_min / params )
bbands(src, length, mult)
Bollinger Bands. Returns .
mid = SMA. Matches talib.BBANDS (matype=0 = SMA).
Parameters:
src (float) : Source series (typically close)
length (simple int) : Period (default 20)
mult (float) : Standard deviation multiplier (default 2.0)
Returns:
bb_pctb(src, length, mult)
Bollinger Bands %B = (close − lower) / (upper − lower).
Returns 0.5 during warmup (matches Python _nan50 fallback in base.bb_pctb).
Parameters:
src (float) : Source series
length (simple int) : Period (default 20)
mult (float) : Multiplier (default 2.0)
Returns: %B value
bb_width_x1000(src, length, mult)
BB bandwidth × 1000 / mid. Used by vol filter 202 (bb_width).
Parameters:
src (float) : Source series
length (simple int) : Period (default 20)
mult (float) : Multiplier (default 2.0)
Returns: (upper − lower) / |mid| × 1000
keltner(ema_period, atr_period, mult)
Keltner Channel. mid = EMA(close, ema_period), band = ATR(atr_period) Wilder RMA.
IMPORTANT: this is the TW-standard formula. NOT pandas_ta kc(mamode="ema") which uses EMA(TR).
That version produces ~40% narrower bands than TW. This library uses the correct RMA(ATR) band.
Parameters:
ema_period (simple int) : EMA period for midline (default 20)
atr_period (simple int) : ATR period for band width (default 10)
mult (float) : ATR multiplier (default 1.5)
Returns:
keltner_width_x1000(period, mult)
Keltner Channel bandwidth × 1000 / mid. Used by vol filter 204 (keltner_width).
Parameters:
period (simple int) : Period for both EMA and ATR (default 20)
mult (float) : ATR multiplier (default 1.5)
Returns: (upper − lower) / |mid| × 1000
choppiness(length)
Choppiness Index. CHOP = 100·log10(Σ ATR1 / (HH − LL)) / log10(N).
Matches pandas_ta.chop and TW built-in CHOP. Returns 50.0 during warmup.
Parameters:
length (simple int) : Period (default 14)
Returns: CHOP value
rsi_val(src, length)
RSI using Wilder RMA. Identical to talib.RSI and TW ta.rsi.
Returns 50.0 during warmup (matches Python _nan50 fallback).
Parameters:
src (float) : Source series (typically close)
length (simple int) : Period (default 14)
Returns: RSI value
cci_val(length)
CCI = (typical − SMA(typical)) / (0.015 · mean_deviation). Matches talib.CCI.
Returns 0.0 during warmup (matches Python _nan0 fallback).
Parameters:
length (simple int) : Period (default 20)
Returns: CCI value
stoch_raw_k(k_period)
Stochastic raw %K (no smoothing). Matches base.stoch_k (talib slowk_period=1).
NOTE: TW ta.stoch default smooths %K with SMA(3). This is the unsmoothed fast %K.
Used by filter 103 (stoch_k_below).
Parameters:
k_period (simple int) : Lookback period (default 14)
Returns: Raw %K (50.0 during warmup)
stoch_full_d(k_period, d_period)
Full Stochastic %D = SMA(SMA(raw%K, d_period), d_period). Matches talib.STOCH output.
Used by trigger 11 (stoch_cross). NOT single-smoothed %K — lag is +2-3 bars vs TW default.
Parameters:
k_period (simple int) : Raw %K lookback (default 14)
d_period (simple int) : Smoothing applied twice (default 3)
Returns: Full Stochastic %D (50.0 during warmup)
williams_r(length)
Williams %R = −100 · (HH − close) / (HH − LL). Matches talib.WILLR.
Range: −100 to 0. Returns −50.0 during warmup.
Parameters:
length (simple int) : Period (default 14)
Returns: Williams %R value
mfi_val(length)
MFI (Money Flow Index). Matches talib.MFI.
Returns 50.0 during warmup.
Parameters:
length (simple int) : Period (default 14)
Returns: MFI value
macd_val(src, fast, slow, signal_period)
MACD. Returns . Identical to talib.MACD.
All NaN values replaced with 0.0 (matches Python _nan0).
Parameters:
src (float) : Source series
fast (simple int) : Fast EMA period (default 12)
slow (simple int) : Slow EMA period (default 26)
signal_period (simple int) : Signal EMA period (default 9)
Returns:
ppo_val(src, fast, slow)
PPO = (EMA(fast) − EMA(slow)) / EMA(slow) × 100. Matches talib.PPO.
Returns 0.0 during warmup.
Parameters:
src (float) : Source series
fast (simple int) : Fast period (default 12)
slow (simple int) : Slow period (default 26)
Returns: PPO value
tsi_val(src, long_period, short_period)
TSI (True Strength Index). Matches pandas_ta.tsi parameter order.
TSI = 100 · EMA(EMA(Δclose, slow), fast) / EMA(EMA(|Δclose|, slow), fast)
slow is the OUTER (first) smoothing, fast is the INNER (second). Same as TW.
Parameters:
src (float) : Source series
long_period (simple int) : Outer (slow) EMA period (default 25)
short_period (simple int) : Inner (fast) EMA period (default 13)
Returns: TSI value (0.0 during warmup)
adx_di(length)
ADX + DI lines. Returns . Matches talib.ADX/PLUS_DI/MINUS_DI.
Uses Wilder RMA (identical to TW ta.dmi / ta.adx).
Parameters:
length (simple int) : Period (default 14)
Returns: — 0.0 during warmup
supertrend_val(length, mult)
SuperTrend direction and value. Matches pandas_ta.supertrend (RMA ATR).
Returns : direction = 1 (bull) or −1 (bear).
Parameters:
length (simple int) : ATR period (default 10)
mult (float) : ATR multiplier (default 3.0)
Returns:
psar_val(start, inc, max_af)
Parabolic SAR. Returns . Matches talib.SAR.
direction = 1 if close > SAR (bull), −1 bear.
Parameters:
start (simple float) : Initial AF / step (default 0.02)
inc (simple float) : AF increment per bar (default 0.02)
max_af (simple float) : Maximum AF cap (default 0.2)
Returns:
aroon_val(length)
Aroon Up and Down. Returns . Matches talib.AROON.
ta.aroon does not exist in Pine v6 — computed manually:
Aroon Up = (length − bars since highest high over length+1 bars) / length × 100
Aroon Down = (length − bars since lowest low over length+1 bars) / length × 100
This is identical to talib.AROON and TradingView's built-in Aroon indicator.
Returns 50.0 during warmup (matches Python _nan50).
Parameters:
length (simple int) : Period (default 25)
Returns:
vortex_diff(length)
Vortex Indicator difference (VI+ − VI−). Matches base.vortex.
Positive = bullish regime, negative = bearish. Returns 0.0 during warmup.
Parameters:
length (simple int) : Period (default 14)
Returns: VI+ minus VI−
linreg_slope(src, length)
Linear Regression Slope. Matches talib.LINEARREG_SLOPE exactly.
Computes OLS slope for x = 0..N-1 (oldest=0, newest=N-1).
Positive = uptrend, negative = downtrend. Returns 0.0 during warmup.
Parameters:
src (float) : Source series
length (simple int) : Period (default 20)
Returns: Slope value
obv_val()
OBV (On-Balance Volume). Cumulative. Matches talib.OBV.
Returns: Cumulative OBV
vwap_reset(reset_bars)
VWAP with periodic session reset. Matches base.vwap(reset_bars).
reset_bars=24 on H1 ≈ daily VWAP (crypto 24/7). reset_bars=6 on H4 ≈ daily.
reset_bars=0 uses TW built-in ta.vwap (session anchor).
Parameters:
reset_bars (simple int) : Bars per session (0 = TW session anchor, 24 = H1 daily, 6 = H4 daily)
Returns: VWAP value
cmf_val(length)
CMF (Chaikin Money Flow) = Σ(CLV·vol) / Σvol. Matches pandas_ta.cmf.
CLV = ((close − low) − (high − close)) / (high − low). Returns 0.0 during warmup.
Parameters:
length (simple int) : Period (default 20)
Returns: CMF value (−1 to 1)
ad_val()
Accumulation/Distribution Line. Matches talib.AD.
Returns: Cumulative A/D value
efi_val(length)
EFI (Elder Force Index). EFI = EMA((close − close ) · volume, length).
Matches pandas_ta.efi. Returns 0.0 during warmup.
Parameters:
length (simple int) : EMA period (default 13)
Returns: EFI value
ichimoku_val(tenkan_period, kijun_period, senkou_b_period)
Ichimoku lines. Returns .
Matches pandas_ta.ichimoku with CORRECTED column mapping (ISA, ISB, ITS, IKS, ICS).
senkou_a/b are plotted 26 bars AHEAD in TW — values here are for current bar alignment.
Parameters:
tenkan_period (simple int) : Tenkan-sen period (default 9)
kijun_period (simple int) : Kijun-sen period (default 26)
senkou_b_period (simple int) : Senkou B period (default 52)
Returns:
donchian_val(length)
Donchian Channel. Returns .
upper = highest(high, N), lower = lowest(low, N). Matches pandas_ta.donchian.
NOTE: lookback may differ ±1 bar from TA-Lib; consistent across all pipeline stages.
Trigger 37 (donchian_break) compares close > upper — use upper in Pine.
Parameters:
length (simple int) : Period (default 20)
Returns:
ttm_squeeze_val(bb_period, bb_mult, kc_period, kc_mult)
TTM Squeeze. Returns .
squeeze_on: BB inside KC (volatility compression).
momentum: ta.linreg(close − (donchian_mid + SMA) / 2, bb_period)
EXACT match with John Carter formula and base.ttm_squeeze after fix.
Parameters:
bb_period (simple int) : BB period (default 20)
bb_mult (float) : BB multiplier (default 2.0)
kc_period (simple int) : KC period — same for EMA midline and ATR band (default 20)
kc_mult (float) : KC ATR multiplier (default 1.5)
Returns:
chandelier_val(period, mult)
Chandelier Exit. Returns .
long_exit = highest(high, period) − mult · ATR(period)
short_exit = lowest(low, period) + mult · ATR(period)
Exact match with base.chandelier_exit. Both include current bar in rolling max/min.
Trigger 45 fires when close crosses long_exit or short_exit (up = bull, down = bear).
Parameters:
period (simple int) : Lookback and ATR period (default 22)
mult (float) : ATR multiplier (default 3.0)
Returns:
ha_close()
Heikin Ashi close. HA_close = (open + high + low + close) / 4. Matches pandas_ta.ha.
Returns: HA close value
ha_open()
Heikin Ashi open. HA_open = (HA_open + HA_close ) / 2.
Trigger 48 fires on HA candle color flip: HA_close vs HA_open.
Returns: HA open value
pivot_pp(period)
Rolling Pivot Point (floor method). Matches base.pivot_points.
pp = (max(high, period bars ago) + min(low, period bars ago) + close ) / 3
NOTE: Rolling window, NOT session-based. H1 default period=24 ≈ 1 day (crypto 24/7).
For H4 set period=6 (6 × 4h = 1 day). TW Pivot Points use session H/L/C — differs.
Parameters:
period (simple int) : Rolling lookback (default 24)
Returns: Pivot point value
pivot_r1_s1(period)
Rolling R1 and S1 levels. Matches base.pivot_points r1/s1.
r1 = 2·pp − lowest_low, s1 = 2·pp − highest_high
Parameters:
period (simple int) : Rolling lookback (default 24)
Returns: Perpustakaan

fpa_unified_libLibrary "fpa_unified_lib"
lineStyle(styleText)
Parameters:
styleText (string)
labelSize(sizeText)
Parameters:
sizeText (string)
normalizeSession(sessionInput, hideWeekends)
Parameters:
sessionInput (string)
hideWeekends (bool)
isSessionActive(sessionInput, timezoneInput)
Parameters:
sessionInput (string)
timezoneInput (string)
tfInRange(lowTf, highTf)
Parameters:
lowTf (string)
highTf (string)
parseTradingDayOpenMinutes(sessionInput)
Parameters:
sessionInput (string)
safeColor(c, transp)
Parameters:
c (color)
transp (int)
updateRay(lineRef, shouldShow, startBarIndex, yPrice, lineColor, lineWidth, lineStyleText, rightOffsetBars, lookbackBars)
Parameters:
lineRef (line)
shouldShow (bool)
startBarIndex (int)
yPrice (float)
lineColor (color)
lineWidth (int)
lineStyleText (string)
rightOffsetBars (int)
lookbackBars (int)
updateLabel(labelRef, shouldShow, yPrice, textValue, labelColor, rightOffsetBars, sizeText)
Parameters:
labelRef (label)
shouldShow (bool)
yPrice (float)
textValue (string)
labelColor (color)
rightOffsetBars (int)
sizeText (string)
trimLines(arr, limit)
Parameters:
arr (array)
limit (int)
trimLabels(arr, limit)
Parameters:
arr (array)
limit (int)
parseFloatList(textArea)
Parameters:
textArea (string) Perpustakaan

Perpustakaan

VoltRouter Webhook BuilderBuild TradingView alert webhook payloads for VoltRouter — a signal routing service that executes your TradingView strategy alerts directly at your broker. $0.07/signal, pay-as-you-go, no subscription required .
Supports: market, limit, stop, bracket (TP+SL), trailing stop, FLAT, and cancel-all.
How to use:
1. Sign up at voltrouter.com and connect your broker
2. Import this library in your strategy
3. Paste the output into a TradingView alert → Webhook URL field
Setup: voltrouter.com
import VoltRouterWebhook as vr
// In your strategy alert message field:
vr.market("MNQM26", "buy", 1, "ibkr", "my_strategy")
vr.bracket("MNQM26", "sell", 1, close + 10, close - 5)
vr.flat("MNQM26") Perpustakaan

Vantage_PickMyTrade_IntegrationVantage_PickMyTrade_Integration — Webhook integration library for Pine Script strategies routing orders through PickMyTrade.
─────────────────────────────────────────
WHAT IT DOES
Constructs and emits JSON webhook payloads in the PickMyTrade format. The library provides a strongly-typed Pine Script interface and emits the alert for you, so your strategy never has to hand-build JSON strings, remember exact field values, or track which fields are conditional.
─────────────────────────────────────────
WHAT IT PROVIDES
Strong types for every PickMyTrade enumeration — order actions (buy / sell / close), order types (market / limit / stop / stop-limit), and bracket-mode specification (price / dollar / percent). Using a typed enum catches typos at compile time.
High-level send functions covering the common order patterns — a stop entry with bracket (pre-placed at the exchange), a market or limit entry with bracket, targeted close by comment tag, a full-flatten for a symbol, and in-place SL/TP modification on an existing position. All share a single underlying builder that handles field ordering, conditional fields, and token-in-body authentication.
─────────────────────────────────────────
HOW TO USE
A complete example call is in the comment block at the top of the source file — import the library, copy the pattern, adjust to your strategy. Hover any exported type or function in the Pine Editor for per-parameter documentation. Perpustakaan

Vantage_TradersPostVantage_TradersPost — Webhook integration library for Pine Script strategies routing orders through TradersPost.
─────────────────────────────────────────
WHAT IT DOES
Constructs and emits JSON webhook payloads in the TradersPost format. The library provides a strongly-typed Pine Script interface and emits the alert for you, so your strategy never has to hand-build JSON strings, remember exact enum values, or track which fields are conditional.
─────────────────────────────────────────
WHAT IT PROVIDES
Strong types for every TradersPost enumeration — order actions, order types, quantity types, position sentiment, stop-loss types, time-in-force, and the options fields. Using a typed enum in your strategy catches typos at compile time instead of at trade time.
High-level send functions covering the common order patterns — a single-call bracket (entry + TP + SL), an advanced send with every TradersPost field exposed, a no-cancel variant, a sentiment-based position-management send, a cancel-all, and two-leg OTO and OCO helpers.
─────────────────────────────────────────
HOW TO USE
A complete example call is in the comment block at the top of the source file — import the library, copy the pattern, adjust to your strategy. Hover any exported type or function in the Pine Editor for per-parameter documentation.
─────────────────────────────────────────
Maintenance of this library was taken over at the request of adam_overton. Perpustakaan

AvwapLibLibrary "AvwapLib"
Shared functions: AVWAP, stage classification, position sizing,
swing detection, and risk helpers. Used by all strategy() scripts.
NOTE: rs_vs_spy() cannot live here (request.security() banned in
library exports) — each strategy implements it inline.
avwap(src, anchor_bar, max_lookback)
Anchored VWAP from a specific bar to current bar.
Uses loop approach with bounded max_lookback for robustness.
Parameters:
src (float) : Source price (typically hlc3)
anchor_bar (int) : Bar index of anchor point (from find_swing_high/low)
max_lookback (simple int) : Maximum bars to look back (cap for performance, default 500 ~2yr daily)
Returns: AVWAP value, or na if anchor invalid or out of range
avwap_slope(avwap_val, lookback)
AVWAP slope — rate of change over lookback period.
Parameters:
avwap_val (float) : AVWAP series
lookback (simple int) : Number of bars for slope calculation
Returns: Slope (positive = rising, negative = falling), or na
dcr()
Daily Closing Range — where price closed within the bar's range.
Returns: DCR as percentage (0 = closed at low, 100 = closed at high)
rvol(period)
Relative Volume — current bar volume vs historical average.
Uses volume offset to avoid including current bar in average.
Parameters:
period (simple int) : Lookback period for average calculation
Returns: RVOL ratio (>1 = above average)
is_stage2()
Stage 2 check (simplified Weinstein model).
Conditions: price > SMA50, SMA50 rising (vs 10 bars ago), price > SMA200.
Returns: true if all Stage 2 conditions met
calc_shares(entry, stop, risk_pct, equity)
Position size: shares = floor(equity * risk% / risk_per_share).
Parameters:
entry (float) : Entry price
stop (float) : Stop-loss price
risk_pct (float) : Risk as decimal (0.01 = 1%)
equity (float) : Account equity
Returns: Number of shares (integer), 0 if invalid
rr_valid(entry, stop, target, min_rr)
Validate risk/reward ratio meets minimum threshold.
Parameters:
entry (float) : Entry price
stop (float) : Stop-loss price
target (float) : Target price
min_rr (float) : Minimum required R:R (e.g., 2.0 for 1:2)
Returns: true if R:R >= min_rr
confirmed()
Returns true only on confirmed (closed) bars.
MUST gate every entry/exit signal to prevent repainting.
Returns: true if bar is confirmed
find_swing_high(strength)
Bar index of the most recent confirmed swing high.
Uses ta.pivothigh — confirmed 'strength' bars after the actual high.
Result persists (via var) until a new swing high is detected.
Parameters:
strength (simple int) : Number of bars required on each side to confirm pivot
Returns: Bar index of last swing high, or na if none found yet
find_swing_low(strength)
Bar index of the most recent confirmed swing low.
Uses ta.pivotlow — confirmed 'strength' bars after the actual low.
Result persists (via var) until a new swing low is detected.
Parameters:
strength (simple int) : Number of bars required on each side to confirm pivot
Returns: Bar index of last swing low, or na if none found yet Perpustakaan

Perpustakaan

Perpustakaan

Perpustakaan

Lib_Sw_SignalsLibrary "Lib_Sw_Signals"
checkPivotCross_Anlik(sysEn, lvlEn, active, inPos, pVal)
Parameters:
sysEn (bool) : Pivot system active
lvlEn (bool) : This level active
active (bool) : This pivot active (reactivated)
inPos (bool) : Already entered from this pivot
pVal (float) : Pivot price value
Returns: Pivot triggered
checkPivotCross_MumKapanisi(sysEn, lvlEn, active, inPos, pVal, isLong)
Parameters:
sysEn (bool)
lvlEn (bool)
active (bool)
inPos (bool)
pVal (float)
isLong (bool)
checkPivotReactivate(sysEn, pVal, isLong)
Parameters:
sysEn (bool)
pVal (float)
isLong (bool)
checkPivotCross(mode, sysEn, lvlEn, active, inPos, pVal, isLong)
Parameters:
mode (string) : 'Anlık' (Instant) or 'Mum Kapanışı' (Bar Close)
sysEn (bool)
lvlEn (bool)
active (bool)
inPos (bool)
pVal (float)
isLong (bool)
Returns: Pivot triggered
f_calcMACD(cfg, flagsL, flagsS)
Parameters:
cfg (MACDConfig) : MACD configuration
flagsL (MACDTrigFlags) : Long trigger flags
flagsS (MACDTrigFlags) : Short trigger flags
Returns:
allowSignal(enabled, src, lvl, rule)
Parameters:
enabled (bool) : Filter active
src (float) : Source value
lvl (float) : Comparison level
rule (string) : 'Altında Engelle' (Block Below) or 'Üstünde Engelle' (Block Above)
Returns: true = signal allowed
allowPriceSignal(enabled, line, rule)
Parameters:
enabled (bool)
line (float)
rule (string)
allowZoneSignal(enabled, zoneSrc)
Parameters:
enabled (bool)
zoneSrc (float) : >= 0.5 means zone is active (entry allowed)
Returns: true = signal allowed
allowLineRangeDual(enabled, lineLevel, pctAbove, pctBelow, modeAbove, modeBelow)
Parameters:
enabled (bool) : Filter active
lineLevel (float) : Line price level
pctAbove (float) : Above % threshold
pctBelow (float) : Below % threshold
modeAbove (string) : 'Eşik İçi' (Inside) or 'Eşik Dışı' (Outside)
modeBelow (string) : 'Eşik İçi' (Inside) or 'Eşik Dışı' (Outside)
Returns: true = signal allowed
blockPass(mode, e1, p1, e2, p2, e3, p3, eZ, pZ)
Parameters:
mode (string) : 'AND' or 'OR'
e1 (bool) : Blocker 1 enabled
p1 (bool) : Blocker 1 passed
e2 (bool) : Blocker 2 enabled
p2 (bool) : Blocker 2 passed
e3 (bool) : Blocker 3 enabled
p3 (bool) : Blocker 3 passed
eZ (bool) : Zone enabled
pZ (bool) : Zone passed
Returns: true = signal allowed
checkSignalInstant(use, src)
Parameters:
use (bool) : Source active
src (float) : Source value (0 = no signal)
Returns: true = signal exists
detectTick(use, currentVal, lastVal, prevBarVal)
Parameters:
use (bool) : Source active
currentVal (float) : Current source value
lastVal (float) : Last recorded value (held with varip)
prevBarVal (float) : Previous bar value (src )
Returns: true = new signal tick detected
zoneOrCombine(enableArray, passArray)
Parameters:
enableArray (array) : bool array: Active states
passArray (array) : bool array: Pass results
Returns: true = all filters passed (or none active)
ppZoneBlock(blockEnable, blockMode, inZone, checkSide)
Parameters:
blockEnable (bool) : Block active
blockMode (string) : 'Long', 'Short', 'Her İkisi' (Both)
inZone (bool) : Is in zone (src >= 0.5)
checkSide (string) : 'Long' or 'Short' - checked direction
Returns: true = signal BLOCKED
anySignalActive(signals)
Parameters:
signals (array) : array: 7 signal slots + pivot + MACD latch results
Returns: true = at least one signal active
finalTrigger(rawTrigger, blockPassResult, zoneCombined, pivotDistPass, ppZoneBlocked)
Parameters:
rawTrigger (bool) : Raw signal (before filters)
blockPassResult (bool) : BlockPass result
zoneCombined (bool) : Zone OR combination
pivotDistPass (bool) : Pivot distance filter
ppZoneBlocked (bool) : PP zone blocked
Returns: true = signal valid (all filters passed)
MACDConfig
Fields:
oscType (series string)
fast (series int)
slow (series int)
sig (series int)
sigType (series string)
l1 (series float)
l2 (series float)
l3 (series float)
l4 (series float)
l5 (series float)
MACDTrigFlags
Fields:
crossUP (series bool)
crossDN (series bool)
ml1U (series bool)
ml1D (series bool)
ml2U (series bool)
ml2D (series bool)
ml3U (series bool)
ml3D (series bool)
ml4U (series bool)
ml4D (series bool)
ml5U (series bool)
ml5D (series bool)
sl1U (series bool)
sl1D (series bool)
sl2U (series bool)
sl2D (series bool)
sl3U (series bool)
sl3D (series bool)
sl4U (series bool)
sl4D (series bool)
sl5U (series bool)
sl5D (series bool)
SignalSlot
Fields:
use (series bool)
src (series float)
srcPrice (series float)
BlockerConfig
Fields:
enable (series bool)
src (series float)
level (series float)
rule (series string)
LineBlockerConfig
Fields:
enable (series bool)
src (series float)
pctAbove (series float)
pctBelow (series float)
modeAbove (series string)
modeBelow (series string)
ZoneBlocker
Fields:
enable (series bool)
src (series float) Perpustakaan

Lib_SW_AlertsLibrary "Lib_SW_Alerts"
buildCode(action, cfg)
Parameters:
action (string) : Action code (e.g., 'ENTER-LONG', 'EXIT-SHORT', etc.)
cfg (BotConfig) : Bot configuration
Returns: Formatted code string
buildMPTPSL(tpsl)
Parameters:
tpsl (AlertTPSL) : TP/SL configuration
Returns: JSON string (,"takeProfits": ,"stopLoss":{...})
enterLong(cfg, amount, tpsl)
Parameters:
cfg (BotConfig) : Bot configuration
amount (float) : Trade amount (USDT)
tpsl (AlertTPSL) : TP/SL configuration (for MP mode, if na not added)
Returns: JSON string
enterShort(cfg, amount, tpsl)
Parameters:
cfg (BotConfig) : Bot configuration
amount (float) : Trade amount (USDT)
tpsl (AlertTPSL) : TP/SL configuration (for MP mode)
Returns: JSON string
exitLong(cfg)
Parameters:
cfg (BotConfig) : Bot configuration
Returns: JSON string
exitShort(cfg)
Parameters:
cfg (BotConfig) : Bot configuration
Returns: JSON string
exitLongPartial(cfg, totalNotional, pctClose)
Parameters:
cfg (BotConfig) : Bot configuration
totalNotional (float) : Current total position volume
pctClose (float) : Percentage to close (100 = full)
Returns: JSON string
exitShortPartial(cfg, totalNotional, pctClose)
Parameters:
cfg (BotConfig) : Bot configuration
totalNotional (float) : Current total position volume
pctClose (float) : Percentage to close
Returns: JSON string
buildTPSL_Normal(tp1_pct, tp1_port, tp2_pct, tp2_port, tp3_pct, tp3_port, sl_pct)
Parameters:
tp1_pct (float)
tp1_port (float)
tp2_pct (float)
tp2_port (float)
tp3_pct (float)
tp3_port (float)
sl_pct (float)
buildTPSL_DCA(dca_tp1_pct, dca_tp1_port, dca_tp2_pct, dca_tp2_port, dca_tp3_pct, dca_tp3_port, dca_sl_pct)
Parameters:
dca_tp1_pct (float)
dca_tp1_port (float)
dca_tp2_pct (float)
dca_tp2_port (float)
dca_tp3_pct (float)
dca_tp3_port (float)
dca_sl_pct (float)
selectTPSL(level, normalTPSL, dcaTPSL)
Parameters:
level (int) : Current DCA level
normalTPSL (AlertTPSL) : Normal entry TP/SL
dcaTPSL (AlertTPSL) : DCA entry TP/SL
Returns: Appropriate AlertTPSL
formatPnL(pnl)
Parameters:
pnl (float) : PnL value
Returns: Formatted string
formatPct(pct)
Parameters:
pct (float) : Percentage value
Returns: Formatted string
formatPrice(price)
Parameters:
price (float) : Price value
Returns: Formatted string
buildEntryLabel(isLong, level, price, amount, leverage)
Parameters:
isLong (bool) : Is Long
level (int) : DCA level
price (float) : Entry price
amount (float) : Trade amount
leverage (int) : Leverage
Returns: (emoji) Level - price - amount
buildTPLabel(isLong, tpNum, price, pnl, isDCA)
Parameters:
isLong (bool) : Is Long
tpNum (int) : TP number (1, 2, 3)
price (float) : Exit price
pnl (float) : PnL value
isDCA (bool) : Is DCA TP
Returns: Formatted label string
buildSLLabel(isLong, price, pnl, isTrailing)
Parameters:
isLong (bool)
price (float)
pnl (float)
isTrailing (bool)
buildForceExitLabel(isLong, price, pnl)
Parameters:
isLong (bool)
price (float)
pnl (float)
buildSwingLabel(isLong, price, pnl)
Parameters:
isLong (bool)
price (float)
pnl (float)
swb_secretPart(cfg)
Parameters:
cfg (SWBotConfig)
swb_base(cfg, action)
Parameters:
cfg (SWBotConfig) : SWBot configuration
action (string) : Action type ('BUY', 'SELL', 'CLOSE_LONG', etc.)
Returns: JSON start
swb_buy(cfg, lotSize, slPrice)
Parameters:
cfg (SWBotConfig) : SWBot configuration
lotSize (float) : Lot amount
slPrice (float) : SL price (if na, SL not added)
Returns: JSON string
swb_sell(cfg, lotSize, slPrice)
Parameters:
cfg (SWBotConfig) : SWBot configuration
lotSize (float) : Lot amount
slPrice (float) : SL price (if na, SL not added)
Returns: JSON string
swb_buy_tpsl(cfg, lotSize, slPips, tpPips)
Parameters:
cfg (SWBotConfig)
lotSize (float)
slPips (float) : SL distance (pips)
tpPips (float) : TP distance (pips)
Returns: JSON string
swb_sell_tpsl(cfg, lotSize, slPips, tpPips)
Parameters:
cfg (SWBotConfig)
lotSize (float)
slPips (float)
tpPips (float)
swb_closeLong(cfg)
Parameters:
cfg (SWBotConfig)
swb_closeShort(cfg)
Parameters:
cfg (SWBotConfig)
swb_closeLongPartial(cfg, lotToClose)
Parameters:
cfg (SWBotConfig)
lotToClose (float) : Lot amount to close
swb_closeShortPartial(cfg, lotToClose)
Parameters:
cfg (SWBotConfig)
lotToClose (float)
swb_amendLong(cfg, slPrice, tpPrice)
Parameters:
cfg (SWBotConfig)
slPrice (float) : New SL price
tpPrice (float) : New TP price
swb_amendShort(cfg, slPrice, tpPrice)
Parameters:
cfg (SWBotConfig)
slPrice (float)
tpPrice (float)
swb_amendSLLong(cfg, slPrice)
Parameters:
cfg (SWBotConfig)
slPrice (float)
swb_amendSLShort(cfg, slPrice)
Parameters:
cfg (SWBotConfig)
slPrice (float)
swb_amendTrailingLong(cfg, slPrice)
Parameters:
cfg (SWBotConfig)
slPrice (float) : SL price (broker trailing start point)
swb_amendTrailingShort(cfg, slPrice)
Parameters:
cfg (SWBotConfig)
slPrice (float)
exchA_openLong(cfg, qtyInCoin)
Parameters:
cfg (ExchangeConfigA) : configuration
qtyInCoin (float) : Trade amount in Coin
exchA_openShort(cfg, qtyInCoin)
Parameters:
cfg (ExchangeConfigA)
qtyInCoin (float)
exchA_closeLong(cfg)
Parameters:
cfg (ExchangeConfigA)
exchA_closeShort(cfg)
Parameters:
cfg (ExchangeConfigA)
exchA_closeLongPartial(cfg, pct)
Parameters:
cfg (ExchangeConfigA)
pct (float)
exchA_closeShortPartial(cfg, pct)
Parameters:
cfg (ExchangeConfigA)
pct (float)
exchB_base(cfg)
Parameters:
cfg (ExchangeConfigB)
exchB_openLong(cfg, qtyInCoin)
Parameters:
cfg (ExchangeConfigB)
qtyInCoin (float)
exchB_openShort(cfg, qtyInCoin)
Parameters:
cfg (ExchangeConfigB)
qtyInCoin (float)
exchB_closeLong(cfg, qtyInCoin)
Parameters:
cfg (ExchangeConfigB)
qtyInCoin (float)
exchB_closeShort(cfg, qtyInCoin)
Parameters:
cfg (ExchangeConfigB)
qtyInCoin (float)
exchB_closeLongPartial(cfg, partialQty)
Parameters:
cfg (ExchangeConfigB)
partialQty (float)
exchB_closeShortPartial(cfg, partialQty)
Parameters:
cfg (ExchangeConfigB)
partialQty (float)
BotConfig
Fields:
exchangeName (series string)
symbolInput (series string)
botName (series string)
tfStr (series string)
botID (series string)
useMultiPair (series bool)
leverage (series int)
AlertTPSL
Fields:
tp1_pct (series float)
tp1_port (series float)
tp2_pct (series float)
tp2_port (series float)
tp3_pct (series float)
tp3_port (series float)
sl_pct (series float)
SWBotConfig
Fields:
licenseKey (series string)
secretKey (series string)
symbol (series string)
pipValue (series float)
contractSize (series float)
useBrokerTPSL (series bool)
useMultiPos (series bool)
ExchangeConfigA
Fields:
symbol (series string)
strategyId (series string)
maxLag (series int)
ExchangeConfigB
Fields:
symbol (series string)
signalId (series string)
uid (series string)
positionSide (series string) Perpustakaan

Lib_AlertswLibrary "Webhook_Payload_Builder"
buildCode(action, cfg)
Parameters:
action (string) : Action code (e.g., 'ENTER-LONG', 'EXIT-SHORT', etc.)
cfg (BotConfig) : Bot configuration
Returns: Formatted code string
buildMPTPSL(tpsl)
Parameters:
tpsl (AlertTPSL) : TP/SL configuration
Returns: JSON string (,"takeProfits": ,"stopLoss":{...})
enterLong(cfg, amount, tpsl)
Parameters:
cfg (BotConfig) : Bot configuration
amount (float) : Trade amount (USDT)
tpsl (AlertTPSL) : TP/SL configuration (for MP mode, if na not added)
Returns: JSON string
enterShort(cfg, amount, tpsl)
Parameters:
cfg (BotConfig) : Bot configuration
amount (float) : Trade amount (USDT)
tpsl (AlertTPSL) : TP/SL configuration (for MP mode)
Returns: JSON string
exitLong(cfg)
Parameters:
cfg (BotConfig) : Bot configuration
Returns: JSON string
exitShort(cfg)
Parameters:
cfg (BotConfig) : Bot configuration
Returns: JSON string
exitLongPartial(cfg, totalNotional, pctClose)
Parameters:
cfg (BotConfig) : Bot configuration
totalNotional (float) : Current total position volume
pctClose (float) : Percentage to close (100 = full)
Returns: JSON string
exitShortPartial(cfg, totalNotional, pctClose)
Parameters:
cfg (BotConfig) : Bot configuration
totalNotional (float) : Current total position volume
pctClose (float) : Percentage to close
Returns: JSON string
buildTPSL_Normal(tp1_pct, tp1_port, tp2_pct, tp2_port, tp3_pct, tp3_port, sl_pct)
Parameters:
tp1_pct (float)
tp1_port (float)
tp2_pct (float)
tp2_port (float)
tp3_pct (float)
tp3_port (float)
sl_pct (float)
buildTPSL_DCA(dca_tp1_pct, dca_tp1_port, dca_tp2_pct, dca_tp2_port, dca_tp3_pct, dca_tp3_port, dca_sl_pct)
Parameters:
dca_tp1_pct (float)
dca_tp1_port (float)
dca_tp2_pct (float)
dca_tp2_port (float)
dca_tp3_pct (float)
dca_tp3_port (float)
dca_sl_pct (float)
selectTPSL(level, normalTPSL, dcaTPSL)
Parameters:
level (int) : Current DCA level
normalTPSL (AlertTPSL) : Normal entry TP/SL
dcaTPSL (AlertTPSL) : DCA entry TP/SL
Returns: Appropriate AlertTPSL
formatPnL(pnl)
Parameters:
pnl (float) : PnL value
Returns: Formatted string
formatPct(pct)
Parameters:
pct (float) : Percentage value
Returns: Formatted string
formatPrice(price)
Parameters:
price (float) : Price value
Returns: Formatted string
buildEntryLabel(isLong, level, price, amount, leverage)
Parameters:
isLong (bool) : Is Long
level (int) : DCA level
price (float) : Entry price
amount (float) : Trade amount
leverage (int) : Leverage
Returns: (emoji) Level - price - amount
buildTPLabel(isLong, tpNum, price, pnl, isDCA)
Parameters:
isLong (bool) : Is Long
tpNum (int) : TP number (1, 2, 3)
price (float) : Exit price
pnl (float) : PnL value
isDCA (bool) : Is DCA TP
Returns: Formatted label string
buildSLLabel(isLong, price, pnl, isTrailing)
Parameters:
isLong (bool)
price (float)
pnl (float)
isTrailing (bool)
buildForceExitLabel(isLong, price, pnl)
Parameters:
isLong (bool)
price (float)
pnl (float)
buildSwingLabel(isLong, price, pnl)
Parameters:
isLong (bool)
price (float)
pnl (float)
swb_secretPart(cfg)
Parameters:
cfg (SWBotConfig)
swb_base(cfg, action)
Parameters:
cfg (SWBotConfig) : SWBot configuration
action (string) : Action type ('BUY', 'SELL', 'CLOSE_LONG', etc.)
Returns: JSON start
swb_buy(cfg, lotSize, slPrice)
Parameters:
cfg (SWBotConfig) : SWBot configuration
lotSize (float) : Lot amount
slPrice (float) : SL price (if na, SL not added)
Returns: JSON string
swb_sell(cfg, lotSize, slPrice)
Parameters:
cfg (SWBotConfig) : SWBot configuration
lotSize (float) : Lot amount
slPrice (float) : SL price (if na, SL not added)
Returns: JSON string
swb_buy_tpsl(cfg, lotSize, slPips, tpPips)
Parameters:
cfg (SWBotConfig)
lotSize (float)
slPips (float) : SL distance (pips)
tpPips (float) : TP distance (pips)
Returns: JSON string
swb_sell_tpsl(cfg, lotSize, slPips, tpPips)
Parameters:
cfg (SWBotConfig)
lotSize (float)
slPips (float)
tpPips (float)
swb_closeLong(cfg)
Parameters:
cfg (SWBotConfig)
swb_closeShort(cfg)
Parameters:
cfg (SWBotConfig)
swb_closeLongPartial(cfg, lotToClose)
Parameters:
cfg (SWBotConfig)
lotToClose (float) : Lot amount to close
swb_closeShortPartial(cfg, lotToClose)
Parameters:
cfg (SWBotConfig)
lotToClose (float)
swb_amendLong(cfg, slPrice, tpPrice)
Parameters:
cfg (SWBotConfig)
slPrice (float) : New SL price
tpPrice (float) : New TP price
swb_amendShort(cfg, slPrice, tpPrice)
Parameters:
cfg (SWBotConfig)
slPrice (float)
tpPrice (float)
swb_amendSLLong(cfg, slPrice)
Parameters:
cfg (SWBotConfig)
slPrice (float)
swb_amendSLShort(cfg, slPrice)
Parameters:
cfg (SWBotConfig)
slPrice (float)
swb_amendTrailingLong(cfg, slPrice)
Parameters:
cfg (SWBotConfig)
slPrice (float) : SL price (broker trailing start point)
swb_amendTrailingShort(cfg, slPrice)
Parameters:
cfg (SWBotConfig)
slPrice (float)
exchA_openLong(cfg, qtyInCoin)
Parameters:
cfg (ExchangeConfigA) : configuration
qtyInCoin (float) : Trade amount in Coin
exchA_openShort(cfg, qtyInCoin)
Parameters:
cfg (ExchangeConfigA)
qtyInCoin (float)
exchA_closeLong(cfg)
Parameters:
cfg (ExchangeConfigA)
exchA_closeShort(cfg)
Parameters:
cfg (ExchangeConfigA)
exchA_closeLongPartial(cfg, pct)
Parameters:
cfg (ExchangeConfigA)
pct (float)
exchA_closeShortPartial(cfg, pct)
Parameters:
cfg (ExchangeConfigA)
pct (float)
exchB_base(cfg)
Parameters:
cfg (ExchangeConfigB)
exchB_openLong(cfg, qtyInCoin)
Parameters:
cfg (ExchangeConfigB)
qtyInCoin (float)
exchB_openShort(cfg, qtyInCoin)
Parameters:
cfg (ExchangeConfigB)
qtyInCoin (float)
exchB_closeLong(cfg, qtyInCoin)
Parameters:
cfg (ExchangeConfigB)
qtyInCoin (float)
exchB_closeShort(cfg, qtyInCoin)
Parameters:
cfg (ExchangeConfigB)
qtyInCoin (float)
exchB_closeLongPartial(cfg, partialQty)
Parameters:
cfg (ExchangeConfigB)
partialQty (float)
exchB_closeShortPartial(cfg, partialQty)
Parameters:
cfg (ExchangeConfigB)
partialQty (float)
BotConfig
Fields:
exchangeName (series string)
symbolInput (series string)
botName (series string)
tfStr (series string)
botID (series string)
useMultiPair (series bool)
leverage (series int)
AlertTPSL
Fields:
tp1_pct (series float)
tp1_port (series float)
tp2_pct (series float)
tp2_port (series float)
tp3_pct (series float)
tp3_port (series float)
sl_pct (series float)
SWBotConfig
Fields:
licenseKey (series string)
secretKey (series string)
symbol (series string)
pipValue (series float)
contractSize (series float)
useBrokerTPSL (series bool)
useMultiPos (series bool)
ExchangeConfigA
Fields:
symbol (series string)
strategyId (series string)
maxLag (series int)
ExchangeConfigB
Fields:
symbol (series string)
signalId (series string)
uid (series string)
positionSide (series string) Perpustakaan

TO_JSONTO_JSON
A lightweight Pine Script v6 library for converting TradingView series data into JSON-formatted alert payloads.
`TO_JSON` is designed for users who want to export chart data to external systems through TradingView alerts.
It helps transform rolling series such as OHLCV, indicator values, or text states into JSON-compatible arrays and wraps them into a structured message for webhooks, bots, dashboards, or automated workflows.
What this library does
This library provides helper functions to:
- convert float series into JSON arrays
- convert integer series into JSON arrays using a sentinel value as `null`
- convert string series into JSON arrays with fallback filling and JSON-safe escaping
- wrap custom payloads into a top-level JSON alert message with symbol, timeframe, timestamp, and token
It is especially useful when you want to send the latest `N` bars of market data or indicator values to an external service.
Features
- Rolling array export for `float`, `int`, and `string` series
- Chronological output from oldest to newest
- `null` support for missing values
- JSON-safe string escaping
- Simple wrapper for alert message generation
- Works well for webhook-based automation and downstream parsing
Exported functions
### `series_to_array_float_null(series float src, int N)`
Converts the latest `N` values of a float series into a JSON array string.
Missing values are exported as `null`.
`series_to_array_int_sentinel(series int src, int N, int sentinel)`
Converts the latest `N` values of an integer series into a JSON array string.
The specified sentinel value is exported as `null`.
`series_to_array_str_fill(series string src, int N, string fill="")`
Converts the latest `N` values of a string series into a JSON array string.
Missing values are replaced with `fill`, and strings are escaped for JSON compatibility.
`json(simple string token="1234567890", string info="", simple string symbol="AUTO")`
Wraps a custom JSON payload into a top-level alert message including:
- symbol
- timeframe
- current timestamp
- human-readable time
- info payload
- token
Typical use case
A common use case is exporting the last bars of:
- time
- open
- high
- low
- close
- volume
- moving averages
- custom signals
into one flat JSON object, then embedding it into the alert message.
Example
```pine
//@version=6
import veegee82/TO_JSON/1 as json
indicator("TO_JSON Example", overlay=false)
stO = open
stH = high
stL = low
stC = close
stV = volume
ema_50 = ta.ema(close, 50)
ema_100 = ta.ema(close, 100)
ema_200 = ta.ema(close, 200)
ema_500 = ta.ema(close, 500)
ema_1000 = ta.ema(close, 1000)
json_flat(int n=50) =>
s_name = '"name":"' + 'vision_' + timeframe.period + '"'
s_tf = ',"timeframe":"' + timeframe.period + '"'
s_ts = ',"ts":' + json.series_to_array_float_null(time, n)
s_o = ',"open":' + json.series_to_array_float_null(stO, n)
s_h = ',"high":' + json.series_to_array_float_null(stH, n)
s_l = ',"low":' + json.series_to_array_float_null(stL, n)
s_c = ',"close":' + json.series_to_array_float_null(stC, n)
s_v = ',"volume":' + json.series_to_array_float_null(stV, n)
s_ema_50 = ',"ema_50":' + json.series_to_array_float_null(ema_50, n)
s_ema_100 = ',"ema_100":' + json.series_to_array_float_null(ema_100, n)
s_ema_200 = ',"ema_200":' + json.series_to_array_float_null(ema_200, n)
s_ema_500 = ',"ema_500":' + json.series_to_array_float_null(ema_500, n)
s_ema_1000 = ',"ema_1000":' + json.series_to_array_float_null(ema_1000, n)
"{" + s_name + s_tf + s_ts + s_o + s_h + s_l + s_c + s_v + s_ema_50 + s_ema_100 + s_ema_200 + s_ema_500 + s_ema_1000 + "}"
info = json_flat(100)
alert(
message = json.json(token = "1234567890", info = info, symbol = "AUTO"),
freq = alert.freq_once_per_bar_close
) Perpustakaan
