Indicator · Pine Script v6 · On the chart

Buddha Price Line

by DarthBuddha

A small chart-overlay indicator that marks the latest price with a coloured arrow line extending to the right of the last bar.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code76
Settings5inputs
LicenceMIT
Last update3 months ago15 Jul 2026

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

76 lines of Pine Script v6 from src/PriceLine.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

PriceLine.pine
// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Darth_Buddha

// @version=6
indicator(
  title = 'Buddha Price Line', 
  shorttitle = 'Price', 
  overlay = true)

//----------------------------------------------------------------------------------------------------< CONSTANTS >---//

// @variable - Bullish Color
const color BULLISH_COLOR = color.rgb(0, 255, 30)
// @variable - Neutral Color
const color NEUTRAL_COLOR = color.rgb(255, 255, 255)
// @variable - Bearish Color
const color BEARISH_COLOR = color.rgb(255, 0, 0)

//-------------------------------------------------------------------------------------------------------< INPUTS >---//

// Group Labels
const string g_Price = "Price Line"
// @variable - Bullish line color
color i_BullishColor = input.color(title = "Bullish", defval = BULLISH_COLOR, 
  group = g_Price, inline = "1", display = display.none)
// @variable - Neutral line color
color i_NeutralColor = input.color(title = "Neutral", defval = NEUTRAL_COLOR, 
  group = g_Price, inline = "1", display = display.none)
// @variable - Bearish line color
color i_BearishColor = input.color(title = "Bearish", defval = BEARISH_COLOR, 
  group = g_Price, inline = "1", display = display.none)
// @variable - Line Size
int i_Width = input.int(title = "Line Size", defval = 2, options = [1, 2, 3, 4, 5], 
  group = g_Price, inline = "2", display = display.none)
// @variable - Line On/Off
bool i_PriceLine = input.bool(title = "On/Off", defval = true, 
  group = g_Price, inline = "2", display = display.none)

//-------------------------------------------------------------------------------------------------< CALCULATIONS >---//

// @variable - Line data
series float v_Data = i_PriceLine ? close : na

// @variable - Price line color
var color v_LineColor = na
if barstate.islast
    v_LineColor := 
      v_Data > v_Data[1] ? i_BullishColor :
      v_Data < v_Data[1] ? i_BearishColor :
      i_NeutralColor

// Line Points
chart.point cp1_Data = chart.point.from_index(last_bar_index + 1, price = v_Data)
chart.point cp2_Data = chart.point.from_index(last_bar_index + 10, price = v_Data)

//------------------------------------------------------------------------------------------------------< VISUALS >---//

// @variable - Plot hidden baseline
var plot_PriceLine = plot(
  series = v_Data, 
  title = "Price", 
  color = v_LineColor, 
  editable = false, 
  display = display.price_scale)

// @variable - Arrow line
var line line_Arrow = na
if barstate.islast
    if not na(line_Arrow)
        line.delete(line_Arrow)
    line_Arrow := line.new(
      first_point = cp1_Data, second_point = cp2_Data,
      xloc = xloc.bar_index, extend = extend.right,
      color = v_LineColor, style = line.style_arrow_left, width = i_Width, force_overlay = true)

//----------------------------------------------------< END-CODE >----------------------------------------------------//

Overview

The colour depends on the last bar: one colour when the close is above the previous close, another when it is below, and a neutral colour when unchanged. It also adds a price-scale marker. Settings are the three colours, line size and an on or off switch. It is a display helper with no signals or alerts.

Details

Published by

DarthBuddha on GitHub

Draws

On the price chart

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
BullishcolorBULLISH_COLORi_BullishColor
NeutralcolorNEUTRAL_COLORi_NeutralColor
BearishcolorBEARISH_COLORi_BearishColor
Line Sizeint2i_Width
On/Offbooltruei_PriceLine
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

947 stars

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

Indicator v4 TrendMoving averages
Updated 12 days ago · GPL-3.0 GitHub repository of Adaptive Laguerre Filter
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 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

Indicator v4 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of 3 EMA/SMA + Cross [Alorse]
318 stars

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

Indicator v5 TrendVolatility & bands
Updated 2 months ago · MIT GitHub repository of ATR Trailing Stoploss

1833 Tracker

by Allen1212
303 stars

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

Indicator v4
Updated 2 years ago · None stated GitHub repository of 1833 Tracker

More indicators

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