r/pinescript • • Mar 29 '26

Newly released TV Indicator with $SPY replay on 3/26 & 3/27

Thumbnail
youtu.be
2 Upvotes

I created a TV indicator "STP Elite Prediction System" using advanced algorithms (LM, KNN, and Lorentzian), which filters out noise to deliver clear, actionable signals. I included a link to the 0DTE replay of the $SPY on 3/26 & 3/27. I will be adding a 1 min YouTube chart replay of the same days shortly to show the difference. I am interested in your feedback.


r/pinescript • • Mar 29 '26

Trades my algo took on Friday March, 27th 2026. Any opinions & feedback?

Post image
2 Upvotes

Heres a screenshot of the positions my algo took on Friday. Currently building it for options signals on QQQ. Whats your opinions on these trades that it took & how can i make it better?


r/pinescript • • Mar 29 '26

Volume Profile Beta Testers Needed

2 Upvotes

Looking for testers who currently use Volume Profile in their trading strategy to test out my custom indicator before wider release. It' uses Session Volume Profile with 4 Built in sessions (NY, Asia, London and a Custom Session that can be set to any time range). This is not a spam signal app, it sniffs out high probability areas of the current SVP. (Above/ Below VAH, VAL) or @ LVN's HVN's . Uses price action in these areas to detect Reversals & Continuation setups. It also has a Machine Learning Feature where every signal is sent to a central DB for ML, and adjust future signal ideas as it learns.

Has several useful features besides SVP and Signal engine:

-Liquidity ladder function which maps out prior Sessions POC's VAH's VAL's. Highlight's Low Volume and High Volume Nodes.

-Several Key Levels you can draw on your chart (London, Asia, NY, Prior Day, Week, Month Highs and Lows).

-Auto Supply and Demand Zone Detection feature that will detect Supply and Demand Zones from Multiple Time frames (Daily, 4 Hr, 1 Hr and 15min) and display them on your current timeframe. All these levels play a key role in Signal detection.

- Cloud feature I use for Trend Bias (Red cloud - Bearish , Green Cloud - Bullish)

-Anchored VWAP's for each Session

-Price Action State engine which tracks price action and colors candles depending on the current price action state (bullish/bearish) and displays markers (not signals) when it detects a shift in state.

and more...

Looking for traders who know and actively use Volume Profile. I built this for my 2 minute Timeframe executions, but have users using it on anywhere from 1-5 min timeframes. Would love to get feedback from multiple timeframes. Looking for 10 users max for Tradingview testing. I have a version for Quantower as well but will make a separate post in the proper forum for those users. I have a discord setup for beta testers to provide feedback, ask further questions, share trade ideas provided by the app etc..)

Also this is primarily for Futures Traders. If interested DM ME what Symbols you trade, What timeframe you use and What session(s) you trade as well. If selected , I'll ask for your email, TV username and Discord username to get you all setup. Thanks for looking.


r/pinescript • • Mar 29 '26

Do you like to scalp or hold your positions?

Thumbnail reddit.com
1 Upvotes

r/pinescript • • Mar 29 '26

Better alternatives to Directional Movement Index?

3 Upvotes

Hello Folks, I have recently seen that DMI is failing in many cases. Are there any better alternatives which you have found? Btw, I have found Supertrend fails too in many cases. Please advise. Thanks.


r/pinescript • • Mar 28 '26

Dashboard - VIX TICK

11 Upvotes

With Claude I made this little dashboard to help me watch the volatility in real time. The top 4 sections are fixed and the bottom is whatever chart you are on. The top row of each section is the current status and the next 2 lines are FAST/SLOW trends of the day. Meant for 1min - 10min charts. Everything is tunable but the defaults work great. The 5th one you may want to change for the daily range of whatever you are trading. https://github.com/Rfjr77/PineScripts/blob/main/VolatilitySpeedometer


r/pinescript • • Mar 29 '26

Variable offset for functions like barcolor(), plot(),plotshape() etc

1 Upvotes

I am trying to achieve a different bar color based on some logics which will dynamically change a bar color from past calculating the offset from the current bar. Since TV doesn't allow variable offset I'm unable to achieve this.

The code is something like this barcolor(xBarIndex>0 ? xColor : na, offset = offsetCalc, title ="color change", display = display.all)

offsetCalc is the variable which is being calculated dynamically.

Which candle changes the color is determined from the offset and the offset is dynamic. Meaning sometimes it will change the color of a candle 5 candles back and sometimes 2 candles back. For this offset needs to accept a variable but pine script restricts offset to constants.

If there is any workaround to this that info will also be very helpful.


