Indicator · Pine Script v4 · Own pane

Example 6.1

by be-thomas

This indicator retrieves Heikin Ashi candle data for the current symbol and timeframe using the security function.

View on GitHub

GitHub stars65on the repository
Pine versionv4older, still runs
Lines of code9
Settings0inputs
LicenceGPL-3.0
Last update4 days ago24 Oct 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

9 lines of Pine Script v4 from examples/v4/tradingview-docs/v4-essential-non-standard-chart-types-data-02.pine, published under GPL-3.0. Keep the author's credit and licence lines when you reuse it.

v4-essential-non-standard-chart-types-data-02.pine
//@version=4
study("Example 6.1")
ha_t = heikinashi(syminfo.tickerid)
ha_open = security(ha_t, timeframe.period, open)
ha_high = security(ha_t, timeframe.period, high)
ha_low = security(ha_t, timeframe.period, low)
ha_close = security(ha_t, timeframe.period, close)
palette = ha_close >= ha_open ? color.green : color.red
plotcandle(ha_open, ha_high, ha_low, ha_close, color=palette)

Overview

Example 6.1 constructs and plots custom Heikin Ashi candlesticks, coloring them green when the Heikin Ashi close is greater than or equal to the Heikin Ashi open, and red otherwise. Designed as an example script demonstrating non-standard chart data requests, it visualizes smoothed Heikin Ashi price action.

Details

Published by

be-thomas on GitHub

Type

Indicator, Pine Script v4

Draws

Separate pane below the chart

Category

Candlestick patterns

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.

Topics

algorithmic-tradingbacktestingcompilerfintechjavascriptpinescripttechnical-analysistradingview

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

The Bullish/Bearish Candle Series Distribution indicator calculates the length of the current streak of consecutive bullish or bearish candles based on user-selected mode. It tracks streak lengths from 2 to 59 and plots a histogram in a separate pane showing t

Indicator v4 Candlestick patterns
Updated 10 days ago · GPL-3.0 GitHub repository of Bullish/Bearish Candle Series Distribution

My Script

by ricardosantos79
261 stars

This indicator plots a normalized candle dynamic visualization inside a custom 500x500 Gann square grid within a separate pane. It normalizes each bar's open and close prices relative to its high-low range, storing the resulting coordinate pairs in fixed-size

Indicator v5 Support & resistanceCandlestick patterns
Updated 4 years ago · None stated GitHub repository of My Script

Commitment Gauge

by harryguiacorn
219 stars

This indicator measures directional momentum by evaluating candlestick body proportions and volume over a user-defined lookback window. It computes the ratio of candle body to total range, weights the cumulative value by volume and absolute body size, and dete

Indicator v4 VolumeCandlestick patterns
Updated 1 year ago · None stated GitHub repository of Commitment Gauge

Qstick Indicator

by mihakralj
99 stars

This indicator calculates the Qstick value as a simple or exponential moving average of the difference between a chosen close source and open source. It plots that oscillator in a separate pane as a yellow line, draws a dashed zero line, and shades the backgro

Indicator v6 Oscillators & momentumCandlestick patterns
Updated 4 weeks ago · Apache-2.0 GitHub repository of Qstick Indicator
43 stars

This indicator builds a synthetic Heikin-Ashi series using only the current open and the opens of the previous three bars. It derives open, high, low, and close from those values, rounds each price to the symbol mintick, and plots the result as candles in a se

Indicator v5 Candlestick patterns
Updated 2 years ago · None stated GitHub repository of Heikin-Ashi Open Only
24 stars

This indicator plots a Cipher B-style oscillator in a separate pane and can source its calculations from Heikin Ashi candles when that option is on. It draws WaveTrend lines with optional buy, gold, sell, and divergence dots, plus overbought and oversold level

Indicator v5 Oscillators & momentumDivergence
Updated 4 years ago · MPL-2.0 GitHub repository of Cipher B Heikin Ashi

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