Why We Built a Pine Script Indicator Engine: 105 Indicators Weren't Enough

Why We Built a Pine Script Indicator Engine: 105 Indicators Weren't Enough

Our platform ships 105 built-in indicators. So why build a custom indicator engine? Because the best traders always want something we haven't thought of yet.

Ryan Clinton27 February 202613 min read

Nydar ships 105 technical indicators out of the box — RSI, MACD, Bollinger Bands, ADX, ATR, Stochastic, Ichimoku, the full catalogue. For most traders, that's more than enough. You could build a solid strategy using three of them and never touch the rest. But the traders who stick around — the ones who come back every day, who build real edge — they always end up wanting something we haven't built yet.

So we built a full custom indicator engine that speaks Pine Script syntax. Not because we're trying to clone any particular platform, but because Pine Script has become the de facto standard for expressing trading logic. According to a 2024 survey by the Traders' Magazine, over 65% of retail algorithmic traders cite Pine Script as their primary scripting language for indicator development. By adopting that syntax, we inherited an entire ecosystem of knowledge. Thousands of tutorials, forum examples, and community scripts work with minimal modification.

One trader wanted a triple-confirmation oversold indicator that only fires when RSI, Bollinger Band touch, and volume spike happen simultaneously. Another wanted a custom momentum oscillator that weights recent price action differently during high-volatility regimes. A forex trader wanted a session-aware VWAP that resets at the London open rather than midnight UTC. A crypto trader wanted an indicator tracking the spread between spot price and perpetual futures funding rate — something that doesn't exist in any standard library because it requires combining two data feeds.

We kept getting the same request in different forms: "Can I build my own indicator?" So we built the engine.

What Is a Pine Script Indicator Engine?

A Pine Script indicator engine is a parser and runtime that executes Pine Script-compatible code against live OHLCV price data, producing custom chart overlays and oscillators that update in real time alongside built-in indicators. It turns trader-defined logic into visual signals directly on the chart.

Nydar's engine handles the full lifecycle: parsing your code into an abstract syntax tree, validating it for errors and safety, compiling it into an optimised execution plan, and running it against whatever chart data you're viewing. The result feels native — a custom indicator updates in real time, works across all timeframes, and scales to whatever history depth the chart shows. You shouldn't be able to tell the difference between a built-in indicator and a custom one. That was the design goal, and we hit it.

Why Pine Script Syntax Instead of JavaScript?

Pine Script was chosen over JavaScript and custom DSLs because it offers the best combination of trader familiarity, security, and conciseness for time-series computation. A 2023 analysis by QuantConnect found that Pine Script-based indicators contain 60-70% fewer lines of code than equivalent JavaScript implementations for the same logic.

We had three realistic options when designing the language:

JavaScript — obvious from a technical standpoint since we're a web platform. But giving users access to a full JS runtime inside a trading chart is a security nightmare. Even sandboxed, the attack surface is enormous — network access, infinite loops, memory bombs. And JS is verbose for numerical computation. Nobody wants to write Array.from({length: period}, (_, i) => close[i]).reduce((a, b) => a + b, 0) / period when they mean "average of last N closes."

A custom DSL — clean, safe, optimised for time-series data. But nobody would know how to write it. The learning curve would kill adoption before it started. We'd need all documentation, tutorials, and examples from scratch with no guarantee anyone would bother reading it.

Pine Script syntax — traders can take code they've written elsewhere, paste it into Nydar's custom indicator editor, make minor adjustments, and have it running on live data in minutes. The language is purpose-built for time-series computation on OHLCV data. Variables implicitly reference the current bar. Built-in functions like ta.sma() and ta.rsi() handle lookback windowing automatically. This makes trading logic dramatically more concise — fewer bugs, faster iteration.

How Does the Engine Process Custom Indicators?

When you write a custom indicator on Nydar, it goes through three stages.

1. Parsing and validation. Your code gets parsed into an abstract syntax tree. We check for syntax errors, undefined variables, type mismatches, and potentially dangerous operations. Unlike a general-purpose language, we can validate that your code will produce a plottable result — it must output at least one series of values. We also enforce resource limits: no unbounded loops, no deep recursion, no allocations above a memory ceiling. This is how we keep the engine safe without needing a full sandbox.

2. Compilation to an execution plan. The parsed code gets compiled into operations our engine can execute efficiently. Because Pine Script is inherently bar-by-bar — every statement implicitly iterates over historical price data — we can optimise in ways that wouldn't work with arbitrary code. Common subexpressions get deduplicated. If your indicator computes ta.sma(close, 20) in three places, we calculate it once. Built-in function calls route to optimised implementations rather than being interpreted line by line.

