Indicator · Pine Script v4 · Own pane

Tables 002 Matrixscreen

by ricardosantos79· code credited to RicardoSantos

This visual script displays a digital matrix screen effect using TradingView tables.

View on GitHub

GitHub stars261on the repository
Pine versionv4older, still runs
Lines of code78
Settings2inputs
LicenceNone statedfile: MPL-2.0
Last update4 years ago13 Nov 2021

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

78 lines of Pine Script v4 from beta/tables/tables-002-matrixscreen.pinescript, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

tables-002-matrixscreen.pinescript
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © RicardoSantos

//@version=4
study("tables-002-matrixscreen")

f_ascii_alphabet(_i)=>//{
//| @description: returns the character at a index from the ASCII alphabet.
    (_i==00?'':(_i==01?'!':(_i==02?'"':(_i==03?'#':(_i==04?'$':(_i==05?'%':(_i==06?'&':(_i==07?"'":(_i==08?'(':(_i==09?')':
     (_i==10?'*':(_i==11?'+':(_i==12?',':(_i==13?'-':(_i==14?'.':(_i==15?'/':(_i==16?'0':(_i==17?'1':(_i==18?'2':(_i==19?'3':
     (_i==20?'4':(_i==21?'5':(_i==22?'6':(_i==23?'7':(_i==24?'8':(_i==25?'9':(_i==26?':':(_i==27?';':(_i==28?'<':(_i==29?'=':
     (_i==30?'>':(_i==31?'?':(_i==32?'@':(_i==33?'A':(_i==34?'B':(_i==35?'C':(_i==36?'D':(_i==37?'E':(_i==38?'F':(_i==39?'G':
     (_i==40?'H':(_i==41?'I':(_i==42?'J':(_i==43?'K':(_i==44?'L':(_i==45?'M':(_i==46?'N':(_i==47?'O':(_i==48?'P':(_i==49?'Q':
     (_i==50?'R':(_i==51?'S':(_i==52?'T':(_i==53?'U':(_i==54?'V':(_i==55?'W':(_i==56?'X':(_i==57?'Y':(_i==58?'Z':(_i==59?'[':
     (_i==60?'\\':(_i==61?']':(_i==62?'^':(_i==63?'_':(_i==64?'`':(_i==65?'a':(_i==66?'b':(_i==67?'c':(_i==68?'d':(_i==69?'e':
     (_i==70?'f':(_i==71?'g':(_i==72?'h':(_i==73?'i':(_i==74?'j':(_i==75?'k':(_i==76?'l':(_i==77?'m':(_i==78?'n':(_i==79?'o':
     (_i==80?'p':(_i==81?'q':(_i==82?'r':(_i==83?'s':(_i==84?'t':(_i==85?'u':(_i==86?'v':(_i==87?'w':(_i==88?'x':(_i==89?'y':
     (_i==90?'z':(_i==91?'{':(_i==92?'|':(_i==93?'}':(_i==94?'~':(_i==95?'':(_i==96?'':(_i==97?'':(_i==98?'':(_i==99?'':''
     )))))))))) )))))))))) )))))))))) )))))))))) )))))))))) )))))))))) )))))))))) )))))))))) )))))))))) ))))))))))
//}

//| Random number generation function:
//| -------------------------------------------------------------------------------|
var float[] seed = array.new_float(size=1, initial_value=42.0)                  //-|
f_prng(_range)=>                                                              //---|
//| pseudo random function:                                                 // O O |
    var float _return = 1.0                                                 //- V -|
    float _seed = array.get(id=seed, index=0)                                //NNNN|
    float _reseed =  271.828                                                  // A |
    _return := ((3.1416 * _return % _seed) * _reseed) % _range                // V |
    array.set(id=seed, index=0, value=(1 + (_seed * 1.618) % _range) + _return) //||
    _return                                                                    // ||
//| -------------------------------------------------------------------------------|

i_tb_row = input(title='Table Rows:', defval=32)
i_tb_col = input(title='Table Columns:', defval=32)

//-----------------------------------------------------------------------------||
// issue: chart space by N cells causes bleed
i_tb_cwidth = 98/i_tb_col
i_tb_cheigth = 98/i_tb_row

var a = table.new(position=position.top_left, 
     rows=i_tb_row, columns=i_tb_col, bgcolor=color.black, 
     frame_color=color.black, frame_width=0, 
     border_color=color.black, border_width=0)

