Skip to content

AI‐Powered Market Indicator Plugin Generation

Benny Thadikaran edited this page Jul 15, 2026 · 2 revisions

This guide explains how to use the curated AI prompt to generate market indicator plugins for the chart.py.

The prompt is tested and optimized for both ChatGPT and DeepSeek.

📋 Prerequisites

  • Access to the charting application repository
  • The AI prompt file: src/renderer/plugins/plugin-ai-prompt.md
  • A ChatGPT or DeepSeek account

🚀 Quick Start

Step 1: Start a New AI Chat Session

Start a fresh conversation. For DeepSeek, choose Expert if necessary.

Step 2: Attach the Prompt File

Attach the entire src/renderer/plugins/plugin-ai-prompt.md file to the AI chat.

Or alternatively open the file and copy its entire contents into the prompt.

This prompt contains:

  • Complete plugin system architecture documentation
  • Function signature requirements
  • Panel allocation rules
  • Coding standards and helper utilities
  • Output format specifications

The AI will acknowledge and ask which indicator you'd like to generate

Step 3: Request Your Indicator

Once the AI acknowledges the system prompt, provide the full name of the indicator you want. Alternatively you may add:

  • specific default configuration,
  • steps to calculate the indicator
  • Any additional customization steps.

Example requests:

"Ichimoku Cloud"
"Money Flow Index (MFI) with a 14-period default and overbought/oversold lines at 80/20"

You can also request use of third party libraries like TA-Lib or pandas-ta. Make sure to install these libraries before running the plugins.

Step 4: Save the Generated Files

The AI will output exactly three sections plus notes:

  1. Plugin File — Save as renderer/plugins/<module_name>.py
  2. Configuration Block — Merge into defs/user.json under the CHART_PLUGINS object
  3. Usage Example — The CLI command to activate the plugin
  4. Notes — Important implementation details

Step 5: Enable and Test

  1. Ensure the plugin module is saved in the correct location:

    renderer/plugins/<module_name>.py
    
  2. Verify the configuration is properly merged into defs/user.json:

    {
      "CHART_PLUGINS": {
        "YOUR_INDICATOR_KEY": {
          "name": "module_name",
          "option": "cli-option-name",
          ...
        }
      }
    }
  3. Run the chart with your new plugin:

    python chart.py --sym RELIANCE --cli-option-name

❗ Common Pitfalls

Plugin Not Loading

  • Verify the "name" field in config matches the Python filename exactly (without .py)
  • Check that the module is in renderer/plugins/
  • Ensure no syntax errors in the generated code

Incorrect Slicing

  • If you see too much or too little data, verify all make_addplot calls use .iloc[-display_period:]

Panel Conflicts

  • If indicators overlap unexpectedly, check the panel configuration:
    • "share": false for exclusive panels
    • "allow_volume_panel": false to prevent sharing with volume
    • Adjust "preferred_axis" if two indicators conflict on the same y-axis

Missing Data

  • The lookback value in config determines how much historical data is loaded. Increase it for indicators needing more history (e.g., 200-period MA needs "lookback": 200)

Clone this wiki locally