< All Topics

Publishing and Sharing Scripts

Publishing to TradingView Community

  1. Create and save your script
  2. Click “Publish Script” in the Pine Editor
  3. Fill in the description and tags
  4. Choose visibility (public or private)
  5. Add screenshots of your indicator in action
  6. Click “Publish”

Script Visibility Options

  • Public: Available to all TradingView users
  • Private: Only available to you
  • Protected: Public but source code is hidden

Finding and Using Community Scripts

  1. Click “Indicators” in the top toolbar
  2. Select “Public Library” tab
  3. Browse categories or search for specific indicators
  4. Click on an indicator to add it to your chart
  5. Adjust settings in the popup dialog
  6. To see the code: right-click on the indicator name in the chart → “View Source”

Best Practices for Pine Script

  1. Comment your code: Add // comments to explain complex logic
  2. Use descriptive variable names: Makes code easier to understand
  3. Start simple: Begin with basic scripts and add complexity gradually
  4. Leverage existing code: Study public scripts to learn techniques
  5. Test thoroughly: Check your script on different timeframes and symbols
  6. Optimize performance: Avoid unnecessary calculations
  7. Version control: Save iterations of your scripts with version numbers

Debugging Pine Script

  1. Use plot() to visualize intermediate values
  2. Add strategy.close_all() at the beginning of your strategy for clean backtests
  3. Use var keyword for variables that should be initialized only once
  4. Check Pine Script error messages carefully
  5. Test on different symbols and timeframes

Learning Resources

  1. Official TradingView Pine Script documentation
  2. Pine Script Reference (available in Pine Editor)
  3. TradingView public scripts (study how others code)
  4. TradingView Pine Script community forum
  5. Video tutorials on TradingView’s YouTube channel

TradingView Mobile App

The mobile app offers most desktop features on the go:

  1. Download from App Store (iOS) or Google Play (Android)
  2. Log in with your TradingView account
  3. Access your watchlists, saved layouts, and alerts
  4. Perform basic analysis with indicators and drawing tools
  5. Receive alerts on your mobile device
Table of Contents