PageSourceSearch

https://www.luxalgo.com/_next/static/chunks/pages/pinets-ff1bc59bfe068382.js

js luxalgo.com collected 2026-09-25 20:27:09 UTC 30,116 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7365],{8520:(e,n,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/pinets",function(){return t(61965)}])},9811:(e,n,t)=>{"use strict";t.d(n,{A:()=>s});var a=t(66352),r=t(95132);function s(e){let{domain:n,name:t,src:s,className:i="size-7",imgSize:l=18}=e,c=(0,r.useMemo)(()=>{let e=[];return s&&e.push(s),n&&(e.push("https://www.google.com/s2/favicons?domain=".concat(n,"&sz=64")),e.push("https://icons.duckduckgo.com/ip3/".concat(n,".ico"))),e},[s,n]),[o,d]=(0,r.useState)(0),m=c.join("|");(0,r.useEffect)(()=>d(0),[m]);let u=c[o];return u?(0,a.jsx)("span",{className:"flex ".concat(i," shrink-0 items-center justify-center overflow-hidden rounded-md border border-white/10 bg-white"),"aria-hidden":!0,children:(0,a.jsx)("img",{src:u,alt:"",width:l,height:l,loading:"lazy",onError:()=>d(e=>e+1)},u)}):(0,a.jsx)("span",{className:"flex ".concat(i," shrink-0 items-center justify-center rounded-md border border-white/10 bg-white/[0.05] text-[11px] font-semibold text-fg-300"),"aria-hidden":!0,children:t.charAt(0).toUpperCase()})}},19932:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>i,v0:()=>l,yR:()=>c,yf:()=>s});var a=t(66352);let r={sky:"var(--color-sky-400)",cobalt:"var(--color-cobalt-400)",purple:"var(--color-purple-400)",pink:"var(--color-pink-400)",orange:"var(--color-orange-400)",emerald:"var(--color-green-400, #34d399)",green:"var(--color-green-400, #34d399)"},s=e=>r[e];function i(e){let{hue:n="sky",hue2:t="pink",glow:s=!0,pad:i=!0,className:l="",innerClassName:c="",children:o}=e,d=r[n],m=r[t];return(0,a.jsxs)("section",{className:"relative overflow-hidden px-6 ".concat(i?"py-24 sm:py-28":""," ").concat(l),children:[(0,a.jsx)("span",{"aria-hidden":!0,className:"absolute inset-x-0 top-0 h-px",style:{background:"linear-gradient(90deg, color-mix(in srgb, ".concat(d," 55%, transparent), color-mix(in srgb, ").concat(m," 55%, transparent))")}}),s&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute -top-24 left-[-8%] h-64 w-[45vw] rounded-full opacity-[0.16] blur-[140px]",style:{background:d}}),(0,a.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute -top-24 right-[-8%] h-64 w-[45vw] rounded-full opacity-[0.13] blur-[140px]",style:{background:m}})]}),(0,a.jsx)("div",{className:"relative mx-auto max-w-[1240px] ".concat(c),children:o})]})}function l(e){let{hue:n,children:t}=e;return(0,a.jsxs)("p",{className:"flex items-center gap-2 text-[13px] font-medium text-fg-300",children:[(0,a.jsx)("span",{"aria-hidden":!0,className:"size-1.5 shrink-0 rounded-full",style:{background:r[n]}}),t]})}function c(e){let{hue:n="sky",hue2:t="pink",children:s}=e;return(0,a.jsx)("span",{className:"bg-clip-text text-transparent",style:{backgroundImage:"linear-gradient(100deg, ".concat(r[n],", ").concat(r[t],")")},children:s})}},31963:(e,n,t)=>{"use strict";t.d(n,{A:()=>a});let a=(0,t(91163).A)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]])},38441:(e,n,t)=>{"use strict";t.d(n,{A:()=>a});let a=(0,t(91163).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},61737:(e,n,t)=>{"use strict";t.d(n,{A:()=>i});var a=t(66352),r=t(95132),s=t(31963);function i(e){let{repo:n,href:t,children:i="Star on GitHub"}=e,[l,c]=(0,r.useState)(null);(0,r.useEffect)(()=>{let e=new AbortController;return fetch("/api/guest/public-get-github-stars/?repo=".concat(encodeURIComponent(n)),{signal:e.signal}).then(e=>e.ok?e.json():null).then(e=>{let n=null==e?void 0:e.stars;"number"==typeof n&&Number.isFinite(n)&&c(n)}).catch(()=>{}),()=>e.abort()},[n]);let o=null===l?null:Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(l);return(0,a.jsxs)("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"group inline-flex items-stretch overflow-hidden rounded-full border border-white/15 bg-surface-100 text-sm font-medium text-fg-100 transition-[transform,background-color,border-color] duration-[160ms] ease-out-quart hover:border-white/30 hover:bg-surface-200 active:scale-[0.97] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white",children:[(0,a.jsxs)("span",{className:"inline-flex items-center gap-2 py-2.5 pl-6 pr-4",children:[(0,a.jsx)(s.A,{"aria-hidden":!0,
1className:"size-4 text-fg-300 transition-colors duration-150 group-hover:fill-amber-300 group-hover:text-amber-300"}),i]}),null!==o&&(0,a.jsx)("span",{className:"inline-flex items-center border-l border-white/10 bg-white/[0.03] py-2.5 pr-5 pl-4 font-mono text-[13px] tabular-nums text-fg-200",children:o})]})}},61965:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>E});var a=t(66352),r=t(95132),s=t(56900),i=t(59038),l=t(72766),c=t(75623),o=t(61737),d=t(62348),m=t(37540),u=t(75271),x=t(19932),p=t(9811),h=t(99082);let g={kw:"#4a9eff",ty:"#3fbfb2",st:"#6ccf7c",nu:"#e8964a",al:"#c678dd",rd:"#e5534b",cm:"#6b7280",ink:"#9aa3b2"},f=[[g.cm,"//-----------------------------------------------------------------"]],b=[[[g.cm,"//@version=6"]],[[g.cm,"//Copyright LuxAlgo"]],[[g.kw,"indicator"],[g.ink,"("],[g.st,"'LuxAlgo\xae - Signals & Overlays™'"],[g.ink,", "],[g.st,"'LuxAlgo\xae - Signals & Overlays™ [7.3.1]'"]],[[g.ink,"    , "],[g.nu,"true"]],[[g.ink,"    , max_lines_count  = "],[g.nu,"200"]],[[g.ink,"    , max_boxes_count  = "],[g.nu,"200"]],[[g.ink,"    , max_labels_count = "],[g.nu,"500"]],[[g.ink,"    , calc_bars_count  = "],[g.nu,"25000"],[g.ink,")"]],f,[[g.cm,"//Imports"]],f,[[g.kw,"import"],[g.ink," LuxAlgo/alertScripting/6 "],[g.kw,"as"],[g.al," alertScripting"]],[[g.kw,"import"],[g.ink," LuxAlgo/lucid/1 "],[g.kw,"as"],[g.al," lucid"]],[],f,[[g.cm,"//Functions"]],f,[[g.al,"reversal_zones"],[g.ink,"(len) "],[g.rd,"=>"]],[[g.ink,"    "],[g.ty,"var float"],[g.ink," rz_r3 = "],[g.rd,"na"],[g.ink,","],[g.ty,"var float"],[g.ink," rz_r2 = "],[g.rd,"na"]],[[g.ink,"    "],[g.ty,"var float"],[g.ink," rz_r1 = "],[g.rd,"na"],[g.ink,","],[g.ty,"var float"],[g.ink," rz_s1 = "],[g.rd,"na"]],[[g.ink,"    "],[g.ty,"var float"],[g.ink," rz_s2 = "],[g.rd,"na"],[g.ink,","],[g.ty,"var float"],[g.ink," rz_s3 = "],[g.rd,"na"]],[],[[g.ink,"    "],[g.ty,"var"],[g.ink," length = "],[g.ty,"switch"],[g.ink," len"]],[[g.ink,"        "],[g.st,"'1'"],[g.ink," "],[g.rd,"=>"],[g.ink," "],[g.nu,"14"]],[[g.ink,"        "],[g.st,"'2'"],[g.ink," "],[g.rd,"=>"],[g.ink," "],[g.nu,"28"]],[[g.ink,"        "],[g.st,"'3'"],[g.ink," "],[g.rd,"=>"],[g.ink," "],[g.nu,"42"]],[[g.ink,"        "],[g.st,"'4'"],[g.ink," "],[g.rd,"=>"],[g.ink," "],[g.nu,"56"]],[[g.ink,"        "],[g.st,"'5'"],[g.ink," "],[g.rd,"=>"],[g.ink," "],[g.nu,"70"]]],j=e=>e.reduce((e,n)=>{let[,t]=n;return e+t.length},0),w=b.reduce((e,n)=>e+j(n)+1,0);function v(e){let{className:n=""}=e,[t,s]=(0,r.useState)(0),i=t>=w,l=(0,r.useRef)(0);(0,r.useEffect)(()=>{if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return void s(w);let e=performance.now()+350,n=t=>{let a=Math.min(w,Math.max(0,Math.floor((t-e)/7)));s(a),a<w&&(l.current=requestAnimationFrame(n))};return l.current=requestAnimationFrame(n),()=>cancelAnimationFrame(l.current)},[]);let c=t,o=b.map((e,n)=>{let t=j(e),r=Math.max(0,Math.min(t,c)),s=!i&&c>=0&&c<=t;c-=t+1;let l=r;return(0,a.jsxs)("span",{className:"flex",children:[(0,a.jsx)("span",{className:"w-10 shrink-0 pr-4 text-right text-[#3a3f4a] select-none",children:n+1}),(0,a.jsxs)("span",{className:"whitespace-pre",children:[e.map((e,n)=>{let[t,r]=e;if(l<=0)return null;let s=r.slice(0,l);return l-=r.length,(0,a.jsx)("span",{style:{color:t,textShadow:"0 0 18px ".concat(t,"55")},children:s},n)}),s&&(0,a.jsx)("span",{className:"inline-block h-[1.1em] w-[7px] translate-y-[0.18em] animate-pulse bg-[#4a9eff] shadow-[0_0_14px_#4a9eff]"})]})]},n)});return(0,a.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 overflow-hidden ".concat(n),children:(0,a.jsx)("div",{className:"absolute inset-x-0 top-0 mx-auto max-w-[1100px] px-6 pt-10 font-mono text-[12px] leading-[1.9] opacity-[0.7] [mask-image:linear-gradient(180deg,black_0%,black_62%,transparent_97%)] sm:text-[13px]",children:o})})}var y=t(38441),k=t(85814);let N="https://github.com/LuxAlgo/PineTS",A="https://docs.luxalgo.com/developers/pinets",S="npm install pinets",_={kw:"text-[#4a9eff]",fn:"text-[#4a9eff]",str:"text-[#6ccf7c]",num:"text-[#e8964a]",ty:"text-[#3fbfb2]",cmt:"text-[#6b7280]",dim:"text-[#6b7280]"},T=[[[_.kw,"import"],[null," { "],[_.ty,"PineTS"],[null,", "],[_.ty,"Provider"],[null," } "],[_.kw,"from"],[_.str," 'pinets'"]],[],[[_.kw,"const"],[null," pineTS = "],[_.kw,"new"],[null," "],[_.fn,"PineTS"],[null,"("],[_.ty,"Provider"],[null,".Binance, "],[_.str,"'BTCUSDT'"],[null,", "],[_.str,"'D'"],[null,", "],[_.num,"200"],[null,")"]],[],[[_.kw,"const"],[null," { plots } = "],[_.kw,"await"],[null," pineTS."],[_.fn,"run"],[null,"(`"]],[[_.cmt,"//@version=6"]],[[_.fn,"indicator"],[null,"("],[_.str,'"MACD"'],[null,")"]],[[null,"[macdLine, signalLine, hist] = ta."],[_.fn,"macd"],[null,"(close, "],[_.num,"12"],[null,", "],[_.num,"26"],[null,", "],[_.num,"9"],[null,")"]],[[_.fn,"plot"],[null,"(macdLine, "],[_.str,'"MACD"'],[null,", color.blue)"]],[[_.fn,"plot"],[null,"(signalLine, "],[_.str,'"Signal"'],[null,", color.orange)"]],[[null,"`)"]]],P=[[[null,"console."],[_.fn,"log"],[null,"(plots["],[_.str,"'MACD'"],[null,"].data)"]],[[_.dim,"[ "],[_.num,"-12.63"],[_.dim,", "],[_.num,"-9.41"],[_.dim,", "],[_.num,"-4.02"],[_.dim,", "],[_.num,"1.87"],[_.dim,", … ]"]],[],[[null,"console."],[_.fn,"log"],[null,"(plots["],[_.str,"'Signal'"],[null,"].data)"]],[[_.dim,"[ "],[_.num,"-10.98"],[_.dim,", "],[_.num,"-8.75"],[_.dim,", "],[_.num,"-5.66"],[_.dim,", "],[_.num,"-2.31"],[_.dim,", … ]"]],[],[[_.cmt,"// plain arrays: feed a bot, an alert,"]],[[_.cmt,"// a backtest, a model, a chart"]]],M=[[[_.kw,"const"],[null," stream = pineTS."],[_.fn,"stream"],[null,"(`"]],[[_.cmt,"  //@version=6"]],[[null,"  "],[_.fn,"indicator"],[null,"("],[_.str,'"Live RSI"'],[null,")"]],[[null,"  "],[_.fn,"plot"],[null,"(ta."],[_.fn,"rsi"],[null,"(close, "],[_.num,"14"],[null,"), "],[_.str,'"RSI"'],[null,")"]],[[null,"`, { live: "],[_.ty,"true"],[null," })"]],[],[[null,"stream."],[_.fn,"on"],[null,"("],[_.str,"'data'"],[null,", (ctx) => {"]],[[null,"  "],[_.kw,"const"],[null," rsi = ctx.plots["],[_.str,"'RSI'"],[null,"].data.at("],[_.num,"-1"],[null,").value"]],[[null,"  "],[_.kw,"if"],[null," (rsi < "],[_.num,"30"],[null,") "],[_.fn,"alert"],[null,"("],[_.str,"'oversold'"],[null,")"]],[[null,"})"]]];function z(e){let{down:n=!1}
1=e;return(0,a.jsx)("svg",{"aria-hidden":!0,viewBox:n?"0 0 4 32":"0 0 44 4",className:n?"mx-auto h-8 w-1 lg:hidden":"hidden w-11 lg:block",children:(0,a.jsx)("line",{x1:2*!!n,y1:2*!n,x2:n?2:44,y2:n?32:2,pathLength:100,strokeDasharray:"12 10",strokeWidth:"1.5",className:"animate-outline-ray stroke-green-400/80 motion-reduce:animate-none"})})}let F=[{name:"Node.js",domain:"nodejs.org",note:"servers & bots"},{name:"Browsers",note:"dashboards & web apps"},{name:"Deno",domain:"deno.com",note:"edge & scripts"},{name:"Bun",domain:"bun.sh",note:"fast local tooling"}];function L(){return(0,a.jsx)("div",{className:"dark",children:(0,a.jsx)("div",{className:"relative overflow-hidden rounded-2xl border border-white/10 bg-[#060606]",children:(0,a.jsxs)("div",{className:"grid items-center gap-2 p-5 sm:p-8 lg:grid-cols-[1fr_auto_auto_auto_1fr] lg:gap-4",children:[(0,a.jsx)("div",{className:"space-y-2",children:(0,a.jsxs)("div",{className:"rounded-lg border border-white/[0.08] bg-white/[0.02] p-4",children:[(0,a.jsx)("p",{className:"font-mono text-[13px] text-fg-100",children:"strategy.pine"}),(0,a.jsxs)("p",{className:"mt-2 text-[11px] leading-relaxed text-fg-300",children:["native Pine Script\xae",(0,a.jsx)("br",{}),"v6 or v5, unchanged"]})]})}),(0,a.jsx)(z,{}),(0,a.jsx)(z,{down:!0}),(0,a.jsxs)("div",{className:"relative overflow-hidden rounded-xl border border-white/[0.12] bg-white/[0.03] p-5",children:[(0,a.jsx)("span",{"aria-hidden":!0,className:"absolute inset-x-0 top-0 h-px bg-[linear-gradient(90deg,transparent,rgba(102,187,106,0.8),transparent)]"}),(0,a.jsx)("p",{className:"text-[15px] font-medium text-fg-100",children:"PineTS"}),(0,a.jsx)("p",{className:"mt-0.5 text-[11px] text-fg-300",children:"open source \xb7 runs in your process"}),(0,a.jsxs)("div",{className:"mt-4 space-y-1.5 text-xs font-medium",children:[(0,a.jsx)("p",{className:"text-green-300/90",children:"✓ same time-series model"}),(0,a.jsx)("p",{className:"text-green-300/90",children:"✓ 60+ ta functions"}),(0,a.jsx)("p",{className:"text-green-300/90",children:"✓ request.security() MTF"}),(0,a.jsx)("p",{className:"text-green-300/90",children:"✓ matches TradingView\xae output"})]})]}),(0,a.jsx)(z,{}),(0,a.jsx)(z,{down:!0}),(0,a.jsx)("div",{className:"space-y-2",children:F.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2.5 rounded-lg border border-white/[0.08] bg-white/[0.02] px-3 py-2",children:[(0,a.jsx)(p.A,{domain:e.domain,name:e.name,className:"size-6",imgSize:15}),(0,a.jsxs)("span",{className:"min-w-0",children:[(0,a.jsx)("span",{className:"block truncate text-[13px] font-medium text-fg-100",children:e.name}),(0,a.jsx)("span",{className:"block truncate text-[10px] font-medium text-fg-300",children:e.note})]})]},e.name))})]})})})}let C=[{name:"Binance",domain:"binance.com",note:"crypto candles, built in",tag:"keyless"},{name:"Financial Modeling Prep",domain:"financialmodelingprep.com",note:"stocks and ETFs",tag:"built in"},{name:"Alpaca",domain:"alpaca.markets",src:"https://github.com/alpacahq.png?size=64",note:"US equities",tag:"built in"},{name:"Your own candles",note:"pass any OHLCV array from any source",tag:"no provider needed"}];function q(){let[e,n]=(0,r.useState)(!1),[t,s]=(0,r.useState)(0);return(0,r.useEffect)(()=>{if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return void s(S.length);let e=0,n=500/S.length,t=setTimeout(()=>{let t=performance.now(),a=r=>{let i=Math.min(S.length,Math.floor((r-t)/n));s(i),i<S.length&&(e=requestAnimationFrame(a))};e=requestAnimationFrame(a)},400);return()=>{clearTimeout(t),cancelAnimationFrame(e)}},[]),(0,a.jsxs)("div",{className:"mx-auto flex w-full max-w-md items-center gap-3 rounded-xl border border-white/10 bg-surface-100 py-3 pr-3 pl-5",children:[(0,a.jsx)("span",{className:"font-mono text-sm text-fg-300",children:"$"}),(0,a.jsxs)("span",{"aria-label":S,className:"min-w-0 flex-1 truncate text-left font-mono text-sm text-fg-100",children:[(0,a.jsx)("span",{"aria-hidden":!0,children:S.slice(0,t)}),(0,a.jsx)("span",{"aria-hidden":!0,className:"opacity-0",children:S.slice(t)})]}),(0,a.jsx)("button",{type:"button","aria-label":"Copy install c
1ommand",onClick:()=>{var e;null==(e=navigator.clipboard)||e.writeText(S).then(()=>{n(!0),setTimeout(()=>n(!1),1600)})},className:"flex size-8 shrink-0 items-center justify-center rounded-md border border-white/10 text-fg-300 transition-colors duration-150 hover:border-white/25 hover:text-fg-100",children:e?(0,a.jsx)(y.A,{className:"size-3.5 text-green-400"}):(0,a.jsx)(k.A,{className:"size-3.5"})})]})}function E(){return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.A,{title:"PineTS: Run Pine Script\xae in JavaScript | LuxAlgo",description:"Run your TradingView\xae indicators in your own app, bot, or server. PineTS executes native Pine Script\xae in Node.js and the browser and hands you the values as plain JavaScript. Free and open source.",canonicalUrl:"".concat("https://www.luxalgo.com","/pinets"),openGraphImageUrl:"/api/og/page/?title=PineTS&bg=/images/og/pinets-code.png",markdownPath:"/pinets.md"}),(0,a.jsx)(i.gk,{items:[{name:"LuxAlgo",url:"/"},{name:"PineTS",url:"/pinets/"}]}),(0,a.jsx)(i.Ec,{project:"pinets"}),(0,a.jsxs)("section",{className:"dark relative overflow-hidden bg-[#030304] px-6 pt-24 pb-20 sm:pt-32 sm:pb-24",children:[(0,a.jsx)(v,{}),(0,a.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 bg-[radial-gradient(70%_60%_at_50%_42%,rgba(3,3,4,0.88)_0%,rgba(3,3,4,0.55)_55%,transparent_100%)]"}),(0,a.jsxs)("div",{className:"relative mx-auto max-w-3xl space-y-8 text-center",children:[(0,a.jsx)(u.A,{immediate:!0,children:(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("h1",{className:"text-[clamp(38px,5.5vw,64px)] leading-[1.06] font-medium tracking-tight text-fg-100 text-balance",children:"Run Pine Script\xae anywhere."}),(0,a.jsx)(l.Y0,{children:(0,a.jsx)("span",{className:"mx-auto block max-w-2xl",children:"The indicators you already run on your charts, running in your own app, bot, or server. Paste the original code and PineTS hands you the values back as plain JavaScript."})})]})}),(0,a.jsx)(u.A,{immediate:!0,delay:120,children:(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsx)(q,{}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[(0,a.jsx)(l.Bk,{href:"/pinets/playground",children:"Try it in your browser"}),(0,a.jsx)(l.pq,{href:A,external:!0,children:"Read the Docs"}),(0,a.jsx)(o.A,{repo:"LuxAlgo/PineTS",href:N}),(0,a.jsx)(d.A,{href:"/vela/pricing"})]})]})})]})]}),(0,a.jsxs)(x.Ay,{hue:"green",hue2:"sky",innerClassName:"space-y-10",children:[(0,a.jsxs)("div",{className:"grid items-start gap-6 lg:grid-cols-[1fr_1.1fr] lg:gap-12",children:[(0,a.jsx)(u.A,{children:(0,a.jsx)("h2",{className:"text-[clamp(30px,4vw,52px)] leading-[1.06] font-medium tracking-tight text-fg-100 text-balance",children:"Paste the original. Get the numbers."})}),(0,a.jsx)(u.A,{delay:100,children:(0,a.jsx)("p",{className:"max-w-xl text-base leading-relaxed text-fg-300 sm:text-lg",children:"No rewriting, no reverse-engineering the math. PineTS runs the exact Pine Script\xae you already have, v6 or v5, with the same time-series behavior and precision the chart shows. What comes back is just arrays of numbers your code can use."})})]}),(0,a.jsxs)("div",{className:"grid items-start gap-6 lg:grid-cols-2",children:[(0,a.jsx)(u.A,{className:"min-w-0",children:(0,a.jsx)(c.A,{title:"run.mjs",lines:T,typewriter:!0})}),(0,a.jsx)(u.A,{delay:160,className:"min-w-0",children:(0,a.jsx)(c.A,{title:"output \xb7 sample values",lines:P,typewriter:!0})})]})]}),(0,a.jsxs)(x.Ay,{hue:"sky",hue2:"purple",innerClassName:"space-y-10",children:[(0,a.jsxs)("div",{className:"grid items-start gap-6 lg:grid-cols-[1fr_1.1fr] lg:gap-12",children:[(0,a.jsx)(u.A,{children:(0,a.jsx)("h2",{className:"text-[clamp(30px,4vw,52px)] leading-[1.06] font-medium tracking-tight text-fg-100 text-balance",children:"One runtime. Everywhere."})}),(0,a.jsx)(u.A,{delay:100,children:(0,a.jsx)("p",{className:"max-w-xl text-base leading-relaxed text-fg-300 sm:text-lg",children:"Pine Script\xae was built for the chart; PineTS is the runtime for everything around it. The same script runs on a server, in a browser tab, at the edge, or on your laptop, and behaves the same everywhere."})})]}),(0,a.jsx)(u.A,{delay:140,children:(0,a.jsx)(L,{})})]}),(0,a.jsxs)(x.Ay,{hue:"purple",hue2:"pink",innerClassName:"grid items-center gap-10 lg:grid-cols-[1fr_1.1fr] lg:gap-16",children:[(0,a.jsx)(u.A,{children:(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("h2",{className:"text-[clamp(30px,4vw,52px)] leading-[1.06] font-medium tracking-tight text-fg-100 text-balance",children:"Any market you can get candles for."}),(0,a.jsx)(l.iq,{children:"Point it at a built-in provider and go, or hand it the candles you already have from any API, database, or CSV. PineTS is not tied to any one data source."})]})}),(0,a.jsx)(u.A,{delay:140,className:"min-w-0",children:(0,a.jsx)(h.A,{columns:1,connections:C,footer:(0,a.jsx)(a.Fragment,{children:"One constructor either way: a provider, symbol, and timeframe, or an array of your own OHLCV candles"})})})]}),(0,a.jsxs)(x.Ay,{hue:"green",hue2:"pink",innerClassName:"grid items-center gap-10 lg:grid-cols-2 lg:gap-16",children:[(0,a.jsx)(u.A,{children:(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("h2",{className:"text-[clamp(30px,4vw,52px)] leading-[1.06] font-medium tracking-tight text-fg-100 text-balance",children:"Live, bar by bar."}),(0,a.jsx)(l.iq,{children:"Streaming mode recalculates on every new bar and hands your code the fresh values as events. That is a custom alert pipeline or a monitoring desk over hundreds of symbols, in a few lines, running on your own machine."})]})}),(0,a.jsx)(u.A,{delay:120,className:"min-w-0",children:(0,a.jsx)(c.A,{title:"live.mjs",lines:M,typewriter:!0})})]}),(0,a.jsxs)(x.Ay,{hue:"orange",hue2:"pink",glow:!1,innerClassName:"space-y-12",children:[(0,a.jsxs)("div",{className:"grid items-start gap-6 lg:grid-cols-[1fr_1.1fr] lg:gap-12",children:[(0,a.jsx)(u.A,{children:(0,a.jsx)("h2",{className:"text-[clamp(30px,4vw,52px)] leading-[1.06] font-medium tracking-tight text-fg-100 text-balance",children:"The Pine Script\xae ecosystem, in your product."})}),(0,a.jsx)(u.A,{delay:100,children:(0,a.jsx)("p",{className:"max-w-xl text-base leading-relaxed text-fg-300 sm:text-lg",children:"This is the pitch: anything your users already run as Pine Script\xae, your app can now run natively, on your own charts, on your own infrastru
1cture. One commercial license covers shipping it closed-source at any size, up to a major exchange, with published pricing and standard terms."})})]}),(0,a.jsx)(u.A,{delay:80,children:(0,a.jsxs)("div",{className:"flex flex-col items-start justify-between gap-6 rounded-xl border border-white/10 bg-surface-100 p-6 sm:flex-row sm:items-center sm:p-8",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h3",{className:"text-lg font-medium tracking-tight text-fg-100",children:"The engine behind our own products."}),(0,a.jsx)("p",{className:"max-w-xl text-sm leading-relaxed text-fg-300 sm:text-base",children:"PineTS powers the Pine Script\xae runtime in Vela™ Pro, and its calculations match TradingView\xae's output so results transfer one to one. 60+ ta functions, arrays, matrices, maps, and request.security() multi-timeframe, all covered by tests."})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsx)(l.Bk,{href:"/vela/pricing",children:"Commercial licensing"}),(0,a.jsx)(l.pq,{href:A,external:!0,children:"API coverage"})]})]})})]}),(0,a.jsxs)("section",{className:"relative border-t border-white/[0.06] px-6 py-28 sm:py-36",children:[(0,a.jsx)(m.A,{}),(0,a.jsx)(u.A,{children:(0,a.jsxs)("div",{className:"relative mx-auto max-w-2xl space-y-8 text-center",children:[(0,a.jsx)("h2",{className:"text-[clamp(32px,4.5vw,52px)] leading-[1.08] font-medium tracking-tight text-fg-100",children:"Your logic is yours."}),(0,a.jsx)("p",{className:"text-lg text-fg-200",children:"PineTS executes Pine Script\xae independently: in your app, your backend, your research stack. Open source on GitHub and npm, with commercial licensing for closed-source products."}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[(0,a.jsx)(l.Bk,{href:N,children:"View on GitHub"}),(0,a.jsx)(l.pq,{href:"https://www.npmjs.com/package/pinets",external:!0,children:"Get it on npm"})]})]})})]}),(0,a.jsx)("div",{className:"border-t border-white/[0.06] px-6 py-8",children:(0,a.jsx)("p",{className:"mx-auto max-w-3xl text-center text-xs leading-relaxed text-fg-300",children:"PineTS is an independently developed open-source compiler and runtime engine. LuxAlgo Global, LLC and the PineTS project are not affiliated with, sponsored by, endorsed by, or in any way officially associated with TradingView, Inc. “Pine Script” and “TradingView” are trademarks or registered trademarks of TradingView, Inc. Sample output values are illustrative; the output shape is exact."})})]})}},62348:(e,n,t)=>{"use strict";t.d(n,{A:()=>l});var a=t(66352),r=t(94092),s=t.n(r),i=t(56331);function l(e){let{href:n}=e;return(0,a.jsxs)(s(),{href:n,className:"group inline-flex items-center gap-1.5 px-2 py-2.5 text-sm font-medium text-fg-200 transition-colors duration-150 hover:text-fg-100",children:["Pricing",(0,a.jsx)(i.A,{"aria-hidden":!0,className:"size-4 transition-transform duration-200 ease-out-quart group-hover:translate-x-0.5"})]})}},75271:(e,n,t)=>{"use strict";t.d(n,{A:()=>a.gN});var a=t(69626)},75623:(e,n,t)=>{"use strict";t.d(n,{A:()=>d,T:()=>s});var a=t(66352),r=t(95132);let s={kw:"text-pink-400",str:"text-green-400",fn:"text-purple-400",type:"text-sky-400",cmt:"text-fg-300",dim:"text-fg-300",ink:"text-fg-200",hi:"text-fg-100"},i="cubic-bezier(0.16, 1, 0.3, 1)",l=e=>e.reduce((e,n)=>{let[,t]=n;return e+t.length},0);function c(e){let{tokens:n}=e;return 0===n.length?(0,a.jsx)("span",{className:"block",children:" "}):(0,a.jsx)("span",{className:"block whitespace-pre",children:n.map((e,n)=>{let[t,r]=e;return(0,a.jsx)("span",{className:null!=t?t:s.ink,children:r},n)})})}function o(e,n){let t=n,a=[],r="";for(let[n,s]of e)t>=s.length?(a.push([n,s]),t-=s.length):(t>0&&a.push([n,s.slice(0,t)]),r+=s.slice(Math.max(0,t)),t=0);return{shown:a,hidden:r}}function d(e){let{title:n,lines:t,right:d,className:m="",typeLines:u,typewriter:x=!1,still:p=!1}=e,h=(0,r.useRef)(null),[g,f]=(0,r.useState)(p),[b,j]=(0,r.useState)(p),[w,v]=(0,r.useState)({});(0,r.useEffect)(()=>{let e=h.current;if(!e)return;if(p||window.matchMedia("(prefers-reduced-motion: reduce)").matches){j(!0),f(!0);return}let n=new IntersectionObserver(e=>{let[t]=e;t.isIntersecting&&(n.disconnect(),f(!0))},{threshold:.3,rootMargin:"0px 0px -8% 0px"});return n.observe(e),()=>n.disconnect()},[]),(0,r.useEffect)(()=>
1{if(!g||b||!x)return;let e=0,n=t.map(n=>{let t=l(n),a=0===t?0:Math.max(120,14*t),r=e;return e+=a+90,{start:r,ms:a,len:t}}),a=e,r=0,s=performance.now(),i=e=>{let t=e-s,l={};n.forEach((e,n)=>{let{start:a,ms:r,len:s}=e;l[n]=0===s?0:Math.round(Math.max(0,Math.min(1,(t-a)/r))*s)}),v(l),t<a&&(r=requestAnimationFrame(i))};return r=requestAnimationFrame(i),()=>cancelAnimationFrame(r)},[g,b,x]),(0,r.useEffect)(()=>{if(!g||b||x||!(null==u?void 0:u.length))return;let e=[],n=24*t.length+300+150,a=u.map(a=>setTimeout(()=>{var n;let r=(null!=(n=t[a])?n:[]).map(e=>e[1]).join(""),s=450/Math.max(1,r.length),i=performance.now(),l=n=>{let t=Math.min(r.length,Math.floor((n-i)/s));v(e=>({...e,[a]:t})),t<r.length&&e.push(requestAnimationFrame(l))};e.push(requestAnimationFrame(l))},n));return()=>{a.forEach(clearTimeout),e.forEach(cancelAnimationFrame)}},[g,b]);let y=x&&!b,k=y?t.findIndex((e,n)=>{var t;return l(e)>0&&(null!=(t=w[n])?t:0)<l(e)}):-1;return(0,a.jsxs)("div",{ref:h,className:"relative overflow-hidden rounded-xl border border-white/10 bg-black/40 ".concat(m),children:[(0,a.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-6 top-0 h-px bg-[linear-gradient(90deg,transparent,color-mix(in_srgb,var(--color-purple-500)_40%,transparent)_40%,color-mix(in_srgb,var(--color-pink-500)_35%,transparent)_65%,transparent)]"}),(0,a.jsxs)("div",{className:"flex items-center gap-3 border-b border-white/[0.06] px-5 py-3",children:[(0,a.jsx)("div",{className:"min-w-0 flex-1 truncate font-mono text-xs text-fg-300",children:n}),d&&(0,a.jsx)("div",{className:"shrink-0",children:d})]}),(0,a.jsx)("pre",{className:"overflow-x-auto p-5 font-mono text-xs leading-relaxed sm:text-[13px]",children:t.map((e,n)=>{var t,r,l;if(y){let{shown:r,hidden:i}=o(e,null!=(t=w[n])?t:0);return(0,a.jsxs)("span",{className:"block whitespace-pre",children:[r.map((e,n)=>{let[t,r]=e;return(0,a.jsx)("span",{className:null!=t?t:s.ink,children:r},n)}),n===k&&(0,a.jsx)("span",{"aria-hidden":!0,className:"animate-pulse text-fg-100",children:"▍"}),(0,a.jsx)("span",{"aria-hidden":!0,className:"opacity-0",children:i||(0===r.length&&n!==k?" ":"")})]},n)}let d=b?void 0:{opacity:+!!g,transform:g?"none":"translateY(4px)",transition:"opacity ".concat(300,"ms ").concat(i,", transform ").concat(300,"ms ").concat(i),transitionDelay:"".concat(24*n,"ms")};if(!b&&!x&&null!=(l=null==u?void 0:u.includes(n))&&l){let{shown:t,hidden:i}=o(e,null!=(r=w[n])?r:0);return(0,a.jsxs)("span",{className:"block whitespace-pre",style:d,children:[t.map((e,n)=>{let[t,r]=e;return(0,a.jsx)("span",{className:null!=t?t:s.ink,children:r},n)}),(0,a.jsx)("span",{"aria-hidden":!0,className:"opacity-0",children:i||(0===t.length?" ":"")})]},n)}return(0,a.jsx)("span",{className:"block",style:d,children:(0,a.jsx)(c,{tokens:e})},n)})})]})}},85814:(e,n,t)=>{"use strict";t.d(n,{A:()=>a});let a=(0,t(91163).A)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},99082:(e,n,t)=>{"use strict";t.d(n,{A:()=>s});var a=t(66352),r=t(9811);function s(e){let{connections:n,footer:t,columns:s=2}=e;return(0,a.jsx)("div",{className:"dark",children:(0,a.jsxs)("div",{className:"relative overflow-hidden rounded-2xl border border-white/10 bg-[#060606]",children:[(0,a.jsx)("div",{className:2===s?"grid sm:grid-cols-2":"grid",children:n.map((e,n)=>(0,a.jsxs)("div",{className:"flex items-center gap-3 border-white/[0.05] px-5 sm:px-6 ".concat(1===s?"py-4 ".concat(n>0?"border-t":""):"py-3 ".concat(n>1?"border-t":n>0?"border-t sm:border-t-0":""," ").concat(n%2==0?"sm:border-r":"")),children:[(0,a.jsx)(r.A,{domain:e.domain,src:e.src,name:e.name,className:"size-7",imgSize:17}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block truncate text-[13px] font-medium text-fg-100",children:e.name}),(0,a.jsx)("span",{className:"block truncate text-xs text-fg-300",children:e.note})]}),e.tag&&(0,a.jsx)("span",{className:"shrink-0 rounded-full border border-white/10 bg-white/[0.03] px-2 py-0.5 text-[10px] font-medium whitespace-nowrap text-fg-300",children:e.tag})]},e.name))}),t&&(0,a.jsx)("p",{className:"border-t border-white/[0.06] px-5 py-3 text-xs text-fg-300 sm:px-6",children:t})]})})}}},e=>{e.O(0,[6302,636,6593,8792],()=>e(e.s=8520)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.