🏆 AG Pro Crypto Screener & Signal Dashboard v2.7🏆 AG Pro Multi-Crypto Screener & Signal Dashboard (Completely Free)
Stop wasting your valuable time navigating dozens of charts just to find opportunities!
This completely free and professional signal dashboard scans up to 40 Crypto, Stock, or Forex assets for you from a single screen. The AG Pro Screener is designed for traders who need to make fast, informed decisions. It monitors the market 24/7, identifies 'Buy' signals based on its robust multi-filter strategy, and presents all opportunities on a professional "at-a-glance" interface.
This is not just another indicator; it's a complete Crypto Screener and Signal Panel designed for professional traders.
AG Pro Kripto Tarayıcı ve Sinyal Paneli (Multi-Crypto Screener & Signal Dashboard)
✨ Compelling Features (All 100% Free)
Advanced Dashboard Design: A best-in-class professional table with "Zebra Stripes" for easy reading, a custom-branded title bar, and a compact layout.
Multi-Symbol Scanning: Scans up to 40 different user-defined assets (Coins, Stocks, etc.) simultaneously.
Advanced Multi-Filter Strategy (All Toggleable):
Trend Filter (SMA 200): Capture only strong signals that are aligned with the main trend.
Momentum Filter (RSI): Increase your success rate by confirming signals with relative strength (e.g., RSI > 50).
Entry Signal (EMA Crossover): The core 'Buy' signal based on a fast/slow EMA cross (e.g., 20/50).
Volume Filter: Automatically filter out low-volume, illiquid, and risky assets from your signal list.
"At-a-Glance" Visual Icons: This dashboard doesn't just give signals; it shows you the quality of the signal:
Trend Column: 🔼 (Uptrend) or 🔽 (Downtrend) icons instantly show if the signal is "with the trend."
Signal Freshness Column: Special icons show how "fresh" the signal is:
🔥 (Hot): 0-3 bars ago (A new opportunity!)
❇️ (Fresh): 4-7 bars ago
⏳ (Old): 8+ bars ago (Signal may be stale)
Fully Customizable Interface:
Adjustable Text Size: Choose your own font size (Tiny, Small, Normal) to perfectly fit the table to your screen.
Selectable Timeframe: Scan your current "Chart" timeframe, or lock the panel to a specific timeframe (e.g., "4H" or "1D").
Powerful Alert Support: Set up just one single alert to receive instant notifications for all new 'Buy' signals found across all 40 assets. Perfect for strategy automation and bot setups.
⚙️ How to Use
Add this indicator (AG Pro Screener) to your chart.
Open the Settings (⚙️) panel for the script.
In the "Symbol List" section, fill the 40 empty slots with your favorite assets (e.g., BINANCE:BTCUSDT, BINANCE:ETHUSDT, NASDAQ:AAPL, etc.).
In the "Strategy Settings" section, customize your filters like EMA lengths and RSI levels to match your personal system.
Watch the dashboard scan the market for you and deliver signals in real-time!
🙏 Support & Feedback (Don't Forget to Like!)
A lot of effort went into developing this free tool. If you find it helpful, please take one second to click the Like (👍) button and Follow me for the next scripts in the "AG Pro" series.
You can leave all your suggestions and new feature requests as a comment. Happy trading!
خدمات Pine
Info Box⚙️ Purpose
Shows useful trade and event-related data such as:
% Distance from stop levels (D, DH)
Earnings countdown in bars
All displayed in a single floating info box (table) on the chart.
📋 Key Features
Customizable Display
Choose table position (Top Right, Bottom Center, etc.)
Choose table size (Auto, Large, Tiny, etc.)
Custom text and background colors
Metrics Shown
D: % Distance from stop (difference between close and low/high)
DH: % Distance from midpoint of the candle
Earnings Countdown: Number of bars until next earnings event
Conditional Styling
If earnings are within 3 bars, text color turns red as a warning.
Execution Conditions
Runs only on daily timeframe
Updates on last bar only (no historical clutter)
Output
Displays all selected metrics in one line, separated by “×”
e.g. → D: -2.1% × 5 × DH: 1.4%
🧩 Overall Function
Creates a clean, customizable “info box” showing trade distances and upcoming earnings countdown for quick decision-making directly on your TradingView chart.
Lot Size Calculator - Gold🥇 Lot Size Calculator for Gold (XAU/USD)
Description:
A professional and accurate lot size calculator specifically designed for Gold (XAU/USD) trading. This indicator helps traders calculate the optimal position size based on account balance, risk percentage, and stop loss distance, ensuring proper risk management for every trade.
Key Features:
 Accurate Gold Calculations - Properly accounts for Gold pip values ($10 per pip for standard 100oz lots)
 Multi-Currency Support - Works with USD, EUR, and GBP account currencies
 Flexible Contract Sizes - Supports Standard (100 oz), Mini (10 oz), and Micro (1 oz) lots
 Customizable Decimal Places - Display lot sizes with 2-8 decimal precision (no rounding)
 Clean Visual Design - Modern, professional info panel with gold-themed styling
 Adjustable Display - Position panel anywhere on chart with customizable colors and sizes
 Real-Time Calculations - Instantly updates as you adjust your risk parameters
How It Works:
The calculator uses the standard forex position sizing formula optimized for Gold:
Lot Size = Risk Amount / (Stop Loss in Pips × Pip Value Per Lot)
For Gold (XAU/USD):
Standard Lot (100 oz): 1 pip = $10
Mini Lot (10 oz): 1 pip = $1
Micro Lot (1 oz): 1 pip = $0.10
Settings:
Account Settings:
Account Balance: Your trading capital
Account Currency: USD, EUR, or GBP
Risk Percentage: How much to risk per trade (default: 2%)
Contract Size: 100 oz (Standard), 10 oz (Mini), or 1 oz (Micro)
Display Currency: Choose how to display risk amounts
Trade Settings:
Stop Loss: Your SL distance in pips
Display Settings:
Label Position: Top/Bottom, Left/Right, Middle Right
Label Size: Tiny to Huge
Decimal Places: 2-8 decimals
Custom Colors: Background, text, and accent colors
Perfect For:
Gold (XAU/USD) day traders and swing traders
Position sizing and risk management
Traders using fixed percentage risk models
Anyone trading Gold CFDs or spot markets
Scalpers to long-term Gold investors
What Makes This Different:
Unlike generic lot size calculators, this tool correctly calculates Gold's pip values based on contract size. Many calculators get this wrong, leading to incorrect position sizing. This indicator ensures you're always trading the right lot size for your risk tolerance.
Example Usage:
Account Balance: $10,000
Risk: 1% = $100
Stop Loss: 60 pips
Contract Size: 100 oz (Standard)
Result: 0.1667 lots (exact, no rounding)
Perfect for maintaining consistent risk management in your Gold trading strategy!
Macros Kill Zones Fusionadas (:20 - :40) / :50 - :10)Tiempo y precio ICT
Macros :20 - :40 representa el momento en que el algoritmo institucional confirma dirección y ejecuta desplazamiento tras inducir la liquidez de apertura.
Macros :50 - :10 es la fase de manipulación o acumulación previa al desplazamiento principal.
Time and Price in ICT
Macros :20 - :40 represent the moment when the institutional algorithm confirms direction and executes the displacement after inducing opening liquidity.
Macros :50 - :10 mark the manipulation or accumulation phase that occurs before the main displacement.
Prev 1-Min Volume • 5% Max Shares (TTP-ready)💡 Overview
This tool was built to help Trade The Pool (TTP) traders comply with the new “5% per minute volume” rule — without needing to calculate anything manually.
It automatically tracks the previous 1-minute volume, calculates 5% of it, and compares that to your planned order size.
If your planned size is within the limit, it shows green ✅.
If you’re above, it flashes red 🚫.
And when liquidity spikes allow for more size, you’ll see a green glow and 🔔 alert — so you can size up confidently without breaking the rule.
⚙️ Features
✅ Auto-calculates 5% volume cap from the previous 1-min candle
✅ Displays previous volume, max allowed shares, and your planned size
✅ TTP “different volume” scaling option (e.g. 0.69 for 45M vs 65M real volume)
✅ Per-bar slice suggestion for 10s scalpers
✅ Corner selector (top-left, top-right, bottom-left, bottom-right)
✅ Visual glow and 🔔 alert when liquidity window opens
✅ Compact and real-time responsive on 10s charts
Funded Gang IndiciCustomized indicator to detect the opening bias of Indexes.
Timeframe 14:30 - 15:30
Symbol GuardSymbol Guard (configurable, v6) — a tiny “chart bouncer” to prevent accidental symbol swaps. Two modes only: exact full ticker (tickerid) or base currency. 
Usage: add the indicator, choose Compare by, then set Expected ticker (tickerid) or Expected base currency. Leaving the selected field empty means “no restriction.” Simple, focused, and just bossy enough to save your setup.
ICT Reversals identify when the "top is in " or the bottom is in , 
3 factors to detect if top or bottom is in based on ICT principals:
1. daily High and Daily low of the previous day - the market will reach that point and likely to reverse
2.diviation from Volume at top or bottom compared to the last X candles - default is 9. 
3. detection of FVG on the last 4 candles to identify imbalance - stretched price aka distribution 
after this the market will either consolidate and then reveres or consolidate and retrace before another leg up - remember retracement is 70% min so its enough to use also on retracement not just reversal. 
IT ONLY WORKS ON 4 CHART ATM
Remember WAIT for the FVG to be touched on the bounce before entring !! 
GL
NY Open 5 minute Range (5m Box Extended)Draws a box around the first 5 minute candle for the New York session. 
5-Year Returns Chart BTCvsSPXvsGOLDvsNVDACompare between thes 4 assets:
BTC
NVDA
SPX
GOLD
With an initial 1000$ investment in the last 5 years each return
ICT Kill zones ver 2ICT Kill zones :
London 02:00 - b5:00 
NY 7:00 -10:00
NY Lunch 
13:00 - 14:30 
*all times are NYC times 
MEGA_Long/Short📊 MTF Entry Signal (with L/S Labels)
A clean and compact multi-timeframe entry point indicator for TradingView. Shows clear entry signals for LONG and SHORT trades directly on the chart, with markers and letters for quick decision-making.
🎯 Key Features:
Dual timeframe analysis: Choose main and fast timeframes (default: 30m and 4h).
Entry signals:
🟢 Green triangle + "L" — LONG entry (Buy signal)
🔴 Red triangle + "S" — SHORT entry (Sell signal)
Signal only at true trend reversals – No excessive markers or noise.
Markers move dynamically with price – Always match the candlestick and chart movement.
⚙️ Signal Criteria:
LONG: EMA9 > EMA21 and MACD > 0, confirmed on both selected timeframes.
SHORT: EMA9 < EMA21 and MACD < 0, confirmed on both selected timeframes.
Entry marker appears only when signal direction changes.
🔧 Settings:
Manually select fast/main timeframes in the indicator menu (recommended: 30m + 4h).
Marker size set to minimal (size=tiny) for maximum clarity.
📈 Usage:
Designed for clean, non-overloaded charts.
Works perfectly for trend trading, reversals, and entry confirmation.
Suitable for scalping, swing trading, and crypto/futures analysis.
ICT London & NY Kill ZonesICT london and NYC kiill zones marked on the chart automatically - use with NY time zone 
Kelly Wave Position Matrix 20251024 V1 ZENYOUNGA simple table is designed for use when opening a position. It applies the Kelly formula to calculate a more scientific position size based on win rate and risk–reward ratio. At the same time, it displays 1.65× ATR stop-loss levels for both long and short positions to serve as a reference for comparing with existing stop-loss placements.
Additionally, the table back-calculates the corresponding position size based on a 2% total capital loss limit, using the actual loss ratio. It also shows the current wave trend status as a pre-filtering condition.
Overall, this table integrates the core elements of trading — trend (wave confirmation), win rate, risk–reward ratio, and position sizing — making it an effective checklist before entering a trade. Its purpose is to help achieve a probabilistic edge and ensure positive expected value in trading decisions.
Wall Street Bell 🔔This will ring a bell at market open (9:30 AM EST) and close (4:00 PM EST), automatically adjusted to the user's local time zone, only on valid trading days.
✅ Automatic timezone conversion - Works in any timezone
✅ Weekdays only - No alerts on weekends
✅ Visual markers - Shows 🔔 labels on chart when bells ring
✅ Status dashboard - Shows which bells are enabled (top-right corner)
✅ Customizable - Toggle bells on/off in settings
Note: This excludes weekends automatically, but TradingView doesn't have a built-in holiday calendar for NYSE. On market holidays, you may need to manually disable the alerts for that day,
You'll need to create two separate alerts - one for the opening bell and one for the closing bell.
Name of tickerDescription:
This indicator displays the instrument’s ticker symbol and the current chart timeframe at the top center of the chart.
Features:
 • Shows the ticker (e.g., BTCUSDT, AAPL, etc.).
 • Displays the current timeframe (1m, 5m, 1H, 1D, etc.).
 • Positioned at the top center of the chart for easy reference.
 • Transparent background for minimal interference with price action.
 • Lightweight and simple, no extra settings required.