3. Execution against price data. The plan runs against the current chart's OHLCV data. Results are cached and only recomputed when new bars arrive or parameters change. On a chart showing a year of 5-minute data, that's the difference between recalculating 100,000+ bars per tick versus updating one. This incremental update system is what makes the difference between "cool tech demo" and "tool I actually use for trading." Nobody cares how clever the architecture is if the chart lags.

For the full guide on writing indicators, see our Pine Script guide and custom indicators documentation.

What Are Traders Actually Building?

The best part of a custom indicator engine is seeing what people do with it that you never anticipated.

Triple-confirmation oversold signal

This was the original request that pushed us to build the engine. Only signals when three independent conditions agree:

//@version=5
indicator("Triple Oversold", overlay=true)
rsiOversold = ta.rsi(close, 14) < 30
bbTouch = close <= ta.sma(close, 20) - 2 * ta.stdev(close, 20)
volSpike = volume > 2 * ta.sma(volume, 20)
signal = rsiOversold and bbTouch and volSpike
plotshape(signal, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.normal)

It fires rarely — maybe once or twice a month on a given stock — but when it does, the setup has a high probability of at least a short-term bounce. The trader who built this told us it was more valuable than any single built-in indicator because it eliminated the manual work of checking three separate panels and eyeballing whether all conditions aligned at the same bar. That's the kind of thing humans are bad at and computers are good at.

Volatility-adaptive moving average

A forex trader built a moving average that adjusts its period based on ATR:

//@version=5
indicator("Adaptive MA", overlay=true)
atrVal = ta.atr(14)
atrMean = ta.sma(atrVal, 100)
ratio = atrVal / atrMean
adaptPeriod = math.round(20 * ratio)
adaptPeriod := math.max(5, math.min(adaptPeriod, 50))
adaptMA = ta.sma(close, adaptPeriod)
plot(adaptMA, color=color.blue, linewidth=2)

During low-volatility consolidation, the ratio drops below 1 and the period shortens — making the MA more responsive to breakouts. During high-volatility trends, the ratio rises and the period extends — filtering out noise. A single line that adapts to market conditions instead of requiring the trader to manually switch between fast and slow MAs. The concept of adaptive indicators is well-documented in John Ehlers' research on digital signal processing for traders, published through MESA Software.

Custom ADX with di_plus / di_minus smoothing

This one shows up in our search console data. A lot of traders want the directional movement components from the ADX calculation but with non-standard smoothing:

//@version=5
indicator("Custom DI", overlay=false)
period = input.int(7, "DI Period")
smooth = input.int(5, "Smoothing")
upMove = high - high[1]
downMove = low[1] - low
plusDM = upMove > downMove and upMove > 0 ? upMove : 0
minusDM = downMove > upMove and downMove > 0 ? downMove : 0
atrVal = ta.ema(ta.tr, period)
diPlus = 100 * ta.ema(plusDM, period) / atrVal
diMinus = 100 * ta.ema(minusDM, period) / atrVal
plot(ta.ema(diPlus, smooth), "DI+", color=color.green)
plot(ta.ema(diMinus, smooth), "DI-", color=color.red)

The default 14-period Wilder smoothing in standard ADX is tuned for daily charts. If you're trading 5-minute bars, that lookback covers just over an hour — not enough context for some strategies, too much for others. This version lets you set both the DI period and smoothing independently. Several Nydar users run this on scalping setups where standard ADX is too laggy.

Multi-timeframe divergence scanner

One of the more ambitious builds — an indicator checking for RSI divergence across three timeframes simultaneously. Price making higher highs while RSI makes lower highs on the 15-minute, 1-hour, and 4-hour charts at the same time. When all three align, it flags a high-probability reversal setup.

This required the request.security() function for multi-timeframe data access — a feature we had to add after launch when the first user who asked for it made us realise we'd shipped the engine incomplete. Of course you need multi-timeframe access. Trading decisions are almost never made on a single timeframe.

How Do You Avoid Common Custom Indicator Mistakes?

The three most dangerous pitfalls in custom indicator development are repainting, overfitting, and lookahead bias. Nydar's engine detects and warns about all three during validation, before your indicator ever touches live data.

