Indicator · Pine Script v5 · On the chart

Watermark

by ivansoft· code credited to TradingView

An indicator that places a small coloured text box on the price chart as a watermark.

View on GitHub

Repaints

GitHub stars1on the repository
Pine versionv5runs as is
Lines of code58
Settings9inputs
LicenceNone statedfile: MPL-2.0
Last update1 year ago1 Mar 2025

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

58 lines of Pine Script v5 from edu_std/watermark.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

watermark.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © TradingView

//@version=5
indicator("Watermark", "", true)

// Watermark
// v2 2022.07.24

// This code was written using the recommendations from the Pine Script™ User Manual's Style Guide:
//   https://www.tradingview.com/pine-script-docs/en/v5/writing/Style_guide.html



// ———————————————————— Constants and Inputs {



// ————— Constants
color  WHITE = color.new(color.white, 30)
color  BLUE  = color.new(color.blue, 50)
string ST_1  = "I💙TradingView"
string ST_2  = "I💚Pine"

// ————— Inputs
string GRP1             = "═════════  Text Input  ══════════"
string textInput1       = input.string(ST_1,     "Text 1",    group = GRP1) 
string textInput2       = input.string(ST_2,     "Text 2",    group = GRP1, tooltip = "Clear 'Text 2' to prevent animation.")

string GRP2             = "════════ Information Box ═════════"
string infoBoxSizeInput = input.string("small",  "Size",      inline = "21", group = GRP2, options = ["tiny", "small", "normal", "large", "huge", "auto"])
string infoBoxYPosInput = input.string("bottom", "↕",         inline = "21", group = GRP2, options = ["top", "middle", "bottom"])
string infoBoxXPosInput = input.string("left",   "↔",         inline = "21", group = GRP2, options = ["left", "center", "right"])
int    heightInput      = input.int(3,           "Height",    inline = "22", minval = 1, maxval = 100, tooltip = "1-100")
int    widthInput       = input.int(10,          "Width",     inline = "22", minval = 1, maxval = 100, tooltip = "1-100")
color  textColorInput   = input.color(WHITE,     "Text")
color  bgColorInput     = input.color(BLUE,      "Background")
// }



// ———————————————————— Visuals {


// We use `var` to only initialize the table on the first bar.
var table watermark = table.new(infoBoxYPosInput + "_" + infoBoxXPosInput, 1, 1)

// We only populate the table on the last bar; it's more efficient.
if barstate.islast
    // This `varip` variable will preserve its value across realtime updates.
    varip bool changeText = true
    // Toggle this value on each update.
    changeText := not changeText
    // If there's a "Text 2" string in inputs and it's time to flip, change the text.
    string txt = str.length(textInput2) != 0 and changeText ? textInput2 : textInput1
    // Populate our table cell.
    table.cell(watermark, 0, 0, txt, widthInput, heightInput, textColorInput, text_size = infoBoxSizeInput, bgcolor = bgColorInput)
// }

Overview

Watermark shows one text string, and if a second text is set it alternates between the two on each live update, which gives a simple blinking effect. Settings control both texts, the text size, the corner or edge position, the cell height and width, and the text and background colours. It has no trading signals and uses the live bar to switch text.

Details

Published by

ivansoft on GitHub

Code credit

TradingView, as written in the script's header

Draws

On the price chart

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • Signals can change on the live bar or after it closes (repainting)

Topics

pinescripttradingvew

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Text 1stringST_1textInput1
Text 2stringST_2textInput2
SizestringsmallinfoBoxSizeInput
↕stringbottominfoBoxYPosInput
↔stringleftinfoBoxXPosInput
Heightint3heightInput
Widthint10widthInput
TextcolorWHITEtextColorInput
BackgroundcolorBLUEbgColorInput
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.

Similar Pine Scripts

Symbol Info Helper

by everget
947 stars

Symbol Info Helper is an informational utility script that displays metadata about the currently selected instrument directly on the main price chart. It gathers built-in symbol properties including ticker identifier, description, instrument type, point value,

Indicator v4 Screeners & dashboards
Updated 11 days ago · GPL-3.0 GitHub repository of Symbol Info Helper
575 stars

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

Indicator v6 SMC / ICT / price actionCandlestick patterns
Updated 1 year ago · MPL-2.0 GitHub repository of ICT Displacement Candles Indicator
330 stars

This indicator monitors multiple cryptocurrency symbols for trading signals. It calculates and plots entry prices, take profit, and stop loss levels for each symbol including BTCUSDT, ETHUSDT, BNBUSDT and others. Price crossovers trigger buy, sell or close ale

Indicator v5 Support & resistanceScreeners & dashboards
Updated 2 months ago · None stated GitHub repository of Multi Alert Long/Short [Alorse]

Pricing Table

by namuan
318 stars

This indicator calculates theoretical options contract values and in-the-money probabilities using historical realized volatility across multiple standard deviations. It displays these metrics in a table overlay directly on the price chart. Users can adjust th

Indicator v4 Volatility & bandsScreeners & dashboards
Updated 2 months ago · MIT GitHub repository of Pricing Table

3938 Tracker

by Allen1212
303 stars

3938 Tracker visualizes historical buying and selling activity from ARK Invest funds directly on the main price chart. It plots labels at specific timestamps corresponding to trade dates, indicating buy or sell actions along with the count of participating ETF

Indicator v4 Screeners & dashboards
Updated 2 years ago · None stated GitHub repository of 3938 Tracker

More Screeners & dashboards scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers