Persistence# Persistence
## What it does
Measures **price change persistence**, defined as the percentage of bars within a lookback window that closed higher than the prior close. A high value means the instrument has been closing up frequently, which can indicate durable momentum. This mirrors Stockbee’s idea: *select stocks with high price change persistence*, and then combine **momentum plus persistence**.
## Can be used for scanning in PineScreener
## Calculation
* `isUp` is true when `close > close `.
* `countUp` counts true instances over the last `len` bars.
* `pctUp = 100 * countUp / len`, bounded between 0 and 100.
* A 50% level is a natural baseline. Above 50% suggests more up closes than down closes in the window.
## Inputs
* **Lookback bars (`len`)**: default 252 for roughly one trading year on a daily chart. On weekly charts use something like 52, on monthly charts use 12.
## How to use
1. **Screen for persistence**
   Sort a watchlist by the plotted value, higher is better. Many momentum traders start looking above 58 to 65 percent, then layer a trend filter.
2. **Combine with momentum**
   Examples, pick tickers with:
   * `pctUp > 60`, and price above a rising EMA50 or EMA100.
   * `pctUp rising` and weekly ROC positive.
3. **Switch timeframe to change the horizon**
   * Daily chart with `len = 252` approximates one year.
   * Weekly chart with `len = 52` approximates one year.
   * Monthly chart with `len = 12` approximates one year.
## TC2000 equivalence
Stockbee’s TC2000 expression:
```
CountTrue(c > c1, 252)
```
## Interpretation guide
* **70 to 90**: very strong persistence; often trend leaders, check for extensions and risk controls.
* **60 to 70**: constructive persistence; good hunting ground for swing setups that also pass momentum filters.
* **50**: neutral baseline; around random up vs down frequency.
* **Below 50**: persistent weakness; consider only for mean reversion or short strategies.
## Practical tips
* **Event effects**: ex-dividend gaps can reduce persistence on high yield names. Earnings gaps can swing the value sharply.
* **Survivorship bias**: when backtesting on curated lists, persistence can look cleaner than in live scans.
* **Liquidity**: thin names may show noisy persistence due to erratic prints.
## Reference to Stockbee
* “One way to select stocks for swing trading is to find those with high price change persistence.”
* “Persistence can be calculated on a daily, monthly, or weekly timeframe.”
* TC2000 function: `CountTrue(c > c1, 252)`
* Example noted in the tweet: CVNA had very high one-year price persistence at the time of that post.
* Takeaway: **look for momentum plus persistence**, not persistence alone.
Cari dalam skrip untuk "one一季度财报"
Meta-LR ForecastThis indicator builds a forward-looking projection from the current bar by combining twelve time-compressed “mini forecasts.” Each forecast is a linear-regression-based outlook whose contribution is adaptively scaled by trend strength (via ADX) and normalized to each timeframe’s own volatility (via that timeframe’s ATR). The result is a 12-segment polyline that starts at the current price and extends one bar at a time into the future (1× through 12× the chart’s timeframe). Alongside the plotted path, the script computes two summary measures:
* Per-TF Bias% — a directional efficiency × R² score for each micro-forecast, expressed as a percent.
* Meta Bias% — the same score, but applied to the final, accumulated 12-step path. It summarizes how coherent and directional the combined projection is.
This tool is an indicator, not a strategy. It does not place orders. Nothing here is trade advice; it is a visual, quantitative framework to help you assess directional bias and trend context across a ladder of timeframe multiples.
The core engine fits a simple least-squares line on a normalized price series for each small forecast horizon and extrapolates one bar forward. That “trend” forecast is paired with its mirror, an “anti-trend” forecast, constructed around the current normalized price. The model then blends between these two wings according to current trend strength as measured by ADX.
ADX is transformed into a weight (w) in   using an adaptive band centered on the rolling mean (μ) with width derived from the standard deviation (σ) of ADX over a configurable lookback. When ADX is deeply below the lower band, the weight approaches -1, favoring anti-trend behavior. Inside the flat band, the weight is near zero, producing neutral behavior. Clearly above the upper band, the weight approaches +1, favoring a trend-following stance. The transitions between these regions are linear so the regime shift is smooth rather than abrupt.
You can shape how quickly the model commits to either wing using two exponents. One exponent controls how aggressively positive weights lean into the trend forecast; the other controls how aggressively negative weights lean into the anti-trend forecast. Raising these exponents makes the response more gradual; lowering them makes the shift more decisive. An optional switch can force full anti-trend behavior when ADX registers a deep-low condition far below the lower tail, if you prefer a categorical stance in very flat markets.
A key design choice is volatility normalization. Every micro-forecast is computed in ATR units of its own timeframe. The script fetches that timeframe’s ATR inside each security call and converts normalized outputs back to price with that exact ATR. This avoids scaling higher-timeframe effects by the chart ATR or by square-root time approximations. Using “ATR-true” for each timeframe keeps the cross-timeframe accumulation consistent and dimensionally correct.
Bias% is defined as directional efficiency multiplied by R², expressed as a percent. Directional efficiency captures how much net progress occurred relative to the total path length; R² captures how well the path aligns with a straight line. If price meanders without net progress, efficiency drops; if the variation is well-explained by a line, R² rises. Multiplying the two penalizes choppy, low-signal paths and rewards sustained, coherent motion.
The forward path is built by converting each per-timeframe Bias% into a small ATR-sized delta, then cumulatively adding those deltas to form a 12-step projection. This produces a polyline anchored at the current close and stepping forward one bar per timeframe multiple. Segment color flips by slope, allowing a quick read of the path’s direction and inflection.
Inputs you can tune include:
* Max Regression Length. Upper bound for each micro-forecast’s regression window. Larger values smooth the trend estimate at the cost of responsiveness; smaller values react faster but can add noise.
* Price Source. The price series analyzed (for example, close or typical price).
* ADX Length. Period used for the DMI/ADX calculation.
* ATR Length (normalization). Window used for ATR; this is applied per timeframe inside each security call.
* Band Lookback (for μ, σ). Lookback used to compute the adaptive ADX band statistics. Larger values stabilize the band; smaller values react more quickly.
* Flat half-width (σ). Width of the neutral band on both sides of μ. Wider flats spend more time neutral; narrower flats switch regimes more readily.
* Tail width beyond flat (σ). Distance from the flat band edge to the extreme trend/anti-trend zone. Larger tails create a longer ramp; smaller tails reach extremes sooner.
* Polyline Width. Visual thickness of the plotted segments.
* Negative Wing Aggression (anti-trend). Exponent shaping for negative weights; higher values soften the tilt into mean reversion.
* Positive Wing Aggression (trend). Exponent shaping for positive weights; lower values make trend commitment stronger and sooner.
* Force FULL Anti-Trend at Deep-Low ADX. Optional hard switch for extremely low ADX conditions.
On the chart you will see:
* A 12-segment forward polyline starting from the current close to bar\_index + 1 … +12, with green segments for up-steps and red for down-steps.
* A small label at the latest bar showing Meta Bias% when available, or “n/a” when insufficient data exists.
Interpreting the readouts:
* Trend-following contexts are characterized by ADX above the adaptive upper band, pushing w toward +1. The blended forecast leans toward the regression extrapolation. A strongly positive Meta Bias% in this environment suggests directional alignment across the ladder of timeframes.
* Mean-reversion contexts occur when ADX is well below the lower tail, pushing w toward -1 (or forcing anti-trend if enabled). After a sharp advance, a negative Meta Bias% may indicate the model projects pullback tendencies.
* Neutral contexts occur when ADX sits inside the flat band; w is near zero, the blended forecast remains close to current price, and Meta Bias% tends to hover near zero.
These are analytical cues, not rules. Always corroborate with your broader process, including market structure, time-of-day behavior, liquidity conditions, and risk limits.
Practical usage patterns include:
* Momentum confirmation. Combine a rising Meta Bias% with higher-timeframe structure (such as higher highs and higher lows) to validate continuation setups. Treat the 12th step’s distance as a coarse sense of potential room rather than as a target.
* Fade filtering. If you prefer fading extremes, require ADX to be near or below the lower ramp before acting on counter-moves, and avoid fades when ADX is decisively above the upper band.
* Position planning. Because per-step deltas are ATR-scaled, the path’s vertical extent can be mentally mapped to typical noise for the instrument, informing stop distance choices. The script itself does not compute orders or size.
* Multi-timeframe alignment. Each step corresponds to a clean multiple of your chart timeframe, so the polyline visualizes how successively larger windows bias price, all referenced to the current bar.
House-rules and repainting disclosures:
* Indicator, not strategy. The script does not execute, manage, or suggest orders. It displays computed paths and bias scores for analysis only.
* No performance claims. Past behavior of any measure, including Meta Bias%, does not guarantee future results. There are no assurances of profitability.
* Higher-timeframe updates. Values obtained via security for higher-timeframe series can update intrabar until the higher-timeframe bar closes. The forward path and Meta Bias% may change during formation of a higher-timeframe candle. If you need confirmed higher-timeframe inputs, consider reading the prior higher-timeframe value or acting only after the higher-timeframe close.
* Data sufficiency. The model requires enough history to compute ATR, ADX statistics, and regression windows. On very young charts or illiquid symbols, parts of the readout can be unavailable until sufficient data accumulates.
* Volatility regimes. ATR normalization helps compare across timeframes, but unusual volatility regimes can make the path look deceptively flat or exaggerated. Judge the vertical scale relative to your instrument’s typical ATR.
Tuning tips:
* Stability versus responsiveness. Increase Max Regression Length to steady the micro-forecasts but accept slower response. If you lower it, consider slightly increasing Band Lookback so regime boundaries are not too jumpy.
* Regime bands. Widen the flat half-width to spend more time neutral, which can reduce over-trading tendencies in chop. Shrink the tail width if you want the model to commit to extremes sooner, at the cost of more false swings.
* Wing shaping. If anti-trend behavior feels too abrupt at low ADX, raise the negative wing exponent. If you want trend bias to kick in more decisively at high ADX, lower the positive wing exponent. Small changes have large effects.
* Forced anti-trend. Enable the deep-low option only if you explicitly want a categorical “markets are flat, fade moves” policy. Many users prefer leaving it off to keep regime decisions continuous.
Troubleshooting:
* Nothing plots or the label shows “n/a.” Ensure the chart has enough history for the ADX band statistics, ATR, and the regression windows. Exotic or illiquid symbols with missing data may starve the higher-timeframe computations. Try a more liquid market or a higher timeframe.
* Path flickers or shifts during the bar. This is expected when any higher-timeframe input is still forming. Wait for the higher-timeframe close for fully confirmed behavior, or modify the code to read prior values from the higher timeframe.
* Polyline looks too flat or too steep. Check the chart’s vertical scale and recent ATR regime. Adjust Max Regression Length, the wing exponents, or the band widths to suit the instrument.
Integration ideas for manual workflows:
* Confluence checklist. Use Meta Bias% as one of several independent checks, alongside structure, session context, and event risk. Act only when multiple cues align.
* Stop and target thinking. Because deltas are ATR-scaled at each timeframe, benchmark your proposed stops and targets against the forward steps’ magnitude. Stops that are much tighter than the prevailing ATR often sit inside normal noise.
* Session context. Consider session hours and microstructure. The same ADX value can imply different tradeability in different sessions, particularly in index futures and FX.
This indicator deliberately avoids:
* Fixed thresholds for buy or sell decisions. Markets vary and fixed numbers invite overfitting. Decide what constitutes “high enough” Meta Bias% for your market and timeframe.
* Automatic risk sizing. Proper sizing depends on account parameters, instrument specifications, and personal risk tolerance. Keep that decision in your risk plan, not in a visual bias tool.
* Claims of edge. These measures summarize path geometry and trend context; they do not ensure a tradable edge on their own.
Summary of how to think about the output:
* The script builds a 12-step forward path by stacking linear-regression micro-forecasts across increasing multiples of the chart timeframe.
* Each micro-forecast is blended between trend and anti-trend using an adaptive ADX band with separate aggression controls for positive and negative regimes.
* All computations are done in ATR-true units for each timeframe before reconversion to price, ensuring dimensional consistency when accumulating steps.
* Bias% (per-timeframe and Meta) condenses directional efficiency and trend fidelity into a compact score.
* The output is designed to serve as an analytical overlay that helps assess whether conditions look trend-friendly, fade-friendly, or neutral, while acknowledging higher-timeframe update behavior and avoiding prescriptive trade rules.
Use this tool as one component within a disciplined process that includes independent confirmation, event awareness, and robust risk management.
Wickless Tap Signals Wickless Tap Signals — TradingView Indicator (v6)
A precision signal-only tool that marks BUY/SELL events when price “retests” the base of a very strong impulse candle (no wick on the retest side) in the direction of trend.
What it does (in plain English)
Finds powerful impulse candles:
Bull case: a green candle with no lower wick (its open ≈ low).
Bear case: a red candle with no upper wick (its open ≈ high).
Confirms trend with an EMA filter:
Only looks for bullish bases while price is above the EMA.
Only looks for bearish bases while price is below the EMA.
Waits for the retest (“tap”):
Later, if price revisits the base of that wickless candle
Bullish: taps the candle’s low/open → BUY signal
Bearish: taps the candle’s high/open → SELL signal
Optional level “consumption” so each base can trigger one signal, not many.
The idea: a wickless impulse often marks strong initiative order flow. The first retest of that base frequently acts as a springboard (bull) or ceiling (bear).
Exact rules (formal)
Let tick = syminfo.mintick, tol = tapTicks * tick.
Trend filter
inUp = close > EMA(lenEMA)
inDn = close < EMA(lenEMA)
Wickless impulse candles (confirmed on bar close)
Bullish wickless: close > open and abs(low - open) ≤ tol
Bearish wickless: close < open and abs(high - open) ≤ tol
When such a candle closes with trend alignment:
Store bullTapLevel = low (for bull case) and its bar index.
Store bearTapLevel = high (for bear case) and its bar index.
Signals (must happen on a later bar than the origin)
BUY: low ≤ bullTapLevel + tol and inUp and bar_index > bullBarIdx
SELL: high ≥ bearTapLevel - tol and inDn and bar_index > bearBarIdx
One-shot option
If enabled, once a signal fires, the stored level is cleared so it won’t trigger again.
Inputs (Settings)
Trend EMA Length (lenEMA): Default 200.
Use 50–100 for intraday, 200 for swing/position.
Tap Tolerance (ticks) (tapTicks): Default 1.
Helps account for tiny feed discrepancies. Set 0 for strict equality.
One Signal per Level (oneShot): Default ON.
If OFF, multiple taps can create multiple signals.
Plot Tap Levels (plotLevels): Draws horizontal lines at active bases.
Show Pattern Labels (showLabels): Marks the origin wickless candles.
Plots & Visuals
EMA trend line for context.
Tap Levels:
Green line at bullish base (origin candle’s low/open).
Red line at bearish base (origin candle’s high/open).
Signals:
BUY: triangle-up below the bar on the tap.
SELL: triangle-down above the bar on the tap.
Labels (optional):
Marks the original wickless impulse candle that created each level.
Alerts
Two alert conditions are built in:
“BUY Signal” — fires when a bullish tap occurs.
“SELL Signal” — fires when a bearish tap occurs.
How to set:
Add the indicator to your chart.
Click Alerts (⏰) → Condition = this indicator.
Choose BUY Signal or SELL Signal.
Set your alert frequency and delivery method.
Recommended usage
Timeframes: Works on any; start with 5–15m intraday, or 1H–1D for swing.
Markets: Equities, futures, FX, crypto. For thin/illiquid assets, consider a slightly larger Tap Tolerance.
Confluence ideas (optional, but helpful):
Higher-timeframe trend agreeing with your chart timeframe.
Volume surge on the origin wickless candle.
S/R, order blocks, or SMC structures near the tap level.
Avoid major news moments when slippage is high.
No-repaint behavior
Origin patterns are detected only on bar close (barstate.isconfirmed), so bases are created with confirmed data.
Signals come after the origin bar, on subsequent taps.
There is no lookahead; lines and shapes reflect information known at the time.
(As with all real-time indicators, an intrabar tap can trigger an alert during the live bar; the signal then remains if that condition held at bar close.)
Known limitations & design choices
Single active level per side: The script tracks only the most recent bullish base and most recent bearish base.
Want a queue of multiple simultaneous bases? That’s possible with arrays; ask and we’ll extend it.
Heikin Ashi / non-standard candles: Wick definitions change; for consistent behavior use regular OHLC candles.
Gaps: On large gaps, taps can occur instantly at the open. Consider one-shot ON to avoid rapid repeats.
This is an indicator, not a strategy: It does not place trades or compute PnL. For backtesting, we can convert it into a strategy with SL/TP logic (ATR or structure-based).
Practical tips
Tap Tolerance:
If you miss obvious taps by a hair, increase to 1–2 ticks.
For FX/crypto with tiny ticks, even 0 or 1 is often enough.
EMA length:
Shorten for faster signals; lengthen for cleaner trend selection.
Risk management (manual suggestion):
For BUY signals, consider a stop slightly below the tap level (or ATR-based).
For SELL signals, consider a stop slightly above the tap level.
Scale out or trail using structure or ATR.
Quick checklist
✅ Price above EMA → watch for a green no-lower-wick candle → store its low → BUY on tap.
✅ Price below EMA → watch for a red no-upper-wick candle → store its high → SELL on tap.
✅ Use Tap Tolerance to avoid missing precise touches by one tick.
✅ Consider One Signal per Level to keep trades uncluttered.
FAQ
Q: Why did I not get a signal even though price touched the level?
A: Check Tap Tolerance (maybe too strict), trend alignment at the tap bar, and that the tap happened after the origin candle. Also confirm you’re on regular candles.
Q: Can I see multiple bases at once?
A: This version tracks the latest bull and bear bases. We can extend to arrays to keep N recent bases per side.
Q: Will it repaint?
A: No. Bases form on confirmed closes, and signals only on later bars.
Q: Can I backtest it?
A: This is a study. Ask for the strategy variant and we’ll add entries, exits, SL/TP, and stats.
Advanced Market TheoryADVANCED MARKET THEORY (AMT) 
 This is not an indicator. It is a lens through which to see the true nature of the market. 
Welcome to the definitive application of Auction Market Theory. What you have before you is the culmination of decades of market theory, fused with state-of-the-art data analysis and visual engineering. It is an institutional-grade intelligence engine designed for the serious trader who seeks to move beyond simplistic indicators and understand the fundamental forces that drive price.
This guide is your complete reference. Read it. Study it. Internalize it. The market is a complex story, and this tool is the language with which to read it.
 PART I: THE GRAND THEORY - A UNIVERSE IN AN AUCTION 
 To understand the market, you must first understand its purpose. The market is a mechanism of discovery, organized by a continuous, two-way auction. 
This foundational concept was pioneered by the legendary trader  J. Peter Steidlmayer  at the Chicago Board of Trade in the 1980s. He observed that beneath the chaotic facade of ticking prices lies a beautifully organized structure. The market's primary function is not to go up or down, but to  facilitate trade  by seeking a price level that encourages the maximum amount of interaction between buyers and sellers. This price is "value."
 The Organizing Principle: The Normal Distribution 
Over any given period, the market's activity will naturally form a bell curve (a normal distribution) turned on its side. This is the blueprint of the auction.
 The Point of Control (POC):  This is the peak of the bell curve—the single price level where the most trade occurred. It represents the point of maximum consensus, the "fairest price" as determined by the market participants. It is the gravitational center of the session.
 The Value Area (VA):  This is the heart of the bell curve, typically containing 70% of the session's activity (one standard deviation). This is the zone of "accepted value." Prices within this area are considered fair and are where the market is most comfortable conducting business.
 The Extremes:  The thin areas at the top and bottom of the curve are the "unfair" prices. These are levels where one side of the auction (buyers at the top, sellers at the bottom) was shut off, and trade was quickly rejected. These are areas of emotional trading and excess.
 The Narrative of the Day: Balance vs. Imbalance 
Every trading session is a story of the market's search for value.
 Balance:  When the market rotates and builds a symmetrical, bell-shaped profile, it is in a state of  balance . Buyers and sellers are in agreement, and the market is range-bound.
 Imbalance:  When the market moves decisively away from a balanced area, it is in a state of  imbalance . This is a trend. The market is actively seeking new information and a new area of value because the old one was rejected.
 Your Purpose as a Trader 
Your job is to read this story in real-time. Are we in balance or imbalance? Is the auction succeeding or failing at these new prices?  The Advanced Market Theory engine is your Rosetta Stone to translate this complex narrative into actionable intelligence. 
 PART II: THE AMT ENGINE - AN EVOLUTION IN MARKET VISION 
A standard market profile tool shows you a picture.  The AMT Engine gives you the architect's full schematics, the engineer's stress tests, and the psychologist's behavioral analysis, all at once. 
This is what makes it the Advanced Market Theory. We have fused the timeless principles with layers of modern intelligence:
 TRINITY ANALYSIS:  You can view the market through three distinct lenses. A  Volume Profile  shows where the money traded. A  TPO (Time) Profile  shows where the market spent its time. The revolutionary  Hybrid Profile  fuses both, giving you a complete picture of market conviction—marrying volume with duration.
 AUTOMATED STRUCTURAL DECODING:  The engine acts as your automated analyst, identifying critical structural phenomena in real-time:
 Poor Highs/Lows:  Weak auction points that signal a high probability of reversal.
 Single Prints & Ledges:  Footprints of rapid, aggressive market moves and areas of strong institutional acceptance.
 Day Type Classification:  The engine analyzes the session's personality as it develops ("Trend Day," "Normal Day," etc.), allowing you to adapt your strategy to the market's current character.
 MACRO & MICRO FUSION:  Via the  Composite Profile , the engine merges weeks of data to reveal the major institutional battlegrounds that govern long-term price action. You can see the daily skirmish and the multi-month war on a single chart.
 ORDER FLOW INTELLIGENCE:  The ultimate advancement is the integrated  Cumulative Volume Delta (CVD)  engine. This moves beyond structure to analyze the raw aggression of buyers versus sellers. It is your window into the market's soul, automatically detecting critical  Divergences  that often precede major trend shifts.
 ADAPTIVE SIGNALING:  The engine's signal generation is not static; it is a thinking system. It evaluates setups based on a multi-factor  Confluence Score , understands the market  Regime  (e.g., High Volatility), and adjusts its own confidence ( Probability % ) based on the complete context.
This is not a tool that gives you signals. This is a tool that gives you  understanding .
 PART III: THE VISUAL KEY - A LEXICON OF MARKET STRUCTURE 
Every element on your chart is a piece of information. This is your guide to reading it fluently.
 --- THE CORE ARCHITECTURE --- 
 The Profile Histogram:  The primary visual on the left of each session. Its shape is the story. A thin profile is a trend; a fat, symmetrical profile is balance.
 Blue Box  :  The zone of accepted, "fair" value. The heart of the session's business.
 Bright Orange Line & Label  :   The Point of Control.  The gravitational center. The price of maximum consensus. The most significant intraday level.
 Dashed Blue Lines & Labels  :  The boundaries of value. Critical inflection points where the market decides to either remain in balance or seek value elsewhere.
 Dashed Cyan Lines & Labels  :  The major, long-term structural levels derived from weeks of data. These are institutional reference points and carry immense weight. Treat them as primary support and resistance.
 Dashed Orange Lines & Labels  :  Marks a  Poor  or  Unfinished Auction . These represent emotional, weak extremes and are high-probability targets for future price action.
 Diamond Markers  :  Mark  Single Prints , which are footprints of aggressive, one-sided moves that left a "liquidity vacuum." Price is often drawn back to these levels to "repair" the poor structure.
 Arrow Markers  :  Mark  Ledges , which are areas of strong horizontal acceptance. They often act as powerful support/resistance in the future.
 Dotted Gray Lines & Labels  :  The projected daily range based on multiples of the  Initial Balance . Use them to set realistic profit targets and gauge the day's potential.
 --- THE SIGNAL SUITE --- 
 Colored Triangles  :  These are your high-probability entry signals. The color is a strategic playbook:
 Gold Triangle  :   ELITE Signal.  An A+ setup with overwhelming confluence. This is the highest quality signal the engine can produce.
 Yellow Triangle  :   FADE Signal.  A counter-trend setup against an exhausted move at a structural extreme.
 Cyan Triangle  :   BREAKOUT Signal.  A momentum setup attempting to capitalize on a breakout from the value area.
 Purple Triangle  :   ROTATION Signal.  A mean-reversion setup within the value area, typically from one edge towards the POC.
 Magenta Triangle  :   LIQUIDITY Signal.  A sophisticated setup that identifies a "stop run" or liquidity sweep.
 Percentage   Number:  The engine's calculated  probability of success . This is not a guarantee, but a data-driven confidence score.
 Dotted Gray Line:  The signal's  Entry Price .
 Dashed Green Lines:  The calculated  Take Profit Targets .
 Dashed Red Line:  The calculated  Stop Loss  level.
 PART IV: THE DASHBOARD - YOUR STRATEGIC COMMAND CENTER 
The dashboard is your real-time intelligence briefing. It synthesizes all the engine's analysis into a clear, concise, and constantly updating summary.
 --- CURRENT SESSION --- 
 POC, VAH, VAL:  The live values for the core structure.
 Profile Shape:  Is the current auction top-heavy ( b-shaped ), bottom-heavy ( P-shaped ), or balanced ( D-shaped )?
 VA Width:  Is the value area  expanding  (trending) or  contracting  (balancing)?
 Day Type:  The engine's judgment on the day's personality. Use this to select the right strategy.
 IB Range & POC Trend:  Key metrics for understanding the opening sentiment and its evolution.
 --- CVD ANALYSIS --- 
 Session CVD:  The raw order flow. Is there more net buying or selling pressure in this session?
 CVD Trend & DIVERGENCE:  This is your order flow intelligence. Is the order flow confirming the price action? If "DIVERGENCE" flashes, it is a critical, high-alert warning of a potential reversal.
 --- MARKET METRICS --- 
 Volume, ATR, RSI:  Your standard contextual metrics, providing a quick read on activity, volatility, and momentum.
 Regime:  The engine's assessment of the broad market environment:  High Volatility  (favor breakouts),  Low Volatility  (favor mean reversion), or  Normal .
 --- PROFILE STATS, COMPOSITE, & STRUCTURE --- 
These sections give you a quick quantitative summary of the profile structure, the major long-term Composite levels, and any active Poor Structures.
 --- SIGNAL TYPES & ACTIVE SIGNAL --- 
A permanent key to the signal colors and their meanings, along with the full details of the most recent active signal: its  Type ,  Probability ,  Entry ,  Stop , and  Target .
 PART V: THE INPUTS MENU - CALIBRATING YOUR LENS 
This engine is designed to be calibrated to your specific needs as a trader. Every input is a lever. This is not a "one size fits all" tool. The extensive tooltips are your built-in user manual, but here are the key areas of focus:
 --- MARKET PROFILE ENGINE --- 
 Profile Mode:  This is the most fundamental choice.  Volume  is the standard for price-based support and resistance.  TPO  is for analyzing time-based acceptance.  Hybrid  is the professional's choice, fusing both for a complete picture.
 Profile Resolution:  This is your zoom lens. Lower values for scalping and intraday precision. Higher values for a cleaner, big-picture view suitable for swing trading.
 Composite Sessions:  Your timeframe for macro analysis. 5-10 sessions for a weekly view; 20-30 sessions for a monthly, structural view.
 --- SESSION & VALUE AREA --- 
These settings must be configured correctly for your specific asset. The  Session  times are critical. The  Initial Balance  should reflect the key opening period for your market (60 minutes is standard for equities).
 --- SIGNAL ENGINE & RISK MANAGEMENT --- 
 Signal Mode:   THIS IS YOUR PERSONAL RISK PROFILE.  Set it to  Conservative  to see only the absolute best A+ setups. Use  Elite  or  Balanced  for a standard approach. Use  Aggressive  only if you are an experienced scalper comfortable with managing more frequent, lower-probability setups.
 ATR Multipliers:  This suite gives you full, dynamic control over your risk/reward parameters. You can precisely define your initial stop loss distance and profit targets based on the market's current volatility.
 A FINAL WORD FROM THE ARCHITECT 
The creation of this engine was a journey into the very heart of market dynamics. It was born from a frustrating truth: that the most profound market theories were often confined to books and expensive institutional platforms, inaccessible to the modern retail trader. The goal was to bridge that gap.
The challenge was monumental. Making each discrete system—the volume profile, the TPO counter, the composite engine, the CVD tracker, the signal generator, the dynamic dashboard—work was a task in itself. But the true struggle, the frustrating, painstaking process that consumed countless hours, was making them work  in unison . It was about ensuring the CVD analysis could intelligently inform the signal engine, that the day type classification could adjust the probability scores, and that the composite levels could provide context to the intraday structure, all in a seamless, real-time dance of data.
This engine is the result of that relentless pursuit of integration. It is built on the belief that a trader's greatest asset is not a signal, but  clarity . It was designed to clear the noise, to organize the chaos, and to present the elegant, underlying logic of the market auction so that you can make better, more informed, and more confident decisions.
It is now in your hands. Use it not as a crutch, but as a lens. See the market for what it truly is.
 "The market can remain irrational longer than you can remain solvent." 
 - John Maynard Keynes 
 DISCLAIMER 
 This script is an advanced analytical tool provided for informational and educational purposes only. It is not financial advice. All trading involves substantial risk, and past performance is not indicative of future results. The signals, probabilities, and metrics generated by this indicator do not constitute a recommendation to buy or sell any financial instrument. You, the user, are solely responsible for all trading decisions, risk management, and outcomes. Use this tool to supplement your own analysis and trading strategy. 
 PUBLISHING CATEGORIES 
 Volume Profile 
 Market Profile 
 Order Flow
Correlation HeatMap [TradingFinder] Sessions Data Science Stats🔵 Introduction 
n financial markets, correlation describes the statistical relationship between the price movements of two assets and how they interact over time. It plays a key role in both trading and investing by helping analyze asset behavior, manage portfolio risk, and understand intermarket dynamics. The Correlation Heatmap is a visual tool that shows how the correlation between multiple assets and a central reference asset (the Main Symbol) changes over time. 
It supports four market types forex, stocks, crypto, and a custom mode making it adaptable to different trading environments. The heatmap uses a color-coded grid where warmer tones represent stronger negative correlations and cooler tones indicate stronger positive ones. This intuitive color system allows traders to quickly identify when assets move together or diverge, offering real-time insights that go beyond traditional correlation tables.
🟣 How to Interpret the Heatmap Visually ?
 
 Each cell represents the correlation between the main symbol and one compared asset at a specific time.
 Warm colors (e.g. red, orange) suggest strong negative correlation as one asset rises, the other tends to fall.
 Cool colors (e.g. blue, green) suggest strong positive correlation both assets tend to move in the same direction.
 Lighter shades indicate weaker correlations, while darker shades indicate stronger correlations.
 The heatmap updates over time, allowing users to detect changes in correlation during market events or trading sessions.
 
  
One of the standout features of this indicator is its ability to overlay global market sessions such as Tokyo, London, New York, or major equity opens directly onto the heatmap timeline. This alignment lets traders observe how correlation structures respond to real-world session changes. For example, they can spot when assets shift from being inversely correlated to moving together as a new session opens, potentially signaling new momentum or macro flow. The customizable symbol setup (including up to 20 compared assets) makes it ideal not only for forex and crypto traders but also for multi-asset and sector-based stock analysis.
🟣 Use Cases and Advantages 
 
 Analyze sector rotation in equities by tracking correlation to major indices like SPX or DJI.
 Monitor altcoin behavior relative to Bitcoin to find early entry opportunities in crypto markets.
 Detect changes in currency alignment with DXY across trading sessions in forex.
 Identify correlation breakdowns during market volatility, signaling possible new trends.
 Use correlation shifts as confirmation for trade setups or to hedge multi-asset exposure
 
  
🔵 How to Use 
Correlation is one of the core concepts in financial analysis and allows traders to understand how assets behave in relation to one another. The Correlation Heatmap extends this idea by going beyond a simple number or static matrix. Instead, it presents a dynamic visual map of how correlations shift over time.
In this indicator, a Main Symbol is selected as the reference point for analysis. In standard modes such as forex, stocks, or crypto, the symbol currently shown on the main chart is automatically used as the main symbol. This allows users to begin correlation analysis right away without adjusting any settings. 
The horizontal axis of the heatmap shows time, while the vertical axis lists the selected assets. Each cell on the heatmap shows the correlation between that asset and the main symbol at a given moment.
This approach is especially useful for intermarket analysis. In forex, for example, tracking how currency pairs like  OANDA:EURUSD  EURUSD,  FX:GBPUSD  GBPUSD, and  PEPPERSTONE:AUDUSD  AUDUSD correlate with  TVC:DXY  DXY can give insight into broader capital flow. 
If these pairs start showing increasing positive correlation with DXY say, shifting from blue to light green it could signal the start of a new phase or reversal. Conversely, if negative correlation fades gradually, it may suggest weakening relationships and more independent or volatile movement.
In the crypto market, watching how altcoins correlate with Bitcoin can help identify ideal entry points in secondary assets. In the stock market, analyzing how companies within the same sector move in relation to a major index like  SP:SPX  SPX or  DJ:DJI  DJI is also a highly effective technique for both technical and fundamental analysts.
  
This indicator not only visualizes correlation but also displays major market sessions. When enabled, this feature helps traders observe how correlation behavior changes at the start of each session, whether it's Tokyo, London, New York, or the opening of stock exchanges. Many key shifts, breakouts, or reversals tend to happen around these times, and the heatmap makes them easy to spot.
Another important feature is the market selection mode. Users can switch between forex, crypto, stocks, or custom markets and see correlation behavior specific to each one. In custom mode, users can manually select any combination of symbols for more advanced or personalized analysis. This makes the heatmap valuable not only for forex traders but also for stock traders, crypto analysts, and multi-asset strategists.
Finally, the heatmap's color-coded design helps users make sense of the data quickly. Warm colors such as red and orange reflect stronger negative correlations, while cool colors like blue and green represent stronger positive relationships. This simplicity and clarity make the tool accessible to both beginners and experienced traders.
  
🔵 Settings 
Correlation Period: Allows you to set how many historical bars are used for calculating correlation. A higher number means a smoother, slower-moving heatmap, while a lower number makes it more responsive to recent changes.
Select Market: Lets you choose between Forex, Stock, Crypto, or Custom. In the first three options, the chart’s active symbol is automatically used as the Main Symbol. In Custom mode, you can manually define the Main Symbol and up to 20 Compared Symbols.
Show Open Session: Enables the display of major trading sessions such as Tokyo, London, New York, or equity market opening hours directly on the timeline. This helps you connect correlation shifts with real-world market activity.
Market Mode: Lets you select whether the displayed sessions relate to the forex or stock market.
🔵 Conclusion 
The Correlation Heatmap is a robust and flexible tool for analyzing the relationship between assets across different markets. By tracking how correlations change in real time, traders can better identify alignment or divergence between symbols and gain valuable insights into market structure. 
Support for multiple asset classes, session overlays, and intuitive visual cues make this one of the most effective tools for intermarket analysis.
Whether you’re looking to manage portfolio risk, validate entry points, or simply understand capital flow across markets, this heatmap provides a clear and actionable perspective that you can rely on.
BE-Indicator Aggregator toolkit█  Overview: 
 BE-Indicator Aggregator toolkit  is a toolkit which is built for those we rely on taking multi-confirmation from different indicators available with the traders. This Toolkit aid's traders in understanding their custom logic for their trade setups and provides the summarized results on how it performed over the past.
█  How It Works: 
 
  Load the external indicator plots in the indicator input setting
  Provide your custom logic for the trade setup
  Set your expected SL & TP values
 
█  Legends, Definitions & Logic Building Rules: 
Building the logic for your trade setup plays a pivotal role in the toolkit, it shall be broken into parts and toolkit aims to understand each of the logical parts of your setup and interpret the outcome as trade accuracy. 
Toolkit broadly aims to understand 4 types of inputs in  "Condition Builder" 
  
 
   Comments :  Line which starts with single quotation ( ' ) shall be ignored by toolkit while understanding the logic.
 Note: Blank line space or less than 3 characters are treated equally to comments.  
   Long Condition:  Line which starts with " L- " shall be considered for identifying Long setups.
   Short Condition:  Line which starts with " S- " shall be considered for identifying Short setups.
   Variables:  Line which starts with " VAR- " shall be considered as variables. Variables can be one such criteria for Long or short condition.
 
 Building Rules:  Define all variables first then specify the condition.  The usual declare and assign concept of programming. :p)  
 Criteria Rules:  Criteria are individual logic for your one parent condition. multiple criteria can be present in one condition. Each parameter should be delimited with  ' | '  key and each criteria should be delimited with  ' , ' (Comma with a space - IMPORTANT!!!) 
█  Sample Codes for Conditional Builder: 
For Trading Long when Open = Low
For Trading Short when Open = High with a Red candle
 
'Long Setup <---- Comment
L-O|E|L
' E <- in the above line refers to Equals ' = '
'Short Setup
S-AND:O|E|H, O|G|C
' 2 Criteria for used building one condition. Since, both have to satisfied used "AND:" logic.
 
 Understanding of Operator Legends: 
 
"E"            => Refers to Equals
"NE"          => Refers to Not Equals
"NEOR"      => Logical value is Either Comparing value 1 or Comparing value 2 
"NEAND"    => Logical value is Comparing value 1 And Comparing value 2 
"G"            => Logical value Greater than Comparing value 1 
"GE"          => Logical value Greater than and equal to Comparing value 1 
"L"            => Logical value Lesser than Comparing value 1
"LE"          => Logical value Lesser than and equal to Comparing value 1
"B"            => Logical value is Between Comparing value 1 & Comparing value 2
"BE"          => Logical value is Between or Equal to Comparing value 1 & Comparing value 2
"OSE"        => Logical value is Outside of Comparing value 1 & Comparing value 2
"OSI"         => Logical value is Outside or Equal to Comparing value 1 & Comparing value 2
"ERR"        => Logical value is 'na'
"NERR"      => Logical value is not 'na'
"CO"          => Logical value Crossed Over Comparing value 1
"CU"          => Logical value Crossed Under Comparing value 1 
 
 Understanding of Condition Legends: 
 
   AND:  -> All criteria's to be satisfied for the condition to be True.
   NAND:  -> Output of AND condition shall be Inversed for the condition to be True.
   OR:  -> One of criteria to be satisfied for the condition to be True.
   NOR:  -> Output of OR condition shall be Inversed for the condition to be True.
   ATLEAST:X:  -> At-least X no of criteria to be satisfied for the condition to be True. 
Note: "X" can be any number
   NATLEAST:X:  -> Output of ATLEAST condition shall be Inversed for the condition to be True
   WASTRUE:X:  -> Single criteria WAS TRUE within X bar in past for the condition to be True. 
Note: "X" can be any number.
   ISTRUE:X:  -> Single criteria is TRUE since X bar in past for the condition to be True. 
Note: "X" can be any number. 
 
 Understanding of Variable Legends: 
While Condition Supports 8 Types, Variable supports only 6 Types listed below
 
   AND:  -> All criteria's to be satisfied for the Variable to be True.
   NAND:  -> Output of AND condition shall be Inversed for the Variable to be True.
   OR:  -> One of criteria to be satisfied for the Variable to be True.
   NOR:  -> Output of OR condition shall be Inversed for the Variable to be True.
   ATLEAST:X:  -> At-least X no of criteria to be satisfied for the Variable to be True. 
Note: "X" can be any number
   NATLEAST:X:  -> Output of ATLEAST condition shall be Inversed for the Variable to be True
 
█  Sample Outputs with Logics: 
1. RSI Indicator + Technical Indicator:  StopLoss: 2.25 against Reward ratio of 1.75 (3.94 value)
Plots Used in Indicator Settings: 
 
  Source 1:- RSI
  Source 2:- RSI Based MA
  Source 3:- Strong Buy
  Source 4:- Strong Sell
 
Logic Used: 
For Long Setup : RSI Should be above RSI Based MA, RSI has been Rising when compared to 3 candles ago, Technical Indicator signaled for a Strong Buy on the current candle, however in last 6 candles Technical indicator signaled for Strong Sell.
 Similarly Inverse for Short Setup. 
 
L-AND:ES1|GE|ES2, ES1|G|ES1 
L-ES3|E|1
L-OR:ES4 |E|1, ES4 |E|1, ES4 |E|1, ES4 |E|1, ES4 |E|1, ES4 |E|1
S-AND:ES1|LE|ES2, ES1|L|ES1 
S-ES4|E|1
S-OR:ES3 |E|1, ES3 |E|1, ES3 |E|1, ES3 |E|1, ES3 |E|1, ES3 |E|1
'Note: Last OR condition can also be written by using WASTRUE definition like below
'L-WASTRUE:6:ES4|E|1
'S-WASTRUE:6:ES3|E|1
 
Output:
  
2. Volumatic Support / Resistance Levels  :  
Plots Used in Indicator Settings: 
 
  Source 1:- Resistance
  Source 2:- Support
 
Logic Used: 
For Long Setup : Long Trade on Liquidity Support.
For Short Setup : Short Trade on Liquidity Resistance.
 
'Variable Named "ChkLowTradingAbvSupport" is declared to check if last 3 candles is trading above support line of liquidity.
VAR-ChkLowTradingAbvSupport:AND:L|G|ES2, L |G|ES2, L |G|ES2
'Variable Named "ChkCurBarClsdAbv4thBarHigh" is declared to check if current bar closed above the high of previous candle where the Liquidity support is taken (4th Bar).
VAR-ChkCurBarClsdAbv4thBarHigh:OR:C|GE|H , L|G|H 
'Combining Condition and Variable to Initiate Long Trade Logic
L-L |LE|ES2
L-AND:ChkLowTradingAbvSupport, ChkCurBarClsdAbv4thBarHigh
VAR-ChkHghTradingBlwRes:AND:H|L|ES1, H |L|ES1, H |L|ES1
VAR-ChkCurBarClsdBlw4thBarLow:OR:C|LE|L , H|L|L 
S-H |GE|ES1
S-AND:ChkHghTradingBlwRes, ChkCurBarClsdBlw4thBarLow
 
Output 1: Day Trading Version
  
Output 2: Scalper Version
  
Output 3: Position Version
 
DrawZigZag🟩  OVERVIEW 
This library draws zigzag lines for existing pivots. It is designed to be simple to use. If your script creates pivots and you want to join them up while handling edge cases, this library does that quickly and efficiently. If you want your pivots created for you, choose one of the many other zigzag libraries that do that.
🟩  HOW TO USE 
Pine Script libraries contain reusable code for importing into indicators. You do not need to copy any code out of here. Just import the library and call the function you want.
For example, for version 1 of this library, import it like this:
 
import SimpleCryptoLife/DrawZigZag/1
 
See the EXAMPLE USAGE sections within the library for examples of calling the functions.
For more information on libraries and incorporating them into your scripts, see the  Libraries  section of the Pine Script User Manual. 
🟩  WHAT IT DOES 
I looked at every zigzag library on TradingView, after finishing this one. They all seemed to fall into two groups in terms of functionality:
 • Create the pivots themselves, using a combination of Williams-style pivots and sometimes price distance.
 • Require an array of pivot information, often in a format that uses user-defined types.
My library takes a completely different approach. 
Firstly, it only does the drawing. It doesn't calculate the pivots for you. This isn't laziness. There are so many ways to define pivots and that should be up to you. If you've followed my work on market structure you know what I think of Williams pivots.
Secondly, when you pass information about your pivots to the library function, you only need the minimum of pivot information -- whether it's a High or Low pivot, the price, and the bar index. Pass these as normal variables -- bools, ints, and floats -- on the fly as your pivots confirm. It is completely agnostic as to how you derive your pivots. If they are confirmed an arbitrary number of bars after they happen, that's fine.
So why even bother using it if all it does it draw some lines?
Turns out there is quite some logic needed in order to connect highs and lows in the right way, and to handle edge cases. This is the kind of thing one can happily outsource.
🟩  THE RULES 
 • Zigs and zags must alternate between Highs and Lows. We never connect a High to a High or a Low to a Low.
 • If a candle has both a High and Low pivot confirmed on it, the first line is drawn to the end of the candle that is the opposite to the previous pivot. Then the next line goes vertically through the candle to the other end, and then after that continues normally.
 • If we draw a line up from a Low to a High pivot, and another High pivot comes in higher, we *extend* the line up, and the same for lines down. Yes this is a form of repainting. It is in my opinion the only way to end up with a correct structure.
 • We ignore lower highs on the way up and higher lows on the way down.
🟩  WHAT'S COOL ABOUT THIS LIBRARY 
 • It's simple and lightweight: no exported user-defined types, no helper methods, no matrices.
 • It's really fast. In my profiling it runs at about ~50ms, and changing the options (e.g., trimming the array) doesn't make very much difference.
 • You only need to call one function, which does all the calculations and draws all lines.
 • There are two variations of this function though -- one simple function that just draws lines, and one slightly more advanced method that modifies an array containing the lines. If you don't know which one you want, use the simpler one.
