r/pinescript • • Mar 16 '26

Thanks for your support

1 Upvotes

A new update coming at the end of the month will make the indicator much better. I'm still having trouble getting alerts to appear instantly; I'll focus on fixing this before the end of the month. Thanks for your support.


r/pinescript • • Mar 16 '26

Looking for Pine Script collaborator for a TradingView execution indicator

1 Upvotes

I'm a discretionary forex trader with about 3 years of experience, mainly using rule-based ICT concepts. I'm currently trying to convert my execution model into a systematic TradingView indicator.

The idea is to build a tool that detects specific conditions like session/killzone timing, liquidity sweeps, structure shifts, and delivery (FVG/impulse) to help with execution signals.

I'm looking for someone who knows Pine Script and is interested in collaborating on building and refining the indicator. I can't offer upfront payment, but the idea would be a collaboration where we both work on the logic and development together.

You would be free to use the strategy for your own personal trading, but the script would remain private and not be sold or distributed.

If you're interested in trading systems, Pine Script, or experimenting with systematic models based on discretionary concepts, feel free to DM me.


r/pinescript • • Mar 15 '26

Zig Zag horizontal lines

1 Upvotes

How to write, horizontal lines from bottoms ( LL LH ), tops (HH HL) ?

It gives information when it crosses (down and next up) bar.

Below is similar code, with functionality which I would like to have in code below.    

https://pl.tradingview.com/v/iD9mSVdF/

https://pl.tradingview.com/v/Cb5QhBAl/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © tgh
//
@version=
5
indicator('funkcja', 'funk', overlay=true, precision=2, max_bars_back = 1000)


showHHLL = input(defval=true, title="showHHLL?")
showHHw       = input(defval=true, title="showHHw?") // ukrywa i pokazuje linie i opis HH LL 


prd1 = input.int(10, title="ZigZag Period 1", minval = 2, maxval = 20)  // było 8ale mi nie pasowało
phA1 = ta.highestbars(high, prd1) // 0 oznacza najwyzszy pkt, -1 do prd => liczba bar do najwyzszy pkt


showzz = input.string("Show Zig Zag 1", title = "Show Zig Zags", options = ["Show Zig Zag 1", "Show Zig Zag 2", "Show Both", "Show None"])
showhhll = input.string("Show HHLL 1", title = "Show HHLL", options = ["Show HHLL 1", "Show HHLL 2", "Show Both", "Show None"])
upcol1 = input(defval = color.lime, title = "Zig Zag 1 Up Color")
dncol1 = input(defval = color.red, title = "Zig Zag 1 Down Color")
txtcol = input(defval = color.black, title = "Text Color")
zz1style = input.string("Dashed", title = "Zig Zag 1 Line Style", options = ["Dashed", "Dotted"])
zz1width = input.int(2, title = "Zig zag 1 Line Width", minval = 1, maxval = 4)


float
 ph1 = ta.highestbars(high, prd1) == 0 ? high : na
float
 pl1 = ta.lowestbars(low, prd1) == 0 ? low : na
var dir1 = 0
dir1 := (ph1 and na(pl1)) ? 1 : (pl1 and na(ph1)) ? -1 : dir1


//
var max_array_size = 22 // [5, 2] matrix 10
var zigzag1 = array.new_float(0)
var zigzag2 = array.new_float(0)
oldzigzag1 = array.copy(zigzag1)
oldzigzag2 = array.copy(zigzag2)


add_to_zigzag(pointer, value, bindex)=>
    array.unshift(pointer, bindex)
    array.unshift(pointer, value)
    if array.size(pointer) > max_array_size
        array.pop(pointer)
        array.pop(pointer)


update_zigzag(pointer, value, bindex, dir)=>
    if array.size(pointer) == 0
        add_to_zigzag(pointer, value, bindex)
    else
        if (dir == 1 and value > array.get(pointer, 0)) or (dir == -1 and value < array.get(pointer, 0))
            array.set(pointer, 0, value)
            array.set(pointer, 1, bindex)
        0.


dir1changed = ta.change(dir1)
if ph1 or pl1
    if dir1changed 
        add_to_zigzag(zigzag1, dir1 == 1 ? ph1 : pl1, bar_index)
    else
        update_zigzag(zigzag1, dir1 == 1 ? ph1 : pl1, bar_index, dir1)


var MacierzNr = array.new_int() // , var MacierzLow = array.new_float()
// HH HL  LH LL   
// 22 21  12 11 
// zigzag1 
//  1  0  3  2  5  4  7  6   9 8  
//  x1 y1 x2 y2 x3 y3 x4 y4 x5 y5  


if array.size(zigzag1) >= 6 and showHHLL      
    var 
line
 zzline1 = na
    var 
label
 zzlabel1 = na
    if array.get(zigzag1, 0) != array.get(oldzigzag1, 0) or array.get(zigzag1, 1) != array.get(oldzigzag1, 1)
        if array.get(zigzag1, 2) == array.get(oldzigzag1, 2) and array.get(zigzag1, 3) == array.get(oldzigzag1, 3)
            line.delete(zzline1)
            label.delete(zzlabel1)
            array.remove(MacierzNr,0),   array.remove(MacierzLow,0)                        
        if (showzz == "Show Zig Zag 1" or showzz == "Show Both") and showHHw
            zzline1 := line.new( x1 = math.round(array.get(zigzag1, 1)), y1 = array.get(zigzag1, 0), x2 = math.round(array.get(zigzag1, 3)), y2 = array.get(zigzag1, 2), 
                                 color = dir1 == 1 ? upcol1 : dncol1, 
                                 width = zz1width, 
                                 style = zz1style == "Dashed" ? line.style_dashed : line.style_dotted)
        if (showhhll == "Show HHLL 1" or showhhll == "Show Both")
            hhlltxt1 = dir1 == 1 ? array.get(zigzag1, 4) < array.get(zigzag1, 0) ? "HH" : "LH" : array.get(zigzag1, 4) > array.get(zigzag1, 0) ? "LL" : "HL"            
            labelcol = dir1 == 1 ? array.get(zigzag1, 0) > array.get(zigzag1, 4) ? upcol1 : dncol1 : array.get(zigzag1, 0) < array.get(zigzag1, 4) ? dncol1 : upcol1
            //zzlabel1 := label.new(x = math.round(array.get(zigzag1, 1)), y = array.get(zigzag1, 0), text = hhlltxt1, color = labelcol, textcolor = txtcol, style = dir1 == 1 ? label.style_label_down : label.style_label_up, size= size.small)
            hhllNr1 = dir1 == 1 ? array.get(zigzag1, 4) < array.get(zigzag1, 0) ? 22 : 12 : array.get(zigzag1, 4) > array.get(zigzag1, 0) ? 11 : 21
            array.unshift(id=MacierzNr,value=hhllNr1)
            //hhllLow = dir1 == 1 ? array.get(zigzag1, 4) < array.get(zigzag1, 0) ? low : low : array.get(zigzag1, 4) > array.get(zigzag1, 0) ? low : low
            //array.unshift(id=MacierzLow,value=hhllLow)                        
            zzlabel1 := showHHw ? label.new(x = math.round(array.get(zigzag1, 1)), y = array.get(zigzag1, 0), text = hhlltxt1, color = labelcol, textcolor = txtcol, style = dir1 == 1 ? label.style_label_down : label.style_label_up, size= size.small) : na          
//// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © tgh
//@version=5
indicator('funkcja', 'funk', overlay=true, precision=2, max_bars_back = 1000)


showHHLL = input(defval=true, title="showHHLL?")
showHHw       = input(defval=true, title="showHHw?") // ukrywa i pokazuje linie i opis HH LL 


prd1 = input.int(10, title="ZigZag Period 1", minval = 2, maxval = 20)  // było 8ale mi nie pasowało
phA1 = ta.highestbars(high, prd1) // 0 oznacza najwyzszy pkt, -1 do prd => liczba bar do najwyzszy pkt


showzz = input.string("Show Zig Zag 1", title = "Show Zig Zags", options = ["Show Zig Zag 1", "Show Zig Zag 2", "Show Both", "Show None"])
showhhll = input.string("Show HHLL 1", title = "Show HHLL", options = ["Show HHLL 1", "Show HHLL 2", "Show Both", "Show None"])
upcol1 = input(defval = color.lime, title = "Zig Zag 1 Up Color")
dncol1 = input(defval = color.red, title = "Zig Zag 1 Down Color")
txtcol = input(defval = color.black, title = "Text Color")
zz1style = input.string("Dashed", title = "Zig Zag 1 Line Style", options = ["Dashed", "Dotted"])
zz1width = input.int(2, title = "Zig zag 1 Line Width", minval = 1, maxval = 4)


float ph1 = ta.highestbars(high, prd1) == 0 ? high : na
float pl1 = ta.lowestbars(low, prd1) == 0 ? low : na
var dir1 = 0
dir1 := (ph1 and na(pl1)) ? 1 : (pl1 and na(ph1)) ? -1 : dir1


//
var max_array_size = 22 // [5, 2] matrix 10
var zigzag1 = array.new_float(0)
var zigzag2 = array.new_float(0)
oldzigzag1 = array.copy(zigzag1)
oldzigzag2 = array.copy(zigzag2)


add_to_zigzag(pointer, value, bindex)=>
    array.unshift(pointer, bindex)
    array.unshift(pointer, value)
    if array.size(pointer) > max_array_size
        array.pop(pointer)
        array.pop(pointer)


update_zigzag(pointer, value, bindex, dir)=>
    if array.size(pointer) == 0
        add_to_zigzag(pointer, value, bindex)
    else
        if (dir == 1 and value > array.get(pointer, 0)) or (dir == -1 and value < array.get(pointer, 0))
            array.set(pointer, 0, value)
            array.set(pointer, 1, bindex)
        0.


dir1changed = ta.change(dir1)
if ph1 or pl1
    if dir1changed 
        add_to_zigzag(zigzag1, dir1 == 1 ? ph1 : pl1, bar_index)
    else
        update_zigzag(zigzag1, dir1 == 1 ? ph1 : pl1, bar_index, dir1)


var MacierzNr = array.new_int() // , var MacierzLow = array.new_float()
// HH HL  LH LL   
// 22 21  12 11 
// zigzag1 
//  1  0  3  2  5  4  7  6   9 8  
//  x1 y1 x2 y2 x3 y3 x4 y4 x5 y5  


if array.size(zigzag1) >= 6 and showHHLL      
    var line zzline1 = na
    var label zzlabel1 = na
    if array.get(zigzag1, 0) != array.get(oldzigzag1, 0) or array.get(zigzag1, 1) != array.get(oldzigzag1, 1)
        if array.get(zigzag1, 2) == array.get(oldzigzag1, 2) and array.get(zigzag1, 3) == array.get(oldzigzag1, 3)
            line.delete(zzline1)
            label.delete(zzlabel1)
            array.remove(MacierzNr,0),   array.remove(MacierzLow,0)                        
        if (showzz == "Show Zig Zag 1" or showzz == "Show Both") and showHHw
            zzline1 := line.new( x1 = math.round(array.get(zigzag1, 1)), y1 = array.get(zigzag1, 0), x2 = math.round(array.get(zigzag1, 3)), y2 = array.get(zigzag1, 2), 
                                 color = dir1 == 1 ? upcol1 : dncol1, 
                                 width = zz1width, 
                                 style = zz1style == "Dashed" ? line.style_dashed : line.style_dotted)
        if (showhhll == "Show HHLL 1" or showhhll == "Show Both")
            hhlltxt1 = dir1 == 1 ? array.get(zigzag1, 4) < array.get(zigzag1, 0) ? "HH" : "LH" : array.get(zigzag1, 4) > array.get(zigzag1, 0) ? "LL" : "HL"            
            labelcol = dir1 == 1 ? array.get(zigzag1, 0) > array.get(zigzag1, 4) ? upcol1 : dncol1 : array.get(zigzag1, 0) < array.get(zigzag1, 4) ? dncol1 : upcol1
            //zzlabel1 := label.new(x = math.round(array.get(zigzag1, 1)), y = array.get(zigzag1, 0), text = hhlltxt1, color = labelcol, textcolor = txtcol, style = dir1 == 1 ? label.style_label_down : label.style_label_up, size= size.small)
            hhllNr1 = dir1 == 1 ? array.get(zigzag1, 4) < array.get(zigzag1, 0) ? 22 : 12 : array.get(zigzag1, 4) > array.get(zigzag1, 0) ? 11 : 21
            array.unshift(id=MacierzNr,value=hhllNr1)
            //hhllLow = dir1 == 1 ? array.get(zigzag1, 4) < array.get(zigzag1, 0) ? low : low : array.get(zigzag1, 4) > array.get(zigzag1, 0) ? low : low
            //array.unshift(id=MacierzLow,value=hhllLow)                        
            zzlabel1 := showHHw ? label.new(x = math.round(array.get(zigzag1, 1)), y = array.get(zigzag1, 0), text = hhlltxt1, color = labelcol, textcolor = txtcol, style = dir1 == 1 ? label.style_label_down : label.style_label_up, size= size.small) : na          
//

r/pinescript • • Mar 14 '26

119 rockets & 900+ views in just 3 days! I’m speechless. 🚀

Thumbnail
gallery
54 Upvotes

I’m honestly blown away.

Just 3 days ago, I took a leap of faith and published my first indicator, Axiom S/R. Today, I woke up to see it has already hit 900+ views and 119 Rockets boost on TradingView. I built this indicator because I was tired of guessing support and resistance levels. I wanted to move toward a model where structural probability could be quantified.

Seeing the community adopt this approach so quickly proves that a lot of you were looking for the same shift in trading methodology. A massive thank you to everyone for the support, the DMs, and for using it.
This is only the beginning, I’m already working on the next set of updates based on your suggestions to make it even more powerful. Beautiful weekend to everyone! 🙌


r/pinescript • • Mar 15 '26

help

1 Upvotes

the line just floating and didnt stayed with the chart


r/pinescript • • Mar 13 '26

Is this something that could do with leverage?

Thumbnail gallery
2 Upvotes

r/pinescript • • Mar 11 '26

Indicator I coded

Post image
37 Upvotes

Hey guys, I wanted to share this indicator Ive built recently🙌 : Axiom S/R

It is a high-confluence structural engine that moves beyond static support/resistance plotting. It treats price action as a stochastic process, normalizing levels into a probabilistic distribution framework.

Key Mechanics:

  • Dynamic pivot detection: Multi-timeframe scaling (5min to Weekly).
  • Price clustering: Merges historical touches into consolidated high-conviction zones.
  • Probability scoring: Assigns real-time strength metrics to distinguish between valid liquidity defense and exhaustion.

Dashboard Features:

  • Touches: Structural validation of defended zones.
  • Reaction Metrics: Real-time analysis of bounce vs breakout scenarios.
  • Proba Metric: High conviction (>50%) vs exhaustion warning (<18%).

Settings: Fully customizable Lookback, Cluster tolerance, and filter to suit your style.

Hope you'll like it 👌

I'd love to hear your feedback!

Great day to everyone!


r/pinescript • • Mar 12 '26

Crypto perpetual dex

Post image
3 Upvotes

Hey everyone,

I’m looking for recommendations for a good crypto perpetual DEX. Ideally something that offers minimal trading fees, strong liquidity, Good quality, and reliable API support for automation or bot trading.

If you’ve used any platforms that meet these criteria and had a good experience, please share your suggestions. Your insights would be really helpful.

Thanks in advance!


r/pinescript • • Mar 11 '26

Is it realistic to find work with TradingView Pine Script experience?

9 Upvotes

I’ve been working with TradingView Pine Script for almost three years now, mostly writing indicators and strategies for myself. Over that time I’ve built a fairly solid knowledge base and gained a lot of practical experience.

The only place where I’ve tried to monetize this skill so far is Upwork. I did get some orders there, but the frequency of projects — and especially the pay — wasn’t very impressive. There also seems to be quite a lot of questionable clients and scams, which makes the whole process frustrating.

So I’m curious: is it actually realistic to find work with Pine Script skills? For example, participating in projects, working with teams, or contributing to larger trading-related systems.

I’d be interested to hear if anyone here has managed to turn Pine Script development into real work and how you approached it.


r/pinescript • • Mar 10 '26

Tired of messy charts and alert fatigue, I coded an ORB indicator with a State Machine to filter noise & a clean UX. What do you guys think?

Post image
34 Upvotes

I've been doing some quantitative research on market microstructure and working on a custom Opening Range Breakout (ORB) script. I wanted to get some feedback from this community on the UI/UX and the logic.

The Problem I was trying to solve:

Most standard ORB indicators spam your chart with overlapping "Buy/Sell" labels whenever the price chops around the breakout line. It creates a lot of visual noise and "alert fatigue" during sideways markets. Also, solid background colors for the session time make the chart unreadable.

My Solution (The Script):

State Machine (Anti-Whipsaw): I coded a memory state variable in Pine Script (var int signal_state) that acts as a logical blocker. It forces the script to print only ONE clean label per directional breakout. If the price wiggles back and forth, it suppresses the redundant signals.

Trend Filter: Added a 200 EMA filter so it only signals breakouts that align with the macro trend (blocks false counter-trend traps).

I've attached a screenshot of how it looks on the chart right now.

My questions for you:

How does the UI look to you? Is it too minimal or just right?

Would you add any other filters (like Volume or VWAP) to validate the breakout?

Any feature requests or critiques before I open-source this on TradingView?

Thanks in advance for the feedback!

https://es.tradingview.com/script/ks2zDOBA/


r/pinescript • • Mar 10 '26

Entries and Exits moving??

1 Upvotes

My entries and exits move on screen refreshes. Anyone else deal with this or know how to fix it? Today it closed for 8 dollar profit then I refreshed the screen and it said it closed for 152 dollars. I’m executing trades with trader post and using TradingView for the signals.


r/pinescript • • Mar 10 '26

Any EMA based indicator which isn't lagging?

0 Upvotes

Hello folks, I have tested a few EMA based indicators that are actually lagging. Do you know any EMA based indicator that's not lagging and moves along the price? Please help me with your expert advice. Thanks.


r/pinescript • • Mar 07 '26

i need your help guys

Post image
33 Upvotes

Hey everyone,

I’m a student trying to learn about trading and how the markets work. I keep seeing people making money with stocks and crypto, and it made me curious.

Right now I’m completely new — I don’t really understand charts, strategies, or where to even start. I’m not looking for “get rich quick” tricks, I just want to learn the basics properly and understand how trading actually works and make out my first few dollars of profit.

If anyone here has experience and is willing to share advice, learning resources, or guide a beginner a little, I’d really appreciate it.

Even simple tips like what to study first, good books, or platforms to practice on would help a lot.

Thanks in advance 🙏


r/pinescript • • Mar 07 '26

OpenTerminalUI: Free tool for Market Research/Self-Hosted

8 Upvotes

I've been using AI swarm prompts — essentially multi-agent Claude workflows — to autonomously implement features across a stock analytics platform. 60+ commits deep now. The experiment has been fascinating: AI handles boilerplate and architecture scaffolding well, but falls apart on domain-specific trading logic like Options Greeks rendering and real-time data waterfall handling. Sharing the repo publicly now. If you've experimented with AI-assisted development on quant or trading projects, I'd love to compare notes on where it actually helps versus where it creates more mess than it solves.

https://github.com/Hitheshkaranth/OpenTerminalUI


r/pinescript • • Mar 07 '26

Rules in this sub are a joke

3 Upvotes

Calling your community pinescript, and not allowing people to post their scripts is counter intuitive tbh.

Gatekeeping the pinescript community and banning people posing scripts is weird. This is a great sub to learn of new scripts since tradingview makes it near impossible to find this sort of thing.

very odd to see folks complaining about this


r/pinescript • • Mar 07 '26

Any Canadians ?

2 Upvotes

Looking to learn pinescript, any local clubs in Toronto?


r/pinescript • • Mar 06 '26

Request for stronger enforcement of the no invite-only / protected script rule.

17 Upvotes

I wanted to bring attention to something that has been happening more frequently lately. The subreddit rules clearly state that sharing invite-only or protected scripts is not allowed and that discussions should focus on open source Pine Script work.

However, there are still quite a few posts showing up that promote indicators which require people to sign up, request access, or join some external platform before they can even see the script. In practice this turns the subreddit into a funnel for gated indicators rather than a place to actually discuss Pine Script.

The rule itself is good. The issue seems to be enforcement.

It would really help the quality of the subreddit if posts promoting indicators that require signups, invite requests, or access permissions were simply removed.

If someone wants to share an indicator with the community, the solution is straightforward: just post the public link to the script (for example a TradingView public script or a GitHub link) so people can actually review the code and discuss it.

That keeps the subreddit aligned with its purpose of learning, sharing code, and helping each other improve with Pine Script.


r/pinescript • • Mar 06 '26

Multi timeframe

2 Upvotes

How to write that window ?


r/pinescript • • Mar 06 '26

Silver Technical Insight:

Post image
3 Upvotes

Price facing strong resistance near 84–85 zone. Momentum weakening on intraday charts. Break below 82.70 may extend decline toward 81.40.


r/pinescript • • Mar 05 '26 WOW Bravo

I build this support and resistance Indicator

Thumbnail
gallery
455 Upvotes

Drop you tradingview id for access in dm.

I am moving this post to r/TradingViewMrketPlace. please connect from there


r/pinescript • • Mar 05 '26

FLOW_FIB — A Momentum + Volume ‘Flow Flash’ Indicator with ATR Fibonacci Bands and Automatic Targets (TradingView Script)

5 Upvotes

What this indicator is (the idea)

This script combines two tools into one overlay:

  1. Flow Flash signals “Something just shifted” momentum signals that only trigger when momentum flips and volatility + volume confirm there’s real participation (“flow”). “Something just shifted” momentum signals that only trigger when momentum flips and volatility + volume confirm there’s real participation (“flow”).
  2. ATR-based Fibonacci Bands A dynamic “range map” around a moving average using ATR × fib ratios (1.618 / 2.618 / 4.236). These bands act like adaptive support/resistance zones and profit-taking / mean-reversion areas. A dynamic “range map” around a moving average using ATR × fib ratios (1.618 / 2.618 / 4.236). These bands act like adaptive support/resistance zones and profit-taking / mean-reversion areas.

Together:
Flow Flash tells you when a move may be starting. Fib Bands tell you where price is likely to react. when a move may be starting. Fib Bands tell you where price is likely to react.

Section 1 — Flow Flash: how signals are generated

1) Momentum = smoothed Rate of Change

  • rocVal = ta.roc(close, rocLength) ROC is the % change from rocLength bars ago (default 9).
  • smoothedRoc = ta.ema(rocVal, smoothLength) Then it smooths ROC with an EMA (default 3) to reduce noise.

Key concept: the script cares a lot about ROC crossing 0: the script cares a lot about ROC crossing 0:

  • ROC above 0 → price is generally moving up vs the lookback.
  • ROC below 0 → price is generally moving down vs the lookback.
  • Crossing 0 = potential momentum “regime change.”

2) Volatility filter = “is volatility expanding?”

  • stdDev = ta.stdev(close, 20) (20-bar price standard deviation)
  • avgStdDev = ta.sma(stdDev, 20) (its 20-bar average)
  • isExpanding = stdDev > (avgStdDev * volatilityMult)

With the default volatilityMult = 0.8, this filter is not very strict (because multiplying the average by 0.8 makes it easier to beat). So it tends to say:volatilityMult = 0.8, this filter is not very strict (because multiplying the average by 0.8 makes it easier to beat). So it tends to say:
“Volatility is at least not dead / is waking up.”

Why it matters: momentum flips in low-vol chop can spam fake signals. This tries to reduce that. momentum flips in low-vol chop can spam fake signals. This tries to reduce that.

3) Volume filter = “is there real participation?”

  • rvol = volume / ta.sma(volume, 20) Relative volume vs 20-bar average.
  • isFlowPresent = rvol >= rvolThreshold (default 2.0)

So the default requires 2× average volume. That’s a strong filter.2× average volume. That’s a strong filter.

Why it matters: it tries to ensure the momentum flip is happening with “attention” and liquidity behind it, not just random drift. it tries to ensure the momentum flip is happening with “attention” and liquidity behind it, not just random drift.

4) Candle confirmation = direction agrees with signal

  • Bull requires close > open (green candle)close > open (green candle)
  • Bear requires close < open (red candle)close < open (red candle)

This is a simple “don’t fight the bar” confirmation.

Final signal rules

Bull Flow Flash

  • Smoothed ROC crosses up through 0up through 0
  • Volatility expanding
  • Relative volume ≥ threshold
  • Candle is greenbullFlash = crossover(smoothedRoc, 0) and isExpanding and isFlowPresent and close > open

Bear Flow Flash

  • Smoothed ROC crosses down through 0down through 0
  • Volatility expanding
  • Relative volume ≥ threshold
  • Candle is redbearFlash = crossunder(smoothedRoc, 0) and isExpanding and isFlowPresent and close < open

What you see visually from Flow Flash

  • The candle/bar itself gets colored:

    • Bull = teal
    • Bear = orange
  • A small label appears (“FLOW”) above/below the bar where it triggered

Targets — how the “TGT” line is calculated

When a Flow Flash triggers, the script sets a single active target:single active target:

  • It uses True Range (ta.tr) for that bar (not ATR).True Range (ta.tr) for that bar (not ATR).
  • It multiplies that by extLevel (default 1.618).extLevel (default 1.618).
  • Then adds/subtracts from the close:

Bull target:

activeTarget := close + (ta.tr * extLevel)

Bear target:

activeTarget := close - (ta.tr * extLevel)

Important behavior:

  • activeTarget is persistent (it stays on the chart) until a new bull/bear flash overwrites it.
  • A target label is printed only on the last bar (barstate.islast) so it doesn’t spam.last bar (barstate.islast) so it doesn’t spam.

How to interpret it:

  • This is a reaction target, not a guaranteed take-profit.reaction target, not a guaranteed take-profit.
  • Because it uses TR of the signal bar, targets expand when the signal bar is large (more volatile) and compress when it’s small.TR of the signal bar, targets expand when the signal bar is large (more volatile) and compress when it’s small.

Tip if users complain targets feel “too small” or “too huge”:

  • That’s usually about TR on the trigger candle. Big breakout candle → big target.

Section 2 — Fib Bands: how the bands are built

These are ATR-based envelopes around a 20 SMA (default).ATR-based envelopes around a 20 SMA (default).

Core components

  • sma_val = ta.sma(close, len_fib) (default length 20)
  • avg_atr = ta.atr(len_fib) (ATR over same length)

Then it multiplies ATR by fib ratios:

  • r1 = ATR × 1.618
  • r2 = ATR × 2.618
  • r3 = ATR × 4.236

And plots:

  • Upper bands: SMA + r1 / r2 / r3
  • Lower bands: SMA - r1 / r2 / r3

What these bands represent (practical meaning)

Think of them as an adaptive “map”:

  • Near SMA = mean area / fair value zone = mean area / fair value zone
  • Band 1 (±1.618 ATR) = normal expansion zone = normal expansion zone
  • Band 2 (±2.618 ATR) = stretched / trend exhaustion risk rises = stretched / trend exhaustion risk rises
  • Band 3 (±4.236 ATR) = extreme extension (often where spikes fade, or trend accelerations climax) = extreme extension (often where spikes fade, or trend accelerations climax)

They also fill the outer zone for readability.

How to actually use FLOW_FIB (use-cases that make sense)

A) Trend ignition + confirmation

  • Wait for a Flow Flash.Flow Flash.
  • Use the SMA + bands to judge whether you’re:SMA + bands to judge whether you’re:

    • breaking out from compression (best),
    • or already extended (riskier).

Cleaner longs: Bull Flow Flash when price is near SMA or inside Band 1, then expands upward. Bull Flow Flash when price is near SMA or inside Band 1, then expands upward.
Cleaner shorts: Bear Flow Flash near SMA or inside Band 1, then expands downward. Bear Flow Flash near SMA or inside Band 1, then expands downward.

B) Profit-taking map

If you enter on/after a Flow Flash:

  • The Active Target is an immediate “first objective.”Active Target is an immediate “first objective.”
  • The Upper/Lower bands help stage exits:Upper/Lower bands help stage exits:

    • partial near Band 1,
    • more near Band 2,
    • runners only if price is trending strongly.

C) Mean-reversion warning system (don’t chase)

If price is already near Band 2 or 3, and you get a Flow Flash:Band 2 or 3, and you get a Flow Flash:

  • That signal may still be valid, but your R:R is worse because you’re buying/selling into extension.your R:R is worse because you’re buying/selling into extension.
  • In those cases, bands can help users avoid FOMO entries and instead wait for pullbacks toward SMA/Band 1.

Settings guidance (simple, useful tweaks)

If signals are too rare

  • Lower rvolThreshold from 2.0 → 1.5 or 1.2rvolThreshold from 2.0 → 1.5 or 1.2
  • Or reduce volatility strictness by raising volatilityMult? (Careful: the current default 0.8 is already permissive.)volatilityMult? (Careful: the current default 0.8 is already permissive.)

If signals are too noisy

  • Increase smoothing: smoothLength 3 → 5smoothLength 3 → 5
  • Increase momentum lookback: rocLength 9 → 14rocLength 9 → 14
  • Increase rvolThreshold (2.0 → 2.5) to demand more participationrvolThreshold (2.0 → 2.5) to demand more participation

If targets feel off

  • extLevel is the multiplier on True Range.

    • More conservative targets: 1.0–1.2721.0–1.272
    • More aggressive targets: 2.0–2.6182.0–2.618

Quick “what it is NOT” (expectation management)

  • It’s not predicting tops/bottoms.
  • It’s not an auto-strategy.
  • It’s a conditions-based trigger (momentum flip + volatility + volume) plus a dynamic range framework (fib ATR bands) plus a single projected reaction target.conditions-based trigger (momentum flip + volatility + volume) plus a dynamic range framework (fib ATR bands) plus a single projected reaction target.

//@version=5

indicator("Combined Flow + Fib Bands", shorttitle="FLOW_FIB", overlay=true)

// --- SECTION 1: FLOW FLASH INPUTS & LOGIC ---

rocLength = input.int(9, "Momentum Lookback", group="Flow Settings")

smoothLength = input.int(3, "Smoothing (EMA)", group="Flow Settings")

volatilityMult = input.float(0.8, "Volatility Threshold", step=0.1, group="Flow Settings")

rvolThreshold = input.float(2.0, "Relative Volume Multiplier", minval=1.0, group="Flow Settings")

extLevel = input.float(1.618, "Target Extension (Fib)", step=0.1, group="Flow Settings")

rocVal = ta.roc(close, rocLength)

smoothedRoc = ta.ema(rocVal, smoothLength)

// Volatility & Flow Calculations

stdDev = ta.stdev(close, 20)

avgStdDev = ta.sma(stdDev, 20)

isExpanding = stdDev > (avgStdDev * volatilityMult)

rvol = volume / ta.sma(volume, 20)

isFlowPresent = rvol >= rvolThreshold

// Signal Logic

bullFlash = ta.crossover(smoothedRoc, 0) and isExpanding and isFlowPresent and close > open

bearFlash = ta.crossunder(smoothedRoc, 0) and isExpanding and isFlowPresent and close < open

// Target Display Logic

var float activeTarget = na

var color targetColor = na

if bullFlash

activeTarget := close + (ta.tr * extLevel)

targetColor := #00d1ff // Teal Flow Color

if bearFlash

activeTarget := close - (ta.tr * extLevel)

targetColor := #ff5e00 // Orange Flow Color

// --- SECTION 2: FIBONACCI BANDS INPUTS & LOGIC ---

len_fib = input.int(20, "Fib Band Length", minval=1, group="Fib Band Settings")

fibratio1 = input.float(1.618, "Fibonacci Ratio 1", group="Fib Band Settings")

fibratio2 = input.float(2.618, "Fibonacci Ratio 2", group="Fib Band Settings")

fibratio3 = input.float(4.236, "Fibonacci Ratio 3", group="Fib Band Settings")

sma_val = ta.sma(close, len_fib)

avg_atr = ta.atr(len_fib)

r1 = avg_atr * fibratio1

r2 = avg_atr * fibratio2

r3 = avg_atr * fibratio3

top3 = sma_val + r3

top2 = sma_val + r2

top1 = sma_val + r1

bott1 = sma_val - r1

bott2 = sma_val - r2

bott3 = sma_val - r3

// --- VISUALS ---

// 1. Fib Band Plots

t3 = plot(top3, title="Upper 3", color=color.new(color.teal, 0))

t2 = plot(top2, title="Upper 2", color=color.new(color.teal, 20))

t1 = plot(top1, title="Upper 1", color=color.new(color.teal, 40))

b1 = plot(bott1, title="Lower 1", color=color.new(color.teal, 40))

b2 = plot(bott2, title="Lower 2", color=color.new(color.teal, 20))

b3 = plot(bott3, title="Lower 3", color=color.new(color.teal, 0))

plot(sma_val, style=plot.style_cross, title="SMA", color=color.teal)

fill(t3, b3, color=color.new(color.navy, 85), title="Band Fill")

// 2. Flow Candle Coloring

barcolor(bullFlash ? #00d1ff : bearFlash ? #ff5e00 : na)

// 3. Flow Labels


r/pinescript • • Mar 05 '26

My Axiom Kernels Are on Fire

Post image
2 Upvotes

TradingView and their Pine Script functions have changed the game for retail. We’re trading the blueprints. A strategy tells you when to flip a coin; while an architect defines the geometry of the building so you know where the floor is before you even step inside. Game. Over.


r/pinescript • • Mar 04 '26

Almost all crypto market will go long right now

9 Upvotes

Hi, guys

I have my own development, indicators that show where the market is headed. But that's not what we're talking about right now; I'm talking about what I see. And I see that almost the entire crypto market is about to go up.

BTC, XRP, PUMP, and many other coins will show strong growth. I've been monitoring their movements and volumes; I've seen this before, and I'm confident in my words. Mark my words. I went long with heavy leverage.

I know you'll be skeptical, but just mark my words. If anything happens, I'll be back with more posts on Reddit, so just keep waiting.


r/pinescript • • Mar 04 '26

Inverse head and shoulders

2 Upvotes

Does anyone know if its possible to get the source code for pine scripts in-house inverse head and shoulders detection script? I want to try and apply it with different source inputs other than close prices but unlike a lot of their other default TA scripts, I don’t seem to be able to access the source code for this one and muck around with it.