TradingView Pine Script Telegram screenshots

Yes—but not directly from Pine Script alone. Verified Answer #1

Short answer If your goal is: Verified Answer #1

“When my Pine alert triggers, send me a Telegram message with a screenshot of the chart on that timeframeVerified Answer #1

then the practical answer is: Verified Answer #1

Pine Script itself cannot take or attach screenshots. Verified Answer #1

TradingView alerts can send text/webhook events, not a Pine-generated image. Verified Answer #1

To get a screenshot into Telegram, you typically need an external service in the middle: Verified Answer #1

TradingView alert fires Verified Answer #1

Webhook hits your server / automation service Verified Answer #1

That service opens the chart in the correct symbol + timeframe, captures an image, and Verified Answer #1

sends it to Telegram via the Bot API Verified Answer #1

That is the standard architecture. Verified Answer #1

Why Pine Script cannot do this by itself Pine Script is designed for calculations, plotting, and alert generation, not for interacting with your operating system or UI. Verified Answer #1

In practice, Pine can: Verified Answer #1

calculate conditions, Verified Answer #1

plot signals, Verified Answer #1

and trigger alerts/messages, Verified Answer #1

but it cannot: Verified Answer #1

read the screen, Verified Answer #1

capture the TradingView chart window, Verified Answer #1

create image files, Verified Answer #1

upload images to Telegram directly. Verified Answer #1

TradingView’s Pine alert functions (alert() / alertcondition()) are for generating alert events/messages, and TradingView alert delivery supports channels such as webhooks for external automation rather than arbitrary file/image creation inside Pine itself (TradingView, Pine Script docs; TradingView, Webhook alerts docs). Verified Answer #1

Sources Verified Answer #1

TradingView. (n.d.). Pine Script® alerts. https://www.tradingview.com/pine-script-docs/concepts/alerts/ Verified Answer #1

TradingView. (n.d.). How to configure webhook alerts. https://www.tradingview.com/support/solutions/43000529348-how-to-configure-webhook-alerts/ Verified Answer #1

Telegram. (n.d.). Bot API. https://core.telegram.org/bots/api Verified Answer #1

What is possible Option 1 — Best practice: TradingView alert → webhook → screenshot service → Telegram This is the robust solution. Verified Answer #1

Flow Verified Answer #1

Your Pine script triggers an alert. Verified Answer #1

TradingView sends the alert to a webhook URL. Verified Answer #1

Your webhook server receives JSON like: Verified Answer #1

ticker Verified Answer #1

timeframe Verified Answer #1

alert type (buy/sell/etc.) Verified Answer #1

price/time Verified Answer #1

Your server uses one of these methods to get an image: Verified Answer #1

a headless browser (Playwright/Puppeteer/Selenium) logged into TradingView, Verified Answer #1

a chart-rendering service, Verified Answer #1

or a third-party screenshot automation platform. Verified Answer #1

Your server sends the image to Telegram using sendPhoto in the Telegram Bot API. Verified Answer #1

Telegram side Telegram bots can send images using sendPhoto (official Bot API). Verified Answer #1

Source Verified Answer #1

Telegram. (n.d.). Bot API: sendPhoto. https://core.telegram.org/bots/api#sendphoto Verified Answer #1

Why this works Because the webhook carries the signal, and the external service does the part Pine/TradingView alerts do not do: UI/image capture + Telegram image upload. Verified Answer #1

Option 2 — Send a Telegram text alert with symbol/timeframe/link only If you do not want to maintain infrastructure, this is much easier. Verified Answer #1

Your TradingView alert can send to a webhook that forwards a Telegram message containing: Verified Answer #1

symbol Verified Answer #1

timeframe Verified Answer #1

price Verified Answer #1

signal direction Verified Answer #1

timestamp Verified Answer #1

TradingView chart link Verified Answer #1

This does not include a screenshot, but often it is good enough and far simpler. Verified Answer #1

Example alert text: Verified Answer #1

json { "ticker": "{{ticker}}", "exchange": "{{exchange}}", "interval": "{{interval}}", "price": "{{close}}", "time": "{{time}}", "signal": "LONG" } Verified Answer #1

Then your webhook can format that into a Telegram message. Verified Answer #1

Option 3 — Use third-party bridge/automation tools There are third-party services that bridge TradingView alerts → Telegram, and some also support richer automation. Verified Answer #1

