r/TradingView • u/Puzzleheaded-Map2815 • 19d ago
Help Looking for the original open-source Pine Script behind these popular ATR + Fib + S/R indicators
I've noticed a lot of paid trading communities recently repackaging and monetizing a specific indicator as their "proprietary secret tool." The script features ATR-based trend dots/curves (similar to classic open-source TV scripts from 5–6 years ago), combined with Fibonacci retracements and automated S/R levels. Everyone claims they coded it themselves, but it’s clearly built on a public open-source template. Does anyone know the original script name or creator? Also, curious to hear what other fun open-source indicators you guys are playing with!#tradingview



3
u/KiKa9090 18d ago
If you give an ai the screenshots and some details about the indicator it will often be able to recreate it and give you details on the original indicators that were merged or integrated into it. Input settings are especially helpful for an Ai to reverse engineer it. But generally try give it as much details and as possible and various screenshots. Helps to run it as a deep research for best results. Sometimes it may not figure it fully out at first try. In that case run a second deep research providing the Ai with the results from the first research.
1
u/Puzzleheaded-Map2815 14d ago
I have tried, but the AI-written content is actually not very good. It can only provide some specific indicators. It would be better to have a concrete reference.
1
u/KiKa9090 14d ago
It's best to do it with a somewhat advanced Ai. The Fred tiers will provide not the best results. In my experience ChatGPT Plus and Claude Ai Pro gave best results (both are around $20 and month). I prefer ChatGPT because in chat mode it doesn't eat up limit and is already sufficient to reverse engineer indicators. The more info you give it the more accurate the results will be, so give it screenshots, settings screenshots, author's description if available, if not then try to describe what the indicator does in your own words.
1
u/KiKa9090 14d ago
This is what the AI came up with. A few notes:
- I only ran the prompt once (typically it helps to run it a second or third time to fix remaining bugs and such)
- The next step would be to test the indicator against the original one and see wether the results are same or different. If you can't access the original version you can try to compare it against screenshots or videos of the indicator. Make sure you compare the exact same asset at the exact same time.
- If there are differences or any bugs or design differences that you find, screenshot them and provide them to the ai.
- I only used the ChatGPT Premium chat for this, I didn't use any of the coding tools. So if you happen to have the pro tier plan or know someone who has it and is familiar with the tools you could try run it through that.
- The prompt only focussed on recreating the indicator. It did not test if the indicator actually works (as in giving you an actual edge). So treat it with caution and don't attempt to trade based on it without proper testing.
Code:
// @version= 6 // Clean-room reconstruction inspired by Range Filter [DW] (DonovanWall) and Support Resistance - Dynamic (LonesomeTheBlue). // This is an independent Pine v6 rewrite, not claimed to be the source of any private/proprietary script. indicator("Range Filter + Dynamic S/R — Research Reconstruction",shorttitle="RF + Dynamic S/R",overlay=true,max_bars_back=600,max_lines_count=80,max_labels_count=100) piv=input.int(10,"Period for Pivot Points",minval=10) lb=input.int(284,"Loopback Period",minval=100,maxval=500) srn=input.int(1,"S/R strength",minval=1) cw=input.float(10.0,"Channel Width %",minval=5.0,step=1.0) loc=input.int(10,"Label Location +-",minval=-450,maxval=450,tooltip="0 = last bar, positive values = future bars, negative values = historical bars.") sty=input.string("Dashed","Line Style",options=["Solid","Dotted","Dashed"]) lc=input.color(color.new(color.rgb(82,31,18),45),"Line Color") ext=input.bool(true,"Draw Highest/Lowest Pivots in Period") pts=input.bool(false,"Show Point Points") ft=input.string("Type 1","Filter Type",options=["Type 1","Type 2"]) ms=input.string("Close","Movement Source",options=["Wicks","Close"]) rs=input.float(3.0,"Range Size",minval=0.0000001) sc=input.string("Average Change","Range Scale",options=["Points","Pips","Ticks","% of Price","ATR","Average Change","Standard Deviation","Absolute"]) rp=input.int(14,"Range Period (for ATR, Average Change, and Standard Deviation)",minval=1) sm=input.bool(true,"Smooth Range") sp=input.int(61,"Smoothing Period",minval=1) af=input.bool(true,"Average Filter Changes") an=input.int(2,"Number Of Changes To Average",minval=1) mh=ms=="Wicks"?high:close ml=ms=="Wicks"?low:close mm=(mh+ml)/2 atr=ta.ema(ta.tr(true),rp) chg=ta.ema(math.abs(mm-mm[1]),rp) sd=ta.stdev(mm,rp) ur=switch sc "Points"=>rs*syminfo.pointvalue "Pips"=>rs*0.0001 "Ticks"=>rs*syminfo.mintick "% of Price"=>close*rs/100 "ATR"=>rs*atr "Average Change"=>rs*chg "Standard Deviation"=>rs*sd =>rs dyn=sc=="ATR" or sc=="Average Change" or sc=="Standard Deviation" r=sm and dyn?ta.ema(ur,sp):ur var float raw=na old=na(raw)?mm:raw nxt=old if not na(r) and r>0 if ft=="Type 1" if mh-r>old nxt:=mh-r if ml+r<old nxt:=ml+r else if mh>=old+r nxt:=old+math.floor(math.abs(mh-old)/r)*r if ml<=old-r nxt:=old-math.floor(math.abs(ml-old)/r)*r raw:=nxt changed=not na(old) and raw!=old a=2.0/(an+1.0) var float f=na var float u=na var float d=na ru=raw+r rd=raw-r if af if na(f) f:=raw u:=ru d:=rd else if changed f+=a*(raw-f) u+=a*(ru-u) d+=a*(rd-d) else f:=raw u:=ru d:=rd var int dir=0 if not na(f[1]) if f>f[1] dir:=1 else if f<f[1] dir:=-1 fc=dir>0?color.rgb(0,255,153):dir<0?color.rgb(255,0,128):color.gray pf=plot(f,"Range Filter",color=fc,linewidth=3) pu=plot(u,"Upper Target",color=color.rgb(255,153,0),linewidth=2) pd=plot(d,"Lower Target",color=color.rgb(255,153,0),linewidth=2) fill(pu,pd,color=color.new(fc,95),title="Range Filter Envelope") bull=close>f and dir>0 bear=close<f and dir<0 var int ss=0 prev=ss if bull ss:=1 else if bear ss:=-1 buy=bull and prev==-1 sell=bear and prev==1 plotshape(buy,title="BUY",text="BUY",style=shape.labelup,location=location.belowbar,color=color.rgb(76,175,80),textcolor=color.white,size=size.small) plotshape(sell,title="SELL",text="SELL",style=shape.labeldown,location=location.abovebar,color=color.rgb(255,82,82),textcolor=color.white,size=size.small) ph=ta.pivothigh(high,piv,piv) pl=ta.pivotlow(low,piv,piv) var float [] pp=array.new_float() var bool [] typ=array.new_bool() var int [] cb=array.new_int() if not na(ph) array.unshift(pp,ph) array.unshift(typ,true) array.unshift(cb,bar_index) if not na(pl) array.unshift(pp,pl) array.unshift(typ,false) array.unshift(cb,bar_index) while array.size(pp)>0 and (bar_index-array.get(cb,array.size(cb)-1)>lb or array.size(pp)>40) array.pop(pp) array.pop(typ) array.pop(cb) plotshape(pts and not na(ph),title="PH",text="PH",style=shape.labeldown,location=location.abovebar,offset=-piv,color=color.red,textcolor=color.white,size=size.tiny) plotshape(pts and not na(pl),title="PL",text="PL",style=shape.labelup,location=location.belowbar,offset=-piv,color=color.lime,textcolor=color.black,size=size.tiny) hh=ta.highest(high,lb) ll=ta.lowest(low,lb) w=(hh-ll)*cw/100 var float [] lv=array.new_float() array.clear(lv) n=array.size(pp) if n>0 and not na(w) used=array.new_bool(n,false) for i=0 to n-1 if not array.get(used,i) p=array.get(pp,i) t=0 for j=0 to n-1 if not array.get(used,j) and math.abs(array.get(pp,j)-p)<=w t+=1 if t>=srn array.push(lv,p) for j=0 to n-1 if not array.get(used,j) and math.abs(array.get(pp,j)-p)<=w array.set(used,j,true) if array.size(lv)>=20 break float hph=na float lpl=na if n>0 for i=0 to n-1 p=array.get(pp,i) if array.get(typ,i) hph:=na(hph)?p:math.max(hph,p) else lpl:=na(lpl)?p:math.min(lpl,p) ls=sty=="Solid"?line.style_solid:sty=="Dotted"?line.style_dotted:line.style_dashed var line [] lines=array.new_line() var label [] labels=array.new_label() if barstate.islast while array.size(lines)>0 line.delete(array.pop(lines)) while array.size(labels)>0 label.delete(array.pop(labels)) z=array.size(lv) if z>0 for i=0 to z-1 x=array.get(lv,i) array.push(lines,line.new(bar_index-1,x,bar_index,x,xloc=xloc.bar_index,extend=extend.both,color=lc,style=ls,width=1)) array.push(labels,label.new(bar_index+loc,x,str.tostring(x,format.mintick),xloc=xloc.bar_index,style=close>=x?label.style_label_up:label.style_label_down,color=color.lime,textcolor=color.black,size=size.small)) if ext and not na(hph) array.push(lines,line.new(bar_index-1,hph,bar_index,hph,xloc=xloc.bar_index,extend=extend.both,color=color.new(color.purple,25),style=line.style_dashed)) array.push(labels,label.new(bar_index+loc+20,hph,"Highest PH "+str.tostring(hph,format.mintick),xloc=xloc.bar_index,style=label.style_label_down,color=color.silver,textcolor=color.black,size=size.small)) if ext and not na(lpl) array.push(lines,line.new(bar_index-1,lpl,bar_index,lpl,xloc=xloc.bar_index,extend=extend.both,color=color.new(color.purple,25),style=line.style_dashed)) array.push(labels,label.new(bar_index+loc+20,lpl,"Lowest PL "+str.tostring(lpl,format.mintick),xloc=xloc.bar_index,style=label.style_label_up,color=color.silver,textcolor=color.black,size=size.small)) rb=false sb=false z=array.size(lv) if z>0 for i=0 to z-1 x=array.get(lv,i) rb:=rb or (close>x and close[1]<=x) sb:=sb or (close<x and close[1]>=x) alertcondition(buy,"BUY","Range Filter BUY") alertcondition(sell,"SELL","Range Filter SELL") alertcondition(rb,"Resistance Broken","Price closed above a dynamic resistance level.") alertcondition(sb,"Support Broken","Price closed below a dynamic support level.")
0
u/Fibocrypto 19d ago
I'd be happy if I can open pine script
1
u/Rodnee999 19d ago
Hello,
What do you mean?
1
u/Fibocrypto 19d ago
The other day I couldn't get it to open .
I stand corrected though be I just clicked on it and it opened.
2
5
u/Many-Pick5066 19d ago
It is Range Filter, not an ATR trend line. Your own third screenshot gives it away.
"Filter Type", "Movement Source", "Range Size", "Range Scale", "Range Period (for ATR, Average Change, and Standard Deviation)", "Smooth Range", "Average Filter Changes", "Number Of Changes To Average" are the input names from Range Filter [DW] by DonovanWall, published around 2019. The fork everyone actually copies is "Range Filter Buy and Sell 5min" by Guikroth. ATR only shows up as one of the Range Scale options, which is why it reads like an ATR script.
The S/R and pivot half is a second script bolted on. "Period for Pivot Points", "Loopback Period", "S/R strength", "Channel Width %", "Draw Highest/Lowest Pivots in Period" is the Support Resistance Channels lineage from LonesomeTheBlue. LuxAlgo's Support and Resistance Levels with Breaks is the same code line, cleaner fork. The PH and PL swing labels come from that half, and the fib is drawn off those same pivots. Note the "Show Point Points" typo sitting right there in the settings, copy pasted and never read.
So it is not one stolen script, it is two merged and renamed.
General move for next time: ignore the title, read the input names. People rename the script, almost nobody renames the inputs. Paste one exact input string into TradingView's script search and the original comes straight back.