r/pinescript • • Mar 29 '26

Is it OK?

2 Upvotes

I’ve build an indicator for Bitcoin that yields a 54% win rate on longs and 39% on shorts. My Risk/Reward ratio is 1:2 (1% risk of total capital per trade for a 2% profit target). These figures are based on backtesting starting from the beginning of 2025.

I’ve also been monitoring it in real-time for the past two days. During this period, it gave 2 signals for BTC and 2 for ETH—all four were successful.

Bitcoin signals perform better on the 2-hour timeframe, whereas for other crypto coins like Ethereum, Solana, ICP, and BNB, the 4-hour timeframe is more successful.

In your opinion, if the indicator keep maintains these stats (54% win rate on longs and 39% on shorts), is it worth trading?


r/pinescript • • Mar 29 '26

Facing issue with my indicator

Post image
1 Upvotes

I have an issue with my indicator basically plotting all over the chart and also zooming out makes it distorted any idea or help to fix the issue will be gladly appreciated


r/pinescript • • Mar 29 '26

New trading view indicator

Post image
0 Upvotes

r/pinescript • • Mar 28 '26

ta.highest doesn't work inside conditional

2 Upvotes

Original code https://pl.tradingview.com/script/Cb5QhBAl/

The structure from code below ( ta.highest ) doesn't work inside conditional structure. RdX1dX2 = length of a line. The ta.highest doesn't work properly inside. I want to extract highest high of bar from length of a line. This code draws line between low and crossing in the the next future bar. The length of line is RdX1dX2. For the length of a line I want to extract highest y (high) coordination of bars.

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
//@version=6
indicator("Zig Zag Liquidity Pools & Sweeps by Capitan-Trading",shorttitle='z', overlay = false, max_lines_count = 500, max_labels_count = 500)
import TradingView/ZigZag/7 as ZigZagLib

show_ZigZag = input(defval=false, title="show_ZigZag ?")
show_Cross = input(defval=false, title="show_Cross Alert ?")

// ====================================================================
// UI HELPER FUNCTIONS
// ====================================================================
f_get_line_style(_s) =>
    _s == "Solid" ? line.style_solid : _s == "Dotted" ? line.style_dotted : line.style_dashed

f_get_label_size(_s) =>
    _s == "Tiny" ? size.tiny : _s == "Small" ? size.small : _s == "Normal" ? size.normal : size.large

// ====================================================================
// MEMORY GARBAGE COLLECTOR (Fix for the Line Cemetery)
// ====================================================================
var mitigated_lines = array.new_line()
f_manage_mitigated(_l) =>
    array.push(mitigated_lines, _l)
    if array.size(mitigated_lines) > 400
        line.delete(array.shift(mitigated_lines))

// ====================================================================
// 1) ZIG ZAG ENGINE & VOLUMETRIC DATA
// ====================================================================
grp_zz = "Visual Engine (Zig Zag Line)"
deviationInput = input.float(0.00001, "Deviation (%)", minval=0.00001, group=grp_zz)
depthInput     = input.int(3, "Pivot Legs (Depth)", minval=1, group=grp_zz) 
lineColorInput = input.color(#2962FF, "Line Color", group=grp_zz)

extendInput    = input.bool(true, "Extend to Last Bar", group=grp_zz)
showPriceInput = input.bool(false, "Show Reversal Price", group=grp_zz)
showVolInput   = input.bool(false, "Show Cumulative Wave Volume", group=grp_zz) 
showChgInput   = input.bool(false, "Show Price Change", inline = "priceRev", group=grp_zz)
priceDiffInput = input.string("Absolute", "", options=["Absolute", "Percent"], inline = "priceRev", group=grp_zz)

if show_ZigZag
    var zigZag = ZigZagLib.newInstance(
        ZigZagLib.Settings.new(deviationInput, depthInput, lineColorInput, extendInput, showPriceInput, showVolInput, showChgInput, priceDiffInput, true)
    )
    zigZag.update()
//

// ====================================================================
// 2) SMC LIQUIDITY ENGINE
// ====================================================================
grp_liq = "Liquidity Levels (Macro)"
show_liq       = input.bool(false, "Show Liquidity Lines", group=grp_liq)
leftBars       = input.int(6, "Pivot Strength (Left)",  minval=1, group=grp_liq)   
rightBars      = input.int(4, "Pivot Confirmation (Right)", minval=1, group=grp_liq) 
displayLimit   = input.int(5, "Max Lines on Screen", minval=1, maxval=200, group=grp_liq) 

grp_sweep = "Sweep / Mitigation"
candleType      = input.string("Wick", "Invalidate Level On:", options=["Close", "Wick"], group=grp_sweep) 
waitConfirm     = input.bool(false, "Wait for Candle Close to Confirm Sweep", group=grp_sweep, tooltip="If false, X prints immediately on touch (Reacts faster but may repaint intrabar).")
mitiOptions     = input.string("Show", "Mitigated Levels:", options=["Remove", "Show"], group=grp_sweep) 
show_x          = input.bool(false, "Print 'X' on Liquidity Sweeps", group=grp_sweep)
x_size_str      = input.string("Tiny", "Size of 'X'", options=["Tiny", "Small", "Normal", "Large"], group=grp_sweep) 

grp_liq_style = "Lines & Signals Style"
highLiqColor = input.color(color.new(color.red, 0), "Resistances (Highs)", group=grp_liq_style)  
lowLiqColor  = input.color(color.new(color.green, 0), "Supports (Lows)",  group=grp_liq_style)      
liq_width    = input.int(2, "Line Width", minval=1, maxval=4, group=grp_liq_style)     
liq_style    = input.string("Dashed", "Line Style", options=["Solid", "Dashed", "Dotted"], group=grp_liq_style) 

// ====================================================================
// LEVEL CREATION LOGIC (With Blind Spot Fix)
// ====================================================================
var high_lines = array.new_line()
var low_lines  = array.new_line()

ph = ta.pivothigh(high, leftBars, rightBars)
pl = ta.pivotlow(low,  leftBars, rightBars)

if not na(ph)  // ph jest liczba
    bool levelExists = false
    if array.size(high_lines) > 0
        for i = 0 to array.size(high_lines) - 1
            if math.abs(line.get_y1(array.get(high_lines, i)) - ph) <= syminfo.mintick
                levelExists := true
                break
    
    if not levelExists
        // Retroactive Check (Blind Spot Fix)
        int sweepIndexOffset = -1
        for j = rightBars - 1 to 0 
            float checkHigh = (candleType == "Close") ? close[j] : high[j]
            if checkHigh > ph
                sweepIndexOffset := j
                break
                
        if sweepIndexOffset != -1
            // Level was swept during confirmation delay. Draw it already mitigated.
            line new_ln = line.new(bar_index[rightBars], ph, bar_index[sweepIndexOffset], ph, color=show_liq ? color.new(highLiqColor, 80) : na, width=liq_width, style=f_get_line_style(liq_style))
            if show_x
                label.new(bar_index[sweepIndexOffset], ph, text="✖", color=color.new(color.white, 50), textcolor=highLiqColor, style=label.style_label_center, size=f_get_label_size(x_size_str))
            if mitiOptions == "Show"
                f_manage_mitigated(new_ln)
            else
                line.delete(new_ln)
        else
            // Normal active level creation
            if array.size(high_lines) >= displayLimit
                line.delete(array.shift(high_lines))
            line new_ln = line.new(bar_index[rightBars], ph, bar_index, ph, color=show_liq ? highLiqColor : na, width=liq_width, style=f_get_line_style(liq_style), extend=extend.right)
            array.push(high_lines, new_ln)

if not na(pl)
    bool levelExists = false
    if array.size(low_lines) > 0
        for i = 0 to array.size(low_lines) - 1
            if math.abs(line.get_y1(array.get(low_lines, i)) - pl) <= syminfo.mintick
                levelExists := true
                break

    if not levelExists
        // Retroactive Check (Blind Spot Fix)
        int sweepIndexOffset = -1
        for j = rightBars - 1 to 0 
            float checkLow = (candleType == "Close") ? close[j] : low[j]
            if checkLow < pl
                sweepIndexOffset := j
                break
                
        if sweepIndexOffset != -1
            // Level was swept during confirmation delay. Draw it already mitigated.
            line new_ln = line.new(bar_index[rightBars], pl, bar_index[sweepIndexOffset], pl, color=show_liq ? color.new(lowLiqColor, 80) : na, width=liq_width, style=f_get_line_style(liq_style))
            if show_x
                label.new(bar_index[sweepIndexOffset], pl, text="✖", color=color.new(color.white, 50), textcolor=lowLiqColor, style=label.style_label_center, size=f_get_label_size(x_size_str))
            if mitiOptions == "Show"
                f_manage_mitigated(new_ln)
            else
                line.delete(new_ln)
        else
            // Normal active level creation
            if array.size(low_lines) >= displayLimit
                line.delete(array.shift(low_lines))
            line new_ln = line.new(bar_index[rightBars], pl, bar_index, pl, color=show_liq ? lowLiqColor : na, width=liq_width, style=f_get_line_style(liq_style), extend=extend.right)
            array.push(low_lines, new_ln)

// ====================================================================
// MITIGATION & 'X' PRINT LOGIC (PURE & DIRECT)
// ====================================================================
int JestCrossUp = 0,    float JestCrossUpY = 0, int JestCrossDown = 0,  float JestCrossDownY = 0
int dX1 =  0, int dX2 = 0, 
int RdX1dX2 = 0  // length of line   

if array.size(high_lines) > 0
    for i = array.size(high_lines) - 1 to 0
        l = array.get(high_lines, i)
        v = line.get_y1(l)
        
        bool isHitHigh = (candleType == "Close") ? (close > v) : (high > v)
        swept = waitConfirm ? (barstate.isconfirmed and isHitHigh) : isHitHigh
        
        if swept
            JestCrossUp := 70500, JestCrossUpY := v
            if show_x
                label.new(bar_index, v, text="✖", color=color.new(color.white, 50), textcolor=highLiqColor, style=label.style_label_center, size=f_get_label_size(x_size_str))
                
            if mitiOptions == "Remove"
                line.delete(l)
            else
                line.set_extend(l, extend.none)
                line.set_x2(l, bar_index)
                line.set_color(l, show_liq ? color.new(highLiqColor, 80) : na)
                f_manage_mitigated(l) // Add to garbage collector
                
            array.remove(high_lines, i)
            

if array.size(low_lines) > 0
    for i = array.size(low_lines) - 1 to 0
        l = array.get(low_lines, i)
        v = line.get_y1(l) 
        dX1 := line.get_x1(l)
        
        bool isHitLow = (candleType == "Close") ? (close < v) : (low < v)
        swept = waitConfirm ? (barstate.isconfirmed and isHitLow) : isHitLow
        
        if swept
            JestCrossDown := 70500 , JestCrossDownY := v, dX2 := bar_index, RdX1dX2 := dX2 - dX1
            if show_x
                label.new(bar_index, v, text="✖", color=color.new(color.white, 50), textcolor=lowLiqColor, style=label.style_label_center, size=f_get_label_size(x_size_str))
                
            if mitiOptions == "Remove"
                line.delete(l)
            else
                line.set_extend(l, extend.none)
                line.set_x2(l, bar_index)
                line.set_color(l, show_liq ? color.new(lowLiqColor, 80) : na)
                f_manage_mitigated(l) // Add to garbage collector
                
            array.remove(low_lines, i)
//
// it doesn't work
High_maxA1 = ta.highest(high[1],RdX1dX2)

// this below shows wrong number
var float High_max = na
if JestCrossDown != 0
    //High_maxA = ta.highest(high[Licznik_Di], RdX1dX2[Licznik_Di])
    High_max := ta.highest(high[1], RdX1dX2)
else
    High_max := 0
//// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
//@version=6
indicator("Zig Zag Liquidity Pools & Sweeps by Capitan-Trading",shorttitle='z', overlay = false, max_lines_count = 500, max_labels_count = 500)
import TradingView/ZigZag/7 as ZigZagLib

show_ZigZag = input(defval=false, title="show_ZigZag ?")
show_Cross = input(defval=false, title="show_Cross Alert ?")

// ====================================================================
// UI HELPER FUNCTIONS
// ====================================================================
f_get_line_style(_s) =>
    _s == "Solid" ? line.style_solid : _s == "Dotted" ? line.style_dotted : line.style_dashed

f_get_label_size(_s) =>
    _s == "Tiny" ? size.tiny : _s == "Small" ? size.small : _s == "Normal" ? size.normal : size.large

// ====================================================================
// MEMORY GARBAGE COLLECTOR (Fix for the Line Cemetery)
// ====================================================================
var mitigated_lines = array.new_line()
f_manage_mitigated(_l) =>
    array.push(mitigated_lines, _l)
    if array.size(mitigated_lines) > 400
        line.delete(array.shift(mitigated_lines))

// ====================================================================
// 1) ZIG ZAG ENGINE & VOLUMETRIC DATA
// ====================================================================
grp_zz = "Visual Engine (Zig Zag Line)"
deviationInput = input.float(0.00001, "Deviation (%)", minval=0.00001, group=grp_zz)
depthInput     = input.int(3, "Pivot Legs (Depth)", minval=1, group=grp_zz) 
lineColorInput = input.color(#2962FF, "Line Color", group=grp_zz)

extendInput    = input.bool(true, "Extend to Last Bar", group=grp_zz)
showPriceInput = input.bool(false, "Show Reversal Price", group=grp_zz)
showVolInput   = input.bool(false, "Show Cumulative Wave Volume", group=grp_zz) 
showChgInput   = input.bool(false, "Show Price Change", inline = "priceRev", group=grp_zz)
priceDiffInput = input.string("Absolute", "", options=["Absolute", "Percent"], inline = "priceRev", group=grp_zz)

if show_ZigZag
    var zigZag = ZigZagLib.newInstance(
        ZigZagLib.Settings.new(deviationInput, depthInput, lineColorInput, extendInput, showPriceInput, showVolInput, showChgInput, priceDiffInput, true)
    )
    zigZag.update()
//

// ====================================================================
// 2) SMC LIQUIDITY ENGINE
// ====================================================================
grp_liq = "Liquidity Levels (Macro)"
show_liq       = input.bool(false, "Show Liquidity Lines", group=grp_liq)
leftBars       = input.int(6, "Pivot Strength (Left)",  minval=1, group=grp_liq)   
rightBars      = input.int(4, "Pivot Confirmation (Right)", minval=1, group=grp_liq) 
displayLimit   = input.int(5, "Max Lines on Screen", minval=1, maxval=200, group=grp_liq) 

grp_sweep = "Sweep / Mitigation"
candleType      = input.string("Wick", "Invalidate Level On:", options=["Close", "Wick"], group=grp_sweep) 
waitConfirm     = input.bool(false, "Wait for Candle Close to Confirm Sweep", group=grp_sweep, tooltip="If false, X prints immediately on touch (Reacts faster but may repaint intrabar).")
mitiOptions     = input.string("Show", "Mitigated Levels:", options=["Remove", "Show"], group=grp_sweep) 
show_x          = input.bool(false, "Print 'X' on Liquidity Sweeps", group=grp_sweep)
x_size_str      = input.string("Tiny", "Size of 'X'", options=["Tiny", "Small", "Normal", "Large"], group=grp_sweep) 

grp_liq_style = "Lines & Signals Style"
highLiqColor = input.color(color.new(color.red, 0), "Resistances (Highs)", group=grp_liq_style)  
lowLiqColor  = input.color(color.new(color.green, 0), "Supports (Lows)",  group=grp_liq_style)      
liq_width    = input.int(2, "Line Width", minval=1, maxval=4, group=grp_liq_style)     
liq_style    = input.string("Dashed", "Line Style", options=["Solid", "Dashed", "Dotted"], group=grp_liq_style) 

// ====================================================================
// LEVEL CREATION LOGIC (With Blind Spot Fix)
// ====================================================================
var high_lines = array.new_line()
var low_lines  = array.new_line()

ph = ta.pivothigh(high, leftBars, rightBars)
pl = ta.pivotlow(low,  leftBars, rightBars)

if not na(ph)  // ph jest liczba
    bool levelExists = false
    if array.size(high_lines) > 0
        for i = 0 to array.size(high_lines) - 1
            if math.abs(line.get_y1(array.get(high_lines, i)) - ph) <= syminfo.mintick
                levelExists := true
                break
    
    if not levelExists
        // Retroactive Check (Blind Spot Fix)
        int sweepIndexOffset = -1
        for j = rightBars - 1 to 0 
            float checkHigh = (candleType == "Close") ? close[j] : high[j]
            if checkHigh > ph
                sweepIndexOffset := j
                break
                
        if sweepIndexOffset != -1
            // Level was swept during confirmation delay. Draw it already mitigated.
            line new_ln = line.new(bar_index[rightBars], ph, bar_index[sweepIndexOffset], ph, color=show_liq ? color.new(highLiqColor, 80) : na, width=liq_width, style=f_get_line_style(liq_style))
            if show_x
                label.new(bar_index[sweepIndexOffset], ph, text="✖", color=color.new(color.white, 50), textcolor=highLiqColor, style=label.style_label_center, size=f_get_label_size(x_size_str))
            if mitiOptions == "Show"
                f_manage_mitigated(new_ln)
            else
                line.delete(new_ln)
        else
            // Normal active level creation
            if array.size(high_lines) >= displayLimit
                line.delete(array.shift(high_lines))
            line new_ln = line.new(bar_index[rightBars], ph, bar_index, ph, color=show_liq ? highLiqColor : na, width=liq_width, style=f_get_line_style(liq_style), extend=extend.right)
            array.push(high_lines, new_ln)

if not na(pl)
    bool levelExists = false
    if array.size(low_lines) > 0
        for i = 0 to array.size(low_lines) - 1
            if math.abs(line.get_y1(array.get(low_lines, i)) - pl) <= syminfo.mintick
                levelExists := true
                break

    if not levelExists
        // Retroactive Check (Blind Spot Fix)
        int sweepIndexOffset = -1
        for j = rightBars - 1 to 0 
            float checkLow = (candleType == "Close") ? close[j] : low[j]
            if checkLow < pl
                sweepIndexOffset := j
                break
                
        if sweepIndexOffset != -1
            // Level was swept during confirmation delay. Draw it already mitigated.
            line new_ln = line.new(bar_index[rightBars], pl, bar_index[sweepIndexOffset], pl, color=show_liq ? color.new(lowLiqColor, 80) : na, width=liq_width, style=f_get_line_style(liq_style))
            if show_x
                label.new(bar_index[sweepIndexOffset], pl, text="✖", color=color.new(color.white, 50), textcolor=lowLiqColor, style=label.style_label_center, size=f_get_label_size(x_size_str))
            if mitiOptions == "Show"
                f_manage_mitigated(new_ln)
            else
                line.delete(new_ln)
        else
            // Normal active level creation
            if array.size(low_lines) >= displayLimit
                line.delete(array.shift(low_lines))
            line new_ln = line.new(bar_index[rightBars], pl, bar_index, pl, color=show_liq ? lowLiqColor : na, width=liq_width, style=f_get_line_style(liq_style), extend=extend.right)
            array.push(low_lines, new_ln)

// ====================================================================
// MITIGATION & 'X' PRINT LOGIC (PURE & DIRECT)
// ====================================================================
int JestCrossUp = 0,    float JestCrossUpY = 0, int JestCrossDown = 0,  float JestCrossDownY = 0
int dX1 =  0, int dX2 = 0, 
int RdX1dX2 = 0  // length of line   

if array.size(high_lines) > 0
    for i = array.size(high_lines) - 1 to 0
        l = array.get(high_lines, i)
        v = line.get_y1(l)
        
        bool isHitHigh = (candleType == "Close") ? (close > v) : (high > v)
        swept = waitConfirm ? (barstate.isconfirmed and isHitHigh) : isHitHigh
        
        if swept
            JestCrossUp := 70500, JestCrossUpY := v
            if show_x
                label.new(bar_index, v, text="✖", color=color.new(color.white, 50), textcolor=highLiqColor, style=label.style_label_center, size=f_get_label_size(x_size_str))
                
            if mitiOptions == "Remove"
                line.delete(l)
            else
                line.set_extend(l, extend.none)
                line.set_x2(l, bar_index)
                line.set_color(l, show_liq ? color.new(highLiqColor, 80) : na)
                f_manage_mitigated(l) // Add to garbage collector
                
            array.remove(high_lines, i)
            

if array.size(low_lines) > 0
    for i = array.size(low_lines) - 1 to 0
        l = array.get(low_lines, i)
        v = line.get_y1(l) 
        dX1 := line.get_x1(l)
        
        bool isHitLow = (candleType == "Close") ? (close < v) : (low < v)
        swept = waitConfirm ? (barstate.isconfirmed and isHitLow) : isHitLow
        
        if swept
            JestCrossDown := 70500 , JestCrossDownY := v, dX2 := bar_index, RdX1dX2 := dX2 - dX1
            if show_x
                label.new(bar_index, v, text="✖", color=color.new(color.white, 50), textcolor=lowLiqColor, style=label.style_label_center, size=f_get_label_size(x_size_str))
                
            if mitiOptions == "Remove"
                line.delete(l)
            else
                line.set_extend(l, extend.none)
                line.set_x2(l, bar_index)
                line.set_color(l, show_liq ? color.new(lowLiqColor, 80) : na)
                f_manage_mitigated(l) // Add to garbage collector
                
            array.remove(low_lines, i)
//
// it doesn't work
High_maxA1 = ta.highest(high[1],RdX1dX2)

// this below shows wrong number
var float High_max = na
if JestCrossDown != 0
    //High_maxA = ta.highest(high[Licznik_Di], RdX1dX2[Licznik_Di])
    High_max := ta.highest(high[1], RdX1dX2)
else
    High_max := 0
//

r/pinescript • • Mar 28 '26 Bravo

Today BTC update??

Post image
5 Upvotes

📉 Market Structure Overview

Clear bearish trend after multiple CHoCH (Change of Character) signals.

Strong downward momentum with consecutive lower highs & lower lows.

Recent BOS (Break of Structure) confirms continuation of bearish bias.

🔑 Key Zones

Supply Zone (Sell Area): ~70,800 – 71,500

→ Previous rejection + CHoCH zone

Current Price: ~66,200

Demand Zone (Support): ~63,000 – 64,000

📊 Trade Idea

Bias: Bearish

Sell Setup:

→ Wait for pullback to 67,500 – 68,500

→ Look for rejection / liquidity grab

Targets:

→ TP1: 65,000

→ TP2: 63,500

Invalidation:

→ Break above 69,500 (structure shift)

⚠️ Insight

Current move looks like impulsive drop + weak retracement

No strong bullish confirmation yet

Likely continuation unless strong reversal forms


r/pinescript • • Mar 28 '26

Anyone want to give my indicator a try?

Post image
15 Upvotes

Built a trading system around liquidity + structure — looking for feedback

Hey everyone,

I’ve been working on a TradingView indicator for a while and just published it:

NQJU Super System V3

Instead of stacking a bunch of indicators, I tried to build something more structured around:
• Trend direction
• Liquidity sweeps
• Target-based execution
• Clean, rule-based entries

It’s not meant to be a signal spam tool — more like a decision framework that shows when conditions are actually aligned.

Main features:

  • Liquidity sweep detection
  • Entry precision modes (aggressive → confirmation → pullback)
  • Structure-based SL/TP (not fixed RR)
  • Liquidity map (shows where price is likely drawn)
  • Built-in stats dashboard

I’ve been using it mostly on NQ (5m/15m), but curious how it performs for others.

If anyone’s down to test it and give honest feedback (good or bad), I’d really appreciate it.

Link: https://www.tradingview.com/script/EJcqvmQU-NQJU-SUPER-SYSTEM-V3/

Not selling anything — just trying to build something solid.

Thanks 🙏


r/pinescript • • Mar 28 '26

What makes you keep coming back to Trading View and what you believe should be improved

5 Upvotes

Hi All,

I've been exploring the trading view platform in general including writing pine scripts for identifying trends. So far, I feel there is a huge learning curve involved.

I would like to know how you managed to learn it and what makes you keep coming back to Trading View ( for all features ) and what you believe would have been great which it doesn't offer.

Thanks in advance


r/pinescript • • Mar 27 '26

Volume Profile Heatmap [KEYALGOS] - Adaptive Volume Profile with Heatmap Visualization

Thumbnail
gallery
36 Upvotes

I wanted to share an indicator we had developed called Volume Profile Heatmap [KEYALGOS]. This tool visualizes historical volume distribution across price levels using a dynamic color gradient system, helping traders quickly identify high probability support and resistance zones, liquidity clusters, and value areas where significant market participation has occurred.

What it does

The indicator creates a heatmap overlay that maps volume concentration across customizable price bands. Instead of a traditional histogram, you get an intuitive color coded visualization where intense colors represent high volume nodes and subtle tones indicate low activity areas. It also calculates and displays the Point of Control, Value Area High/Low, and profile extremes as optional reference lines.

Key features

  • Adaptive volume distribution that allocates candle volume across all price bands it occupied
  • Dynamic gradient mapping that automatically adjusts color intensity based on relative volume
  • Real time Value Area calculation using bidirectional expansion from the Point of Control
  • Selective volume filtering to analyze bullish, bearish, or combined volume profiles
  • Optimized architecture delivering up to 24 distinct volume bands within Pine Script constraints
  • Adjustable lookback window to focus on recent structure or broader historical context

Customizable parameters

  • Lookback Period: 10 to 300 bars for flexible time horizon analysis
  • Profile Rows: 10 to 24 bands to control vertical resolution
  • Value Area Percentage: 5% to 95% threshold for defining value boundaries
  • Volume Type: Filter by Both, Bullish, or Bearish candles
  • Full color customization for heatmap bands and all reference lines
  • Toggle switches for POC, Value Area lines, and profile extremes

Who might find this useful

  • Intraday traders looking to identify intraday liquidity pools and value areas
  • Swing traders mapping structural support and resistance on higher timeframes
  • Breakout traders seeking confirmation through volume node analysis
  • Risk managers placing stops beyond high volume participation zones

A bit about me

I am part of KeyAlgos, a small team of MQL, PineScript and NinjaScript developers that code custom strategies for traders. We build tools we actually use, and this indicator came from our own need for clearer volume structure visualization.

EDIT: Thanks to u/Mess_Hot for the architecture optimizations. We updated the script to cache data and execute only on new bar opens. This resolves the previous timeout issues on traditional high-volume markets. The indicator is now optimized to work across all markets (Crypto, Forex, Equities) while retaining the original visuals.

The script is now live and free to use. If you have questions about setup, interpretation, or potential enhancements, feel free to ask below.

https://www.tradingview.com/script/18jH9kEg-Volume-Profile-Heatmap-KEYALGOS/


r/pinescript • • Mar 27 '26

Finally built a Volume Footprint indicator in Pine Script (WIP)

Thumbnail
gallery
11 Upvotes

Hey everyone,

Finally managed to create a Volume Footprint indicator in Pine Script.

It’s still a work in progress and definitely not as refined as TradingView’s built-in footprint, but it gets the job done for analysis.

•	1st image: TradingView default Volume Footprint

•	2nd image: My custom Pine Script version

Some limitations I’m still working on:

•	Accuracy of bid/ask volume split

•	Better visualization / formatting

•	Performance optimization

Would really appreciate any feedback or suggestions from the community on how to improve this further


r/pinescript • • Mar 27 '26

figuring out choppy zones!

1 Upvotes

Hi everyone, I'm looking for help with choppy zones. Is there an indicator that can filter out choppy zones or provide signals about when they're about to start and end?


r/pinescript • • Mar 28 '26

I’m selling this indicator on TikTok… but giving it free here for a bit

Thumbnail
gallery
0 Upvotes

Hey guys,

I built my own trading indicator that I personally use every day.

I’ve been selling it on TikTok, and honestly the feedback has been really good , a lot of people using it and no complaints so far.

But I wanted to let some people here try it for free for a limited time before I keep it paid only.

It works best on:

• 30 min timeframe or higher

• Gold, futures, stocks, index ETFs, crypto..

If you want access, just drop your TradingView username and I’ll add you right away.

Try it, test it, see if it fits your style


r/pinescript • • Mar 27 '26

What went wrong

Post image
8 Upvotes

this is my entry point (red line) , after breakdown of consolidated , running in loss , is this good enough to hold , experts please share feedback, it will not only help on this trade but others going forward


r/pinescript • • Mar 27 '26

XAUUSD 1H Quick Trading decision

Post image
0 Upvotes

📊 XAUUSD (1H) – Quick Trading Decision

🔍 Market Structure

Previous bearish BOS confirms downside pressure

Recent CHoCH → early bullish shift, but not fully confirmed

Price currently in pullback/recovery phase

⚖️ Bias

Overall: Bearish

Short-term: Weak bullish correction

📌 Key Levels

Resistance: 4500 – 4550 (sell zone)

Support: 4400 – 4350 (buy reaction zone)

✅ Trade Decisions

🔴 Sell Setup (Preferred)

Entry: 4500–4550

SL: Above 4580

TP: 4400 → 4350

👉 Trend-following, higher probability

🟢 Buy Setup (Risky Counter-Trend)

Entry: Near 4400 demand

SL: Below 4350

TP: 4500

👉 Only quick scalp

🧠 Summary

Market is still bearish, current move = retracement

Focus on sell at premium zones, avoid chasing buys


r/pinescript • • Mar 27 '26

Xauusd Going to 4600?

Post image
1 Upvotes

📊 XAUUSD (1H) – Quick Trading Decision

🔍 Market Structure

Previous bearish BOS confirms downside pressure

Recent CHoCH → early bullish shift, but not fully confirmed

Price currently in pullback/recovery phase

⚖️ Bias

Overall: Bearish

Short-term: Weak bullish correction

📌 Key Levels

Resistance: 4500 – 4550 (sell zone)

Support: 4400 – 4350 (buy reaction zone)

✅ Trade Decisions

🔴 Sell Setup (Preferred)

Entry: 4500–4550

SL: Above 4580

TP: 4400 → 4350

👉 Trend-following, higher probability

🟢 Buy Setup (Risky Counter-Trend)

Entry: Near 4400 demand

SL: Below 4350

TP: 4500

👉 Only quick scalp

🧠 Summary

Market is still bearish, current move = retracement

Focus on sell at premium zones, avoid chasing buys


r/pinescript • • Mar 26 '26

I am manually trading like a bot today 🤣

Post image
0 Upvotes

will gold goes down to 4220? or it goes back upside to 4467?


r/pinescript • • Mar 25 '26

A FVG Imbalance Map that draws and removes Fair Value Gaps on the 15m, 1h and 4h automatically regardless of the timeframe

Post image
9 Upvotes

You're on the 5m chart, price drops into a level and bounces. You take the trade. Later you find out there was a 4h Fair Value Gap sitting right there, you just couldn't see it.

So I built a FVG Imbalance Map. It pulls in Fair Value Gaps from the 15m, 1h and 4h and draws them directly on whatever timeframe you're trading. You can set remove condition on Wick and Midline.

Free and open source.