Open-source code in our drills
Some of the interactive drills on our blog recompute a TradingView script in TypeScript. Where that code is a port of a script released under the Mozilla Public License 2.0 (MPL-2.0), the licence lets us use it on this site as long as each ported file keeps its notice and its source stays available to anyone who receives it. Our pages ship these files inside their JavaScript, so each one is listed here with a plain-text copy of the exact source file. Each copy is the file as it is in our code, licence notice included.
MPL-2.0 files
- squeeze.ts
A port of Squeeze Momentum Indicator [LazyBear] by LazyBear. Licence: MPL-2.0 (the script carries no licence line, so TradingView's default for open-source scripts, MPL-2.0, applies).
Our changes: ported from Pine to TypeScript for a drill on simulated candles, with the fixed BB MultFactor formula as a switch.
Used by the drill in Squeeze Momentum Indicator Settings: LazyBear's Code, Read Line by Line.
Source: squeeze.ts.txt
- wavetrend.ts
A port of Indicator: WaveTrend Oscillator [WT] by LazyBear. Licence: MPL-2.0 (the script carries no licence line, so TradingView's default for open-source scripts, MPL-2.0, applies).
Our changes: ported from Pine to TypeScript for a drill on simulated candles, with a guard against division by zero, adjustable lengths, VuManChu Cipher B's preset values and pivot divergences.
Used by the drill in WaveTrend Oscillator Settings: LazyBear & VuManChu Cipher B Code, Read Line by Line.
Source: wavetrend.ts.txt
- lorentzian.ts
A port of Machine Learning: Lorentzian Classification by jdehorty. Licence: MPL-2.0.
Our changes: a reduced TypeScript model of its features, its Lorentzian-distance neighbour search (with a sorted k-NN to compare) and its kernel filter, for a drill on simulated candles.
Used by the drill in Lorentzian Classification Indicator Settings: jdehorty's Code, Read Line by Line.
Source: lorentzian.ts.txt
- ut-bot.ts
A port of UT Bot Alerts by QuantNomad. Licence: MPL-2.0 (the script carries no licence line, so TradingView's default for open-source scripts, MPL-2.0, applies).
Our changes: ported from Pine to TypeScript for a drill on simulated candles, with a reading taken part-way through a candle.
Used by the drill in UT Bot Alerts Settings, Read From the Code: Key Value, ATR Period and Heikin Ashi.
Source: ut-bot.ts.txt
Drill engines we wrote from a published method
These drills show other authors' rules, but none of their code: we wrote each engine from the published method and the rules as our posts describe them. The scripts are named for the rules, and our numbers aren't claimed to be theirs.
- false-breakout-example.ts
A false breakout: price takes out an N-candle (or a period's) high or low, then closes back inside within M candles; here, the two scripts' rules as the post states them in words.
Rules from False Breakout (Expo) by Zeiierman and Breakout Detector (Previous MTF High Low Levels) by LuxAlgo.
Drill in Best False Breakout Indicators on TradingView (2026), Code-Read.
- nadaraya.ts
Nadaraya-Watson kernel regression with a Gaussian kernel, two-sided and one-sided, and an envelope at a multiple of the mean absolute error.
Rules from Nadaraya-Watson Envelope [LuxAlgo] by LuxAlgo.
Drill in Nadaraya-Watson Envelope Settings: LuxAlgo's Code & Non-Repainting Kernels, Read Line by Line.
- chandelier.ts, trail.ts
Chuck LeBeau's Chandelier Exit: the highest high (or close) of N candles minus k × ATR(N) for a long stop, the lowest low (or close) plus k × ATR(N) for a short stop, on Wilder's ATR.
Rules from Chandelier Exit by everget.
Drills in Chandelier Exit Settings: What Each Input Changes, Read From the Code and The SuperTrend Indicator, Explained: Formula, Settings and the Flip.