Indicator · Pine Script v6 · On the chart

Internal Candle Strength [LuxAlgo]

by theonetrade· code credited to LuxAlgo

Internal Candle Strength [LuxAlgo] evaluates intrabar price action by segmenting each bar's high-low range into price rows and analyzing lower timeframe candles.

View on GitHub

GitHub stars34on the repository
Pine versionv6current
Lines of code80
Settings3inputs
LicenceMIT
Last update2 weeks ago8 Nov 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

80 lines of Pine Script v6 from assets/indicator/bit-exact/internal_candle_strength_luxalgo_4WIILHOS.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

internal_candle_strength_luxalgo_4WIILHOS.pine
// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
// © LuxAlgo

//@version=6
indicator('Internal Candle Strength [LuxAlgo]', 'LuxAlgo - Internal Candle Strength', overlay=true, max_lines_count = 500, max_boxes_count = 500)
//---------------------------------------------------------------------------------------------------------------------}
//CONSTANTS & STRINGS & INPUTS
//---------------------------------------------------------------------------------------------------------------------{
timeframeInput  = input.timeframe(  '1',  'Timeframe')
sizeInput       = input(            20.,  'Row Size', inline = 'size')
autoInput       = input.bool(       true, 'Auto',     inline = 'size')

//---------------------------------------------------------------------------------------------------------------------}
//DATA STRUCTURES & VARIABLES
//---------------------------------------------------------------------------------------------------------------------{
var table t_able = table.new(position.bottom_right,2,2
     , bgcolor      = #1e222d
     , border_color = #373a46
     , border_width = 1
     , frame_color  = #373a46
     , frame_width  = 1)

//---------------------------------------------------------------------------------------------------------------------}
//USER-DEFINED FUNCTIONS
//---------------------------------------------------------------------------------------------------------------------{
ohlc()=> [open, high, low, close]

//---------------------------------------------------------------------------------------------------------------------}
//MUTABLE VARIABLES & EXECUTION
//---------------------------------------------------------------------------------------------------------------------{
volatility    = math.round_to_mintick(0.1 * ta.atr(200))
parsedSize    = autoInput ? volatility : sizeInput
n             = bar_index
idx           = math.max(math.round((high - low) / parsedSize), 1)
[o, h, l, c]  = request.security_lower_tf(syminfo.tickerid, timeframeInput, ohlc())

min           = low
max           = low
float avg     = na 
color css     = na

for i = 0 to idx-1
    max += (high - low) / idx
    num = array.new<float>()
    den = array.new<float>()

    for [index, value] in o
        if array.get(h, index) > min and array.get(l, index) < max
            diff = array.get(c, index) - array.get(o, index)

            array.push(num, diff)
            array.push(den, math.abs(diff))

    strength  = 50 * (array.sum(num) / array.sum(den)) + 50
    css       := color.from_gradient(strength, 0, 100, color.red, color.teal)

    box.new(n, max, n+1, min
      , text = str.tostring(strength, format.percent)
      , text_color = css
      , bgcolor = color.new(#5d606b, 80)
      , border_color = na)

    line.new(n, min, n+1, min, color = css)    
    
    min := max

line.new(n, min, n+1, min, color = css)

plotcandle(open, math.max(close, open), math.min(close, open), open
  , bordercolor = #00000000
  , color = #00000000
  , wickcolor = close > open ? color.teal : color.red)

if barstate.islast
    t_able.cell(0,0,'Current Row Size',text_color = color.new(color.white,50))
    t_able.cell(0,1,'Optimal Row Size',text_color = color.new(color.white,50))
    t_able.cell(1,0,str.tostring(parsedSize),text_color = color.new(color.white,50))
    t_able.cell(1,1,str.tostring(volatility),text_color = color.new(color.white,50))
    
//---------------------------------------------------------------------------------------------------------------------}

Overview

For each price segment, it calculates a strength percentage based on intrabar candle direction and movement magnitude. The indicator plots visual boxes and boundary lines directly on the main chart, shaded along a color gradient from red to teal to reflect local strength, and displays an information table showing current and ATR-based row sizes.

Details

Published by

theonetrade on GitHub

Code credit

LuxAlgo, as written in the script's header

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.

Topics

algorithmic-tradingbacktestingbitcoinccxtcrypto-tradingllm-agentoffline-backtestingopen-source-tradingpine-scriptpine-to-pythonpinescriptpynecorepythonquantquantitative-financestrategy-backtestingtechnical-analysistrading-indicatorstrading-strategiestradingview

Settings

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

SettingTypeDefaultVariable
Timeframetimeframe1timeframeInput
Row Sizeinput20.sizeInput
AutobooltrueautoInput
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

This indicator plots buy and sell labels on the price chart. A buy appears when a short stochastic crosses up from below 20 while a slow MACD histogram is positive and a faster MACD histogram is negative. A sell uses the opposite stochastic and MACD alignment.

Indicator v5 Oscillators & momentumCandlestick patterns
Updated 6 months ago · None stated GitHub repository of Heikin Ashi with MACD Signals
1 stars

BL-ESW Pinbar Market Lab Pro OSC is an experimental chart overlay indicator that combines Pinbar candle detection with market cost anchors, cost bands, volatility metrics, and liquidity provider ranges. It calculates VWAP-based cost anchors, GetDelta price ban

Indicator v6 Support & resistanceCandlestick patterns
Updated 5 days ago · AGPL-3.0 GitHub repository of BL-ESW Pinbar Market Lab Pro OSC

This indicator identifies Hammer and Inverted Hammer candlestick patterns overlaid directly on the price chart. It evaluates body proportions, upper wick lengths, and lower wick ratios against user-defined thresholds. To filter out low-volatility noise, candle

Indicator v6 Candlestick patternsVolatility & bands
1 stars

A research indicator, with no trade signals, that finds unusually large candles on the 5 and 15 minute timeframes and the chart timeframe, and studies how price returns to the other end of each one. A news candle must exceed a multiple of the largest recent ra

Indicator v6 Candlestick patternsVolatility & bands
Updated 6 weeks ago · None stated GitHub repository of News Candle Research
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
368 stars

This multi-symbol indicator evaluates a combined trading condition across up to 40 user-defined symbols. It processes MACD bullish crossovers, RSI thresholds, Bollinger Band boundaries, and DMI/ADX trend filters using security calls. When buy or sell criteria

Indicator v5 Oscillators & momentumVolatility & bands
Updated 3 months ago · None stated GitHub repository of Multi MACD + BB + RSI [Alorse]

More Candlestick patterns 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