Exciting Update: Version 1.0.6 is now available, introducing Direct Pine Script Mode, Pine Logs Runtime Bridge, Zero-Repaint Linting, Source Maps, Intrabar MFE/MAE Stats, and expanded Pine v5/v6 Transpiler Parity. Read more
Version: 1.0.6

Custom Alerts & Webhooks

The ctx.alert() and Pine alert() functions let you fire custom notifications, sounds, and outgoing webhooks when conditions trigger, while v1.0.6 adds structured log.* console telemetry with clickable chart bar navigation.

Triggering Alerts

Alerts are evaluated dynamically on the current bar. The engine handles deduplication automatically so historical backtest passes do not flood the notification tray.

BacktestX Script
// JavaScript Mode: trigger an alert when RSI dips below 30
const rsi = ctx.ta.rsi(ctx.bars.map(b => b.close), 14);
const isOversold = rsi[ctx.bars.length - 1] < 30;
ctx.alert("RSI is Oversold! Buy Signal generated.", isOversold);

// Direct Pine Mode (v1.0.6)
if rsiVal < 30
    alert("RSI is Oversold on " + syminfo.ticker)

Webhook Integration

If you connect a Webhook URL in your terminal settings, any triggered ctx.alert(message, true) or Pine alert(...) call dispatches a JSON payload to your server:

BacktestX Script
{
  "symbol": "BTCUSD",
  "timeframe": "15m",
  "message": "RSI is Oversold! Buy Signal generated.",
  "price": 64500.50,
  "timestamp": 1721245000000
}

Alerts vs. Pine Logs (log.*) (v1.0.6)

Use alert() / ctx.alert() for real-time toasts and outgoing webhooks, and use v1.0.6 Pine Logs (log.info(), log.warning(), log.error()) for multi-bar historical debugging:

  • Captures up to MAX_SCRIPT_LOGS = 500 historical messages synced live via cl:script-logs.
  • Supports {0} placeholder interpolation and filter queries using the Pine Logs pill, timestamp bounds, or #bar index search.
  • Clicking any Pine Log row centers and highlights that exact bar on the chart canvas, with a Back to Script Editor / Dismiss (Esc) restore banner.