Quick overview
This workflow listens for a crypto ticker in Telegram, pulls multi-timeframe candlestick data from Binance and recent headlines from NewsAPI, uses OpenAI to score market sentiment and generate trade ideas, and sends back a TradingView chart image plus a two-part analysis message.
How it works
- Receives a Telegram message containing a coin ticker and converts it into a USDT trading pair symbol (for example, BTC → BTCUSDT).
- Requests the last 200 candlesticks for five timeframes (1h, 4h, 1d, 1w, 1M) from the public Binance REST API and bundles them into a single payload.
- Fetches popular crypto news from the last three days via NewsAPI, keeps only the article titles and descriptions, and asks OpenAI to return short-term and long-term sentiment as structured JSON.
- Generates a TradingView chart snapshot for the Binance symbol using chart-img (with Bollinger Bands, Volume, and RSI), downloads the rendered image, and sends it to the same Telegram chat.
- Combines the candlestick bundle and the sentiment output and uses an OpenAI-powered agent to produce spot and leveraged trade recommendations in Telegram-friendly formatting.
- Splits the generated analysis into two messages to stay within Telegram’s message length limit and sends both back to the user.
Setup
- Create a Telegram bot with @BotFather, add a Telegram credential in n8n, and select it for the Telegram Trigger and both Telegram send nodes.
- Add an OpenAI API credential and select it for the sentiment analysis step and the agent’s chat model.
- Get a NewsAPI key and replace the placeholder apiKey value in the NewsAPI request parameters.
- Get a chart-img API key and replace the x-api-key header value in both chart-img HTTP requests.
- Activate the workflow and send your bot a ticker symbol (for example, BTC or ETH).