- Home
- Skills
- Trading & Investing
- Pine Script Alert Debugger
Works with the AI Agents you already use
Pine Script Alert Debugger
Debug Pine Script alert triggers and validate webhook JSON payloads to prevent trading execution errors.
Free
Pine Script Alert Debugger
Example session with this skill installed
My alert fires too often and 3Commas says the JSON is invalid. Code: alertcondition(longCondition, title="Buy", message='{action: buy, price: ' + str.tostring(close) + '}')
- Read your context and instructions
- Compiled the pine script alert
I have analyzed your Pine Script alert logic and identified issues with the payload structure and trigger frequency.
[Pine Script Alert Debug Report]
🚨 Alert Trigger Issues:
- Missing
barstate.isconfirmedcheck. This alert will fire on every tick where the condition is met, even if the bar hasn't closed, leading to "repainting" alerts. - High frequency risk: The current logic does not restrict the alert to once per bar.
📡 Webhook Payload Validation:
- Invalid JSON: The keys and string values are missing double quotes (
"). - Syntax Error: Using string concatenation inside the message parameter is less reliable than using TradingView's placeholder syntax for webhooks.
🔔 Duplicate Fire Prevention:
- Missing
freqoronceparameter inalertcondition(). In the UI, this defaults to "Only Once," but programmatic logic should ideally handle state to prevent spamming.
️ The Fix:
// Add barstate check to your condition logic
longConfirmed = longCondition and barstate.isconfirmed
// Corrected alertcondition with valid JSON payload and placeholders
alertcondition(longConfirmed,
title="Buy",
message='{"action": "buy", "price": "{{close}}", "ticker": "{{ticker}}"}')
[Self-Check]
- Alert trigger conditions validated for barstate and timing
- Webhook payload syntax checked for valid JSON
- Duplicate fire prevention verified
- Corrected code provided with proper parameters
Next steps
- Update your script with the
barstate.isconfirmedlogic to ensure the candle is closed. - Copy the new JSON payload into your TradingView alert settings box.
- Perform a test fire on a lower timeframe to confirm 3Commas accepts the new format.
Connects securely to your tools. The creator never sees your data.
About this skill
The problem
TradingView alerts that fire on unconfirmed bars or send malformed JSON payloads lead to failed executions and costly trading errors. Troubleshooting these "silent" failures in live scripts is difficult and time-consuming.
What it does
- Analyzes
alertcondition()andalert()functions for repainting issues and barstate logic errors. - Validates webhook JSON payloads for syntax errors, unescaped characters, and missing fields.
- Identifies logic flaws that cause duplicate alerts or alert spamming across multiple bars.
- Verifies that dynamic variable references in messages will return valid values at execution time.
Frameworks & tools
Pine Script (v4 and v5), TradingView, and webhook integrations for 3Commas, Alertatron, and custom automation tools.
Why this beats prompting it yourself
General LLMs often overlook Pine Script-specific barstate nuances, such as the importance of barstate.isconfirmed to prevent repainting. This skill follows a rigorous checklist specifically designed for the execution quirks of the TradingView alert engine.
Use cases
- Preventing alerts from firing multiple times on the same candle during high volatility.
- Ensuring webhook payloads are compatible with third-party execution platforms.
- Fixing alerts that "vanish" because conditions only briefly met on an unconfirmed tick.
Known limitations
Requires Pine Script source code to analyze trigger logic. Cannot verify server-side webhook reception issues outside of TradingView.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Trading & Investing.
Requires access to the Pine Script source code. Cannot diagnose external server issues or broker-side execution failures beyond the alert payload itself.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
8 uses
Times used to date
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 12 days ago
- Free with an Agensi account