Usage:
 • Works with any instrument: stocks, crypto, futures.
 • Useful for traders who want to always see the ticker and timeframe while analyzing the chart.
Settings:
 • Text size can be adjusted in the script (text_size).
 • Text and background colors can be customized (text_color, bgcolor).
Major Trading Sessions IndicatorsThis indicator displays vertical lines on your chart to mark the opening times of the major global trading sessions (Tokyo, Shanghai/HK, London, and New York). As a crypto trader I want to find price action patterns after sessions open.
It's fully customizable and extendable (you could add closing time for sessions as well)
Works best on short timeframes.
 Features: 
 
 6 configurable vertical lines (4 preset for major sessions + 2 custom)
 Each line shows a customizable label (e.g., "Tokyo", "London")
 Individual time and color settings for each line
 UTC offset for each line to handle Daylight Saving Time
 Option to fix all labels at a specific price level for cleaner appearance (need to set and save it for each chart, it becomes a mess if you don't). Default behavior and limit of Pine Script is that it will be attached to the price wick.
 
 Default Sessions: 
Tokyo: 00:00 UTC (midnight)
Shanghai/HK: 01:30 UTC
London: 08:00 UTC (winter) - adjust offset to +1 for summer
New York: 13:00 UTC (winter) - adjust offset to -4 for summer
 DST Adjustments: 
Simply change the UTC offset when daylight saving time begins/ends:
London: 0 (winter) or +1 (summer)
New York: -5 (winter) or -4 (summer)
Lines extend from top to bottom of the chart and appear precisely when each session opens.
My preferred configuration: shorten names and reduce opacity of colors to 20-30%.
Realtime RenkoI've been working on real-time renko for a while as a coding challenge. The interesting problem here is building renko bricks that form based on incoming tick data rather than waiting for bar closes. Every tick that comes through gets processed immediately, and when price moves enough to complete a brick, that brick closes and a new one opens right then. It's just neat because you can run it and it updates as you'd expect with renko, forming bricks based purely on price movement happening in real time rather than waiting for arbitrary time intervals to pass.
The three brick sizing methods give you flexibility in how you define "enough movement" to form a new brick. Traditional renko uses a fixed price range, so if you set it to 10 ticks, every brick represents exactly 10 ticks of movement. This works well for instruments with stable tick sizes and predictable volatility. ATR-based sizing calculates the average true range once at startup using a weighted average across all historical bars, then divides that by your brick value input. If you want bricks that are one full ATR in size, you'd use a brick value of 1. If you want half-ATR bricks, use 2. This inverted relationship exists because the calculation is ATR divided by your input, which lets you work with multiples and fractions intuitively. Percentage-based sizing makes each brick a fixed percentage move from the previous brick's close, which automatically scales with price level and works well for instruments that move proportionally rather than in absolute tick increments.
The best part about this implementation is how it uses varip for state management. When you first load the indicator, there's no history at all. Everything starts fresh from the moment you add it to your chart because varip variables only exist in real-time. This means you're watching actual renko bricks form from real tick data as it arrives. The indicator builds its own internal history as it runs, storing up to 250 completed bricks in memory, but that history only exists for the current session. Refresh the page or reload the indicator and it starts over from scratch.
The visual implementation uses boxes for brick bodies and lines for wicks, drawn at offset bar indices to create the appearance of a continuous renko chart in the indicator pane. Each brick occupies two bar index positions horizontally, which spaces them out and makes the chart readable. The current brick updates in real time as new ticks arrive, with its high, low, and close values adjusting continuously until it reaches the threshold to close and become finalized. Once a brick closes, it gets pushed into the history array and a new brick opens at the closing level of the previous one.
What makes this especially useful for debugging and analysis are the hover tooltips on each brick. Clicking on any brick brings up information showing when it opened with millisecond precision, how long it took to form from open to close, its internal bar index within the renko sequence, and the brick size being used. That time delta measurement is particularly valuable because it reveals the pace of price movement. A brick that forms in five seconds indicates very different market conditions than one that takes three minutes, even though both bricks represent the same amount of price movement. You can spot acceleration and deceleration in trend development by watching how quickly consecutive bricks form.
The pine logs that generate when bricks close serve as breadcrumbs back to the main chart. Every time a brick finalizes, the indicator writes a log entry with the same information shown in the tooltip. You can click that log entry and TradingView jumps your main chart to the exact timestamp when that brick closed. This lets you correlate renko brick formation with what was happening on the time-based chart, which is critical for understanding context. A brick that closed during a major news announcement or at a key support level tells a different story than one that closed during quiet drift, and the logs make it trivial to investigate those situations.
The internal bar indexing system maintains a separate count from the chart's bar_index, giving each renko brick its own sequential number starting from when the indicator begins running. This makes it easy to reference specific bricks in your analysis or when discussing patterns with others. The internal index increments only when a brick closes, so it's a pure measure of how many bricks have formed regardless of how much chart time has passed. You can match these indices between the visual bricks and the log entries, which helps when you're trying to track down the details of a specific brick that caught your attention.
Brick overshoot handling ensures that when price blows through the threshold level instead of just barely touching it, the brick closes at the threshold and the excess movement carries over to the next brick. This prevents gaps in the renko sequence and maintains the integrity of the brick sizing. If price shoots up through your bullish threshold and keeps going, the current brick closes at exactly the threshold level and the new brick opens there with the overshoot already baked into its initial high. Without this logic, you'd get renko bricks with irregular sizes whenever price moved aggressively, which would undermine the whole point of using fixed-range bricks.
The timezone setting lets you adjust timestamps to your local time or whatever reference you prefer, which matters when you're analyzing logs or comparing brick formation times across different sessions. The time delta formatter converts raw milliseconds into human-readable strings showing days, hours, minutes, and seconds with fractional precision. This makes it immediately clear whether a brick took 12.3 seconds or 2 minutes and 15 seconds to form, without having to parse millisecond values mentally.
This is the script version that will eventually be integrated into my real-time candles library. The library version had an issue with tooltips not displaying correctly, which this implementation fixes by using a different approach to label creation and positioning. Running it as a standalone indicator also gives you more control over the visual settings and makes it easier to experiment with different brick sizing methods without affecting other tools that might be using the library version.
What this really demonstrates is that real-time indicators in Pine Script require thinking about state management and tick processing differently than historical indicators. Most indicator code assumes bars are immutable once closed, so you can reference `close ` and know that value will never change. Real-time renko throws that assumption out because the current brick is constantly mutating with every tick until it closes. Using varip for state variables and carefully tracking what belongs to finalized bricks versus the developing brick makes it possible to maintain consistency while still updating smoothly in real-time. The fact that there's no historical reconstruction and everything starts fresh when you load it is actually a feature, not a limitation, because you're seeing genuine real-time brick formation rather than some approximation of what might have happened in the past.
[PDR] Daily Rebalance█ OVERVIEW
This indicator is a powerful portfolio backtesting tool designed to simulate the performance of a static-weight, daily rebalancing strategy. It allows you to define a portfolio of up to 10 assets, set their target weights, and track its cumulative return against a user-defined benchmark and a risk-free rate.
The core of the script is its daily rebalancing logic, which calculates and logs every trade needed to bring the portfolio back to its target allocations at the close of each day. This provides a transparent and detailed view of how a static portfolio would have performed historically, including the impact of trading costs.
█ KEY FEATURES
 
  Daily Rebalancing: Simulates a portfolio that is rebalanced at the close of every day to maintain target asset allocations.
  Customizable Portfolio: Configure up to 10 different assets with specific weights. If all weights are left at 0, the script automatically creates an equal-weight portfolio from the selected assets.
  Performance Comparison: Plots the portfolio's equity curve against a user-defined benchmark (e.g.,  SET:SET50 ) and a risk-free return, allowing for easy relative performance analysis.
  Realistic Simulation: Accounts for trading costs like broker commission and minimum lot sizes for more accurate and grounded backtesting results.
  Detailed Performance Metrics: An on-chart table displays real-time statistics, including Current Drawdown, Max Drawdown, and Total Return for both your portfolio and the benchmark.
  Trade-by-Trade Logs: For full transparency, every rebalancing trade (BUY/SELL), including shares, price, notional value, and fees, is logged in the Pine Logs panel.
 
█ HOW TO USE
 
  **Apply to a Daily Chart:** This script is designed to work exclusively on the daily ( 1D ) timeframe. Applying it to any other timeframe will result in a runtime error.
  **Configure Settings:** Open the indicator's settings. Set your `Initial Capital`, `Start Time`, and the `Benchmark` symbol you wish to compare against.
  **Define Your Assets:** In the 'Assets' group, check the box to enable each asset you want to include, select the symbol, and define its target `Weight (%)`.
  **Set Trading Costs:** Adjust the `Broker Commission (%)` and `Minimal Buyable Lot` to match your expected trading conditions.
  **Analyze the Results:** The performance curves are plotted in the indicator pane below your main chart. The key metrics table is displayed on the bottom-right of your chart.
  **View Rebalancing Trades:** This is a crucial step for understanding the simulation. To see the detailed daily trades, you **must** open the **Pine Logs**. You can find this panel at the bottom of your TradingView window, next to the "Pine Editor" and "Strategy Tester" tabs. The logs provide a complete breakdown of every rebalancing action.
 
█ DISCLAIMER
This is a backtesting and simulation tool, not a trading signal generator. Its purpose is for research and performance analysis. Past performance is not indicative of future results. Always conduct your own research before making any investment decisions.
Material Color Palette Library█ OVERVIEW
Unlock a world of color in your Pine Script® projects with the  Material Color Palette Library . This library provides a comprehensive and structured color system based on Google's Material Design palette, making it incredibly easy to create visually appealing and professional-looking indicators and strategies.
Forget about guessing hex codes. With this library, you have access to 19 distinct color families, each offering a wide range of shades. Every color can be fine-tuned with saturation, darkness, and opacity levels, giving you precise control over your script's appearance.
To make development even easier, the library includes a visual cheatsheet. Simply add the script to your chart to display a full table of all available colors and their corresponding parameters.
█ KEY FEATURES
 
   Vast Spectrum:  19 distinct color families, from vibrant reds and blues to subtle greys and browns.
   Fine-Tuned Control:  Each color function accepts parameters for `saturationLevel` (1-13 or 1-9) and `darkLevel` (1-3) to select the perfect shade.
   Opacity Parameter:  Easily add transparency to any color for fills, backgrounds, or lines.
   Quick Access Tones:  A simple `tone()` function to grab base colors by name.
   Visual Cheatsheet:  An on-chart table displays the entire color palette, serving as a handy reference guide during development.
 
█ HOW TO USE
As a library, this script is meant to be imported into your own indicators or strategies.
 1. Import the Library 
Add the following line to the top of your script. Remember to replace `YourUsername` with your TradingView username.
 
import mastertop/ColorPalette/1 as colors
 
 2. Call a Color Function 
You can now use any of the exported functions to set colors for your plots, backgrounds, tables, and more.
The primary functions take three arguments: `functionName(saturationLevel, darkLevel, opacity)`
 
  `saturationLevel`: An integer that controls the intensity of the color. Ranges from 1 (lightest) to 13 (most vibrant) for most colors, and 1-9 for `brown`, `grey`, and `blueGrey`.
  `darkLevel`: An integer from 1 to 3 (1: light, 2: medium, 3: dark).
  `opacity`: An integer from 0 (opaque) to 100 (invisible).
 
 Example Usage: 
Let's plot a moving average with a specific shade of teal.
 
// Import the library
import mastertop/ColorPalette/1 as colors
indicator("My Script with Custom Colors", overlay = true)
// Calculate a moving average
ma = ta.sma(close, 20)
// Plot the MA using a color from the library
// We'll use teal with saturation level 7, dark level 2, and 0% opacity
plot(ma, "MA", color = colors.teal(7, 2, 0), linewidth = 2)
 
 3. Using the `tone()` Function 
For quick access to a base color, you can use the `tone()` function.
 
// Set a red background with 85% transparency
bgcolor(colors.tone('red', 85))
 
█ VISUAL REFERENCE
To see all available colors at a glance, you can add this library script directly to your chart. It will display a comprehensive table showing every color variant. This makes it easy to pick the exact shade you need without guesswork.
This library is designed for fellow Pine Script® developers to streamline their workflow and enhance the visual quality of their scripts. Enjoy!
N Order EMAThe exponential moving average is one of the most fundamental tools in technical analysis, but its implementation is almost always locked to a single mathematical approach. I've always wanted to extend the EMA into an n-order filter, and after some time working through the digital signal processing mathematics, I finally managed to do it. This indicator takes the familiar EMA concept and opens it up to four different discretization methods, each representing a valid way to transform a continuous-time exponential smoother into a discrete-time recursive filter. On top of that, it includes adjustable filter order, which fundamentally changes the frequency response characteristics in ways that simply changing the period length cannot achieve.
The four discretization styles are impulse-matched, all-pole, matched z-transform, and bilinear (Tustin). The all-pole version is exactly like stacking multiple EMAs together but implemented in a single function with proper coefficient calculation. It uses a canonical form where you get one gain coefficient and the rest are zeros, with the feedback coefficients derived from the binomial expansion of the pole polynomial. The other three methods are attempts at making generalizations of the EMA in different ways. Impulse-matched creates the filter by matching the discrete-time impulse response to what the continuous EMA would produce. Matched z-transform directly maps the continuous poles to the z-domain using the exponential relationship. Bilinear uses the Tustin transformation with frequency prewarping to ensure the cutoff frequency is preserved despite the inherent warping of the mapping.
Honestly, they're all mostly the same in practice, which is exactly what you'd expect since they're all valid discretizations of the same underlying filter. The differences show up in subtle ways during volatile market conditions or in the exact phase characteristics, but for most trading applications the outputs will track each other closely. That said, the bilinear version works particularly well at low periods like 2, where other methods can sometimes produce numerical artifacts. I personally like the z-match for its clean frequency-domain properties, but the real point here is demonstrating that you can tackle the same problem from multiple mathematical angles and end up with slightly different but equally valid implementations.
The order parameter is where things get interesting. A first-order EMA is the standard single-pole recursive filter everyone knows. When you move to second-order, you're essentially cascading two filter sections, which steepens the roll-off in the frequency domain and changes how the filter responds to sudden price movements. Higher orders continue this progression. The all-pole style makes this particularly clear since it's literally stacking EMA operations, but all four discretization methods support arbitrary order. This gives you control over the aggressiveness of the smoothing that goes beyond just adjusting the period length.
On top of the core EMA calculation, I've included all the standard variants that people use for reducing lag. DEMA applies the EMA twice and combines the results to get faster response. TEMA takes it further with three applications. HEMA uses a Hull-style calculation with fractional periods, applying the EMA to the difference between a half-period EMA and a full-period EMA, then smoothing that result with the square root of the period. These are all implemented using whichever discretization method you select, so you're not mixing different mathematical approaches. Everything stays consistent within the chosen framework.
The practical upside of this indicator is flexibility for people building trading systems. If you need a moving average with specific frequency response characteristics, you can tune the order parameter instead of hunting for the right period length. If you want to test whether different discretization methods affect your strategy's performance, you can swap between them without changing any other code. For most users, the impulse-matched style at order 1 will behave almost identically to a standard EMA, which gives you a familiar baseline to work from. From there you can experiment with higher orders or different styles to see if they provide any edge in your particular market or timeframe.
What this really highlights is that even something as seemingly simple as an exponential moving average involves mathematical choices that usually stay hidden. The standard EMA formula you see in textbooks is already a discretized version of a continuous exponential decay, and there are multiple valid ways to perform that discretization. By exposing these options, this indicator lets you explore a parameter space that most traders never even know exists. Whether that exploration leads to better trading results is an empirical question that depends on your strategy and market, but at minimum it's a useful reminder that the tools we take for granted are built on arbitrary but reasonable mathematical decisions.






