Whether they support actual chart screenshots varies by vendor and may change over time, so treat this as a vendor-specific feature, not a native Pine capability. Verified Answer #1

Because these tools change frequently, I would not treat them as guaranteed unless you verify the current documentation of the specific service you want to use. Verified Answer #1

Important distinction: “timeframe when alert triggers” You asked for “the chart in the respective TF when the alert is triggered.” Verified Answer #1

That can mean two different things: Verified Answer #1

A. Verified Answer #1

The alert belongs to a specific chart timeframe For example, your alert is created on the 15m chart. Verified Answer #1

Then the screenshot service should open the symbol on 15m. Verified Answer #1

B. Verified Answer #1

Your script uses multi-timeframe logic For example, chart is on 5m but your script also reads 1h data using request.security(). Verified Answer #1

In that case, you must decide what you want the screenshot to show: Verified Answer #1

the chart timeframe where the alert was created, or Verified Answer #1

the higher timeframe used in logic. Verified Answer #1

Usually, people mean the chart timeframe the alert is attached to. Verified Answer #1

To make this reproducible, include the interval explicitly in the alert message using TradingView placeholders such as {{interval}} if supported in your alert context, or hardcode it if you create separate alerts per timeframe. Verified Answer #1

Practical implementation pattern Here is a common setup. Verified Answer #1

Pine Script Your Pine script generates the alert with enough data for your webhook to know what to capture. Verified Answer #1

Example idea: Verified Answer #1


longCond = ta.crossover(ta.sma(close, 9), ta.sma(close, 21)) [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

if longCond alert('{"signal":"LONG","ticker":"{{ticker}}","interval":"{{interval}}","price":"{{close}}","time":"{{time}}"}', alert.freq_once_per_bar_close) ``` [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

Notes: [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

The exact use of placeholders depends on how you create the alert in TradingView. [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

Some users prefer `alertcondition()` and then set the message in the alert dialog. [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

The main point is: send **structured data** your webhook can use. [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

Webhook receiver Your server receives that JSON and then: [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

Parses `ticker` and `interval` [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

Builds/open a TradingView chart URL [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

Sets the timeframe [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

Captures a screenshot [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

Sends it to Telegram via bot API [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

Telegram send example Your server would call something like: [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

`https://api.telegram.org/bot<YOUR_BOT_TOKEN>/sendPhoto` [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

with: [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

`chat_id` [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

`photo` [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

optional `caption` [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

per Telegram Bot API docs. [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

**Source** [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

Telegram. (n.d.). *Bot API: sendPhoto*. https://core.telegram.org/bots/api#sendphoto [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

What TradingView supports natively vs not natively Native / straightforward [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

Triggering alerts from Pine scripts [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

Sending alert messages [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

Sending alerts to **webhook URLs** [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

Not native from Pine alone [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

Capturing a screenshot at alert time [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

Uploading that screenshot to Telegram directly [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

That distinction is the key answer to your question. [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

**Sources** [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

TradingView. (n.d.). *Pine Script® alerts*. https://www.tradingview.com/pine-script-docs/concepts/alerts/ [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

TradingView. (n.d.). *How to configure webhook alerts*. https://www.tradingview.com/support/solutions/43000529348-how-to-configure-webhook-alerts/ [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

Best answer in one sentence **Yes, it is possible to receive a chart screenshot in Telegram when a Pine alert fires, but only by using TradingView alerts plus an external webhook/automation service; Pine Script itself cannot capture or send screenshots directly.** [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

Recommended setup if you want the simplest reliable solution I would recommend: [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

**Use Pine Script only to trigger the alert** [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

**Send JSON to a webhook** [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

Build or use a small service that: [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

opens the chart on the correct symbol/timeframe, [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

captures a screenshot, [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

posts it to your Telegram bot chat. [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

If you want, I can give you a **working reference architecture** next, for example: [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

**Pine Script alert message template**, plus [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

a **Python/Flask webhook example**, plus [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

a **Telegram bot sendPhoto example**, plus [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

a simple way to capture the TradingView chart screenshot automatically. [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)

If you want that, I can write the full implementation. [Verified Answer #1](/isr/aa15c1bf-f1dd-4a33-a76e-2cbe91b3e45f)