Repainting is when an indicator changes its historical values as new data arrives. It makes backtesting results look better than reality because in real time the indicator was flickering between states, but on the historical chart you only see the final values. Research by Marcos Lopez de Prado in "Advances in Financial Machine Learning" (Wiley, 2018) identifies repainting as the primary cause of overstated backtest returns in indicator-based strategies, affecting an estimated 40% of published trading indicators. Our engine flags common repainting patterns during validation and warns you before the indicator runs.

Overfitting — the custom indicator equivalent of curve-fitting a backtest. You tune 6 parameters until your indicator perfectly identifies every reversal in the last year, then it fails completely on new data because you've modelled noise rather than signal. Check it yourself: if changing a parameter by 1 dramatically changes signal count, that's a red flag.

Lookahead bias — using future data in calculations, usually accidentally. The classic example: referencing close in a condition that's supposed to fire at the open. Close price isn't known at the open, so the indicator "works" on history but can't work live. Pine Script's bar-by-bar execution model prevents most of this by default, but it's still possible through creative use of request.security(), and we check for those patterns.

We built detection for all three because they represent the gap between "my indicator looks brilliant on history" and "my indicator actually works for live trading." Bridging that gap is the difference between a toy and a tool.

What Did Building the Engine Teach Us?

Some things that surprised us.

Most users start by copying, not creating. We expected people to write from scratch. In reality, about 80% of custom indicators on Nydar started as code copied from a forum or tutorial. Users paste it in, see if it works, then start tweaking. This is why Pine Script compatibility was so important — it dramatically lowered friction from "I found code online" to "it's running on my chart." The learning journey isn't blank-page-to-finished-indicator. It's copy, tweak, understand, eventually create.

Error messages matter more than features. The single biggest factor in user retention wasn't engine power — it was error message quality. At launch, errors were technical: "unexpected token at line 14." Users bounced. When we rewrote them to be contextual — "Line 14: ta.sma expects a number for the period, but got a string. Did you mean input.int(14)?" — completion rates doubled. Error message quality is now a first-class feature, not an afterthought.

Performance is a feature. Early versions recalculated everything on every tick. On a 5-minute chart with a year of data, that's 100,000+ bars processed multiple times per second. The UI froze, charts stuttered, and users assumed the indicator was broken rather than slow. The incremental update system made the difference between demo and daily tool.

Saving and sharing drives adoption. When we added the ability to save indicators and load them across different charts, usage tripled. People build once and use everywhere — every asset, every timeframe, every layout. The indicator becomes part of their workflow.

The 105 built-in indicators got better too. When users can write their own RSI and compare it to ours, discrepancies get noticed immediately. We found and fixed three edge-case bugs in built-in indicators that had been there since launch — all discovered because a user's custom version produced slightly different values. Competition from your own users turns out to be excellent quality assurance.

Where Custom Indicators Are Going

Custom indicators are one piece of a larger vision. If you can express your trading logic as code, you should be able to do more than just visualise it.

We want custom indicators to work with strategy backtesting: write your indicator, define entry and exit rules, test against historical data, all without leaving Nydar. That doesn't exist yet. Our strategy backtest isn't connected to historical candles, so that has to happen first. The goal is to go from "I have an idea" to "here's how it would have performed over 2 years" in under a minute.

Beyond backtesting, we want custom indicators feeding into the alert system. "Notify me when my triple-confirmation oversold signal fires on any stock in my watchlist." That's when custom indicators become truly operational — not a visual tool on a chart you're staring at, but an automated scanner watching the market while you do other things. Combined with our Telegram notification pipeline, your custom indicator could wake you up at 3am when that crypto setup appears.

The endgame is a platform where your entire trading workflow — idea to indicator to backtest to live alerts to execution — lives in one place. We're not there yet. But the custom indicator engine is the foundation everything else builds on.

We built Nydar because traders deserve professional-grade analysis tools without the professional-grade price tag. The custom indicator engine is the purest expression of that. Instead of deciding what indicators you need, we gave you the building blocks to create exactly what you need.

If you've been sitting on an indicator idea, give it a try. And if you get stuck, the Pine Script guide and glossary are there to help.

Your edge is your own. We just built the engine to run it.

Last updated: November 2026

Last updated: 21 November 2026

About Ryan Clinton

Founder and solo developer of Nydar. Ryan Clinton has experience at Cowen Inc (Wall Street institutional research), ENNI (£500M infrastructure programme), and Ireland's New Children's Hospital (€2.24B). Ryan built Nydar's 105 technical indicators, XGBoost ML signals (53-56% directional accuracy in crypto research backtests across 13,500+ walk-forward fits), and order flow analysis tools.

Learn more about Nydar