f_fill_cells()=>
    for _r = 0 to i_tb_row-1
        bool _r_iseven = _r % 2 == 0
        for _c = 0 to i_tb_col-1
            bool _c_isodd = _c % 2 == 0
            if _r_iseven and _c_isodd
                table.cell(table_id=a,
                     column=_c, row=_r, text='º',
                     width=i_tb_cwidth, height=i_tb_cheigth, 
                     text_color=#ffffff, text_halign=text.align_center, bgcolor=color.new(#060606, 90))
            else if _r_iseven and not _c_isodd
                table.cell(table_id=a,
                     column=_c, row=_r, text='+',
                     width=i_tb_cwidth, height=i_tb_cheigth, 
                     text_color=#ffffff, text_halign=text.align_center, bgcolor=color.new(#060606, 80))
            else if not _r_iseven and _c_isodd
                table.cell(table_id=a,
                     column=_c, row=_r, text='*',
                     width=i_tb_cwidth, height=i_tb_cheigth, 
                     text_color=#ffffff, text_halign=text.align_center, bgcolor=color.new(#060606, 90))
            else if not _r_iseven and not _c_isodd
                table.cell(table_id=a,
                     column=_c, row=_r, text='|',
                     width=i_tb_cwidth, height=i_tb_cheigth, 
                     text_color=#ffffff, text_halign=text.align_center, bgcolor=color.new(#060606, 80))
    

if barstate.islast or barstate.isconfirmed[1]
    f_fill_cells()

plot(close)

Overview

Tables 002 Matrixscreen generates pseudo-random character displays across a customizable grid of rows and columns. Users can configure the table dimensions, controlling row and column counts to adjust cell proportions across the display area. It draws directly in a separate pane as a visual demonstration of table rendering and pseudo-random string generation techniques in Pine Script.

Details

Published by

ricardosantos79 on GitHub

Code credit

RicardoSantos, as written in the script's header

Type

Indicator, Pine Script v4

Draws

Separate pane below the chart

Category

Screeners & dashboards

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

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

SettingTypeDefaultVariable
Table Rows:int32i_tb_row
Table Columns:int32i_tb_col
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

948 stars

This indicator measures the chart symbol’s percentage change from the opening price at the start of each US presidential term and plots those values as histogram columns in a separate pane. Columns are offset so each administration appears separately, with a s

Indicator v6 Screeners & dashboards
Updated 10 days ago · GPL-3.0 GitHub repository of Presidents Performance

This indicator scans a pasted list of symbols for RSI directional momentum and shows matching long and short signals in a table in a separate pane. The user chooses continuous break, continuous retracement, flip break, flip retracement, divergence, or hidden d

Indicator v6 Oscillators & momentumDivergence
Updated 1 year ago · MPL-2.0 GitHub repository of Momentum Setup - RSI Directional Momentum Scanner
257 stars

Donald SPX - Options Trading is an indicator designed to assist SPX index option traders by tracking session benchmarks and multi-timeframe moving average data. It calculates a 200-period weighted moving average (WMA) and requests multi-timeframe bar data from

Indicator v5 Moving averagesScreeners & dashboards Repaints
Updated 6 weeks ago · None stated GitHub repository of Donald SPX - Options Trading

Index Member Distribution

by TradersPost
218 stars

Calculates and plots a weighted histogram of constituent returns for major market indices (NDX, SPX, DJIA, and RUT) in a separate pane. Each histogram bin reflects the summed weights of members within that percentage return bracket. The script renders vertical

Indicator v6 Screeners & dashboards
Updated 3 months ago · None stated GitHub repository of Index Member Distribution

KamaFama

by Mastaaa1987
141 stars

KamaFama is an indicator that translates a Freqtrade trading strategy into Pine Script for visualization. It combines Kaufman Adaptive Moving Average (KAMA), MAMA/FAMA calculations derived via Hilbert Transform, Williams %R, and correlation trend filters to ev

Indicator v6 Moving averagesOscillators & momentum
Updated 6 weeks ago · MIT GitHub repository of KamaFama
114 stars

Calculates normalized reversal metrics across up to ten Forex currency pairs using user-selected moving average methods, including HarmonicMA, EMA, SMA, or WMA. The indicator identifies overbought, oversold, and mean-crossing conditions using a configurable th

Indicator v4 Screeners & dashboardsMean reversion
Updated 1 year ago · None stated GitHub repository of Multi-Pair Trend Reversal Widget

More indicators

Trade Your Charts With a Regulated Broker

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

Compare brokers