Skip to main content

Smart TradingView Description Auto-Generation

🎯 Problem Solved

TradingView Publication Constraints:

  • Initial Publication: Full description allowed
  • ⚠️ Updates: Should only append changelog updates (TradingView tracks edit history)
  • 🚫 Overwrites: Avoid replacing entire description after publication

🧠 Smart Solution

Auto-Detection Logic

The system automatically detects publication status:

  1. Unpublished Indicator (Initial Mode)

    • No tv-archive/ directory exists
    • Generates FULL description from README.md
    • Perfect for first publication
  2. Published Indicator (Update Mode)

    • tv-archive/ directory exists (indicates previous publications)
    • Generates ONLY changelog update snippet
    • Preserves original description integrity

🔄 Integration with Post-Commit Hook

Enhanced Workflow:

  1. Commit changes to indicator
  2. Pre-commit validates Pine Script
  3. Post-commit automatically:
    • Increments version number
    • Runs test workflow
    • 🆕 Generates smart TV description
    • Creates auto-sync commit

📋 Two Generation Modes

Mode 1: Initial Publication

./tools/smart-tv-description.sh indicators/trend/macdrsi-plus 2.6.0 initial
  • Converts full README.md to TradingView format
  • Creates complete publication-ready description
  • Use for first-time publications

Mode 2: Update Publication

./tools/smart-tv-description.sh indicators/trend/macdrsi-plus 2.7.0 update
  • Extracts only latest changelog
  • Formats for TradingView update
  • Creates snippet to paste at top of Version History

Mode 3: Auto-Detect (Default)

./tools/smart-tv-description.sh indicators/trend/macdrsi-plus 2.6.0 auto
  • Automatically chooses initial or update mode
  • Used by post-commit hook

🎁 Benefits

For Initial Publications:

Automated conversion from README to TradingView format
Consistent formatting across all indicators
Manual review prompts for special characters
Character limit awareness

For Updates:

Changelog-only updates (preserves original description)
TradingView-formatted changelog snippets
Copy-paste ready for quick updates
Version history preservation

For Workflow:

Zero manual intervention for routine updates
Smart detection of publication status
Git integration with auto-commits
Backup and archival capabilities

📋 Complete Step-by-Step Workflow

🚀 Initial Publication Process

  1. Code & Commit (auto-generates FULL TV description)

    # Make changes to indicator
    git commit -m "feat: add new feature"
    # → Post-commit hook auto-generates tv-description.txt
  2. Copy & Publish

    # Copy from auto-generated file
    cat indicators/trend/macdrsi-plus/docs/tv-description.txt
    # → Copy to TradingView Pine Editor
    # → Publish indicator manually on TradingView
  3. Complete Workflow

    ./tools/one-command.sh indicators/trend/macdrsi-plus 2.6.0 complete
    # → Creates tv-archive/ directory automatically
    # → Archives tv-description-v2.6.0.txt
    # → Switches to UPDATE mode for future commits

🔄 Future Updates Process

  1. Code & Commit (auto-generates UPDATE snippet)

    # Make changes to indicator  
    git commit -m "fix: improve accuracy"
    # → Post-commit hook auto-generates tv-update-v2.7.0.txt
  2. Copy Update Only

    # Copy ONLY the update snippet
    cat indicators/trend/macdrsi-plus/docs/tv-update-v2.7.0.txt
    # → Copy to TradingView
    # → Paste at TOP of Version History section
    # → Update script version number
    # → Save (preserves original description)
  3. No Complete Command Needed

    # Updates don't need the complete workflow
    # Just commit and copy the update snippet

🚀 Usage Examples

Scenario 1: New Indicator (Auto) - CURRENT STATE

# Commit changes - auto-generates full TV description
git commit -m "feat: add new momentum indicator"
# Post-commit hook automatically creates FULL TV description
# (Because no tv-archive/ directory exists = unpublished status)

Scenario 2: Published Indicator Update (Auto) - FUTURE STATE

# Commit changes - auto-generates changelog update only
git commit -m "fix: improve signal accuracy"
# Post-commit hook creates update snippet for TradingView
# (Only after tv-archive/ directory is created = published status)

Scenario 3: Manual Control

# Force full regeneration
./tools/smart-tv-description.sh indicators/trend/macdrsi-plus 2.8.0 initial

# Force update-only mode
./tools/smart-tv-description.sh indicators/trend/macdrsi-plus 2.8.0 update

⚠️ Current MACDRSI+ Status

MACDRSI+ is currently in UNPUBLISHED status:

  • ❌ No tv-archive/ directory exists
  • ✅ Every feat: commit generates FULL TV description
  • 🔄 After running one-command.sh complete, automatically switches to UPDATE mode

Automatic tv-archive creation:

# 1. Prepare for publication
./tools/one-command.sh indicators/trend/macdrsi-plus 2.6.0 publish

# 2. Publish on TradingView (manual step)

# 3. Complete workflow (creates tv-archive automatically)
./tools/one-command.sh indicators/trend/macdrsi-plus 2.6.0 complete
# → Creates tv-archive/ directory
# → Archives tv-description-v2.6.0.txt
# → Future commits = changelog updates only

🎯 Perfect Balance

This solution provides:

  • Automation for routine work
  • Intelligence for different scenarios
  • Control when manual override needed
  • Compliance with TradingView best practices

Result: Never manually write TradingView descriptions again, while maintaining professional quality and TradingView compatibility!