- Home
- Skills
- Trading & Investing
- Pine Script Alert Debugger
Works with the AI tools 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
- Generated the document
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.
pine-script-alert-debugger.pdf
PDF · document
Example file from a real run - the skill writes it into your workspace.
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.
How to install
Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 3
Ask your agent to use it
Restart the agent if it was already running. It picks the skill up automatically - no config needed.
Skills folder by agent
Click the path to copy it. Create the folder if it does not exist yet.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
6 installs
Downloaded by developers to date
Free forever
No account required to browse
Trust & safety
Security scanned
Verified clean 22 days ago
- Free to download with an account