🟩  GEEK STUFF 
 • There are no dependencies on other libraries.
 • I tried to make the logic as clear as I could and comment it appropriately.
 • In the `f_drawZigZags` function, the line variable is declared using the `var` keyword *inside* the function, for simplicity. For this reason, it persists between function calls *only* if the function is called from the global scope or a local if block. In general, if a function is called  from inside a loop , or multiple times from different contexts, persistent variables inside that function are  re-initialised  on each call. In this case, this re-initialisation would mean that the function loses track of the previous line, resulting in incorrect drawings. This is why you cannot call the `f_drawZigZags` function from a loop (not that there's any reason to). The `m_drawZigZagsArray` does not use any internal `var` variables.
 • The function itself takes a Boolean parameter `_showZigZag`, which turns the drawings on and off, so there is no need to call the function conditionally. In the examples, we do call the functions from an if block, purely as an illustration of how to increase performance by restricting the amount of code that needs to be run.
🟩  BRING ON THE FUNCTIONS 
 f_drawZigZags(_showZigZag, _isHighPivot, _isLowPivot, _highPivotPrice, _lowPivotPrice, _pivotIndex, _zigzagWidth, _lineStyle, _upZigColour, _downZagColour) 
  This function creates or extends the latest zigzag line. Takes real-time information about pivots and draws lines. It does not calculate the pivots. It must be called once per script and cannot be called from a loop.
  Parameters:
     _showZigZag (bool) : Whether to show the zigzag lines.
     _isHighPivot (bool) : Whether the current bar confirms a high pivot. Note that pivots are confirmed after the bar in which they occur.
     _isLowPivot (bool) : Whether the current bar confirms a low pivot.
     _highPivotPrice (float) : The price of the high pivot that was confirmed this bar. It is NOT the high price of the current bar.
     _lowPivotPrice (float) : The price of the low pivot that was confirmed this bar. It is NOT the low price of the current bar.
     _pivotIndex (int) : The bar index of the pivot that was confirmed this bar. This is not an offset. It's the `bar_index` value of the pivot.
     _zigzagWidth (int) : The width of the zigzag lines.
     _lineStyle (string) : The style of the zigzag lines.
     _upZigColour (color) : The colour of the up zigzag lines.
     _downZagColour (color) : The colour of the down zigzag lines.
  Returns: The function has no explicit returns. As a side effect, it draws or updates zigzag lines.
 method m_drawZigZagsArray(_a_zigZagLines, _showZigZag, _isHighPivot, _isLowPivot, _highPivotPrice, _lowPivotPrice, _pivotIndex, _zigzagWidth, _lineStyle, _upZigColour, _downZagColour, _trimArray) 
  Namespace types: array
  Parameters:
     _a_zigZagLines (array) 
     _showZigZag (bool) : Whether to show the zigzag lines.
     _isHighPivot (bool) : Whether the current bar confirms a high pivot. Note that pivots are usually confirmed after the bar in which they occur.
     _isLowPivot (bool) : Whether the current bar confirms a low pivot.
     _highPivotPrice (float) : The price of the high pivot that was confirmed this bar. It is NOT the high price of the current bar.
     _lowPivotPrice (float) : The price of the low pivot that was confirmed this bar. It is NOT the low price of the current bar.
     _pivotIndex (int) : The bar index of the pivot that was confirmed this bar. This is not an offset. It's the `bar_index` value of the pivot.
     _zigzagWidth (int) : The width of the zigzag lines.
     _lineStyle (string) : The style of the zigzag lines.
     _upZigColour (color) : The colour of the up zigzag lines.
     _downZagColour (color) : The colour of the down zigzag lines.
     _trimArray (bool) : If true, the array of lines is kept to a maximum size of two lines (the line elements are not deleted). If false (the default), the array is kept to a maximum of 500 lines (the maximum number of line objects a single Pine script can display).
  Returns: This function has no explicit returns but it modifies a global array of zigzag lines.
Market Zone Analyzer[BullByte]Understanding the Market Zone Analyzer 
---
 1. Purpose of the Indicator 
The  Market Zone Analyzer  is a Pine Script™ (version 6) indicator designed to streamline market analysis on TradingView. Rather than scanning multiple separate tools, it unifies four core dimensions—trend strength, momentum, price action, and market activity—into a single, consolidated view. By doing so, it helps traders:
•  Save time  by avoiding manual cross-referencing of disparate signals.
•  Reduce decision-making errors  that can arise from juggling multiple indicators.
•  Gain a clear, reliable read  on whether the market is in a bullish, bearish, or sideways phase, so they can more confidently decide to enter, exit, or hold a position.
---
 2. Why a Trader Should Use It 
•  Unified View:  Combines all essential market dimensions into one easy-to-read score and dashboard, eliminating the need to piece together signals manually.
•  Adaptability:  Automatically adjusts its internal weighting for trend, momentum, and price action based on current volatility. Whether markets are choppy or calm, the indicator remains relevant.
•  Ease of Interpretation:  Outputs a simple “BULLISH,” “BEARISH,” or “SIDEWAYS” label, supplemented by an intuitive on-chart dashboard and an oscillator plot that visually highlights market direction.
•  Reliability Features:  Built-in smoothing of the net score and hysteresis logic (requiring consecutive confirmations before flips) minimize false signals during noisy or range-bound phases.
---
 3. Why These Specific Indicators? 
This script relies on a curated set of well-established technical tools, each chosen for its particular strength in measuring one of the four core dimensions:
 1. Trend Strength: 
•  ADX/DMI (Average Directional Index / Directional Movement Index):  Measures how strong a trend is, and whether the +DI line is above the –DI line (bullish) or vice versa (bearish).
•  Moving Average Slope (Fast MA vs. Slow MA):  Compares a shorter-period SMA to a longer-period SMA; if the fast MA sits above the slow MA, it confirms an uptrend, and vice versa for a downtrend.
•  Ichimoku Cloud Differential (Senkou A vs. Senkou B):  Provides a forward-looking view of trend direction; Senkou A above Senkou B signals bullishness, and the opposite signals bearishness.
 2. Momentum: 
•  Relative Strength Index (RSI):  Identifies overbought (above its dynamically calculated upper bound) or oversold (below its lower bound) conditions; changes in RSI often precede price reversals.
•  Stochastic %K:  Highlights shifts in short-term momentum by comparing closing price to the recent high/low range; values above its upper band signal bullish momentum, below its lower band signal bearish momentum.
•  MACD Histogram:  Measures the difference between the MACD line and its signal line; a positive histogram indicates upward momentum, a negative histogram indicates downward momentum.
 3. Price Action: 
•  Highest High / Lowest Low (HH/LL) Range:  Over a defined lookback period, this captures breakout or breakdown levels. A closing price near the recent highs (with a positive MA slope) yields a bullish score, and near the lows (with a negative MA slope) yields a bearish score.
•  Heikin-Ashi Doji Detection:  Uses Heikin-Ashi candles to identify indecision or continuation patterns. A small Heikin-Ashi body (doji) relative to recent volatility is scored as neutral; a larger body in the direction of the MA slope is scored bullish or bearish.
•  Candle Range Measurement:  Compares each candle’s high-low range against its own dynamic band (average range ± standard deviation). Large candles aligning with the prevailing trend score bullish or bearish accordingly; unusually small candles can indicate exhaustion or consolidation.
 4. Market Activity: 
•  Bollinger Bands Width (BBW):  Measures the distance between BB upper and lower bands; wide bands indicate high volatility, narrow bands indicate low volatility.
•  Average True Range (ATR):  Quantifies average price movement (volatility). A sudden spike in ATR suggests a volatile environment, while a contraction suggests calm.
•  Keltner Channels Width (KCW):  Similar to BBW but uses ATR around an EMA. Provides a second layer of volatility context, confirming or contrasting BBW readings.
•  Volume (with Moving Average):  Compares current volume to its moving average ± standard deviation. High volume validates strong moves; low volume signals potential lack of conviction.
By combining these tools, the indicator captures trend direction, momentum strength, price-action nuances, and overall market energy, yielding a more balanced and comprehensive assessment than any single tool alone.
---
 4. What Makes This Indicator Stand Out 
•  Multi-Dimensional Analysis:  Rather than relying on a lone oscillator or moving average crossover, it simultaneously evaluates trend, momentum, price action, and activity.
•  Dynamic Weighting:  The relative importance of trend, momentum, and price action adjusts automatically based on real-time volatility (Market Activity State). For example, in highly volatile conditions, trend and momentum signals carry more weight; in calm markets, price action signals are prioritized.
•  Stability Mechanisms: 
•  Smoothing:  The net score is passed through a short moving average, filtering out noise, especially on lower timeframes.
•  Hysteresis:  Both Market Activity State and the final bullish/bearish/sideways zone require two consecutive confirmations before flipping, reducing whipsaw.
•  Visual Interpretation:  A fully customizable on-chart dashboard displays each sub-indicator’s value, regime, score, and comment, all color-coded. The oscillator plot changes color to reflect the current market zone (green for bullish, red for bearish, gray for sideways) and shows horizontal threshold lines at +2, 0, and –2.
---
 5. Recommended Timeframes 
•  Short-Term (5 min, 15 min):  Day traders and scalpers can benefit from rapid signals, but should enable smoothing (and possibly disable hysteresis) to reduce false whipsaws.
•  Medium-Term (1 h, 4 h):  Swing traders find a balance between responsiveness and reliability. Less smoothing is required here, and the default parameters (e.g., ADX length = 14, RSI length = 14) perform well.
•  Long-Term (Daily, Weekly):  Position traders tracking major trends can disable smoothing for immediate raw readings, since higher-timeframe noise is minimal. Adjust lookback lengths (e.g., increase adxLength, rsiLength) if desired for slower signals.
 Tip:  If you keep smoothing off, stick to timeframes of 1 h or higher to avoid excessive signal “chatter.”
---
 6. How Scoring Works 
 A. Individual Indicator Scores 
Each sub-indicator is assigned one of three discrete scores:
•  +1  if it indicates a bullish condition (e.g., RSI above its dynamically calculated upper bound).
•  0  if it is neutral (e.g., RSI between upper and lower bounds).
•  –1  if it indicates a bearish condition (e.g., RSI below its dynamically calculated lower bound).
Examples of individual score assignments:
•  ADX/DMI: 
•  +1  if ADX ≥ adxThreshold and +DI > –DI (strong bullish trend)
•  –1  if ADX ≥ adxThreshold and –DI > +DI (strong bearish trend)
•  0  if ADX < adxThreshold (trend strength below threshold)
•  RSI: 
•  +1  if RSI > RSI_upperBound
•  –1  if RSI < RSI_lowerBound
•  0  otherwise
•  ATR (as part of Market Activity): 
•  +1  if ATR > (ATR_MA + stdev(ATR))
•  –1  if ATR < (ATR_MA – stdev(ATR))
•  0  otherwise
Each of the four main categories shares this same +1/0/–1 logic across their sub-components.
 B. Category Scores 
Once each sub-indicator reports +1, 0, or –1, these are summed within their categories as follows:
•  Trend Score  = (ADX score) + (MA slope score) + (Ichimoku differential score)
•  Momentum Score  = (RSI score) + (Stochastic %K score) + (MACD histogram score)
•  Price Action Score  = (Highest-High/Lowest-Low score) + (Heikin-Ashi doji score) + (Candle range score)
•  Market Activity Raw Score  = (BBW score) + (ATR score) + (KC width score) + (Volume score)
Each category’s summed value can range between –3 and +3 (for Trend, Momentum, and Price Action), and between –4 and +4 for Market Activity raw.
 C. Market Activity State and Dynamic Weight Adjustments 
Rather than contributing directly to the netScore like the other three categories, Market Activity determines how much weight to assign to Trend, Momentum, and Price Action:
1. Compute Market Activity Raw Score by summing BBW, ATR, KCW, and Volume individual scores (each +1/0/–1).
2. Bucket into High, Medium, or Low Activity:
   •  High  if raw Score ≥ 2 (volatile market).
   •  Low  if raw Score ≤ –2 (calm market).
   •  Medium  otherwise.
3. Apply Hysteresis (if enabled): The state only flips after two consecutive bars register the same high/low/medium label.
4. Set Category Weights:
   •  High Activity:  Trend = 50 %, Momentum = 35 %, Price Action = 15 %.
   •  Low Activity:  Trend = 25 %, Momentum = 20 %, Price Action = 55 %.
   •  Medium Activity:  Use the trader’s base weight inputs (e.g., Trend = 40 %, Momentum = 30 %, Price Action = 30 % by default).
    D. Calculating the Net Score 
5. Normalize Base Weights (so that the sum of Trend + Momentum + Price Action always equals 100 %).
6. Determine Current Weights based on the Market Activity State (High/Medium/Low).
7. Compute Each Category’s Contribution: Multiply (categoryScore) × (currentWeight).
8. Sum Contributions to get the raw netScore (a floating-point value that can exceed ±3 when scores are strong).
9. Smooth the netScore over two bars (if smoothing is enabled) to reduce noise.
10. Apply Hysteresis to the Final Zone:
    • If the smoothed netScore ≥ +2, the bar is classified as “Bullish.”
    • If the smoothed netScore ≤ –2, the bar is classified as “Bearish.”
    • Otherwise, it is “Sideways.”
    • To prevent rapid flips, the script requires two consecutive bars in the new zone before officially changing the displayed zone (if hysteresis is on).
     E. Thresholds for Zone Classification 
    •  BULLISH:  netScore ≥ +2
    •  BEARISH:  netScore ≤ –2
    •  SIDEWAYS:  –2 < netScore < +2
---
 7. Role of Volatility (Market Activity State) in Scoring 
Volatility acts as a dynamic switch that shifts which category carries the most influence:
 1. High Activity (Volatile): 
• Detected when at least two sub-scores out of BBW, ATR, KCW, and Volume equal +1.
• The script sets Trend weight = 50 % and Momentum weight = 35 %. Price Action weight is minimized at 15 %.
•  Rationale:  In volatile markets, strong trending moves and momentum surges dominate, so those signals are more reliable than nuanced candle patterns.
 2. Low Activity (Calm): 
• Detected when at least two sub-scores out of BBW, ATR, KCW, and Volume equal –1.
• The script sets Price Action weight = 55 %, Trend = 25 %, and Momentum = 20 %.
•  Rationale:  In quiet, sideways markets, subtle price-action signals (breakouts, doji patterns, small-range candles) are often the best early indicators of a new move.
 3. Medium Activity (Balanced): 
• Raw Score between –1 and +1 from the four volatility metrics.
• Uses whatever base weights the trader has specified (e.g., Trend = 40 %, Momentum = 30 %, Price Action = 30 %).
Because volatility can fluctuate rapidly, the script employs hysteresis on Market Activity State: a new High or Low state must occur on two consecutive bars before weights actually shift. This avoids constant back-and-forth weight changes and provides more stability.
  
---
 8. Scoring Example (Hypothetical Scenario) 
•  Symbol:  Bitcoin on a 1-hour chart.
•  Market Activity:  Raw volatility sub-scores show BBW (+1), ATR (+1), KCW (0), Volume (+1) → Total raw Score = +3 → High Activity.
•  Weights Selected:  Trend = 50 %, Momentum = 35 %, Price Action = 15 %.
•  Trend Signals: 
• ADX strong and +DI > –DI → +1
• Fast MA above Slow MA → +1
• Ichimoku Senkou A > Senkou B → +1
→ Trend Score = +3
•  Momentum Signals: 
• RSI above upper bound → +1
• MACD histogram positive → +1
• Stochastic %K within neutral zone → 0
→ Momentum Score = +2
•  Price Action Signals: 
• Highest High/Lowest Low check yields 0 (close not near extremes)
• Heikin-Ashi doji reading is neutral → 0
• Candle range slightly above upper bound but trend is strong, so → +1
→ Price Action Score = +1
•  Compute Net Score (before smoothing): 
• Trend contribution = 3 × 0.50 = 1.50
• Momentum contribution = 2 × 0.35 = 0.70
• Price Action contribution = 1 × 0.15 = 0.15
• Raw netScore = 1.50 + 0.70 + 0.15 = 2.35
• Since 2.35 ≥ +2 and hysteresis is met, the final zone is “Bullish.”
Although the netScore lands at 2.35 (Bullish), smoothing might bring it slightly below 2.00 on the first bar (e.g., 1.90), in which case the script would wait for a second consecutive reading above +2 before officially classifying the zone as Bullish (if hysteresis is enabled).
---
 9. Correlation Between Categories 
The four categories—Trend Strength, Momentum, Price Action, and Market Activity—often reinforce or offset one another. The script takes advantage of these natural correlations:
•  Bullish Alignment:  If ADX is strong and pointed upward, fast MA is above slow MA, and Ichimoku is positive, that usually coincides with RSI climbing above its upper bound and the MACD histogram turning positive. In such cases, both Trend and Momentum categories generate +1 or +2. Because the Market Activity State is likely High (given the accompanying volatility), Trend and Momentum weights are at their peak, so the netScore quickly crosses into Bullish territory.
•  Sideways/Consolidation:  During a low-volatility, sideways phase, ADX may fall below its threshold, MAs may flatten, and RSI might hover in the neutral band. However, subtle price-action signals (like a small breakout candle or a Heikin-Ashi candle with a slight bias) can still produce a +1 in the Price Action category. If Market Activity is Low, Price Action’s weight (55 %) can carry enough influence—even if Trend and Momentum are neutral—to push the netScore out of “Sideways” into a mild bullish or bearish bias.
•  Opposing Signals:  When Trend is bullish but Momentum turns negative (for example, price continues up but RSI rolls over), the two scores can partially cancel. Market Activity may remain Medium, in which case the netScore lingers near zero (Sideways). The trader can then wait for either a clearer momentum shift or a fresh price-action breakout before committing.
By dynamically recognizing these correlations and adjusting weights, the indicator ensures that:
• When Trend and Momentum align (and volatility supports it), the netScore leaps strongly into Bullish or Bearish.
• When Trend is neutral but Price Action shows an early move in a low-volatility environment, Price Action’s extra weight in the Low Activity State can still produce actionable signals.
---
 10. Market Activity State & Its Role (Detailed) 
The Market Activity State is not a direct category score—it is an overarching context setter for how heavily to trust Trend, Momentum, or Price Action. Here’s how it is derived and applied:
1.  Calculate Four Volatility Sub-Scores: 
   • BBW: Compare the current band width to its own moving average ± standard deviation. If BBW > (BBW_MA + stdev), assign +1 (high volatility); if BBW < (BBW_MA × 0.5), assign –1 (low volatility); else 0.
   • ATR: Compare ATR to its moving average ± standard deviation. A spike above the upper threshold is +1; a contraction below the lower threshold is –1; otherwise 0.
   • KCW: Same logic as ATR but around the KCW mean.
   • Volume: Compare current volume to its volume MA ± standard deviation. Above the upper threshold is +1; below the lower threshold is –1; else 0.
2.  Sum Sub-Scores → Raw Market Activity Score:  Range between –4 and +4.
3.  Assign Market Activity State: 
   •  High Activity:  Raw Score ≥ +2 (at least two volatility metrics are strongly spiking).
   •  Low Activity:  Raw Score ≤ –2 (at least two metrics signal unusually low volatility or thin volume).
   •  Medium Activity:  Raw Score is between –1 and +1 inclusive.
4.  Hysteresis for Stability: 
   • If hysteresis is enabled, a new state only takes hold after two consecutive bars confirm the same High, Medium, or Low label.
   • This prevents the Market Activity State from bouncing around when volatility is on the fence.
5.  Set Category Weights Based on Activity State: 
   • High Activity: Trend = 50 %, Momentum = 35 %, Price Action = 15 %.
   • Low Activity: Trend = 25 %, Momentum = 20 %, Price Action = 55 %.
   • Medium Activity: Use trader’s base weights (e.g., Trend = 40 %, Momentum = 30 %, Price Action = 30 %).
6.  Impact on netScore:  Because category scores (–3 to +3) multiply by these weights, High Activity amplifies the effect of strong Trend and Momentum scores; Low Activity amplifies the effect of Price Action.
7.  Market Context Tooltip:  The dashboard includes a tooltip summarizing the current state—e.g., “High activity, trend and momentum prioritized,” “Low activity, price action prioritized,” or “Balanced market, all categories considered.”
---
 11. Category Weights: Base vs. Dynamic 
Traders begin by specifying base weights for Trend Strength, Momentum, and Price Action that sum to 100 %. These apply only when volatility is in the Medium band. Once volatility shifts:
•  High Volatility Overrides: 
• Trend jumps from its base (e.g., 40 %) to 50 %.
• Momentum jumps from its base (e.g., 30 %) to 35 %.
• Price Action is reduced to 15 %.
 Example:  If base weights were Trend = 40 %, Momentum = 30 %, Price Action = 30 %, then in High Activity they become 50/35/15. A Trend score of +3 now contributes 3 × 0.50 = +1.50 to netScore; a Momentum +2 contributes 2 × 0.35 = +0.70. In total, Trend + Momentum can easily push netScore above the +2 threshold on its own.
•  Low Volatility Overrides: 
• Price Action leaps from its base (30 %) to 55 %.
• Trend falls to 25 %, Momentum falls to 20 %.
 Why?  When markets are quiet, subtle candle breakouts, doji patterns, and small-range expansions tend to foreshadow the next swing more effectively than raw trend readings. A Price Action score of +3 in this state contributes 3 × 0.55 = +1.65, which can carry the netScore toward +2—even if Trend and Momentum are neutral or only mildly positive.
Because these weight shifts happen only after two consecutive bars confirm a High or Low state (if hysteresis is on), the indicator avoids constantly flipping its emphasis during borderline volatility phases.
---
 12. Dominant Category Explained 
Within the dashboard, a label such as “Trend Dominant,” “Momentum Dominant,” or “Price Action Dominant” appears when one category’s absolute weighted contribution to netScore is the largest. Concretely:
• Compute each category’s weighted contribution = (raw category score) × (current weight).
• Compare the absolute values of those three contributions.
• The category with the highest absolute value is flagged as Dominant for that bar.
 Why It Matters: 
•  Momentum Dominant:  Indicates that the combined force of RSI, Stochastic, and MACD (after weighting) is pushing netScore farther than either Trend or Price Action. In practice, it means that short-term sentiment and speed of change are the primary drivers right now, so traders should watch for continued momentum signals before committing to a trade.
•  Trend Dominant:  Means ADX, MA slope, and Ichimoku (once weighted) outweigh the other categories. This suggests a strong directional move is in place; trend-following entries or confirming pullbacks are likely to succeed.
•  Price Action Dominant:  Occurs when breakout/breakdown patterns, Heikin-Ashi candle readings, and range expansions (after weighting) are the most influential. This often happens in calmer markets, where subtle shifts in candle structure can foreshadow bigger moves.
By explicitly calling out which category is carrying the most weight at any moment, the dashboard gives traders immediate insight into why the netScore is tilting toward bullish, bearish, or sideways.
---
 13. Oscillator Plot: How to Read It 
The “Net Score” oscillator sits below the dashboard and visually displays the smoothed netScore as a line graph. Key features:
1.  Value Range:  In normal conditions it oscillates roughly between –3 and +3, but extreme confluences can push it outside that range.
2.  Horizontal Threshold Lines: 
   • +2 Line (Bullish threshold)
   • 0 Line (Neutral midline)
   • –2 Line (Bearish threshold)
3.  Zone Coloring: 
   • Green Background (Bullish Zone): When netScore ≥ +2.
   • Red Background (Bearish Zone): When netScore ≤ –2.
   • Gray Background (Sideways Zone): When –2 < netScore < +2.
4.  Dynamic Line Color: 
   • The plotted netScore line itself is colored green in a Bullish Zone, red in a Bearish Zone, or gray in a Sideways Zone, creating an immediate visual cue.
    Interpretation Tips: 
   •  Crossing Above +2:  Signals a strong enough combined trend/momentum/price-action reading to classify as Bullish. Many traders wait for a clear crossing plus a confirmation candle before entering a long position.
   •  Crossing Below –2:  Indicates a strong Bearish signal. Traders may consider short or exit strategies.
   •  Rising Slope, Even Below +2:  If netScore climbs steadily from neutral toward +2, it demonstrates building bullish momentum.
   •  Divergence:  If price makes a higher high but the oscillator fails to reach a new high, it can warn of weakening momentum and a potential reversal.
---
 14. Comments and Their Necessity 
Every sub-indicator (ADX, MA slope, Ichimoku, RSI, Stochastic, MACD, HH/LL, Heikin-Ashi, Candle Range, BBW, ATR, KCW, Volume) generates a short comment that appears in the detailed dashboard. Examples:
• “Strong bullish trend” or “Strong bearish trend” for ADX/DMI
• “Fast MA above slow MA” or “Fast MA below slow MA” for MA slope
• “RSI above dynamic threshold” or “RSI below dynamic threshold” for RSI
• “MACD histogram positive” or “MACD histogram negative” for MACD Hist
• “Price near highs” or “Price near lows” for HH/LL checks
• “Bullish Heikin Ashi” or “Bearish Heikin Ashi” for HA Doji scoring
• “Large range, trend confirmed” or “Small range, trend contradicted” for Candle Range
Additionally, the top-row comment for each category is:
•  Trend:  “Highly Bullish,” “Highly Bearish,” or “Neutral Trend.”
•  Momentum:  “Strong Momentum,” “Weak Momentum,” or “Neutral Momentum.”
•  Price Action:  “Bullish Action,” “Bearish Action,” or “Neutral Action.”
•  Market Activity:  “Volatile Market,” “Calm Market,” or “Stable Market.”
 Reasons for These Comments: 
•  Transparency:  Shows exactly how each sub-indicator contributed to its category score.
•  Education:  Helps traders learn why a category is labeled bullish, bearish, or neutral, building intuition over time.
•  Customization:  If, for example, the RSI comment says “RSI neutral” despite an impending trend shift, a trader might choose to adjust RSI length or thresholds.
In the detailed dashboard, hovering over each comment cell also reveals a tooltip with additional context (e.g., “Fast MA above slow MA” or “Senkou A above Senkou B”), helping traders understand the precise rule behind that +1, 0, or –1 assignment.
---
 15. Real-Life Example (Consolidated) 
•  Instrument & Timeframe:  Bitcoin (BTCUSD), 1-hour chart.
•  Current Market Activity:  BBW and ATR both spike (+1 each), KCW is moderately high (+1), but volume is only neutral (0) → Raw Market Activity Score = +2 → State = High Activity (after two bars, if hysteresis is on).
•  Category Weights Applied:  Trend = 50 %, Momentum = 35 %, Price Action = 15 %.
•  Trend Sub-Scores: 
1. ADX = 25 (above threshold 20) with +DI > –DI → +1.
2. Fast MA (20-period) sits above Slow MA (50-period) → +1.
3. Ichimoku: Senkou A > Senkou B → +1.
   → Trend Score = +3.
   •  Momentum Sub-Scores: 
4. RSI = 75 (above its moving average +1 stdev) → +1.
5. MACD histogram = +0.15 → +1.
6. Stochastic %K = 50 (mid-range) → 0.
   → Momentum Score = +2.
   •  Price Action Sub-Scores: 
7. Price is not within 1 % of the 20-period high/low and slope = positive → 0.
8. Heikin-Ashi body is slightly larger than stdev over last 5 bars with haClose > haOpen → +1.
9. Candle range is just above its dynamic upper bound but trend is already captured, so → +1.
   → Price Action Score = +2.
   •  Calculate netScore (before smoothing): 
   • Trend contribution = 3 × 0.50 = 1.50
   • Momentum contribution = 2 × 0.35 = 0.70
   • Price Action contribution = 2 × 0.15 = 0.30
   • Raw netScore = 1.50 + 0.70 + 0.30 = 2.50 → Immediately classified as Bullish.
   •  Oscillator & Dashboard Output: 
   • The oscillator line crosses above +2 and turns green.
   • Dashboard displays:
   • Trend Regime “BULLISH,” Trend Score = 3, Comment = “Highly Bullish.”
   • Momentum Regime “BULLISH,” Momentum Score = 2, Comment = “Strong Momentum.”
   • Price Action Regime “BULLISH,” Price Action Score = 2, Comment = “Bullish Action.”
   • Market Activity State “High,” Comment = “Volatile Market.”
   • Weights: Trend 50 %, Momentum 35 %, Price Action 15 %.
   • Dominant Category: Trend (because 1.50 > 0.70 > 0.30).
   • Overall Score: 2.50, posCount = (three +1s in Trend) + (two +1s in Momentum) + (two +1s in Price Action) = 7 bullish signals, negCount = 0.
   • Final Zone = “BULLISH.”
   • The trader sees that both Trend and Momentum are reinforcing each other under high volatility. They might wait one more candle for confirmation but already have strong evidence to consider a long.
---
• .
---
 Disclaimer 
This indicator is strictly a technical analysis tool and does not constitute financial advice. All trading involves risk, including potential loss of capital. Past performance is not indicative of future results. Traders should:
•  Always backtest  the “Market Zone Analyzer ” on their chosen symbols and timeframes before committing real capital.
•  Combine  this tool with sound risk management, position sizing, and, if possible, fundamental analysis.
•  Understand  that no indicator is foolproof; always be prepared for unexpected market moves.
Goodluck
-BullByte!
---
EXODUS                                   EXODUS by (DAFE) Trading Systems 
 EXODUS  is a sophisticated trading algorithm built by Dskyz (DAFE) Trading Systems for competitive and competition purposes, designed to identify high-probability trades with robust risk management. this strategy leverages a multi-signal voting system, combining three core components—SPR, VWMO, and VEI—alongside ADX, choppiness filters, and ATR-based volatility gates to ensure trades are taken only in favorable market conditions. the algo uses a take-profit to stop-loss ratio, dynamic position sizing, and a strict voting mechanism requiring all signals to align before entering a trade.
 EXODUS  was not overfitted for any specific symbol. instead, it uses a generic tuned setting, making it versatile across various markets. while it can trade futures, it’s not currently set up for it but has the potential to do more with further development. visuals are intentionally minimal due to its competition focus, prioritizing performance over aesthetics. a more visually stunning version may be released in the future with enhanced graphics.
 The Unique Core Components Developed for EXODUS 
SPR (Session Price Recalibration)
 SPR  measures momentum during regular trading hours (RTH, 0930-1600, America/New_York) to catch session-specific trends.
 spr_lookback = input.int(15, "SPR Lookback")  this sets how many bars back SPR looks to calculate momentum (default 15 bars). it compares the current session’s price-volume score to the score 15 bars ago to gauge momentum strength.
 how it works:  a longer lookback smooths out the signal, focusing on bigger trends. a shorter one makes SPR more sensitive to recent moves.
 how to adjust:  on a 1-hour chart, 15 bars is 15 hours (about 2 trading days). if you’re on a shorter timeframe like 5 minutes, 15 bars is just 75 minutes, so you might want to increase it to 50 or 100 to capture more meaningful trends. if you’re trading a choppy stock, a shorter lookback (like 5) can help catch quick moves, but it might give more false signals.
 spr_threshold = input.float (0.7, "SPR Threshold")
this is the cutoff for SPR to vote for a trade (default 0.7). if SPR’s normalized value is above 0.7, it votes for a long; below -0.7, it votes for a short.
 how it works:  SPR normalizes its momentum score by ATR, so this threshold ensures only strong moves count. a higher threshold means fewer trades but higher conviction.
 how to adjust:  if you’re getting too few trades, lower it to 0.5 to let more signals through. if you’re seeing too many false entries, raise it to 1.0 for stricter filtering. test on your chart to find a balance.
 spr_atr_length = input.int(21, "SPR ATR Length")  this sets the ATR period (default 21 bars) used to normalize SPR’s momentum score. ATR measures volatility, so this makes SPR’s signal relative to market conditions.
 how it works:  a longer ATR period (like 21) smooths out volatility, making SPR less jumpy. a shorter one makes it more reactive.
 how to adjust:  if you’re trading a volatile stock like TSLA, a longer period (30 or 50) can help avoid noise. for a calmer stock, try 10 to make SPR more responsive. match this to your timeframe—shorter timeframes might need a shorter ATR.
 rth_session = input.session("0930-1600","SPR: RTH Sess.") rth_timezone = "America/New_York"  this defines the session SPR uses (0930-1600, New York time). SPR only calculates momentum during these hours to focus on RTH activity.
 how it works:  it ignores pre-market or after-hours noise, ensuring SPR captures the main market action.
 how to adjust:  if you trade a different session (like London hours, 0300-1200 EST), change the session to match. you can also adjust the timezone if you’re in a different region, like "Europe/London". just make sure your chart’s timezone aligns with this setting.
 VWMO (Volume-Weighted Momentum Oscillator) 
VWMO measures momentum weighted by volume to spot sustained, high-conviction moves.
 vwmo_momlen = input.int(21, "VWMO Momentum Length")  this sets how many bars back VWMO looks to calculate price momentum (default 21 bars). it takes the price change (close minus close 21 bars ago).
 how it works:  a longer period captures bigger trends, while a shorter one reacts to recent swings.
 how to adjust:  on a daily chart, 21 bars is about a month—good for trend trading. on a 5-minute chart, it’s just 105 minutes, so you might bump it to 50 or 100 for more meaningful moves. if you want faster signals, drop it to 10, but expect more noise.
 vwmo_volback = input.int(30, "VWMO Volume Lookback")  this sets the period for calculating average volume (default 30 bars). VWMO weights momentum by volume divided by this average.
 how it works:  it compares current volume to the average to see if a move has strong participation. a longer lookback smooths the average, while a shorter one makes it more sensitive.
 how to adjust:  for stocks with spiky volume (like NVDA on earnings), a longer lookback (50 or 100) avoids overreacting to one-off spikes. for steady volume stocks, try 20. match this to your timeframe—shorter timeframes might need a shorter lookback.
 vwmo_smooth = input.int(9, "VWMO Smoothing") 
this sets the SMA period to smooth VWMO’s raw momentum (default 9 bars).
 how it works:  smoothing reduces noise in the signal, making VWMO more reliable for voting. a longer smoothing period cuts more noise but adds lag.
 how to adjust:  if VWMO is too jumpy (lots of false votes), increase to 15. if it’s too slow and missing trades, drop to 5. test on your chart to see what keeps the signal clean but responsive.
 vwmo_threshold = input.float(10, "VWMO Threshold")  this is the cutoff for VWMO to vote for a trade (default 10). above 10, it votes for a long; below -10, a short.
 how it works:  it ensures only strong momentum signals count. a higher threshold means fewer but stronger trades.
 how to adjust:  if you want more trades, lower it to 5. if you’re getting too many weak signals, raise it to 15. this depends on your market—volatile stocks might need a higher threshold to filter noise.
 VEI (Velocity Efficiency Index) 
VEI measures market efficiency and velocity to filter out choppy moves and focus on strong trends.
 vei_eflen = input.int(14, "VEI Efficiency Smoothing")  this sets the EMA period for smoothing VEI’s efficiency calc (bar range / volume, default 14 bars).
 how it works:  efficiency is how much price moves per unit of volume. smoothing it with an EMA reduces noise, focusing on consistent efficiency. a longer period smooths more but adds lag.
 how to adjust:  for choppy markets, increase to 20 to filter out noise. for faster markets, drop to 10 for quicker signals. this should match your timeframe—shorter timeframes might need a shorter period.
 vei_momlen = input.int(8, "VEI Momentum Length")  this sets how many bars back VEI looks to calculate momentum in efficiency (default 8 bars).
 how it works:  it measures the change in smoothed efficiency over 8 bars, then adjusts for inertia (volume-to-range). a longer period captures bigger shifts, while a shorter one reacts faster.
 how to adjust:  if VEI is missing quick reversals, drop to 5. if it’s too noisy, raise to 12. test on your chart to see what catches the right moves without too many false signals.
 vei_threshold = input.float(4.5, "VEI Threshold")  this is the cutoff for VEI to vote for a trade (default 4.5). above 4.5, it votes for a long; below -4.5, a short.
 how it works:  it ensures only strong, efficient moves count. a higher threshold means fewer trades but higher quality.
 how to adjust:  if you’re not getting enough trades, lower to 3. if you’re seeing too many false entries, raise to 6. this depends on your market—fast stocks like NQ1 might need a lower threshold.
 Features 
 Multi-Signal Voting:  requires all three signals (SPR, VWMO, VEI) to align for a trade, ensuring high-probability setups.
 Risk Management:  uses ATR-based stops (2.1x) and take-profits (4.1x), with dynamic position sizing based on a risk percentage (default 0.4%).
 Market Filters:  ADX (default 27) ensures trending conditions, choppiness index (default 54.5) avoids sideways markets, and ATR expansion (default 1.12) confirms volatility.
 Dashboard:  provides real-time stats like SPR, VWMO, VEI values, net P/L, win rate, and streak, with a clean, functional design.
 Visuals 
 EXODUS  prioritizes performance over visuals, as it was built for competitive and competition purposes. entry/exit signals are marked with simple labels and shapes, and a basic heatmap highlights market regimes. a more visually stunning update may be released later, with enhanced graphics and overlays.
 Usage 
 EXODUS  is designed for stocks and ETFs but can be adapted for futures with adjustments. it performs best in trending markets with sufficient volatility, as confirmed by its generic tuning across symbols like TSLA, AMD, NVDA, and NQ1. adjust inputs like SPR threshold, VWMO smoothing, or VEI momentum length to suit specific assets or timeframes.
 Setting I used:  (Again, these are a generic setting, each security needs to be fine tuned)
SPR LB = 19 SPR TH = 0.5 SPR ATR L= 21 SPR RTH Sess: 9:30 – 16:00
VWMO L = 21 VWMO LB = 18 VWMO S = 6 VWMO T = 8
VEI ES = 14 VEI ML = 21 VEI T = 4 
R % = 0.4
ATR L = 21 ATR M (S) =1.1 TP Multi = 2.1 ATR min mult = 0.8 ATR Expansion = 1.02
ADX L = 21 Min ADX = 25
Choppiness Index = 14 Chop. Max T = 55.5
Backtesting: TSLA
Frame: Jan 02, 2018, 08:00 — May 01, 2025, 09:00
Slippage: 3
Commission .01
 Disclaimer 
this strategy is for educational purposes. past performance is not indicative of future results. trading involves significant risk, and you should only trade with capital you can afford to lose. always backtest and validate any strategy before using it in live markets.
(This publishing will most likely be taken down do to some miscellaneous rule about properly displaying charting symbols, or whatever. Once I've identified what part of the publishing they want to pick on, I'll adjust and repost.)
 About the Author 
 Dskyz (DAFE) Trading Systems  is dedicated to building high-performance trading algorithms. EXODUS is a product of rigorous research and development, aimed at delivering consistent, and data-driven trading solutions.
Use it with discipline. Use it with clarity. Trade smarter.
**I will continue to release incredible strategies and indicators until I turn this into a brand or until someone offers me a contract.
2025 Created by Dskyz, powered by DAFE Trading Systems. Trade smart, trade bold.
[Stop!Loss] ADR Signal ADR Signal  - a technical indicator located in a separate window, which displays by default the  80%-level , as well as the  100%-level  of the  average daily range (ADR)  for the last  10 days  and compares it with the current intraday range. The indicator helps not only with the use of a mathematical-statistical method to identify a potential reversal at the moment during intraday trading, but can also serves as an effective assistant in risk management.
 👉 Basic mechanics of the indicator 
Firstly, this indicator tracks the performance of the standard  ATR  indicator on the daily chart, in other words,  ADR (Average Daily Range). 
 Important ❗️The ATR (Average True Range) indicator was created by J. Welles Wilder Jr. He first introduced ATR in his book "New Concepts in Technical Trading Systems", published in 1978. Wilder developed this indicator to measure market volatility to help traders estimate the range of price movements. This indicator is built into TradingView, more details can be found by link:  www.tradingview.com
Like  ATR ,  ADR  calculates the average true range for a specified period. In this case, the distance in points from the maximum of each day to its minimum is calculated, after which the arithmetic mean is calculated - this is  ADR .
 👉 Visualization 
  ADR Signal  is located in a separate window on the chart and has  3 levels: 
 1)  "ADR level" (green line)  -  the same parameter, the calculations of which are briefly described above. There is 100%-level of ATR on the daily chart (ADR).
 2)  "Current level" (red line)  -  this is the current price passage within the day, calculated in points. At the start of a new day, this parameter is reset. Therefore, in the indicator window, this line has sharp drops at the start of a new trading day:  "A new trading day - the instrument's power reserve is renewed again". 
 3)  "Signal level" (blue line)  -  this is an individually customized value that demonstrates a certain part of the ADR parameter.
 👉 Inputs 
 1)     -  is responsible for the ATR indicator period, the value of which will always be calculated on the daily chart. The default value is "10", that is, ATR is calculated for the last 10 days (not including the current one).
 2)     -  signal level (in %). The default value is "0.8", that is, 80%-level of the ADR parameter (set earlier) is calculated.
 👉 Style 
 1)     -  by default, this level is colored "blue".
 2)     -  by default, this level is colored "red".
 3)     -  by default, this level is colored "green".
 👉 How to use this indicator 
 Important❗️  The two methods of the use of the   ADR Signal indicator described below will be most effective when trading intraday (which is highlighted quite well below), so it is more logical to use the indicator information on time periods H1 and below. 
 1)  Identifying potential reversals during intraday trading:
The   ADR Signal  indicator can be used as a potential individual reversal strategy. 
 Important ❗️It should be noted that using it in it without additional confirming analysis tools will be a rather aggressive trading approach. Therefore, it is best to support the entry point in particular with other methods. 
In this case, the crossing of the  red line  (the number of points passed within the current day, that is, from the minimum of the current day to its maximum) and the  blue line  (color of the Signal level based on the default settings), indicates that the trading instrument has passed 80% (based on the default settings for the "Signal level") of its average distance from the maximum to the minimum over the past 10 days (based on the default settings for the "ADR Length"). Such a situation in the context of the mathematical-statistical approach indicates a probable reversal, since the "power reserve" of this instrument is mostly exhausted, so one can expect with a higher probability, at least, a price stop and possibly a reversal. In case of crossing of the  red line  and the  green one  (ADR level), it says again that based on the mathematical-statistical approach, this trading instrument has completely exhausted its intraday "power reserve". In this situation, a stop or reversal of the price will be even more likely.
Of course, using the "Signal level" parameter, one can filter out even more reliable situations for potential price reversals within a day, namely, by specifying, for example, 1.5 in the field of this parameter. Under such conditions, in the case of crossing the  red  and  blue lines  (based on the default style settings), to say that the trading instrument has passed 150% of its average distance over the last 10 days (based on the default style settings "ADR length"). In this case, the probability of a stop or reversal of the price increases even more.
 2)  Use in risk management:
In terms of risk management, this indicator is more applicable to open trades. For example, if one had an open Buy-position (especially if it is an intraday trade) and the price has raised significantly during the day, then the crossing of the  red line  with the  blue line , and especially the  red line  with the  green line , may indicate that the price will most likely stop growing, since the "power reserve" is almost or completely exhausted for this instrument within the current day. In this case, one can, at a minimum, move the trade to breakeven or even partially fix the profit.
 We will continue to discuss the methods of using this indicator and strategies based on it here. And we are always waiting for your reactions and feedback on this topic  💬.
 Thank you for your support 🚀
Quarterly Theory ICT 04 [TradingFinder] SSMT 4Quarter Divergence🔵 Introduction 
Sequential SMT Divergence is an advanced price-action-based analytical technique rooted in the ICT (Inner Circle Trader) methodology. Its primary objective is to identify early-stage divergences between correlated assets within precise time structures. This tool not only breaks down market structure but also enables traders to detect engineered liquidity traps before the market reacts.
In simple terms, SMT (Smart Money Technique) occurs when two correlated assets—such as indices (ES and NQ), currency pairs (EURUSD and GBPUSD), or commodities (Gold and Silver)—exhibit different reactions at key price levels (swing highs or lows). This lack of alignment is often a sign of smart money manipulation and signals a lack of confirmation in the ongoing trend—hinting at an imminent reversal or at least a pause in momentum.
In its Sequential form, SMT divergences are examined through a more granular temporal lens—between intraday quarters (Q1 through Q4). When SMT appears at the transition from one quarter to another (e.g., Q1 to Q2 or Q3 to Q4), the signal becomes significantly more powerful, often aligning with a critical phase in the Quarterly Theory—a framework that segments market behavior into four distinct phases: Accumulation, Manipulation, Distribution, and Reversal/Continuation.
For instance, a Bullish SMT forms when one asset prints a new low while its correlated counterpart fails to break the corresponding low from the previous quarter. This usually indicates absorption of selling pressure and the beginning of accumulation by smart money. Conversely, a Bearish SMT arises when one asset makes a higher high, but the second asset fails to confirm, signaling distribution or a fake-out before a decline.
However, SMT alone is not enough. To confirm a true Market Structure Break (MSB), the appearance of a Precision Swing Point (PSP) is essential—a specific candlestick formation on a lower timeframe (typically 5 to 15 minutes) that reveals the entry of institutional participants. The combination of SMT and PSP provides a more accurate entry point and better understanding of premium and discount zones.
The Sequential SMT Indicator, introduced in this article, dynamically scans charts for such divergence patterns across multiple sessions. It is applicable to various markets including Forex, crypto, commodities, and indices, and shows particularly strong performance during mid-week sessions (Wednesdays and Thursdays)—when most weekly highs and lows tend to form.
 Bullish Sequential SMT :
  
 Bearish Sequential SMT :
  
🔵 How to Use 
The Sequential SMT (SSMT) indicator is designed to detect time and structure-based divergences between two correlated assets. This divergence occurs when both assets print a similar swing (high or low) in the previous quarter (e.g., Q3), but in the current quarter (e.g., Q4), only one asset manages to break that swing level—while the other fails to reach it.
This temporal mismatch is precisely identified by the SSMT indicator and often signals smart money activity, a market phase transition, or even the presence of an engineered liquidity trap. The signal becomes especially powerful when paired with a Precision Swing Point (PSP)—a confirming candle on lower timeframes (5m–15m) that typically indicates a market structure break (MSB) and the entry of smart liquidity.
🟣 Bullish Sequential SMT 
 
 In the previous quarter, both assets form a similar swing low.
 In the current quarter, one asset (e.g., EURUSD) breaks that low and trades below it.
 The other asset (e.g., GBPUSD) fails to reach the same low, preserving the structure.
 
This time-based divergence reflects declining selling pressure, potential absorption, and often marks the end of a manipulation phase and the start of accumulation. If confirmed by a bullish PSP candle, it offers a strong long opportunity, with stop-losses defined just below the swing low.
  
🟣 Bearish Sequential SMT 
 
 In the previous quarter, both assets form a similar swing high.
 In the current quarter, one asset (e.g., NQ) breaks above that high.
 The other asset (e.g., ES) fails to reach that high, remaining below it.
 
This type of divergence signals weakening bullish momentum and the likelihood of distribution or a fake-out before a price drop. When followed by a bearish PSP candle, it sets up a strong shorting opportunity with targets in the discount zone and protective stops placed above the swing high.
  
🔵 Settings 
⚙️ Logical Settings 
 Quarterly Cycles Type : Select the time segmentation method for SMT analysis. 
Available modes include: Yearly, Monthly, Weekly, Daily, 90 Minute, and Micro.
These define how the indicator divides market time into Q1–Q4 cycles.
 Symbol : Choose the secondary asset to compare with the main chart asset (e.g., XAUUSD, US100, GBPUSD).
 Pivot Period : Sets the sensitivity of the pivot detection algorithm. A smaller value increases responsiveness to price swings.
 Activate Max Pivot Back : When enabled, limits the maximum number of past pivots to be considered for divergence detection.
 Max Pivot Back Length : Defines how many past pivots can be used (if the above toggle is active).
 Pivot Sync Threshold : The maximum allowed difference (in bars) between pivots of the two assets for them to be compared.
 Validity Pivot Length : Defines the time window (in bars) during which a divergence remains valid before it's considered outdated.
🎨 Display Settings 
 Show Cycle :Toggles the visual display of the current Quarter (Q1 to Q4) based on the selected time segmentation
 
 Show Cycle Label : Shows the name (e.g., "Q2") of each detected Quarter on the chart.
 Show Bullish SMT Line : Draws a line connecting the bullish divergence points.
 Show Bullish SMT Label : Displays a label on the chart when a bullish divergence is detected.
 Bullish Color : Sets the color for bullish SMT markers (label, shape, and line).
 Show Bearish SMT Line : Draws a line for bearish divergence.
 Show Bearish SMT Label : Displays a label when a bearish SMT divergence is found.
 Bearish Color : Sets the color for bearish SMT visual elements.
🔔 Alert Settings 
 Alert Name : Custom name for the alert messages (used in TradingView’s alert system).
 Message Frequency :
 
 All: Every signal triggers an alert.
 Once Per Bar: Alerts once per bar regardless of how many signals occur.
 Per Bar Close: Only triggers when the bar closes and the signal still exists.
 
 Time Zone Display : Choose the time zone in which alert timestamps are displayed (e.g., UTC).
 Bullish SMT Divergence Alert : Enable/disable alerts specifically for bullish signals.
 Bearish SMT Divergence Alert : Enable/disable alerts specifically for bearish signals
🔵 Conclusion 
The Sequential SMT (SSMT) indicator is a powerful and precise tool for identifying structural divergences between correlated assets within a time-based framework. Unlike traditional divergence models that rely solely on sequential pivot comparisons, SSMT leverages Quarterly Theory, in combination with concepts like liquidity sweeps, market structure breaks (MSB) and precision swing points (PSP), to provide a deeper and more actionable view of market dynamics.
By using SSMT, traders gain not only the ability to identify where divergence occurs, but also when it matters most within the market cycle. This empowers them to anticipate major moves or traps before they fully materialize, and position themselves accordingly in high-probability trade zones.
Whether you're trading Forex, crypto, indices, or commodities, the true strength of this indicator is revealed when used in sync with the Accumulation, Manipulation, Distribution, and Reversal phases of the market. Integrated with other confluence tools and market models, SSMT can serve as a core component in a professional, rule-based, and highly personalized trading strategy.
Fibonacci 3-D🟩 The  Fibonacci 3-D  indicator is a visual tool that introduces a three-dimensional approach to Fibonacci projections, leveraging market geometry. Unlike traditional Fibonacci tools that rely on two points and project horizontal levels, this indicator leverages slopes derived from three points to introduce a dynamic element into the calculations. The  Fibonacci 3-D  indicator uses three user-defined points to form a triangular structure, enabling multi-dimensional projections based on the relationships between the triangle’s sides.
This triangular framework forms the foundation for the indicator’s calculations, with each slope (⌳AB, ⌳AC, and ⌳BC) representing the rate of price change between its respective points. By incorporating these slopes into Fibonacci projections, the indicator provides an alternate approach to identifying potential support and resistance levels. The  Fibonacci 3-D  expands on traditional methods by integrating both historical price trends and recent momentum, offering deeper insights into market dynamics and aligning with broader market geometry.
The indicator operates across three modes, each defined by the triangular framework formed by three user-selected points (A, B, and C):
 1-Dimensional (1-D):  Fibonacci levels are based on a single side of the triangle, such as AB, AC, or BC. The slope of the selected side determines the angle of the projection, allowing users to analyze linear trends or directional price movements.
 2-Dimensional (2-D):  Combines two slopes derived from the sides of the triangle, such as AB and BC or AC and BC. This mode adds depth to the projections, accounting for both historical price swings and recent market momentum.
 3-Dimensional (3-D):  Integrates all three slopes into a unified projection. This mode captures the full geometric relationship between the points, revealing a comprehensive view of geometric market structure.
 
🌀  THEORY & CONCEPT  🌀
The  Fibonacci 3-D  indicator builds on the foundational principles of traditional Fibonacci analysis while expanding its scope to capture more intricate market structures. At its core, the indicator operates based on three user-selected points (A, B, and C), forming the vertices of a triangle that provides the structural basis for all calculations. This triangle determines the slopes, projections, and Fibonacci levels, aligning with the unique geometric relationships between the chosen points. By introducing multiple dimensions and leveraging this triangular framework, the indicator enables a deeper examination of price movements.
 1️⃣ First Dimension (1-D) 
In technical analysis, traditional Fibonacci retracement and extension tools operate as one-dimensional instruments. They rely on two price points, often a swing high and a swing low, to calculate and project horizontal levels at predefined Fibonacci ratios. These levels identify potential support and resistance zones based solely on the price difference between the selected points.
  A one-dimensional Fibonacci showing levels derived from two price points (B and C). 
The  Fibonacci 3-D  indicator extends this one-dimensional concept by introducing  Ascending  and  Descending  projection options. These options calculate the levels to align with the directional movement of price, creating sloped projections instead of purely horizontal levels.
   1-D mode with an ascending projection along the ⌳BC slope aligned to the market's slope. Potential support is observed at 0.236 and 0.382, while resistance appears at 1.0 and 0.5. 
 2️⃣ Second Dimension (2-D) 
The second dimension incorporates a second side of the triangle, introducing relationships between two slopes (e.g., ⌳AB and ⌳BC) to form a more dynamic three-point structure (A, B, and C) on the chart. This structure enables the indicator to move beyond the single-axis (price) calculations of traditional Fibonacci tools. The sides of the triangle (AB, AC, BC) represent slopes calculated as the rate of price change over time, capturing distinct components of market movement, such as trend direction and momentum.
  2-D mode of the Fibonacci 3-D indicator using the ⌳AC slope with a descending projection. The Fibonacci projections align closely with observed market behavior, providing support at 0.236 and resistance at 0.618. Unlike traditional zigzag setups, this configuration uses two swing highs (A and B) and a swing low (C). The alignment along the descending slope highlights the geometric relationships between selected points in identifying potential support and resistance levels. 
 
 3️⃣ Third Dimension (3-D) 
The third dimension expands the analysis by integrating all three slopes into a unified calculation, encompassing the entire triangle structure formed by points A, B, and C. Unlike the second dimension, which analyzes pairwise slope relationships, the 3-D mode reflects the combined geometry of the triangle. Each slope contributes a distinct perspective: AB and AC provide historical context, while BC emphasizes the most recent price movement and is given greater weight in the calculations to ensure projections remain responsive to current dynamics.
Using this integrated framework, the 3-D mode dynamically adjusts Fibonacci projections to balance long-term patterns and short-term momentum. The projections extend outward in alignment with the triangle’s geometry, offering a comprehensive framework for identifying potential support and resistance zones and capturing market structures beyond the scope of simpler 1-D or 2-D modes.
     Three-dimensional Fibonacci projection using the ⌳AC slope, aligning closely with the market's directional movement. The projection highlights key levels: resistance at 0.0 and 0.618, and support at 1.0, 0.786, and 0.382. 
By leveraging all three slopes simultaneously, the 3-D mode introduces a level of complexity particularly suited for volatile or non-linear markets. The weighted slope calculations ensure no single price movement dominates the analysis, allowing the projections to adapt dynamically to the broader market structure while remaining sensitive to recent momentum. 
    Three-dimensional ascending projection. In 3D mode, the indicator integrates all three slopes to calculate the angle of projection for the Fibonacci levels. The resulting projections adapt dynamically to the overall geometry of the ABC structure, aligning with the market’s current direction. 
🔂  Interactions: Dimensions. Slope Source, Projections, and Orientation 
The  Dimensions ,  Projections , and  Orientation  settings work together to define Fibonacci projections within the triangular framework. Each setting plays a specific role in the geometric analysis of price movements.
♾️  Dimension  determines which of the three modes (1-D, 2-D, or 3-D) is used for Fibonacci projections. In 1-D mode, the projections are based on a single side of the triangle, such as AB, AC, or BC. In 2-D mode, two sides are combined, producing levels based on their geometric relationship. The 3-D mode integrates all three sides of the triangle, calculating projections using weighted averages that emphasize the BC side for its relevance to recent price movement while maintaining historical context from the AB and AC sides.
    A one-dimensional Fibonacci projection using the ⌳AB slope with a neutral projection. Important levels of interaction are highlighted: repeated resistance at Level 1.0 and repeated support at Levels 0.5 and 0.618. The projection aligns horizontally, reflecting the relationship between points A, B, and C while identifying recurring zones of market structure. 
🧮  Slope Source  determines which side of the triangle (AB, AC, or BC) serves as the foundation for Fibonacci projections. This selection directly impacts the calculations by specifying the slope that anchors the geometric relationships within the chosen Dimension mode (1-D, 2-D, or 3-D).
In 1-D mode, the selected  Source  defines the single side used for the projection. In 2-D and 3-D modes, the  Source  works in conjunction with other settings to refine projections by integrating the selected slope into the multi-dimensional framework. 
    One-dimensional Fibonacci projection using the ⌳AC Slope Source and Ascending projection. The projection continues on the AC slope line. 
🎯  Projection  controls the direction and alignment of Fibonacci levels. Neutral projections produce horizontal levels, similar to traditional Fibonacci tools. Ascending and Descending projections adjust the levels along the calculated slope to reflect market trends. These options allow the indicator’s outputs to align with different market behaviors. 
    An ascending projection along the ⌳BC slope aligns with resistance levels at 1.0, 0.618, and 0.236. The geometric relationship between points A, B, and C illustrates how the projection adapts to market structure, identifying resistance zones that may not be captured by traditional Fibonacci tools. 
🧭  Orientation  modifies the alignment of the setup area defined by points A, B, and C, which influences Fibonacci projections in 2-D and 3-D modes. In  Default  mode, the triangle aligns naturally based on the relative positions of points B and C. In  Inverted  mode, the geometric orientation of the setup area is reversed, altering the slope calculations while preserving the projection direction specified in the  Projection  setting. In 1-D mode,  Orientation  has no effect since only one side is used for the projection.
Adjusting the  Orientation  setting provides alternative views of how Fibonacci levels align with the market's structure. By recalibrating the triangle’s setup, the inverted orientation can highlight different relationships between the sides, providing additional perspectives on support and resistance zones.
  2-D inverted. The ⌳AC slope defines the projection, and the inverted orientation adjusts the alignment of the setup area, altering the angles used in level calculations. Key levels are highlighted: resistance at 0.786, strong support at 0.5 and 0.236, and a resistance-turned-support interaction at 0.618. 
🛠️  CONFIGURATION AND SETTINGS  🛠️
The  Fibonacci 3-D  indicator includes configurable settings to adjust its functionality and visual representation. These options include customization of the dimensions (1-D, 2-D, or 3-D), slope calculations, orientations, projections, Fibonacci levels, and visual elements.
When adding the indicator to a new chart, select three reference points (A, B, and C). These are usually set to recent swing points. All three points can be easily changed at any time by clicking on the reference point and dragging it to a new location.
By default, all settings are set to  Auto . The indicator uses an internal algorithm to estimate the projections based on the orientation and relative positions of the reference points. However, all values can be overridden to reflect the user's interpretation of the current market geometry.
⚙️  Core Settings 
  
 Dimensions : Defines how many sides of the triangle formed by points A, B, and C are incorporated into the calculations for Fibonacci projections. This setting determines the level of complexity and detail in the analysis.   1-D : Projects levels along the angle of a single user-selected side of the triangle. 
   2-D : Projects levels based on a composite slope derived from the angles of two sides of the triangle.
   3-D : Projects levels based on a composite slope derived from all three sides of the triangle (A-B, A-C, and B-C), providing a multi-dimensional projection that adapts to both historical and recent market movements.
 
 Slope Source : Determines which side of the triangle is used as the basis for slope calculations.   A–B: The slope between points A and B. In 1-D mode, this determines the projection. In 2-D and 3-D modes, it contributes to the composite slope calculation.
  A–C: The slope between points A and C. In 1-D mode, this determines the projection. In 2-D and 3-D modes, it contributes to the composite slope calculation.
  B--C: The slope between points B and C. In 1-D mode, this determines the projection. In 2-D and 3-D modes, it contributes to the composite slope calculation.
 
 Orientation : Defines the triangle's orientation formed by points A, B, and C, influencing slope calculations.   Auto : Automatically determines orientation based on the relative positions of points B and C. If point C is to the right of point B, the orientation is "normal." If point C is to the left, the orientation is inverted.
   Inverted : Reverses the orientation set in "Auto" mode. This flips the triangle, reversing slope calculations ⌳AB becomes ⌳BA).
 
 Projection : Determines the direction of Fibonacci projections:   Auto : Automatically determines projection direction based on the triangle formed by A, B, and C.
   Ascending : Projects the levels upward.
   Neutral : Projects the levels horizontally, similar to traditional Fibonacci retracements.
   Descending : Projects the levels downward.
 
⚙️  Fibonacci Level Settings   Show or hide specific levels.
   Level Value : Adjust Fibonacci ratios for each level. The 0.0 and 1.0 levels are fixed.
   Color : Set level colors.
 
⚙️ Visibility Settings    Show Setup : Toggle the display of the setup area, which includes the projected lines used in calculations.
   Show Triangle : Toggle the display of the triangle formed by points A, B, and C.
   Triangle Color : Set triangle line colors.
   Show Point Labels : Toggle the display of labels for points A, B, and C.
   Show Left/Right Labels : Toggle price labels on the left and right sides of the chart.
   Fill % : Adjust the fill intensity between Fibonacci levels (0% for no fill, 100% for full fill).
   Info : Set the location or hide the Slope Source and Dimension. If Orientation is  Inverted , the Slope Source will display with an asterisk (*).
 
⚙️  Time-Price Points :  Set the time and price for points A, B, and C, which define the Fibonacci projections.
   A, B, and C Points : User-defined time and price coordinates that form the foundation of the indicator's calculations.
   Interactive Adjustments : Changes made to points on the chart automatically synchronize with the settings panel and update projections in real time.
 
 Notes 
 Unlike traditional Fibonacci tools that include extensions beyond 1.0 (e.g., 1.618 or 2.618), the  Fibonacci 3-D  indicator restricts Fibonacci levels to the range between 0.0 and 1.0. This is because the projections are tied directly to the proportional relationships along the sides of the triangle formed by points A, B, and C, rather than extending beyond its defined structure.
 The indicator's calculations dynamically sort the user-defined A, B, and C points by time, ensuring point A is always the earliest, point C the latest, and point B the middle. This automatic sorting allows users to freely adjust the points directly on the chart without concern for their sequence, maintaining consistency in the triangular structure. 
🖼️  ADDITIONAL CHART EXAMPLES  🖼️
  Three-dimensional ⌳AC slope is used with an ascending projection, even as the broader market trend moves downward. Despite the apparent contradiction, the projected Fibonacci levels align closely with price action, identifying zones of support and resistance. These levels highlight smaller countertrend movements, such as pullbacks to 0.382 and 0.236, followed by continuations at resistance levels like 0.618 and 0.786. 
    In 2-D mode, an ascending projection based on the BC slope highlights the market's geometric structure. A setup triangle, defined by a swing high (A), a swing low (B), and another swing high (C), reveals Fibonacci projections aligning with support at 0.236, 0.382, and 0.5, and resistance at 0.618, 0.786, and 1.0, as shown by the green and red arrows. This demonstrates the ability to uncover dynamic support and resistance levels not calculated in traditional Fibonacci tools. 
  In 2-D mode with an ascending projection from the ⌳AB slope, price movement is contained within the 0.5 and 0.786 levels. The 0.5 level serves as support, while the 0.786 level acts as resistance, with price action consistently interacting with these boundaries. 
  An AC (2-D) ascending projection is derived from two swing highs (A and B) and a swing low (C), reflecting a non-linear market structure that deviates from traditional zigzag patterns. The ascending projection aligns closely with the market's upward trajectory, forming a channel between the 0.0 and 0.5 Fibonacci levels. Note how price action interacts with the projected levels, showing support at 0.236 and 0.382, with the 0.5 level acting as a mid-channel equilibrium. 
  Two-dimensional ascending Fibonacci projection using the ⌳AC slope. Arrows highlight resistance at 0.786 and support at 0.0 and 0.236. The projection follows the ⌳AC slope, reflecting the geometric relationship between points A, B, and C to identify these levels. 
    Three-dimensional Fibonacci projection using the ⌳AC slope, aligned with the actual market's directional trend. By removing additional Fibonacci levels, the image emphasizes key areas: resistance at Level 0.0 and support at Levels 1.0 and 0.5. The projection dynamically follows the ⌳AC slope, adapting to the market's structure as defined by points A, B, and C. 
  A three-dimensional configuration uses the ⌳AB slope as the baseline for projections while incorporating the geometric influence of point C. Only the 0.0 and 0.618 levels are enabled, emphasizing the relationship between support at 0.0 and resistance at 0.618. Unlike traditional Fibonacci tools, which operate in a single plane, this setup reveals levels that rely on the triangular relationship between points A, B, and C. The third dimension allows for projections that align more closely with the market’s structure and reflect its multi-dimensional geometry. 
  The Fibonacci 3-D indicator can adapt to non-traditional point selection. Point A serves as a swing low, while points B and C are swing highs, forming an unconventional configuration. ⌳The BC slope is used in 2-D mode with an inverted orientation, flipping the projection direction and revealing resistance at Level 0.786 and support at Levels 0.618 and 0.5. 
⚠️  DISCLAIMER  ⚠️  
The  Fibonacci 3-D  indicator is a visual analysis tool designed to illustrate Fibonacci relationships. While the indicator employs precise mathematical and geometric formulas, no guarantee is made that its calculations will align with other Fibonacci tools or proprietary methods. Like all technical and visual indicators, the Fibonacci projections generated by this tool may appear to visually align with key price zones in hindsight. However, these projections are not intended as standalone signals for trading decisions. This indicator is intended for educational and analytical purposes, complementing other tools and methods of market analysis.
🧠  BEYOND THE CODE  🧠  
The  Fibonacci 3-D  indicator, like other  xxattaxx indicators , is designed to encourage both education and community engagement. Your feedback and insights are invaluable to refining and enhancing the  Fibonacci 3-D  indicator. We look forward to the creative applications, adaptations, and observations this tool inspires within the trading community.
Uptrick: Arbitrage OpportunityINTRODUCTION  
This script, titled Uptrick: Arbitrage Monitor, is a Pine Script™ indicator that aims to help traders quickly visualize potential arbitrage scenarios across multiple cryptocurrency exchanges. Arbitrage, in general, involves taking advantage of price differences for the same asset across different trading platforms. By comparing market prices of the same symbol on two user-selected exchanges, as well as scanning a broader list of exchanges, this script attempts to signal areas where you might want to buy on one exchange and sell on another. It includes various graphical tools, calculations, and an optional Automated Detection signal feature, allowing users to incorporate more advanced data scanning into their trading decisions. Keep in mind that transaction fees must also be considered in real-world scenarios. These fees can negate potential profits and, in some cases, result in a net loss. 
PURPOSE  
The primary purpose of this indicator is to show potential percentage differences between the same cryptocurrency trading pairs on two different exchanges. This difference is displayed numerically, visually as a line chart, and it is also tested against user-defined thresholds. With the threshold in place, buy and sell signals can be generated. The script allows you to quickly gauge how significant a spread is between two exchanges and whether that spread surpasses a specified threshold. This is particularly useful for arbitrage trading, where an asset is bought at a lower price on one exchange and sold at a higher price on another, capitalizing on price discrepancies. By identifying these opportunities, traders can potentially secure profits across different markets.
WHY IT WAS MADE  
This script was developed to help traders who frequently look for arbitrage opportunities in the fast-paced cryptocurrency market. Cryptocurrencies sometimes experience quick price divergences across different exchanges. By having an automated approach that compares and displays prices, traders can spend less time manually tracking price discrepancies and more time focusing on actual trading strategies. The script was also made with user customization in mind, allowing you to toggle an optional Automated-based approach and choose different moving average methods to smooth out the displayed price difference.  
WHAT ARBITRAGE IS  
Arbitrage is the practice of buying an asset on one market (or exchange) at a lower price and simultaneously selling it on another market where the price is higher, thus profiting from the price difference. In cryptocurrency markets, these price differentials can occur across multiple exchanges due to varying liquidity, trading volume, geographic factors, or market inefficiencies. Though sometimes small, these differences can be exploited for profit when approached methodically.  
EXPLANATION OF INPUTS  
The script includes a variety of user inputs that help tailor the indicator to your specific needs:  
1. Compared Symbol 1: This is the primary symbol you want to track (for example, BTCUSDT).  Make sure it's written in all capital and make sure that it's price from that exchange is available on Tradingview.
2. Compare Exchange 1: The first exchange on which the script will request pricing data for the chosen symbol.  
3. Compared to Exchange: The second exchange, used for the comparison.  
4. Opportunity Threshold (%): A percentage threshold that, when exceeded by the price difference, can trigger buy or sell signals.  
5. Plot Style?: Allows you to choose between plotting the raw difference line or a moving average of that difference.  
6. MA Type: Select among SMA, EMA, WMA, RMA, or HMA for your moving average calculation.  
7. MA Length: The lookback period for the selected moving average.  
8. Plot Buy/Sell Signals?: Enables or disables the plotting of arrows signaling potential buy or sell zones based on threshold crossovers.  
9. Automated Detection?: Toggles an additional multi-exchange data scan feature that calculates the highest and lowest prices for the specified symbol across a predefined list of exchanges.  
CALCULATIONS  
At its core, the script calculates price1 and price2 using the request.security function to fetch close prices from two selected exchanges. The difference is measured as (price1 - price2) / price2 * 100. This results in a percentage that indicates how much higher or lower price1 is relative to price2. Additionally, the script calculates a slope for this difference, which helps color the line depending on whether it is trending up or down. If you choose the moving average option, the script will replace the raw difference data with one of several moving average calculations (SMA, EMA, WMA, RMA, or HMA).  
The script also includes an iterative scan of up to 15 different exchanges for Automated detection, collecting the highest and lowest price across all those exchanges. If the Automated option is enabled, it compiles a potential recommendation: buy at the cheapest exchange price and sell at the most expensive one. The difference across all exchanges (allExDiffPercent) is calculated using (highestPriceAll - lowestPriceAll) / lowestPriceAll * 100.  
WHAT AUTOMATED DETECTION SIGNAL DOES  
If enabled, the Automated detection feature scans all 15 supported exchanges for the specified symbol. It then identifies the exchange with the highest price and the exchange with the lowest price. The script displays a recommended action: buy on the lowest-exchange price and sell on the highest-exchange price. While called “Automated,” it is essentially a multi-exchange data query that automates a portion of research by consolidating different price points. It does not replace thorough analysis or guaranteed execution; it simply provides an overview of potential extremes.  
WHAT ALL-EX-DIFF IS  
The variable allExDiffPercent is used to show the overall difference between the highest price and the lowest price found among the 15 pre-chosen exchanges. This figure can be useful for anyone wanting a big-picture view of how large the arbitrage spread might be across the broader market.  
SIGNALS AND HOW THEY ARE GENERATED  
The script provides two main modes of signal generation:  
1. Raw Difference Mode: If the user chooses “Use Normal Line,” the script compares the percentage difference of the two selected exchanges (price1 and price2) to the user-defined threshold. When the difference crosses under the positive threshold, a sell signal is displayed (red arrow). Conversely, when the difference crosses above the negative threshold, a buy signal is displayed (green arrow).  
2. Moving Average Mode: If the user selects “Use Moving Average,” the script instead references the moving average values (maValue). The signals fire under similar conditions but use the average line to gauge whether the threshold has been crossed.  
HOW TO USE THE INDICATOR  
1. Add the script to your chart in TradingView.  
2. In the script’s settings panel, configure the symbol you wish to compare (for example, BTCUSDT), choose the two exchanges you want to evaluate, and set your desired threshold.  
3. Optionally, pick a moving average type and length if you prefer a smoother representation of the difference.  
4. Enable or disable buy/sell signals according to your preference.  
5. If you’d like to see potential extremes among a broader list of exchanges, enable Automated Detection. Keep in mind that this feature runs additional security requests, so it might slow down performance on weaker devices or if you already have many scripts running.  
EXCHANGES TO USE  
The script currently supports up to 15 exchanges: BYBIT, BINANCE, MEXC, BLOFIN, BITGET, OKX, KUCOIN, COINBASE, COINEX, PHEMEX, POLONIEX, GATEIO, BITSTAMP, and KRAKEN. You can choose any two of these for direct comparison, and if you enable the Automated detection, it will attempt to query them all to find extremes in real time.  
VISUALS
The exchanges and current prices & differences are all plotted in the table while the colored line represents the difference in the price. The two thresholds colored red are where signals are generated. A cross below the upper threshold is a sell signal and a cross above the lower threshold is a buy signal. In the line at the bottom, purple is a negative slope and aqua is a positive slope.
LIMITATIONS AND POTENTIAL PROBLEMS  
If you enable too many visual elements such as signals, additional lines, and the Automated-based scanning table, you may find that your chart becomes cluttered, or text might overlap. One workaround is to remove and reapply the indicator to refresh its display. You may also want to reduce the number of displayed table rows by disabling some features if your chart becomes too crowded. Sometimes there might be an error that the price of an asset is not available on an exchange, to fix this, go and select another exchange to compare it to, or if it happens in Automated detection, choose a different asset, ideally more widely spread.
UNIQUENESS  
This indicator stands out due to its multifaceted approach: it doesn’t just look at two exchanges but optionally scans up to 15 exchanges in real time, presenting users with a much broader view of the market. The dual-mode system (raw difference vs. moving average) allows for both immediate, unfiltered signals and smoother, noise-reduced signals depending on user preference. By default, it introduces dynamic visual cues through color changes when the slope of the difference transitions upward or downward. The optional Automated detection, while not a deep learning system, adds a functional intelligence layer by collating extreme price points from multiple exchanges in one place, thereby streamlining the manual research process. This combination of features gives the script a unique edge in the TradingView ecosystem, catering equally to novices wanting a straightforward approach and to advanced users looking for an aggregated multi-exchange analysis.
CONCLUSION  
Uptrick: Arbitrage Monitor is a versatile and customizable Pine Script™ indicator that highlights price differences for a specified symbol between two user-selected exchanges. Through signals, threshold-based alerts, and optional Automated detection across multiple exchanges, it aims to support traders in identifying potential arbitrage opportunities quickly and efficiently. This script makes no guarantees of profitability but can serve as a valuable tool to add to your trading toolkit. Always use caution when implementing arbitrage strategies, and be mindful of market risks, exchange fees, and latency.  
 ADDITIONAL DISCLOSURES  
This script is provided for educational and informational purposes only. It does not constitute financial advice or a guarantee of performance. Users are encouraged to conduct thorough research and consider the inherent risks of arbitrage trading. Market conditions can change rapidly, and orders may fail to execute at desired prices, especially when large price discrepancies attract competition from other traders.  
 
Advanced Pattern Detector**Script Overview**
**Indicator Name:** Advanced Pattern Detector
**Pine Script Version:** v5
**Indicator Type:** Overlaid on the chart (overlay=true)
**Main Features:**
- Detection and visualization of various technical patterns.
- Generation of BUY and SELL signals based on detected patterns.
- Display of Fibonacci levels to identify potential support and resistance levels.
- Ability to enable or disable each pattern through the indicator settings.
---
**Indicator Settings**
**Switches to Enable/Disable Patterns**
At the top of the indicator, there are parameters that allow the user to select which patterns will be displayed on the chart:
- Three Drives
- Rounding Top
- Rounding Bottom
- ZigZag Pattern
- Inverse Head and Shoulders
- Fibonacci Retracement
**Parameters for ZigZag**
Settings are also available for the ZigZag pattern, such as the depth of peak and trough detection, allowing the user to adjust the indicator's sensitivity to price changes.
---
**Pattern Detection**
Each pattern is implemented with its own logic, which checks specific conditions on the current bar (candle). Below are the main patterns:
1. **Three Drives**
   - **Description:** This pattern consists of three consecutive price movements in one direction (up or down). It can signal the continuation of the current trend or its reversal.
   - **How It Works:**
     - **Upward Drive:** The indicator checks that the closing price of each subsequent candle is higher than the previous one for three bars.
     - **Downward Drive:** The indicator checks that the closing price of each subsequent candle is lower than the previous one for three bars.
2. **Rounding Top**
   - **Description:** A pattern representing a smooth decrease in maximum prices over several bars, which may indicate a potential downward trend reversal.
   - **How It Works:**
     - The indicator checks that the maximum prices of the last five bars are gradually decreasing, and the current bar shows a decrease in the maximum price.
3. **Rounding Bottom**
   - **Description:** A pattern characterized by a smooth increase in minimum prices over several bars, signaling a possible upward trend reversal.
   - **How It Works:**
     - The indicator checks that the minimum prices of the last five bars are gradually increasing, and the current bar shows an increase in the minimum price.
4. **ZigZag Pattern**
   - **Description:** Used to identify corrective movements on the chart. The pattern shows peak and trough points connected by lines, helping to visualize the main price movement.
   - **How It Works:**
     - The indicator uses a function to determine local maxima and minima based on the specified depth.
     - Detected peaks and troughs are connected by lines to create a visual zigzag structure.
5. **Inverse Head and Shoulders**
   - **Description:** An inverted head and shoulders formation signals a possible reversal of a downward trend to an upward one.
   - **How It Works:**
     - The indicator looks for three local minima: the left shoulder, the head (the lowest minimum), and the right shoulder.
     - It checks that the left and right shoulders are approximately at the same level and below the head.
6. **Fibonacci Retracement Levels**
   - **Description:** Automatically builds key Fibonacci levels based on the maximum and minimum prices over the last 50 bars. These levels are often used as potential support and resistance levels.
   - **How It Works:**
     - Daily, the minimum and maximum prices over the last 50 bars are calculated.
     - Based on these values, Fibonacci levels are drawn: 100%, 23.6%, 38.2%, 50%, 61.8%, and 0%.
     - Old levels are removed when a new day begins to keep the chart clean and up-to-date.
---
**Generation of Buy and Sell Signals**
The indicator combines the results of detected patterns to generate trading signals:
- **Buy Signals (BUY):**
  - Rounding Bottom
  - Three Drives Up
  - Inverse Head and Shoulders
  - ZigZag Low
- **Sell Signals (SELL):**
  - Rounding Top
  - Three Drives Down
  - Inverse Head and Shoulders
  - ZigZag High
**How It Works:**
- If one or more buy conditions are met, a "BUY" label is displayed below the corresponding bar on the chart.
- If one or more sell conditions are met, a "SELL" label is displayed above the corresponding bar on the chart.
---
**Visualization of Patterns on the Chart**
Each detected pattern is visualized using various graphical elements, allowing traders to easily identify them on the chart:
- **Three Drives Up:** Green upward triangle below the bar.
- **Three Drives Down:** Red downward triangle above the bar.
- **Rounding Top:** Orange "RT" label above the bar.
- **Rounding Bottom:** Blue "RB" label below the bar.
- **Inverse Head and Shoulders:** Turquoise "iH&S" label below the bar.
- **ZigZag High/Low:** Purple circles at the peaks and troughs of the zigzag.
---
**Displaying Fibonacci Levels**
Fibonacci levels are displayed as horizontal lines on the chart with corresponding labels. These levels help traders determine potential entry and exit points, as well as support and resistance levels.
---
**Drawing ZigZag Lines**
ZigZag lines connect the detected peaks and troughs, visualizing corrective movements. To avoid cluttering the chart, the number of lines is limited, and old lines are automatically removed as new ones are added.
Supply and demandHi all!
This is my take on supply/demand. The gist is that it creates a zone if there is a big enough reaction. This is configurable in settings as "Minimum range (ATR factor)" (the Average True Length of length 14) that is the distance that the price must travel and "Reaction bars" that is the maximum number of bars that price must travel this distance. The zones that are shown are the ones that have a retest, break and retest or is unmitigated (untouched). If a zone is mitigated (entered) or broken it is temporarily hidden. For a zone to be created it needs to have this reaction and the previous bar does not.
So this script will show you zones that are fresh (unmitigated), retested or broken and retested. This means that the zones that are shown have "proven" that they are good zones through this. Basically it means that the script creates a bunch of zones and then picks the good once. This makes the script have some latency, but will hopefully give you good zones. A zone is completely removed if it's broken twice (it's okay if it's broken once and can still have a retest after it has flipped from previous supply (or resistance) into demand (or support)).
Here is a zone (the one that has the lowest opacity) that is broken and retested that could have resulted in a good long trade (the settings are default but has a stop in the beginning of 2024):
  
You have a setting to remove zones that are pierced (broken by price wicks). The following zone is pierced by price (in the beginning of May) that will not be shown after the start of May if you have "Pierced" checked (the indicator has default settings but a stop in the middle of April):
  
You have a trend section. Zones that create a reaction upwards can only be created if the trend is considered to be up, and vice versa. The options here are "SMA50" (the current price needs to be over the Simple Moving Average of length 50) and "SMA50, SMA200" (price needs to be over the Simple Moving Average of length 50 and the Simple Moving Average of length 50 needs to be over the Simple Moving Average of length 200). If these conditions are met the trend is considered to be up, otherwise it's down. You can disable this by choosing "No detection".
The zones that are shown also need to be within a limit (of the current price). This limit is 10 (factor of the Average True Range if length 14) by default. Set this to 0 to deactivate. This is useful for not showing zones that are far away from current price and therefore unlikely to be interacted with.
You can stop the calculation of zones (through the "Stop" value in the settings). This is useful to see if previous zones were any good. I used it in my testing of the script but left it because it can be nice to have.
The zones created by the script have different transparency based upon the zone's interaction. The clearest zones are the ones that are unmitigated, the second clearest ones are the ones having a retest and lastly the zones which are most unclear are the ones having a break and then a retest.
You can see the concept of this script to be a mix of supply/demand and support/resistance, having zones being unmitigated (untouched) as the most important but also show the zones having an interaction (in the form of a retest or a break and retest).
This is from a previous supply (or resistance) zone that has flipped into demand (or support) and has shown to be a good zone through a retest followed by a rally (default settings):
  
This zone has multiple retest and then rallies that could have given a good long trades (it has the default settings but a "Stop" time at 2022-01-14):
  
TODO:
- Create zones based on pivots
- Handle overlapping zones
- Incorporate volume in the creation and/or interaction with zones
- Add alerts
- Add ability to set maximum zone width
- Add ability to set the maximum number of retest bars
- ...?
The example for this publication has the default settings bit a "Stop" and a tighter "Limit" of 4.
I hope this explanation makes sense, let me know otherwise. Also let me know if you have any suggestions on improvements.
Best of trading luck!
ICT Killzones and Sessions W/ Silver Bullet + MacrosForex and Equity Session Tracker with Killzones, Silver Bullet, and Macro Times
This Pine Script indicator is a comprehensive timekeeping tool designed specifically for ICT traders using any time-based strategy. It helps you visualize and keep track of forex and equity session times, kill zones, macro times, and silver bullet hours.
Features:
Session and Killzone Lines:
Green: London Open (LO)
White: New York (NY)
Orange: Australian (AU)
Purple: Asian (AS)
Includes AM and PM session markers.
Dotted/Striped Lines indicate overlapping kill zones within the session timeline.
Customization Options:
Display sessions and killzones in collapsed or full view.
Hide specific sessions or killzones based on your preferences.
Customize colors, texts, and sizes.
Option to hide drawings older than the current day.
Automatic Updates:
The indicator draws all lines and boxes at the start of a new day.
Automatically adjusts time-based boxes according to the New York timezone.
Killzone Time Windows (for indices):
London KZ: 02:00 - 05:00
New York AM KZ: 07:00 - 10:00
New York PM KZ: 13:30 - 16:00
Silver Bullet Times:
03:00 - 04:00
10:00 - 11:00
14:00 - 15:00
Macro Times:
02:33 - 03:00
04:03 - 04:30
08:50 - 09:10
09:50 - 10:10
10:50 - 11:10
11:50 - 12:50
Latest Update:
January 15:
Added option to automatically change text coloring based on the chart.
Included additional optional macro times per user request:
12:50 - 13:10
13:50 - 14:15
14:50 - 15:10
15:50 - 16:15
Usage:
To maximize your experience, minimize the pane where the script is drawn. This minimizes distractions while keeping the essential time markers visible. The script is designed to help traders by clearly annotating key trading periods without overwhelming their charts.
Originality and Justification:
This indicator uniquely integrates various time-based strategies essential for ICT traders. Unlike other indicators, it consolidates session times, kill zones, macro times, and silver bullet hours into one comprehensive tool. This allows traders to have a clear and organized view of critical trading periods, facilitating better decision-making.
Credits:
This script incorporates open-source elements with significant improvements to enhance functionality and user experience.
Forex and Equity Session Tracker with Killzones, Silver Bullet, and Macro Times
This Pine Script indicator is a comprehensive timekeeping tool designed specifically for ICT traders using any time-based strategy. It helps you visualize and keep track of forex and equity session times, kill zones, macro times, and silver bullet hours.
Features:
Session and Killzone Lines:
Green: London Open (LO)
White: New York (NY)
Orange: Australian (AU)
Purple: Asian (AS)
Includes AM and PM session markers.
Dotted/Striped Lines indicate overlapping kill zones within the session timeline.
Customization Options:
Display sessions and killzones in collapsed or full view.
Hide specific sessions or killzones based on your preferences.
Customize colors, texts, and sizes.
Option to hide drawings older than the current day.
Automatic Updates:
The indicator draws all lines and boxes at the start of a new day.
Automatically adjusts time-based boxes according to the New York timezone.
Killzone Time Windows (for indices):
London KZ: 02:00 - 05:00
New York AM KZ: 07:00 - 10:00
New York PM KZ: 13:30 - 16:00
Silver Bullet Times:
03:00 - 04:00
10:00 - 11:00
14:00 - 15:00
Macro Times:
02:33 - 03:00
04:03 - 04:30
08:50 - 09:10
09:50 - 10:10
10:50 - 11:10
11:50 - 12:50
Latest Update:
January 15:
Added option to automatically change text coloring based on the chart.
Included additional optional macro times per user request:
12:50 - 13:10
13:50 - 14:15
14:50 - 15:10
15:50 - 16:15
ICT Sessions and Kill Zones
What They Are:
ICT Sessions: These are specific times during the trading day when market activity is expected to be higher, such as the London Open, New York Open, and the Asian session.
Kill Zones: These are specific time windows within these sessions where the probability of significant price movements is higher. For example, the New York AM Kill Zone is typically from 8:30 AM to 11:00 AM EST.
How to Use Them:
Identify the Session: Determine which trading session you are in (London, New York, or Asian).
Focus on Kill Zones: Within that session, focus on the kill zones for potential trade setups. For instance, during the New York session, look for setups between 8:30 AM and 11:00 AM EST.
Silver Bullets
What They Are:
Silver Bullets: These are specific, high-probability trade setups that occur within the kill zones. They are designed to be "one shot, one kill" trades, meaning they aim for precise and effective entries and exits.
How to Use Them:
Time-Based Setup: Look for these setups within the designated kill zones. For example, between 10:00 AM and 11:00 AM for the New York AM session  .
Chart Analysis: Start with higher time frames like the 15-minute chart and then refine down to 5-minute and 1-minute charts to identify imbalances or specific patterns  .
Macros
What They Are:
Macros: These are broader market conditions and trends that influence your trading decisions. They include understanding the overall market direction, seasonal tendencies, and the Commitment of Traders (COT) reports.
How to Use Them:
Understand Market Conditions: Be aware of the macroeconomic factors and market conditions that could affect price movements.
Seasonal Tendencies: Know the seasonal patterns that might influence the market direction.
COT Reports: Use the Commitment of Traders reports to understand the positioning of large traders and commercial hedgers  .
Putting It All Together
Preparation: Understand the macro conditions and review the COT reports.
Session and Kill Zone: Identify the trading session and focus on the kill zones.
Silver Bullet Setup: Look for high-probability setups within the kill zones using refined chart analysis.
Execution: Execute the trade with precision, aiming for a "one shot, one kill" outcome.
By following these steps, you can effectively use ICT sessions, kill zones, silver bullets, and macros to enhance your trading strategy.
Usage:
To maximize your experience, shrink the pane where the script is drawn. This minimizes distractions while keeping the essential time markers visible. The script is designed to help traders by clearly annotating key trading periods without overwhelming their charts.
Originality and Justification:
This indicator uniquely integrates various time-based strategies essential for ICT traders. Unlike other indicators, it consolidates session times, kill zones, macro times, and silver bullet hours into one comprehensive tool. This allows traders to have a clear and organized view of critical trading periods, facilitating better decision-making.
Credits:
This script incorporates open-source elements with significant improvements to enhance functionality and user experience. All credit goes to itradesize for the SB + Macro boxes
TrendzonesHi all!
This indicator plots trendlines. These lines are not plotted as traditional lines, but are instead zones. This is useful if you think that trend lines are more of an area of importance than a line.
It does so by finding pivots and connecting two of them if they have not been broken (more about that later) in-between the pivots.
These trend zones can be used as support/resistance that the price can react to.
• The first trendline is drawn between the high/low of the first and second pivot.
• The second trendline's first point is at the open/close of the pivot (either the first pivot or the second one) that has the smallest difference between the high/low and the nearest open/close. The same difference (between the high/low and the open/close) is then subtracted from the other pivot's high/low. This creates a point at the other pivot bar. A trendline is then drawn between the points.
This creates two trendlines and a zone between the two trendlines. This zone is the one kept and is shown by the script.
You can define the pivot lengths used to find trend zones (defaults to 3/3). You can also define the number of pivots to look back for, to find trend zones and the number of active zones, both of these defaults to 3. You can also choose to let the script create new zones based on time ("Oldest") or the zone that is furthest away in price, this defaults to be based on time but it can be useful for letting the script remove the one which is furthest away in price. Another useful setting is the one called "Cross source". This defines the price that has to cross the trend zone to make it invalid (broken). This defaults to "Close", i.e. the bar has to close on the "wrong side" of the trend zone.
The current zones are shown with an extension to the right, but you can also choose to keep the previous lines (without extension). Please note that kept zones are only the ones that are broken, not the replaced ones. I.e. the zones that are kept are the ones that are crossed by the user defined "cross source" (defaults to the closing/current price of the bar).
Hope this makes sense, let me know if you have any questions.
Best of trading luck!
TRADINGLibrary   "TRADING" 
This library is a client script for making a webhook signal formatted string to PoABOT server.
 entry_message(password, percent, leverage, margin_mode, kis_number) 
  Create a entry message for POABOT
  Parameters:
     password (string) : (string)   The password of your bot.
     percent (float) : (float)    The percent for entry based on your wallet balance.
     leverage (int) : (int)      The leverage of entry. If not set, your levereage doesn't change.
     margin_mode (string) : (string)   The margin mode for trade(only for OKX). "cross" or "isolated"
     kis_number (int) : (int)      The number of koreainvestment account. Default 1
  Returns: (string) A json formatted string for webhook message.
 order_message(password, percent, leverage, margin_mode, kis_number) 
  Create a order message for POABOT
  Parameters:
     password (string) : (string)   The password of your bot.
     percent (float) : (float)    The percent for entry based on your wallet balance.
     leverage (int) : (int)      The leverage of entry. If not set, your levereage doesn't change.
     margin_mode (string) : (string)   The margin mode for trade(only for OKX). "cross" or "isolated"
     kis_number (int) : (int)      The number of koreainvestment account. Default 1
  Returns: (string) A json formatted string for webhook message.
 close_message(password, percent, margin_mode, kis_number) 
  Create a close message for POABOT
  Parameters:
     password (string) : (string)   The password of your bot.
     percent (float) : (float)    The percent for close based on your wallet balance.
     margin_mode (string) : (string)   The margin mode for trade(only for OKX). "cross" or "isolated"
     kis_number (int) : (int)      The number of koreainvestment account. Default 1
  Returns: (string) A json formatted string for webhook message.
 exit_message(password, percent, margin_mode, kis_number) 
  Create a exit message for POABOT
  Parameters:
     password (string) : (string)   The password of your bot.
     percent (float) : (float)    The percent for exit based on your wallet balance.
     margin_mode (string) : (string)   The margin mode for trade(only for OKX). "cross" or "isolated"
     kis_number (int) : (int)      The number of koreainvestment account. Default 1
  Returns: (string) A json formatted string for webhook message.
 manual_message(password, exchange, base, quote, side, qty, price, percent, leverage, margin_mode, kis_number, order_name) 
  Create a manual message for POABOT
  Parameters:
     password (string) : (string)   The password of your bot.
     exchange (string) : (string)   The exchange
     base (string) : (string)   The base
     quote (string) : (string)   The quote of order message
     side (string) : (string)   The side of order messsage
     qty (float) : (float)    The qty of order message
     price (float) : (float)    The price of order message
     percent (float) : (float)    The percent for order based on your wallet balance.
     leverage (int) : (int)      The leverage of entry. If not set, your levereage doesn't change.
     margin_mode (string) : (string)   The margin mode for trade(only for OKX). "cross" or "isolated"
     kis_number (int) : (int)      The number of koreainvestment account.
     order_name (string) : (string)   The name of order message
  Returns: (string) A json formatted string for webhook message.
 in_trade(start_time, end_time, hide_trade_line) 
  Create a trade start line
  Parameters:
     start_time (int) : (int)     The start of time.
     end_time (int) : (int)     The end of time.
     hide_trade_line (bool) : (bool)    if true, hide trade line. Default false.
  Returns: (bool)  Get bool for trade based on time range.
 real_qty(qty, precision, leverage, contract_size, default_qty_type, default_qty_value) 
  Get exchange specific real qty
  Parameters:
     qty (float) : (float)   qty
     precision (float) : (float)   precision
     leverage (int) : (int)     leverage
     contract_size (float) : (float)   contract_size
     default_qty_type (string) 
     default_qty_value (float) 
  Returns: (float) exchange specific qty.
 method set(this, password, start_time, end_time, leverage, initial_capital, default_qty_type, default_qty_value, margin_mode, contract_size, kis_number, entry_percent, close_percent, exit_percent, fixed_qty, fixed_cash, real, auto_alert_message, hide_trade_line) 
  Set bot object.
  Namespace types: bot
  Parameters:
     this (bot) 
     password (string) : (string)   password for poabot.
     start_time (int) : (int)      start_time timestamp.
     end_time (int) : (int)      end_time timestamp.
     leverage (int) : (int)      leverage.
     initial_capital (float) 
     default_qty_type (string) 
     default_qty_value (float) 
     margin_mode (string) : (string)   The margin mode for trade(only for OKX). "cross" or "isolated"
     contract_size (float) 
     kis_number (int) : (int)      kis_number for poabot.
     entry_percent (float) : (float)    entry_percent for poabot.
     close_percent (float) : (float)    close_percent for poabot.
     exit_percent (float) : (float)    exit_percent for poabot.
     fixed_qty (float) : (float)    fixed qty.
     fixed_cash (float) : (float)    fixed cash.
     real (bool) : (bool)     convert qty for exchange specific.
     auto_alert_message (bool) : (bool)     convert alert_message for exchange specific.
     hide_trade_line (bool) : (bool)     if true, Hide trade line. Default false.
  Returns: (void)
 method print(this, message) 
  Print message using log table.
  Namespace types: bot
  Parameters:
     this (bot) 
     message (string) 
  Returns: (void)
 method start_trade(this) 
  start trade using start_time and end_time
  Namespace types: bot
  Parameters:
     this (bot) 
  Returns: (void)
 method entry(this, id, direction, qty, limit, stop, oca_name, oca_type, comment, alert_message, when) 
  It is a command to enter market position. If an order with the same ID is already pending, it is possible to modify the order. If there is no order with the specified ID, a new order is placed. To deactivate an entry order, the command strategy.cancel or strategy.cancel_all should be used. In comparison to the function strategy.order, the function strategy.entry is affected by pyramiding and it can reverse market position correctly. If both 'limit' and 'stop' parameters are 'NaN', the order type is market order.
  Namespace types: bot
  Parameters:
     this (bot) 
     id (string) : (string)   A required parameter. The order identifier. It is possible to cancel or modify an order by referencing its identifier.
     direction (string) : (string)   A required parameter. Market position direction: 'strategy.long' is for long, 'strategy.short' is for short.
     qty (float) : (float)    An optional parameter. Number of contracts/shares/lots/units to trade. The default value is 'NaN'.
     limit (float) : (float)    An optional parameter. Limit price of the order. If it is specified, the order type is either 'limit', or 'stop-limit'. 'NaN' should be specified for any other order type.
     stop (float) : (float)    An optional parameter. Stop price of the order. If it is specified, the order type is either 'stop', or 'stop-limit'. 'NaN' should be specified for any other order type.
     oca_name (string) : (string)   An optional parameter. Name of the OCA group the order belongs to. If the order should not belong to any particular OCA group, there should be an empty string.
     oca_type (string) : (string)   An optional parameter. Type of the OCA group. The allowed values are: "strategy.oca.none" - the order should not belong to any particular OCA group; "strategy.oca.cancel" - the order should belong to an OCA group, where as soon as an order is filled, all other orders of the same group are cancelled; "strategy.oca.reduce" - the order should belong to an OCA group, where if X number of contracts of an order is filled, number of contracts for each other order of the same OCA group is decreased by X.
     comment (string) : (string)   An optional parameter. Additional notes on the order.
     alert_message (string) : (string)   An optional parameter which replaces the {{strategy.order.alert_message}} placeholder when it is used in the "Create Alert" dialog box's "Message" field.
     when (bool) : (bool)     An optional parmeter. Condition, deprecated.
  Returns: (void)
 method order(this, id, direction, qty, limit, stop, oca_name, oca_type, comment, alert_message, when) 
  It is a command to place order. If an order with the same ID is already pending, it is possible to modify the order. If there is no order with the specified ID, a new order is placed. To deactivate order, the command strategy.cancel or strategy.cancel_all should be used. In comparison to the function strategy.entry, the function strategy.order is not affected by pyramiding. If both 'limit' and 'stop' parameters are 'NaN', the order type is market order.
  Namespace types: bot
  Parameters:
     this (bot) 
     id (string) : (string)   A required parameter. The order identifier. It is possible to cancel or modify an order by referencing its identifier.
     direction (string) : (string)   A required parameter. Market position direction: 'strategy.long' is for long, 'strategy.short' is for short.
     qty (float) : (float)    An optional parameter. Number of contracts/shares/lots/units to trade. The default value is 'NaN'.
     limit (float) : (float)    An optional parameter. Limit price of the order. If it is specified, the order type is either 'limit', or 'stop-limit'. 'NaN' should be specified for any other order type.
     stop (float) : (float)    An optional parameter. Stop price of the order. If it is specified, the order type is either 'stop', or 'stop-limit'. 'NaN' should be specified for any other order type.
     oca_name (string) : (string)   An optional parameter. Name of the OCA group the order belongs to. If the order should not belong to any particular OCA group, there should be an empty string.
     oca_type (string) : (string)   An optional parameter. Type of the OCA group. The allowed values are: "strategy.oca.none" - the order should not belong to any particular OCA group; "strategy.oca.cancel" - the order should belong to an OCA group, where as soon as an order is filled, all other orders of the same group are cancelled; "strategy.oca.reduce" - the order should belong to an OCA group, where if X number of contracts of an order is filled, number of contracts for each other order of the same OCA group is decreased by X.
     comment (string) : (string)   An optional parameter. Additional notes on the order.
     alert_message (string) : (string)   An optional parameter which replaces the {{strategy.order.alert_message}} placeholder when it is used in the "Create Alert" dialog box's "Message" field.
     when (bool) : (bool)     An optional parmeter. Condition, deprecated.
  Returns: (void)
 method close_all(this, comment, alert_message, immediately, when) 
  Exits the current market position, making it flat.
  Namespace types: bot
  Parameters:
     this (bot) 
     comment (string) : (string)   An optional parameter. Additional notes on the order.
     alert_message (string) : (string)   An optional parameter which replaces the {{strategy.order.alert_message}} placeholder when it is used in the "Create Alert" dialog box's "Message" field.
     immediately (bool) : (bool)     An optional parameter. If true, the closing order will be executed on the tick where it has been placed, ignoring the strategy parameters that restrict the order execution to the open of the next bar. The default is false.
     when (bool) : (bool)     An optional parmeter. Condition, deprecated.
  Returns: (void)
 method cancel(this, id, when) 
  It is a command to cancel/deactivate pending orders by referencing their names, which were generated by the functions: strategy.order, strategy.entry and strategy.exit.
  Namespace types: bot
  Parameters:
     this (bot) 
     id (string) : (string)   A required parameter. The order identifier. It is possible to cancel an order by referencing its identifier.
     when (bool) : (bool)     An optional parmeter. Condition, deprecated.
  Returns: (void)
 method cancel_all(this, when) 
  It is a command to cancel/deactivate all pending orders, which were generated by the functions: strategy.order, strategy.entry and strategy.exit.
  Namespace types: bot
  Parameters:
     this (bot) 
     when (bool) : (bool)    An optional parmeter. Condition, deprecated.
  Returns: (void)
 method close(this, id, comment, qty, qty_percent, alert_message, immediately, when) 
  It is a command to exit from the entry with the specified ID. If there were multiple entry orders with the same ID, all of them are exited at once. If there are no open entries with the specified ID by the moment the command is triggered, the command will not come into effect. The command uses market order. Every entry is closed by a separate market order.
  Namespace types: bot
  Parameters:
     this (bot) 
     id (string) : (string)   A required parameter. The order identifier. It is possible to close an order by referencing its identifier.
     comment (string) : (string)   An optional parameter. Additional notes on the order.
     qty (float) : (float)    An optional parameter. Number of contracts/shares/lots/units to exit a trade with. The default value is 'NaN'.
     qty_percent (float) : (float)    Defines the percentage (0-100) of the position to close. Its priority is lower than that of the 'qty' parameter. Optional. The default is 100.
     alert_message (string) : (string)   An optional parameter which replaces the {{strategy.order.alert_message}} placeholder when it is used in the "Create Alert" dialog box's "Message" field.
     immediately (bool) : (bool)     An optional parameter. If true, the closing order will be executed on the tick where it has been placed, ignoring the strategy parameters that restrict the order execution to the open of the next bar. The default is false.
     when (bool) : (bool)     An optional parmeter. Condition, deprecated.
  Returns: (void)
 ticks_to_price(ticks, from) 
  Converts ticks to a price offset from the supplied price or the average entry price.
  Parameters:
     ticks (float) : (float) Ticks to convert to a price.
     from (float) : (float) A price that can be used to calculate from. Optional. The default value is `strategy.position_avg_price`.
  Returns: (float) A price level that has a distance from the entry price equal to the specified number of ticks.
 method exit(this, id, from_entry, qty, qty_percent, profit, limit, loss, stop, trail_price, trail_points, trail_offset, oca_name, comment, comment_profit, comment_loss, comment_trailing, alert_message, alert_profit, alert_loss, alert_trailing, when) 
  It is a command to exit either a specific entry, or whole market position. If an order with the same ID is already pending, it is possible to modify the order. If an entry order was not filled, but an exit order is generated, the exit order will wait till entry order is filled and then the exit order is placed. To deactivate an exit order, the command strategy.cancel or strategy.cancel_all should be used. If the function strategy.exit is called once, it exits a position only once. If you want to exit multiple times, the command strategy.exit should be called multiple times. If you use a stop loss and a trailing stop, their order type is 'stop', so only one of them is placed (the one that is supposed to be filled first). If all the following parameters 'profit', 'limit', 'loss', 'stop', 'trail_points', 'trail_offset' are 'NaN', the command will fail. To use market order to exit, the command strategy.close or strategy.close_all should be used.
  Namespace types: bot
  Parameters:
     this (bot) 
     id (string) : (string)   A required parameter. The order identifier. It is possible to cancel or modify an order by referencing its identifier.
     from_entry (string) : (string)   An optional parameter. The identifier of a specific entry order to exit from it. To exit all entries an empty string should be used. The default values is empty string.
     qty (float) : (float)    An optional parameter. Number of contracts/shares/lots/units to exit a trade with. The default value is 'NaN'.
     qty_percent (float) : (float)    Defines the percentage of (0-100) the position to close. Its priority is lower than that of the 'qty' parameter. Optional. The default is 100.
     profit (float) : (float)    An optional parameter. Profit target (specified in ticks). If it is specified, a limit order is placed to exit market position when the specified amount of profit (in ticks) is reached. The default value is 'NaN'.
     limit (float) : (float)    An optional parameter. Profit target (requires a specific price). If it is specified, a limit order is placed to exit market position at the specified price (or better). Priority of the parameter 'limit' is higher than priority of the parameter 'profit' ('limit' is used instead of 'profit', if its value is not 'NaN'). The default value is 'NaN'.
     loss (float) : (float)    An optional parameter. Stop loss (specified in ticks). If it is specified, a stop order is placed to exit market position when the specified amount of loss (in ticks) is reached. The default value is 'NaN'.
     stop (float) : (float)    An optional parameter. Stop loss (requires a specific price). If it is specified, a stop order is placed to exit market position at the specified price (or worse). Priority of the parameter 'stop' is higher than priority of the parameter 'loss' ('stop' is used instead of 'loss', if its value is not 'NaN'). The default value is 'NaN'.
     trail_price (float) : (float)    An optional parameter. Trailing stop activation level (requires a specific price). If it is specified, a trailing stop order will be placed when the specified price level is reached. The offset (in ticks) to determine initial price of the trailing stop order is specified in the 'trail_offset' parameter: X ticks lower than activation level to exit long position; X ticks higher than activation level to exit short position. The default value is 'NaN'.
     trail_points (float) : (float)    An optional parameter. Trailing stop activation level (profit specified in ticks). If it is specified, a trailing stop order will be placed when the calculated price level (specified amount of profit) is reached. The offset (in ticks) to determine initial price of the trailing stop order is specified in the 'trail_offset' parameter: X ticks lower than activation level to exit long position; X ticks higher than activation level to exit short position. The default value is 'NaN'.
     trail_offset (float) : (float)    An optional parameter. Trailing stop price (specified in ticks). The offset in ticks to determine initial price of the trailing stop order: X ticks lower than 'trail_price' or 'trail_points' to exit long position; X ticks higher than 'trail_price' or 'trail_points' to exit short position. The default value is 'NaN'.
     oca_name (string) : (string)   An optional parameter. Name of the OCA group (oca_type = strategy.oca.reduce) the profit target, the stop loss / the trailing stop orders belong to. If the name is not specified, it will be generated automatically.
     comment (string) : (string)   Additional notes on the order. If specified, displays near the order marker on the chart. Optional. The default is na.
     comment_profit (string) : (string)   Additional notes on the order if the exit was triggered by crossing `profit` or `limit` specifically. If specified, supercedes the `comment` parameter and displays near the order marker on the chart. Optional. The default is na.
     comment_loss (string) : (string)   Additional notes on the order if the exit was triggered by crossing `stop` or `loss` specifically. If specified, supercedes the `comment` parameter and displays near the order marker on the chart. Optional. The default is na.
     comment_trailing (string) : (string)   Additional notes on the order if the exit was triggered by crossing `trail_offset` specifically. If specified, supercedes the `comment` parameter and displays near the order marker on the chart. Optional. The default is na.
     alert_message (string) : (string)   Text that will replace the '{{strategy.order.alert_message}}' placeholder when one is used in the "Message" field of the "Create Alert" dialog. Optional. The default is na.
     alert_profit (string) : (string)   Text that will replace the '{{strategy.order.alert_message}}' placeholder when one is used in the "Message" field of the "Create Alert" dialog. Only replaces the text if the exit was triggered by crossing `profit` or `limit` specifically. Optional. The default is na.
     alert_loss (string) : (string)   Text that will replace the '{{strategy.order.alert_message}}' placeholder when one is used in the "Message" field of the "Create Alert" dialog. Only replaces the text if the exit was triggered by crossing `stop` or `loss` specifically. Optional. The default is na.
     alert_trailing (string) : (string)   Text that will replace the '{{strategy.order.alert_message}}' placeholder when one is used in the "Message" field of the "Create Alert" dialog. Only replaces the text if the exit was triggered by crossing `trail_offset` specifically. Optional. The default is na.
     when (bool) : (bool)     An optional parmeter. Condition, deprecated.
  Returns: (void)
 percent_to_ticks(percent, from) 
  Converts a percentage of the supplied price or the average entry price to ticks.
  Parameters:
     percent (float) : (float) The percentage of supplied price to convert to ticks. 50 is 50% of the entry price.
     from (float) : (float) A price that can be used to calculate from. Optional. The default value is `strategy.position_avg_price`.
  Returns: (float) A value in ticks.
 percent_to_price(percent, from) 
  Converts a percentage of the supplied price or the average entry price to a price.
  Parameters:
     percent (float) : (float) The percentage of the supplied price to convert to price. 50 is 50% of the supplied price.
     from (float) : (float) A price that can be used to calculate from. Optional. The default value is `strategy.position_avg_price`.
  Returns: (float) A value in the symbol's quote currency (USD for BTCUSD).
 bot 
  Fields:
     password (series__string) 
     start_time (series__integer) 
     end_time (series__integer) 
     leverage (series__integer) 
     initial_capital (series__float) 
     default_qty_type (series__string) 
     default_qty_value (series__float) 
     margin_mode (series__string) 
     contract_size (series__float) 
     kis_number (series__integer) 
     entry_percent (series__float) 
     close_percent (series__float) 
     exit_percent (series__float) 
     log_table (series__table) 
     fixed_qty (series__float) 
     fixed_cash (series__float) 
     real (series__bool) 
     auto_alert_message (series__bool) 
     hide_trade_line (series__bool)
IDX Financials v2This indicator adds financial data, ratios, and valuations to your chart. The main objective is to present financial overview that can be glanced quickly to add to your considerations. 
The visualization of the indicator consists of two parts:
A.  Plots  (lines alongside the candlestick)
B.  Financial table  on the right. Drag your candlestick to the left to provide blank area for the table.
Programatically, the financial data is obtained by using these Pine API:
 
 request.earnings(...)  API for the EPS values that are used by the  price at average PER line , and
 request.financial(..)  API for the rest of financial data required by the indicator. 
 
See  What financial data is available in Pine  for more info on getting financial data in Pine.
 A. THE PLOTS 
The plots produces two lines,  price at average PER  in blue and  price at average PBV  line in pink, calculated over some adjustable time period (the default is one year). By default, only  price at average PER  line is shown.
Note that PER stands for Price to Earning Ratio.
The  price at average PER  line shows the price level at the average PER. It is calculated using formula as follows:
 line = AVGPER * EPSTTM 
where AVGPER is the average PER over some time period (default is one year, adjustable) and EPSTTM is the standardized EPS TTM.
Note that the EPS is updated  at the actual time of earning report publication , and not at standard quarter dates such as March 31st, Dec 31st, etc.. This approach is chosen to represent the actual PE at the time.
The  price at average PBV line  (PBV stands for Price to Book Value), which can be enabled in settings, shows the price at average PBV. It is calculated using formula as follows:
 line = AVGPBV * BVPS 
where AVGPBV is the average PBV over some period of time (default is one year, adjustable) and BVPS is the book value per share. Note that the PBV is clipped to   range to avoid values that are too small/large.
Also note that unlike PER, the BVPS is updated at each quarterly date (such as March 31st, Dec 31st, etc.).
Apart from those lines, some values are written to the status line (i.e. the numbers next to indicator name), which represent the corresponding value at the currently hovered bar:
 
 PER TTM
 Average PER
 Std value (zvalue) of PER TTM (equal to = (PERTTM - AVGPER)/STDPER)
 PBV
 
The meaning for these abbreviations should be straightforward.
 Using the price at average PER line 
There are several ways to use the  price at average PER line .
You can quickly get the sense of current valuation by seeing the price relative to the  price at average PER line . If the price is above the line, the valuation is higher than the average valuation, and vice versa if the price is lower. 
The distance between the price and the average is measured in unit of standard deviation. This is represented by the third number in the status line. Value zero indicates the price is exactly at the average PER line. Positive value indicates price is higher than average, and negative if price is lower than average. Usually people use value +2 and -2 to indicate extreme positions.
The second way to use the line is to see how the line jumps up or down  at the earning report date . If the line jumps up, this indicates the increase of EPSTTM. And vice versa when the line jumps down.
When EPSTTM is trending up over several quarters, or if EPSTTM is expected to go up, usually the price is also trending up and the valuation is over the average. And vice versa when EPSTTM is trending down or expected to go down. Deviation from this pattern may present some buying or selling opportunity.
 B. THE FINANCIAL TABLE 
The second visual part is the financial table. The financial table contains financial information  at the last bar . It has four sections:
1. Revenue
2. Income
3. Valuations
4. Ratios
Let's discuss them in detail.
 1. Revenue and income sections 
The revenue and income table are organized into rows and columns. 
Each row shows the data at the specified time frame, as follows:
 
 The first four rows shows quarterly revenue/income of the last four quarters. 
 Then followed by TTM data.
 Then followed by forecast of next quarter revenue/income, if such forecast exists. Note the "(F)" notation next to the quarter name.
 Then followed by forecast of TTM data of next quarter (only for income), if such forecast exists. Note the "(F)" notation next to the TTM name.
 
The columns of revenue and income sections show the following:
 
 The time frame information (such as quarter name, TTM, etc.)
 The revenue/income value, in billions or millions (configurable).
 YoY (year on year) growth, i.e. comparing the value with the value one year earlier, if any.
 QoQ (quarter on quarter) growth, i.e. comparing the value with previous quarter value, if any.
 GPM/NPM (gross profit margin or net profit margin), i.e. the margin on the specified time period.
 
 Using the Revenue and Income table 
The table provides quick way to see the revenue and income trend. You can see the YoY growth as well as QoQ, if that is applicable (non seasonal stocks). You can also see how the margins change over the periods.
The values are also presented with relevant  background color . Green indicates "good" value and red indicates "bad" value. The intensity represents how good/bad the value is. The limits of the good and bad values are currently hardcoded in the script.
 2. Valuations section 
The valuation shows current stock valuation. The section is organized in rows and columns. Each row contains one type of valuation criteria, as follows:
 
 PER (Price Earning Ratio)
 Next quarter PER forecast (marked by "(F)" notation) when available
 PBV (Price to Book value)
 
For each valuation criteria, several values are presented as columns:
 
 The current value of the criteria. By current, it means the value at the last bar.
 The one year standard deviation position
 The three years standard deviation position
 
 3. Ratios Section 
The ratios section contains the following useful financial ratios:
 
 ROA (Return on Asset), equal to: NET_INCOME_TTM / TOTAL_ASSETS
 ROE (Return on Equity), equal to: NET_INCOME_TTM / BOOK_VALUE_PER_SHARE
 PEG (PER to Growth Ratio), equal to PER_TTM / (INCOME_TTM_GROWTH*100)
 DER (Debt to Equity Ratio), taken from request.financial(syminfo.tickerid, "DEBT_TO_EQUITY", "FQ")
 DPR (Dividend Payout Ratio), taken from request.financial(syminfo.tickerid, "DIVIDEND_PAYOUT_RATIO", "FY")
 Dividend yield, equal to (DPR * (NET_INCOME_TTM / TOTAL_SHARES_OUTSTANDING)) / close
 
 KNOWN BUGS 
 
 Currently does not handle when the financial quarter contains gap, i.e. there is missing quarter. This usually happens on newly IPO stocks.
 
