AI Chat Panel
The AI Chat Panel is your direct line to a Pine Script expert. The assistant is specifically trained on Pine Script v6, TradingViewβs platform, and Algo Trade Analytics webhook standards.
Panel Overview
Section titled βPanel Overviewβββββββββββββββββββββββββββββββββββββββββββββββββ [Chat 1] [Chat 2] [+] β β Chat Tabsβββββββββββββββββββββββββββββββββββββββββββββββ€β Context: RSI Strategy.pine (full) β β Active Contextβ report-backtest-001 ββββββββββββββββββββββββββββββββββββββββββββββββ€β ββ User: Create an RSI strategy... ββ β β Message Historyβ AI: Here's a Pine Script strategy... ββ ββββββββββββββββββββββββββββββββββββββββββββββββ€β [π] [π] Type your message... [Send] β β Input Areaβββββββββββββββββββββββββββββββββββββββββββββββ€β Mode: [Agent βΌ] Model: [GPT-5 Codex βΌ] β β SettingsβββββββββββββββββββββββββββββββββββββββββββββββChat Modes
Section titled βChat ModesβAgent Mode (Recommended)
Section titled βAgent Mode (Recommended)βIn Agent mode, the AI:
- Actively suggests code changes
- Returns diffs that can be applied directly
- Modifies your script based on requests
Best for:
- Generating new code
- Fixing errors
- Refactoring existing code
Answer Mode
Section titled βAnswer ModeβIn Answer mode, the AI:
- Provides explanations and guidance
- Does not modify your code directly
- Acts as a consultant rather than an editor
Best for:
- Learning Pine Script concepts
- Understanding existing code
- Getting recommendations without changes
Multi-Chat Support
Section titled βMulti-Chat SupportβCreating Chat Tabs
Section titled βCreating Chat TabsβClick + to create a new chat conversation.
Why use multiple chats:
- Keep different topics separate
- Maintain focused context per conversation
- Reference old conversations while starting new ones
Switching Chats
Section titled βSwitching ChatsβClick any chat tab to switch. Each chat maintains its own:
- Message history
- Context attachments
- Session state
Renaming Chats
Section titled βRenaming ChatsβDouble-click a chat tab name to rename it. The first message often becomes the default name.
Effective Prompting
Section titled βEffective PromptingβStrategy Generation
Section titled βStrategy GenerationβGood prompt:
Create an EMA crossover strategy for BTCUSD on the 1-hour chart:- Fast EMA: 9 periods- Slow EMA: 21 periods- Entry: Fast crosses above slow- Exit: Fast crosses below slow- Include webhook alerts for Algo Trade AnalyticsWhy it works:
- Specific timeframe and symbol
- Clear parameters
- Defined entry/exit logic
- Integration requirement
Bug Fixing
Section titled βBug FixingβGood prompt:
Fix this TradingView error:
Line 23: Could not find function or function reference 'security'
Here's my code context:- I'm trying to get the daily close price- Using Pine Script v6Why it works:
- Includes the exact error message
- Provides line number
- Explains the intent
Code Explanation
Section titled βCode ExplanationβGood prompt:
Explain what this Pine Script code does, especially:1. What is the `var` keyword doing?2. Why are there two alertcondition() calls?3. What does the JSON payload contain?Why it works:
- Asks specific questions
- References particular elements
- Seeks understanding, not just changes
Message Types
Section titled βMessage TypesβUser Messages
Section titled βUser MessagesβYour messages appear on the right side with:
- Timestamp
- Any attached context items
- The full message content
AI Responses
Section titled βAI ResponsesβAI responses include:
- Text explanation β What the AI is suggesting and why
- Code blocks β Highlighted Pine Script code
- Diff blocks β Showing changes to apply
- Reasoning trail β (If using reasoning models) The AIβs thought process
Context Awareness
Section titled βContext AwarenessβThe AI automatically has access to:
Active Script
Section titled βActive ScriptβYour currently selected editor tab is always visible to the AI.
Attached Context
Section titled βAttached ContextβItems you explicitly share:
- Code selections
- Full script tabs
- Analysis reports
- Images
Conversation History
Section titled βConversation HistoryβThe last 10 messages provide context for the current request.
Sending Messages
Section titled βSending MessagesβKeyboard
Section titled βKeyboardβ- Enter β Send message (single line)
- Shift + Enter β New line (multi-line input)
- Ctrl/Cmd + Enter β Send message (from anywhere)
Stopping Requests
Section titled βStopping RequestsβIf the AI is taking too long or going in the wrong direction:
- Click the Stop button that appears during generation
- The partial response is preserved
Response Actions
Section titled βResponse ActionsβWhen the AI returns code suggestions:
Accepts the AIβs changes and applies them to your script.
Dismiss
Section titled βDismissβRejects the changes and clears the diff viewer.
Copy Code
Section titled βCopy CodeβCopies the suggested code to your clipboard without applying it.
Best Practices
Section titled βBest PracticesβBe Specific
Section titled βBe Specificβ| Instead ofβ¦ | Tryβ¦ |
|---|---|
| βMake it better" | "Add a trailing stop loss of 2%" |
| "Fix the bug" | "Fix the undefined variable error on line 15" |
| "Add alerts" | "Add webhook alerts that send JSON to Algo Trade Analyticsβ |
Provide Context
Section titled βProvide ContextβWhen asking about specific code:
- Select the relevant code in the editor
- Click βShare Selectionβ
- Ask your question
This ensures the AI focuses on exactly what youβre asking about.
Iterate Incrementally
Section titled βIterate IncrementallyβBuild your strategy in stages:
- Generate basic structure
- Add entry logic
- Add exit logic
- Add risk management
- Add alerts
- Optimize
Use the Right Mode
Section titled βUse the Right Modeβ- Generating/editing code β Agent mode
- Understanding/learning β Answer mode
Input Toolbar
Section titled βInput ToolbarβAttachment Button (π)
Section titled βAttachment Button (π)βOpens options to attach:
- Current script tab
- Selection from editor
- Image file
- Analysis report
Report Button (π)
Section titled βReport Button (π)βQuick access to attach analysis reports from your Backtest vs Alerts or Alerts vs Fills analyses.
Related Sections
Section titled βRelated Sectionsβ- Context & Attachments β Sharing code and reports
- Diff Viewer β Reviewing suggestions
- Credits & Models β Model selection