Extension Functionality Test is a Pine Script v6 script designed to evaluate editor extension capabilities such as syntax highlighting, code completions, hover documentation, and static analysis.
1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
114 lines of Pine Script v6 from functionality-test.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.
functionality-test.pine
//@version=6
indicator("Extension Functionality Test", overlay=true)
// ============================================
// SYNTAX HIGHLIGHTING TEST
// ============================================
// Test 1: Version recognition (should highlight v6)
// Test 2: Annotations
// @description This tests the extension's annotation support
// @param testParam Test parameter
// @returns Test return value
// Test 3: Import statements
import TradingView/Patterns/1 as p
// Test 4: Function declarations
testFunction(int param1, float param2) =>
result = param1 + param2
result
// Test 5: Variables and types
var int myInt = 10
var float myFloat = 3.14
var bool myBool = true
var string myString = "test"
var color myColor = color.blue
// Test 6: Arrays and collections
myArray = array.new<float>()
myMatrix = matrix.new<int>()
myMap = map.new<string, float>()
// ============================================
// V6 SPECIFIC FEATURES TEST
// ============================================
// Test 7: Dynamic requests (v6 feature)
dynamicSymbol = "AAPL"
dynamicTimeframe = "1D"
price = request.security(dynamicSymbol, dynamicTimeframe, close)
// Test 8: Text formatting (v6 features)
if barstate.islast
label.new(bar_index, high, "Bold",
text_size = 16,
text_formatting = text.format_bold)
label.new(bar_index, low, "Italic",
text_size = 14,
text_formatting = text.format_italic)
// Test 9: Negative array indices (v6 feature)
if array.size(myArray) > 2
lastElement = array.get(myArray, -1)
secondLast = array.get(myArray, -2)
// Test 10: Boolean short-circuit evaluation (v6 optimization)
if array.size(myArray) > 0 and array.first(myArray) > 0
log.info("Safe evaluation")
// ============================================
// CODE COMPLETION TEST AREAS
// ============================================
// Test 11: Math namespace completion
mathTest = math.abs(-5)
mathPi = math.pi
// Test 12: Array methods completion
array.push(myArray, 1.0)
arraySize = array.size(myArray)
// Test 13: Color functions completion
dynamicColor = color.new(color.red, 50)
rgbColor = color.rgb(255, 0, 0)
// Test 14: Request functions completion
securityData = request.security(syminfo.tickerid, "1H", close)
// Test 15: Strategy functions (for hover documentation)
// strategy.entry("Long", strategy.long)
// Test 16: Technical analysis functions
emaValue = ta.ema(close, 20)
smaValue = ta.sma(close, 50)
// Test 17: String functions
stringFormatted = str.format("Price: {0}", close)
stringConverted = str.tostring(close)
// ============================================
// HOVER DOCUMENTATION TEST
// ============================================
// Hover over these functions to test documentation:
// - close (built-in variable)
// - high (built-in variable)
// - barstate.islast (built-in constant)
// - math.abs (namespace function)
// - array.new (constructor)
// - label.new (constructor)
// ============================================
// FUNCTION SIGNATURE TEST
// ============================================
// Type these function calls and check parameter hints:
// label.new(
// box.new(
// line.new(
// request.security(
plot(close, title="Close Price", color=color.blue)
Overview
The code demonstrates various Pine v6 features, including dynamic security requests, formatted text labels, negative array indexing, and standard technical analysis function calls. On the chart, it creates text labels on the final bar and plots the asset's closing price in the main price pane.
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
The Adaptive Laguerre Filter calculates a smoothed, dynamically adjusted trendline plotted directly on the main price chart. It dynamically adjusts its damping factor (alpha) based on recent price range variations and median percentile calculations over a spec
The indicator plots ICT displacement candles on the price chart and can switch to retracement scanning. Displacement requires a move larger than a set share of the 14-bar average high-low range, lasting at least a chosen number of bars, with optional close, pr
This indicator classifies each bar as bull, bear, or sideways from a rolling log return compared with adjustable percentage thresholds. It paints a regime ribbon on the price chart, shows a current-regime banner, and labels state changes after a minimum hold.
This script plots three moving averages on the price chart: a fast EMA or SMA with 10 periods, a slow EMA or SMA with 20 periods, and a trend EMA or SMA with 100 periods. It signals trend changes by drawing a white cross when the fast moving average crosses ab
This indicator calculates an ATR trailing stop line derived from the highest high minus an average true range multiple over a specified lookback period. It plots the trailing stop line directly on the price chart and colors price bars based on whether the clos
1833 Tracker is an overlay indicator that visualizes historical buy and sell transactions executed by ARK Invest ETFs for the stock on the main price chart. It displays trade dates using green buy and red sell labels positioned relative to price bars, indicati