Indicator · Pine Script v5 · On the chart

Table 1m 15m 1HR

by srinivas-yarramsetti

The Table 1m 15m 1HR indicator renders a multi-asset monitoring table overlay on the top-right of the price chart.

View on GitHub

GitHub stars2on the repository
Pine versionv5runs as is
Lines of code115
Settings8inputs
LicenceNone statedfile: MPL-2.0
Last update3 years ago30 Jun 2023

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

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

Table_1m_15m_1Hr.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Srinivas Yarramsetti - srinivasitcrre6@gmail.com

//@version=5
indicator("Table_1m_15m_1HR", overlay = true)
LTPTIME = input.timeframe('1',title = "LTP Time", options = ['1', '2', '3', '5', '10', '15', '30', '60', '240', 'D', 'W', 'M'], tooltip = 'Choose different timeframe for LTP')
ticker_1 = input.symbol("NIFTY", "Ticker 1")
ticker_2 = input.symbol("BANKNIFTY", "Ticker 2")
ticker_3 = input.symbol("TCS", "Ticker 3")
ticker_4 = input.symbol("INFY", "Ticker 4")
ticker_5 = input.symbol("RELIANCE", "Ticker 5")
ticker_6 = input.symbol("HDFC", "Ticker 6")
ticker_7 = input.symbol("BAJFINANCE", "Ticker 7")
//ticker_8 = input.symbol("ITC", "Ticker 8")
//ticker_9 = input.symbol("TATAELXSI", "Ticker 9")


FindPOS(sym) => str.pos(sym,':')

//Get close price
Sec_Price(tick, ltp, openorclose) => math.round(request.security(tick, ltp, openorclose), 2)


//Get close price
Sec_Price_Close(tick) => math.round(request.security(tick, LTPTIME, close), 2)

//Get open price
//Sec_Price_Open(tick) => request.security(tick, LTPTIME, open)

//Diff in price of request.security
Sec_Price_Change(tick) => request.security(tick, LTPTIME, close - open)

//Current price of the candle at 1 min - Prior day close
Day_Change(tick) => math.round(request.security(tick, '1', close) - request.security(tick, 'D', close[1]), 2) 

//Current price of the candle at 1 min - Prior day close
Day_Change_Percent(tick) => math.round(((request.security(tick, '1', close) - request.security(tick, 'D', close[1]))/(request.security(tick, 'D', close[1])) * 100), 2)

//Current price of the candle at 1 min - Prior day close 15%
Day_Change_15_Percent(tick) => math.round(((request.security(tick, '15', close) - request.security(tick, 'D', close[1]))/(request.security(tick, 'D', close[1])) * 100), 2)

//Current price of the candle at 1 min - Prior day close 15%
Day_Change_1HR_Percent(tick) => math.round(((request.security(tick, '60', close) - request.security(tick, 'D', close[1]))/(request.security(tick, 'D', close[1])) * 100), 2)

var testTable = table.new(position = position.top_right, columns = 6, rows = 10, bgcolor = color.rgb(36, 150, 202), border_width = 1, border_color=color.white)

