Publishing and Sharing Scripts ๐ข
Publishing your Pine Script on TradingView transforms a personal tool into a resource that can help thousands of traders, build your reputation, and even generate income. This chapter covers everything you need to know: documenting your code properly, choosing the right protection level, writing descriptions that pass moderation, distributing scripts publicly or privately, managing versions, monetizing your work, and engaging with the community.
Script Documentation
Good documentation is the difference between a script that gains traction and one that gets ignored. TradingView moderators check documentation quality before featuring scripts, and users rely on it to decide whether to add your indicator to their charts.
Header Documentation
Every published script should begin with a structured metadata header. This header tells other developers (and your future self) what the script does, who wrote it, and what version it is. Pine Script supports @description, @author, and @version annotations inside comments.
//@version=5
// @description Multi-Timeframe Trend Dashboard - displays trend direction
// across multiple timeframes using EMA crossovers.
// @author YourTradingViewUsername
// @version 2.1.0
// @license Mozilla Public License 2.0
//
// @changelog
// v2.1.0 - Added weekly timeframe support
// v2.0.0 - Refactored to Pine Script v5, new input system
// v1.0.0 - Initial release with daily and 4H timeframes
indicator("Multi-TF Trend Dashboard", overlay=false)
// --- Inputs with descriptive tooltips ---
fastLength = input.int(9, "Fast EMA Length", minval=1,
tooltip="Period for the fast Exponential Moving Average. Lower values react faster to price changes.")
slowLength = input.int(21, "Slow EMA Length", minval=1,
tooltip="Period for the slow Exponential Moving Average. Higher values smooth out noise.")
showWeekly = input.bool(true, "Show Weekly Timeframe",
tooltip="Enable or disable the weekly trend row in the dashboard.")
// --- Core calculations ---
fastEMA = ta.ema(close, fastLength)
slowEMA = ta.ema(close, slowLength)
trendUp = fastEMA > slowEMA
// --- Visualization ---
plotColor = trendUp ? color.green : color.red
plot(trendUp ? 1 : -1, "Current TF Trend", color=plotColor, style=plot.style_columns)The tooltip parameter on each input is especially important. When a user hovers over a parameter in the TradingView settings panel, the tooltip text appears, explaining exactly what that setting controls without the user needing to read your source code.
Continue reading
Sign in or create a free account to unlock Publishing and Sharing and access the full academy.
Free account ยท No credit card required