BreakoutTrendFollowingINFO: 
The "BreakoutTrendFollowing" indicator is a comprehensive trading system designed for trend-following in various market environments. It combines multiple technical indicators, including Moving Averages (MA), MACD, and RSI, 
along with volume analysis and breakout detection from consolidation, to identify potential entry points in trending markets. This strategy is particularly effective for assets that exhibit strong trends and significant price movements.
Note that using the consolidation filter reduces the amount of entries the strategy detects significantly, and needs to be used if we want to have an increased confidence in the trend via breakout. 
However, the strategy can be easily transformed to various only trend-following strategies, by applying different filters and configurations.
The indicator can be used to connect to the Signal input of the TTS (TempalteTradingStrategy) by jason5480 in order to backtest it, thus effectively turning it into a strategy (instructions below in TTS CONNECTIVITY section)
 DETAILS: 
The strategy's core is built upon several key components:
 
 Moving Average (MA): Used to determine the general trend direction. The strategy checks if the price is above the selected MA type and length.
 MACD Filter: Analyzes the relationship between two moving averages to confirm the trend's momentum.
 Consolidation Detection: Identifies periods of price consolidation and triggers trades on breakouts from these ranges.
 Volume Analysis: Assesses trading volume to confirm the strength and validity of the breakout.
 RSI: Used to avoid overbought conditions, ensuring trades are entered in favorable market situations.
 Wick filters: make sure there is not a long wick that indicates selling pressure from above
 
The strategy generates buy signals when several conditions are met concurrently (each one of them can be individually enabled/disabled)"
 
 The price is above the selected MA.
 A breakout occurs from a configurable consolidation range.
 The MACD line is above the signal line, indicating bullish momentum.
 The RSI is below the overbought threshold.
 There's an increase in trading volume, confirming the breakout's strength.
 
Currently the strategy fires SL signals, as the approach is to check for loss of momentum - i.e. crossunder of the MACD line and signal line, but that is to everyone to determine the exit conditions. 
The buy and SL signals are set on the chart using green or orange triangles on the below/above the price action.
 SETTINGS: 
Users can customize various parameters, including MA type and period, MACD settings, consolidation length, and volume increase percentage. The strategy is equipped with alert conditions for both entry (buy signals) and exit (set stop loss) points, facilitating both manual and automated trading.
Each one of the technical indicators, as well as the consilidation range and breakout/wick settings can be configured and enabled/disabled individually.
Please thoroughly review the available settings of the script, but here is an outline of the most important ones:
Use bar wicks (instead of open/close) - the ref_high/low will be taken based on the bar wicks, rather than the open/close when determining the breakout and MA
Enter position only on green candles - additional filters to make sure that we enter only on strong momentum
 
 MA Filter: (enable, source, type, length)   - general settings for MA filter to be checked against the stock price (close or upper wick)
 MACD Filter: (enable, source, Osc MA type, Signal MA type, Fast MA length, Slow MA length, Low MACD Hist) - detailed settings for fine MACD tuning
 Consolidation:
 Consolidation Type: we have two different ways of detecting the consolidation, note the types below. 
 CONSOLIDATION_BASIC - consolidation areas by looking for the pivot point of a trend and counts the number of bars that have not broken the consolidation high/low levels.
 CONSOLIDATIO_RANGE_PERCENT - identifies consolidation by comparing the range between the highest and lowest price points over a specified period.
So in summary the CONSOLIDATIO_RANGE_PERCENT uses a percentage-based range to define consolidation, while CONSOLIDATION_BASIC uses a count of bars within a high-low range to establish consolidation.
Thus the former is more focused on the tightness of the price range, whereas the latter emphasizes the duration of the consolidation phase.
The CONSOLIDATIO_RANGE_PERCENT might be more sensitive to recent price movements and suitable for shorter-term analysis, while CONSOLIDATION_BASIC could be better for identifying longer-term consolidation patterns.
 Min consolidation length - applicable for CONSOLIDATION_BASIC case, the min number of bars for the price to be in the range to consider consolidation
 Consolidation Loopback period - applicable for CONSOLIDATION_BASIC case, the loopback number of bars to look for consolidation
 Consolidation Range percent - applicable for CONSOLIDATIO_RANGE_PERCENT, the percent between the high and low in the range to consider consolidation
 Plot consolidation - enables plotting of the consolidation (only for debug purposes)
 Breakout: (enable, low, high) - the definition of the breakout from the previous consolidation range, the price should be between   to determine the breakout as successfull
 Upper wick: (enable, percent) - defines the percent of the upper wick compared to the whole candle to allow breakout (if the wick is too big part of the candle we can consider entering the position riskier)
 RSI: (enable, length, overbought) - general settings for RSI TA
 Volume (enbale, percentage increase, average volume filter en, loopback bars) - percentage of increase of the volume to consider for a breakout. There are two modes - percentage increase compared to  the previous bar, or percentage against the average volume for the last loopback bars.
  
Note that there are many different configuration that you can play with, and I believe this is the strength of the strategy, as it can provide a single solution for different cases and scenarios.
 My advice is to try and play with the different options for different markets based on the approach you want to implement and try turning features on/off and tuning them further.
 TTS SETTINGS (NEEDED IF USED TO BACKTEST WITH TTS): 
The TempalteTradingStrategy is a strategy script developed in Pine by jason5480, which I recommend for quick turn-around of testing different ideas on a proven and tested framework
I cannot give enough credit to the developer for the efforts put in building of the infrastructure, so I advice everyone that wants to use it first to get familiar with the concept and by checking 
by checking jason5480's profile www.tradingview.com
The TTS itself is extremely functional and have a lot of properties, so its functionality is beyond the scope of the current script - 
Again, I strongly recommend to be thoroughly explored by everyone that plans on using it.
In the nutshell it is a script that can be feed with buy/sell signals from an external indicator script and based on many configuration options it can determine how to execute the trades.
The TTS has many settings that can be applied, so below I will cover only the ones that differ from the default ones, at least according to my testing - do your own research, you may find something even better :)
The current/latest version that I've been using as of writing and testing this script is TTSv48
Settings which differ from the default ones:
 
 Deal Conditions Mode   - External                                    (take enter/exit conditions from an external script)
 🔌Signal 🛈➡          - BreakoutTrendFollowing: 🔌Signal to TTS     (this is the output from the indicator script, according to the TTS convention)
 Order Type             - STOP                                        (perform stop order)
 Distance Method        - HHLL                                        (HigherHighLowerLow - in order to set the SL according to the strategy definition from above)
 
The next are just personal preferences, you can feel free to experiment according to your trading style
 
 Take Profit Targets    - 0                                           (either 100% in or out, no incremental stepping in or out of positions)
 Dist Mul|Len Long/Short- 10                                          (make sure that we don't close on profitable trades by any reason)
 Quantity Method        - EQUITY                                      (personal backtesting preference is to consider each backtest as a separate portfolio, so determine the position size by 100% of the allocated equity size)
 Equity %               - 100                                         (note above)
SPTS_StatsPakLibFinally getting around to releasing the library component to the SPTS indicator! 
This library is packed with a ton of great statistics functions to supplement SPTS, these functions add to the capabilities of SPTS including a forecast function. 
The library includes the following functions 
 
  1. Linear Regression (single independent and single dependent)  
  2. Multiple Regression (2 independent variables, 1 dependent) 
  3. Standard Error of Residual Assessment 
  4. Z-Score 
  5. Effect Size 
  6. Confidence Interval 
  7. Paired Sample Test 
  8. Two Tailed T-Test 
  9. Qualitative assessment of T-Test 
  10. T-test table and p value assigner 
  11. Correlation of two arrays 
  12. Quadratic correlation (curvlinear) 
  13. R Squared value of 2 arrays 
  14. R Squared value of 2 floats 
  15. Test of normality 
  16. Forecast function which will push the desired forecasted variables into an array. 
 
One of the biggest added functionalities of this library is the forecasting function. 
This function provides an autoregressive, trainable model that will export forecasted values to 3 arrays, one contains the autoregressed forecasted results, the other two contain the upper confidence forecast and the lower confidence forecast. 
Hope you enjoy and find use for this! 
Library   "SPTS_StatsPakLib" 
 f_linear_regression(independent, dependent, len, variable) 
  TODO: creates a simple linear regression model between two variables.
  Parameters:
     independent (float) 
     dependent (float) 
     len (int) 
     variable (float) 
  Returns: TODO: returns 6 float variables
result: The result of the regression model
pear_cor: The pearson correlation of the regresion model
rsqrd: the R2 of the regression model
std_err: the error of residuals
slope: the slope of the model (coefficient)
intercept: the intercept of the model (y = mx + b is y = slope x + intercept)
 f_multiple_regression(y, x1, x2, input1, input2, len) 
  TODO: creates a multiple regression model between two independent variables and 1 dependent variable.
  Parameters:
     y (float) 
     x1 (float) 
     x2 (float) 
     input1 (float) 
     input2 (float) 
     len (int) 
  Returns: TODO: returns 7 float variables
result: The result of the regression model
pear_cor: The pearson correlation of the regresion model
rsqrd: the R2 of the regression model
std_err: the error of residuals
b1 & b2: the slopes of the model (coefficients)
intercept: the intercept of the model (y = mx + b is y = b1 x + b2 x + intercept)
 f_stanard_error(result, dependent, length) 
  x TODO: performs an assessment on the error of residuals, can be used with any variable in which there are residual values (such as moving averages or more comlpex models)
param x TODO: result is the output, for example, if you are calculating the residuals of a 200 EMA, the result would be the 200 EMA
dependent: is the dependent variable. In the above example with the 200 EMA, your dependent would be the source for your 200 EMA
  Parameters:
     result (float) 
     dependent (float) 
     length (int) 
  Returns: x TODO: the standard error of the residual, which can then be multiplied by standard deviations or used as is.
 f_zscore(variable, length) 
  TODO: Calculates the z-score
  Parameters:
     variable (float) 
     length (int) 
  Returns: TODO: returns float z-score
 f_effect_size(array1, array2) 
  TODO: Calculates the effect size between two arrays of equal scale.
  Parameters:
     array1 (float ) 
     array2 (float ) 
  Returns: TODO: returns the effect size (float)
 f_confidence_interval(array1, array2, ci_input) 
  TODO: Calculates the confidence interval between two arrays
  Parameters:
     array1 (float ) 
     array2 (float ) 
     ci_input (float) 
  Returns: TODO: returns the upper_bound and lower_bound cofidence interval as float values
 paired_sample_t(src1, src2, len) 
  TODO: Performs a paired sample t-test
  Parameters:
     src1 (float) 
     src2 (float) 
     len (int) 
  Returns: TODO: Returns the t-statistic and degrees of freedom of a paired sample t-test
 two_tail_t_test(array1, array2) 
  TODO: Perofrms a two tailed t-test
  Parameters:
     array1 (float ) 
     array2 (float ) 
  Returns: TODO: Returns the t-statistic and degrees of freedom of a two_tail_t_test sample t-test
 t_table_analysis(t_stat, df) 
  TODO: This is to make a qualitative assessment of your paired and single sample t-test
  Parameters:
     t_stat (float) 
     df (float) 
  Returns: TODO: the function will return 2 string variables and 1 colour variable. The 2 string variables indicate whether the results are significant or not and the colour will
output red for insigificant and green for significant
 t_table_p_value(df, t_stat) 
  TODO: This performs a quantaitive assessment on your t-tests to determine the statistical significance p value
  Parameters:
     df (float) 
     t_stat (float) 
  Returns: TODO: The function will return 1 float variable, the p value of the t-test.
 cor_of_array(array1, array2) 
  TODO: This performs a pearson correlation assessment of two arrays. They need to be of equal size!
  Parameters:
     array1 (float ) 
     array2 (float ) 
  Returns: TODO: The function will return the pearson correlation.
 quadratic_correlation(src1, src2, len) 
  TODO: This performs a quadratic (curvlinear) pearson correlation between two values.
  Parameters:
     src1 (float) 
     src2 (float) 
     len (int) 
  Returns: TODO: The function will return the pearson correlation (quadratic based).
 f_r2_array(array1, array2) 
  TODO: Calculates the r2 of two arrays
  Parameters:
     array1 (float ) 
     array2 (float ) 
  Returns: TODO: returns the R2 value
 f_rsqrd(src1, src2, len) 
  TODO: Calculates the r2 of two float variables
  Parameters:
     src1 (float) 
     src2 (float) 
     len (int) 
  Returns: TODO: returns the R2 value
 test_of_normality(array, src) 
  TODO: tests the normal distribution hypothesis
  Parameters:
     array (float ) 
     src (float) 
  Returns: TODO: returns 4 variables, 2 float and 2 string
Skew: the skewness of the dataset
Kurt: the kurtosis of the dataset
dist = the distribution type (recognizes 7 different distribution types)
implication = a string assessment of the implication of the distribution (qualitative)
 f_forecast(output, input, train_len, forecast_length, output_array, upper_array, lower_array) 
  TODO: This performs a simple forecast function on a single dependent variable. It will autoregress this based on the train time, to the desired length of output,
then it will push the forecasted values to 3 float arrays, one that contains the forecasted result, 1 that contains the Upper Confidence Result and one with the lower confidence
result.
  Parameters:
     output (float) 
     input (float) 
     train_len (int) 
     forecast_length (int) 
     output_array (float ) 
     upper_array (float ) 
     lower_array (float ) 
  Returns: TODO: Will return 3 arrays, one with the forecasted results, one with the upper confidence results, and a final with the lower confidence results. Example is given below.
LNL Trend SystemLNL Trend System is an ATR based day trading system specifically designed for intra-day traders and scalpers. The System works on any chart time frame & can be applied to any market. The study consist of two components - the Trend Line and the Stop Line. Trend System is based on a special ATR calculation that is achieved by combining the previous values of the 13 EMA in relation to the ATR which creates a line of deviations that visually look similar to the basic moving average but actually produce very different results ESPECIALLY in sideways market. 
  
 Trend Line: 
Trend Line is a simple line which is basically a fast gauge represented by the 13 EMA that can change the color based on the current trend structure defined by multiple averages (8,13,21,34 EMAs). Trend Line is there to simply add the confluence for the current trend. Colors of the line are pretty much self-explanatory. Whenever the line turns red it states that the current structure is bearish. Vice versa for green line. Gray line represents neutral market structure. 
 Stop Line: 
Stop Line is an ATR deviaton line with special calculation based on the previous bar ATRs and position of the price in relation to the current and previous values of 13 EMA. As already stated, this creates an ATR deviation marker either above or below the price that trails the price up or down until they touch. Whenever the price comes into the Stop Line it means it is making an ATR expansion move up or down .This touch will usually resolve into a reaction (a bounce) which provides trade opportunities.
 Trend Bars: 
When turned ON, Trend Bars can provide additional confulence of the current trend alongside with the Trend Line color. Trend Bars are based on the DMI and ADX indicators. Whenever the DMI is bearish and ADX is above 20 the candles paint themselfs red. And vice versa applies for the green candles and bullish DMI. Whenever the ADX falls below the 20, candles are netural (Gray) which means there is no real trend in place at the moment.
 Trend Mode: 
There are total of 5 different trend modes available. Each mode is visualizing different ATR settings which provides either aggressive or more conservative approach. The more tigher the mode, the more closer the distance between the price and the Stop Line. First two modes were designed for slower markets, whereas the "Loose" and "FOMC" modes are more suitable for products with high volatility.
 Trend Modes: 
 1. Tight  
Ideal for the slowest markets. Slowest market can be any market with unusually small average true range values or just simply a market that does have a personality of a "sleeper". Tight Mode can be also used for aggresive entries in the most ridiculous trends. Sometimes price will barely pullback to the Trend Line not even the Stop Line.
 2. Normal  
Normal Mode is the golden mean between the modes. "Normal" provides the ideal ATR lengths for the most used markets such as S&P Futures (ES) or SPY, AAPL and plenty of other highly popular stocks. More often than not, the length of this mode is respected considering there is no breaking news or high impact market event scheduled.
 3. Loose  
The "Loose" mode is basically a normal mode but a little bit more loose. This mode is useful whenever the ATRs jump higher than usual or during the days of highly anticipated news events. This mode is also better suited for more active markets such as NQ futures.
 4. FOMC  
The FOMC mode is called FOMC for a reason. This mode provides the maximum amount of wiggle room between the price and the Stop Line. This mode was designed for the extreme volatility, breaking news events or post-FOMC trading. If the market quiets down, this mode will not get the Stop Line touch as frequently as othete modes, thus it is not very useful to run this on markets with the average volatlity. Although never properly tested, perhaps the FOMC mode can find its value in the crypto market?
 5. The Net 
The net mode is basically a combination of all modes into one stop line system which creates "the net" effect. The Net provides the widest Stop Line zone which can be mainly appreciated by traders that like to use scale-in scale-out methods for their trading. Not to mention the visual side of the indicator which looks pretty great with the net mode on.
  
 HTF (Higher Time Frame) Trend System: 
The system also includes additional higher time frame (HTF) trend system. This can be set to any time frame by manual HTF mode. HTF mode set to "auto" will automatically choose the best suitable higher time frame trend system based on how appropriate the aggregation is. For everything below 5min the HTF Trend System will stay on 5min. Anything between 5-15min = 30min. 30min - 120min will turn on the 240min. 180min and higher will result in Daily time frame. Anything above the Daily will result in Weekly HTF aggregation, above W = Monthly, above M = Quarterly.
  
 Background Clouds: 
In terms of visualization, each trend system is fully customizable through the inputs settings. There is also an option to turn on/off the background clouds behind the stop lines. These clouds can make the charts more clean & visible. 
  
 Tips & Tricks: 
 1. Different Trend Modes 
Try out different modes in different markets. There is no one single mode that will fit to everyone on the same type of market. I myself actually prefer more Loose than the Normal.
 2. Stop Line Mirroring 
Whenever the Stop Lines start to mirror each other (there is one above the price and one below) this means the price is entering a ranging sideways market. It does not matter which Stop Line will the price touch first. They can both be faded until one of them flips.
 3. Signs of the Ranging Market 
Watch out for signs of ranging market. Whenever the Trend System looses its colors whether on trend line or trend bars, if everything turns neutral (gray) that is usually a solid indication of a range type action for the following moments. Also as already stated before, the Stop Line mirroring is a good sign of the range market.
 4. Trailing Tool, Trend System as an Additional Study? 
In case you are not a fan of the colorful green / red charts & candles. You can switch all of them off and just leave the Stop Line on. This way you can use the benefits of the trend system and still use other studies on top of that. Similarly as the Parabolic SAR is often used.
 5. The Flip Setup 
One of my favorite trades is the Flip Setup on the 5min charts. Whenever the Stop Line is broken , the very first opposing touch after the Trend System flips is a usually a highly participated touch. If there is a strong reaction, this means this is likely a beginning of a new trend. Once I am in the position i like to trail the Stop Line on the 1min charts.
  
Hope it helps.
MOST + Moving Average ScreenerScreener version of Anıl Özekşi's Moving Stop Loss (MOST) Indicator:
USERS MAY SCREEN MOST WITH 11 DIFFERENT TYPES OF MOVING AVERAGES + THEY CAN ALSO SCREEN SIGNALS  WITH THAT 11 MOVING AVERAGES INSTEAD OF USING MOST LINE.
Adjustable Moving Average Types:
SMA : Simple Moving Average
EMA : Exponential Moving Average
WMA : Weighted Moving Average
DEMA : Double Exponential Moving Average
TMA : Triangular Moving Average
VAR : Variable Index Dynamic Moving Average aka VIDYA
WWMA : Welles Wilder's Moving Average
ZLEMA : Zero Lag Exponential Moving Average
TSF : True Strength Force
HULL : Hull Moving Average
TILL : Tillson T3 Moving Average
About Screener Panel:
Users can explore 20 different and user-defined tickers, which can be changed from the SETTINGS (shares, crypto, commodities...) on this screener version.
The screener panel shows up right after the bars on the right side of the chart.
-In this screener version of MOST, users can define the number of demanded tickers (symbols) from 1 to 20 by checking the relevant boxes on the settings tab.
-All selected tickers can be screened in different timeframes.
-Also, different timeframes of the same Ticker can be screened.
 IMPORTANT NOTICE:
 
Screener shows the results in 3 different logic:
 
1st LOGIC (Default Settings): 
BUY AND SELL SIGNALS of MOST and MOVING AVERAGE LINE
Most Buy Signal: Moving Average Crosses ABOVE the MOST LINE
Most Sel Signal: Moving Average Crosses BELOW the MOST LINE
Tickers seen in green are the ones that are in an uptrend, according to MOST.
The ones that appear in red are those in the SELL signal, in a downtrend.
The numbers before each Ticker indicate how many bars passed after MOST's last BUY or SELL signal.
For example, according to the indicator, when BTCUSDT appears (3) in GREEN, Bitcoin switched to a BUY signal 3 bars ago.
 2nd LOGIC (Moving Average & Price Flips Screener Mode): 
 This mode can only be activated by checking the 'Activate Moving Average Screening Mode' box on the settings menu. 
 MOST line will be disappeared after checking the box. 
Buy Signal: When the Selected Price crosses ABOVE the selected Moving Average. 
Sell Signal: When the Selected Price crosses BELOW the selected Moving Average. 
Tickers seen in green are the ones that are in an uptrend, according to Moving Average & Price Flips.
The ones that appear in red are those in the SELL signal, in a downtrend.
The numbers before each Ticker indicate how many bars passed after the last BUY or SELL signal of Moving Average & Price Flips.
For example, according to the indicator, when BTCUSDT appears (3) in GREEN, Bitcoin switched to a BUY signal 3 bars ago.
 3rd LOGIC (Moving Average Color Change Screener Mode): 
 Both 'Activate Moving Average Screening Mode' and 'Activate Moving Average Color Change Screening Mode' boxes must be checked in the settings tab. 
 Moving Average Line will turn out into two colors. 
Green color means the moving average value is greater than the previous bar's value.
Red color means the moving average value is smaller than the previous bar's value.
Buy Signal: After the Selected Moving Average turns GREEN from red.
Sell Signal: After the Selected Moving Average turns RED from green.
-Screener shows the information about the color changes of the selected Moving Average with default settings.
If this option is preferred, users are advised to enlarge the length to have better signals.
Tickers seen in green are the ones that are in an uptrend, according to Moving Average Color.
The ones that appear in red are those in the SELL signal, in a downtrend.
The numbers before each Ticker indicate how many bars passed after the last BUY or SELL signal of Moving Average Color Change.
For example, according to the indicator, when BTCUSDT appears (3) in GREEN, Bitcoin switched to a BUY signal 3 bars ago.






