if barstate.islast
    //First Column
    table.cell(table_id = testTable, column = 0, row = 0, text = "Symbol", width = 6)
    table.cell(table_id = testTable, column = 0, row = 1, text = str.substring(ticker_1, FindPOS(ticker_1)+1))
    table.cell(table_id = testTable, column = 0, row = 2, text = str.substring(ticker_2, FindPOS(ticker_2)+1))
    table.cell(table_id = testTable, column = 0, row = 3, text = str.substring(ticker_3, FindPOS(ticker_3)+1))
    table.cell(table_id = testTable, column = 0, row = 4, text = str.substring(ticker_4, FindPOS(ticker_4)+1))
    table.cell(table_id = testTable, column = 0, row = 5, text = str.substring(ticker_5, FindPOS(ticker_5)+1))
    table.cell(table_id = testTable, column = 0, row = 6, text = str.substring(ticker_6, FindPOS(ticker_6)+1))
    table.cell(table_id = testTable, column = 0, row = 7, text = str.substring(ticker_7, FindPOS(ticker_7)+1))
    //table.cell(table_id = testTable, column = 0, row = 8, text = str.substring(ticker_8, FindPOS(ticker_8)+1))
    //table.cell(table_id = testTable, column = 0, row = 9, text = str.substring(ticker_9, FindPOS(ticker_9)+1))

    //Second Column
    table.cell(table_id = testTable, column = 1, row = 0, text = "LTP: "+ str.tostring(LTPTIME), width = 5) 
    table.cell(table_id = testTable, column = 1, row = 1, text = str.tostring(Sec_Price_Close(ticker_1)), bgcolor = Sec_Price_Change(ticker_1) > 0?color.green:color.red) 
    table.cell(table_id = testTable, column = 1, row = 2, text = str.tostring(Sec_Price_Close(ticker_2)), bgcolor = Sec_Price_Change(ticker_1) > 0?color.green:color.red) 
    table.cell(table_id = testTable, column = 1, row = 3, text = str.tostring(Sec_Price_Close(ticker_3)), bgcolor = Sec_Price_Change(ticker_1) > 0?color.green:color.red) 
    table.cell(table_id = testTable, column = 1, row = 4, text = str.tostring(Sec_Price_Close(ticker_4)), bgcolor = Sec_Price_Change(ticker_1) > 0?color.green:color.red) 
    table.cell(table_id = testTable, column = 1, row = 5, text = str.tostring(Sec_Price_Close(ticker_5)), bgcolor = Sec_Price_Change(ticker_1) > 0?color.green:color.red) 
    table.cell(table_id = testTable, column = 1, row = 6, text = str.tostring(Sec_Price_Close(ticker_6)), bgcolor = Sec_Price_Change(ticker_1) > 0?color.green:color.red) 
    table.cell(table_id = testTable, column = 1, row = 7, text = str.tostring(Sec_Price_Close(ticker_7)), bgcolor = Sec_Price_Change(ticker_1) > 0?color.green:color.red) 
    //table.cell(table_id = testTable, column = 1, row = 8, text = str.tostring(Sec_Price_Close(ticker_8)), bgcolor = Sec_Price_Change(ticker_1) > 0?color.green:color.red) 
    //table.cell(table_id = testTable, column = 1, row = 9, text = str.tostring(Sec_Price_Close(ticker_9)), bgcolor = Sec_Price_Change(ticker_1) > 0?color.green:color.red) 

    table.cell(table_id = testTable, column = 2, row = 1, text = str.tostring(Day_Change(ticker_1)), bgcolor = Day_Change(ticker_1) >= 0?color.green:color.red)
    table.cell(table_id = testTable, column = 2, row = 2, text = str.tostring(Day_Change(ticker_2)), bgcolor = Day_Change(ticker_2) >= 0?color.green:color.red)
    table.cell(table_id = testTable, column = 2, row = 3, text = str.tostring(Day_Change(ticker_3)), bgcolor = Day_Change(ticker_3) >= 0?color.green:color.red)
    table.cell(table_id = testTable, column = 2, row = 4, text = str.tostring(Day_Change(ticker_4)), bgcolor = Day_Change(ticker_4) >= 0?color.green:color.red)
    table.cell(table_id = testTable, column = 2, row = 5, text = str.tostring(Day_Change(ticker_5)), bgcolor = Day_Change(ticker_5) >= 0?color.green:color.red)
    table.cell(table_id = testTable, column = 2, row = 6, text = str.tostring(Day_Change(ticker_6)), bgcolor = Day_Change(ticker_6) >= 0?color.green:color.red)
    table.cell(table_id = testTable, column = 2, row = 7, text = str.tostring(Day_Change(ticker_7)), bgcolor = Day_Change(ticker_7) >= 0?color.green:color.red)
    //table.cell(table_id = testTable, column = 2, row = 8, text = str.tostring(Day_Change(ticker_8)), bgcolor = Day_Change(ticker_8) >= 0?color.green:color.red)    
    //table.cell(table_id = testTable, column = 2, row = 9, text = str.tostring(Day_Change(ticker_9)), bgcolor = Day_Change(ticker_9) >= 0?color.green:color.red)
    
    table.cell(table_id = testTable, column = 3, row = 1, text = str.tostring(Day_Change_Percent(ticker_1)), bgcolor = Day_Change_Percent(ticker_1) >= 0?color.green:color.red)
    table.cell(table_id = testTable, column = 3, row = 2, text = str.tostring(Day_Change_Percent(ticker_2)), bgcolor = Day_Change_Percent(ticker_2) >= 0?color.green:color.red)
    table.cell(table_id = testTable, column = 3, row = 3, text = str.tostring(Day_Change_Percent(ticker_3)), bgcolor = Day_Change_Percent(ticker_3) >= 0?color.green:color.red)
    table.cell(table_id = testTable, column = 3, row = 4, text = str.tostring(Day_Change_Percent(ticker_4)), bgcolor = Day_Change_Percent(ticker_4) >= 0?color.green:color.red)
    table.cell(table_id = testTable, column = 3, row = 5, text = str.tostring(Day_Change_Percent(ticker_5)), bgcolor = Day_Change_Percent(ticker_5) >= 0?color.green:color.red)
    table.cell(table_id = testTable, column = 3, row = 6, text = str.tostring(Day_Change_Percent(ticker_6)), bgcolor = Day_Change_Percent(ticker_6) >= 0?color.green:color.red)
    table.cell(table_id = testTable, column = 3, row = 7, text = str.tostring(Day_Change_Percent(ticker_7)), bgcolor = Day_Change_Percent(ticker_7) >= 0?color.green:color.red)
    //table.cell(table_id = testTable, column = 3, row = 8, text = str.tostring(Day_Change_Percent(ticker_8)), bgcolor = Day_Change_Percent(ticker_8) >= 0?color.green:color.red) 
    //table.cell(table_id = testTable, column = 3, row = 9, text = str.tostring(Day_Change_Percent(ticker_9)), bgcolor = Day_Change_Percent(ticker_9) >= 0?color.green:color.red)

    table.cell(table_id = testTable, column = 4, row = 1, text = str.tostring(Day_Change_15_Percent(ticker_1)), bgcolor = Day_Change_15_Percent(ticker_1) >= 0?color.green:color.red)
    table.cell(table_id = testTable, column = 4, row = 2, text = str.tostring(Day_Change_15_Percent(ticker_2)), bgcolor = Day_Change_15_Percent(ticker_2) >= 0?color.green:color.red)
    table.cell(table_id = testTable, column = 4, row = 3, text = str.tostring(Day_Change_15_Percent(ticker_3)), bgcolor = Day_Change_15_Percent(ticker_3) >= 0?color.green:color.red)
    table.cell(table_id = testTable, column = 4, row = 4, text = str.tostring(Day_Change_15_Percent(ticker_4)), bgcolor = Day_Change_15_Percent(ticker_4) >= 0?color.green:color.red)
    table.cell(table_id = testTable, column = 4, row = 5, text = str.tostring(Day_Change_15_Percent(ticker_5)), bgcolor = Day_Change_15_Percent(ticker_5) >= 0?color.green:color.red)
    table.cell(table_id = testTable, column = 4, row = 6, text = str.tostring(Day_Change_15_Percent(ticker_6)), bgcolor = Day_Change_15_Percent(ticker_6) >= 0?color.green:color.red)
    table.cell(table_id = testTable, column = 4, row = 7, text = str.tostring(Day_Change_15_Percent(ticker_7)), bgcolor = Day_Change_15_Percent(ticker_7) >= 0?color.green:color.red)
    //table.cell(table_id = testTable, column = 4, row = 8, text = str.tostring(Day_Change_15_Percent(ticker_8)), bgcolor = Day_Change_15_Percent(ticker_8) >= 0?color.green:color.red) 
    //table.cell(table_id = testTable, column = 4, row = 9, text = str.tostring(Day_Change_15_Percent(ticker_9)), bgcolor = Day_Change_15_Percent(ticker_9) >= 0?color.green:color.red)   

    table.cell(table_id = testTable, column = 5, row = 1, text = str.tostring(Day_Change_1HR_Percent(ticker_1)), bgcolor = Day_Change_1HR_Percent(ticker_1) >= 0?color.green:color.red)
    table.cell(table_id = testTable, column = 5, row = 2, text = str.tostring(Day_Change_1HR_Percent(ticker_2)), bgcolor = Day_Change_1HR_Percent(ticker_2) >= 0?color.green:color.red)
    table.cell(table_id = testTable, column = 5, row = 3, text = str.tostring(Day_Change_1HR_Percent(ticker_3)), bgcolor = Day_Change_1HR_Percent(ticker_3) >= 0?color.green:color.red)
    table.cell(table_id = testTable, column = 5, row = 4, text = str.tostring(Day_Change_1HR_Percent(ticker_4)), bgcolor = Day_Change_1HR_Percent(ticker_4) >= 0?color.green:color.red)
    table.cell(table_id = testTable, column = 5, row = 5, text = str.tostring(Day_Change_1HR_Percent(ticker_5)), bgcolor = Day_Change_1HR_Percent(ticker_5) >= 0?color.green:color.red)
    table.cell(table_id = testTable, column = 5, row = 6, text = str.tostring(Day_Change_1HR_Percent(ticker_6)), bgcolor = Day_Change_1HR_Percent(ticker_6) >= 0?color.green:color.red)
    table.cell(table_id = testTable, column = 5, row = 7, text = str.tostring(Day_Change_1HR_Percent(ticker_7)), bgcolor = Day_Change_1HR_Percent(ticker_7) >= 0?color.green:color.red)
    //table.cell(table_id = testTable, column = 5, row = 8, text = str.tostring(Day_Change_1HR_Percent(ticker_8)), bgcolor = Day_Change_1HR_Percent(ticker_8) >= 0?color.green:color.red) 
    //table.cell(table_id = testTable, column = 5, row = 9, text = str.tostring(Day_Change_1HR_Percent(ticker_9)), bgcolor = Day_Change_1HR_Percent(ticker_9) >= 0?color.green:color.red)  

    table.cell(table_id = testTable, column = 2, row = 0, text = "Change", width = 5)
    table.cell(table_id = testTable, column = 3, row = 0, text = "Change %", width = 5)
    table.cell(table_id = testTable, column = 4, row = 0, text = "15m Chg%", width = 5)
    table.cell(table_id = testTable, column = 5, row = 0, text = "1hr Chg%", width = 5)

Overview

Table 1m 15m 1HR fetches real-time prices and calculates percentage price changes across 1-minute, 15-minute, and 1-hour timeframes relative to the prior day's close. Users can customize seven distinct ticker symbols and select the main last traded price timeframe. It updates calculations on the latest chart bar.

Details

Published by

srinivas-yarramsetti on GitHub

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Screeners & dashboards

Markets

Stocks, Indices

Timeframes

M1-M5, M15-H1

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
LTP Timetimeframe1LTPTIME
Ticker 1symbolNIFTYticker_1
Ticker 2symbolBANKNIFTYticker_2
Ticker 3symbolTCSticker_3
Ticker 4symbolINFYticker_4
Ticker 5symbolRELIANCEticker_5
Ticker 6symbolHDFCticker_6
Ticker 7symbolBAJFINANCEticker_7
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
948 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 10 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 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