Multi SMA EMA WMA HMA BB (4x5 MAs Bollinger Bands) Adv MTF - RRBMulti SMA EMA WMA HMA 4x5 Moving Averages with Bollinger Bands Advanced MTF by RagingRocketBull 2019
Version 1.0
This indicator shows multiple MAs of any type SMA EMA WMA HMA etc with BB and MTF support, can show MAs as dynamically moving levels.
There are 4 MA groups + 1 BB group, a total of 4 TFs * 5 MAs = 20 MAs. You can assign any type/timeframe combo to a group, for example:
- EMAs 12,26,50,100,200 x H1, H4, D1, W1 (4 TFs x 5 MAs x 1 type)
- EMAs 8,10,13,21,30,50,55,100,200,400 x M15, H1 (2 TFs x 10 MAs x 1 type)
- D1 EMAs and SMAs 8,10,12,26,30,50,55,100,200,400 (1 TF x 10 MAs x 2 types)
- H1 WMAs 7,77,89,167,231; H4 HMAs 12,26,50,100,200; D1 EMAs 89,144,169,233,377; W1 SMAs 12,26,50,100,200 (4 TFs x 5 MAs x 4 types)
- +1 extra MA type/timeframe for BB
There are several versions: Simple, MTF, Pro MTF, Advanced MTF and Ultimate MTF. This is the Advanced MTF version. The Differences are listed below. All versions have BB
- Simple: you have 2 groups of MAs that can be assigned any type (5+5)
- MTF: +2 custom Timeframes for each group (2x5 MTF) +1 TF for BB, TF XY smoothing
- Pro MTF: 4 custom Timeframes for each group (4x3 MTF), 1 TF for BB, MA levels and show max bars back options
- Advanced MTF: +2 extra MAs/group (4x5 MTF), custom Ticker/Symbols, Timeframe <>= filter, Remove Duplicates Option
- Ultimate MTF: +individual settings for each MA, custom Ticker/Symbols
Features:
- 4x5 = 20 MAs of any type
- 4x MTF groups with XY step line smoothing
- +1 extra TF/type for BB MAs
- 4x5 = 20 MA levels with adjustable group offsets, indents and shift
- supports any existing type of MA: SMA, EMA, WMA, Hull Moving Average (HMA)
- custom tickers/symbols for each group - you can compare MAs of the same symbol across exchanges
- show max bars back option
- show/hide both groups of MAs/levels/BB and individual MAs
- timeframe filter: show only MAs/Levels with TFs <>= Current TF
- hide MAs/Levels with duplicate TFs
- support for custom TFs that are not available in free accounts: 2D, 3D etc
- support for timeframes in H: H, 2H, 4H etc
Notes:
- Uses timeframe textbox instead of input resolution dropdown to allow for 240 120 and other custom TFs
- Uses symbol textbox instead of input symbol to avoid establishing multiple dummy security connections to the current ticker - otherwise empty symbols will prevent script from running
- Possible reasons for missing MAs on a chart:
- there may not be enough bars in history to start plotting it. For example, W1 EMA200 needs at least 200 bars on a weekly chart.
- price << default Y smoothing step 5. For charts with low/fractional prices (i.e. 0.00002 << 5) adjust X Y smoothing as needed (set Y = 0.0000001) or disable it completely (set X,Y to 0,0)
- TradingView Replay Mode UI and Pinescript security calls are limited to TFs >= D (D,2D,W,MN...) for free accounts
- attempting to plot any TF < D1 in Replay Mode will only result in straight lines, but all TFs will work properly in history and real-time modes. This is not a bug.
- Max Bars Back (num_bars) is limited to 5000 for free accounts (10000 for paid), will show error when exceeded. To plot on all available history set to 0 (default)
- Slow load/redraw times. This indicator becomes slower, its UI less responsive when:
- Pinescript Node.js graphics library is too slow and inefficient at plotting bars/objects in a browser window. Code optimization doesn't help much - the graphics engine is the main reason for general slowness.
- the chart has a long history (10000+ bars) in a browser's cache (you have scrolled back a couple of screens in a max zoom mode).
- Reload the page/Load a fresh chart and then apply the indicator or
- Switch to another Timeframe (old TF history will still remain in cache and that TF will be slow)
- in max possible zoom mode around 4500 bars can fit on 1 screen - this also slows down responsiveness. Reset Zoom level
- initial load and redraw times after a param change in UI also depend on TF. For example:
D1/W1 - 2 sec, H1/H4 - 5-6 sec, M30 - 10 sec, M15/M5 - 4 sec, M1 - 5 sec.
M30 usually has the longest history (up to 16000 bars) and W1 - the shortest (1000 bars).
- when indicator uses more MAs (plots) and timeframes it will redraw slower. Seems that up to 5 Timeframes is acceptable, but 6+ Timeframes can become very slow.
- show_last=last_bars plot limit doesn't affect load/redraw times, so it was removed from MA plot
- Max Bars Back (num_bars) default/custom set UI value doesn't seem to affect load/redraw times
- In max zoom mode all dynamic levels disappear (they behave like text)
1. based on 3EmaBB, uses plot*, barssince and security functions
2. you can't set certain constants from input due to Pinescript limitations - change the code as needed, recompile and use as a private version
3. Levels = trackprice implementation
4. Show Max Bars Back = show_last implementation
5. swma has a fixed length = 4, alma and linreg have additional offset and smoothing params
6. Smoothing is applied by default for visual aesthetics on MTF. To use exact ma mtf values (lines with stair stepping) - disable it
Good Luck! You can explore, modify/reuse the code to build your own indicators.
ابحث في النصوص البرمجية عن "黄金近20年走势"
ADX +- DiThis Adx +-Di is just a complete version of what the ADX is supposed to signal.
So you have:
15 (contraction), 20 (threshold), 30 (expansion), 40 (resistance) levels.
Below 20 the price is not trending
Above 30 the price is trending
Below 15 price has been in contraction for too long
Between 20 and 30 price is in a "transition zone".
I finally added a "Resistance" level (40), which has to be adapted to best represent the historical levels where price usually encounters resistance, and where the price can be declared "overtrending", which means a return to lower levels is likely to happen.
I've chosen mild colors, and set the Adx Color to White, because I use black background, you can easily change that.
Enjoy
-Maurice
Average Directional Index with DI SpreadThis indicator converts conventional triple lined ADX, DI+ and DI- into two lines. First line is the
original ADX line and second line is obtained by subtracting DI- from DI+ which named DI Spread(DIS)
If ADX is greater than 20 there is a trend and if greater than 40 there is a strong trend but ADX does not tell
the trend direction
To determine trend direction, DIS can be used with ADX; Sımply; If DIS is greater than 0, it is an uptrend and If DIS
is less than 0, it is a downtrend.
To sum up;
If ADX is greater than 20 and especially greater than 40 with positive DIS value, this implies an uptrend.
If ADX is greater than 20 and especially greater than 40 with negative DIS value, this implies a downtrend.
*Because of coloration and reference levels used, this indicator is really simple and efficient to analyze trend direction.
MFI Multi-TimeframeThe Money Flow Index (MFI) is an oscillating momentum and market strength indicator that was developed by Gene Quong and Avrum Soudack. It is also a leading indicator, which means it tends to lead price action, and is similar in calculation as J. Welles Wilder's Relative Strength Index (RSI) with the significant difference being that the MFI uses both price and volume. Like the RSI, the MFI is a range-bound oscillator that oscillates between zero and 100 and is interpreted in a similar way as the RSI. The ultimate aim of the MFI is to determine whether money is flowing in or out of a security over a specified look-back period.
HOW IS IT USED ?
The MFI oscillates between 0 and 100 and a security is considered overbought when its MFI rises above 80 and oversold when its MFI falls below 20. These levels are the suggested overbought and oversold levels as suggested by Quong and Soudack, though they do not suggest these levels as entry signals. Instead, these caution levels warn that the price action and the current trend have reached extremes that may be unsustainable. Quong and Soudack also recommend using the 90 and 10 lines as truly overbought and truly oversold levels respectively. MFI movements above 90 and below 10 are rare and indicate a higher level of unsustainability.
Finally, failure swings from the 20 or 80 levels can also be used to identify potential price reversals and trade entries. A failure swing occurs when the MFI moves over the overbought or oversold level but reverses back before reaching the opposite level. Thus, when the MFI crosses up over the 20 (oversold) level but reverses before it reaches the 80 (overbought) level, it indicates that the uptrend is weak and that it may reverse soon. This signals that you should cover any long positions or go short. Similarly, when the MFI crosses down over the 80 (overbought) level but reverses before it reaches the 20 (oversold) level, it indicates a weakness in the down trend and the probability that the trend will reverse. This would be a signal to close of any short positions; or a signal to long buy.
I added the possibility to add on the chart a 2nd timeframe for confirmation.
If you found this script useful, a tip is always welcome... :)
Exponential Moving Average (Set of 3) [Krypt] + 13/34 EMAsI took Krypt's script and essentially added on to it.
the 20/50/100/200 EMAs should be used together as support and resistance as normal.
Wait for price to break 200 EMA
Wait for 50 EMA to cross 200 EMA
Wait for pullback to 50 EMA to open position
20 and 100 EMAs are for extra information about moving support and resistance
and 13/34 EMAs should be used in conjunction
When 13 EMA crosses 34 EMA, open position
When price gets far from 13/34, close position (because price will attempt to revert back to mean)
This is better for scalping and swing trades than the 20/50/100/200 setup.
Twitter: @AzorAhai06
Gap Gain Test V1.0 by @overratedtraderOddball indicators for entertainment purposes only. This is best used on daily chart.
Look at the 20 ALMA to gauge likelihood of stock following its up or down gap.
- if above the 20 ALMA , follow the gap direction
- if below the 20 ALMA , take counter trend trade
If stock gaps up AND closes higher than it opens, that gain % (close/open) is colored green and if stock gaps down and closes lower than it opens, that gain % (close/open) is colored green
Conversely if the stock gaps up BUT closes lower than it opens, red and if a stop gaps down but closes higher than it opens, red.
Enjoy and follow me on twitter @overratedtrader for more nonsensical and out-of-the-box ideas.
Adaptive Donchian ChannelThis indicator adds a level of adaptivity to the simple Donchian Channel by adjusting the sensitivity (lookback periods) of the channel's upper and lower bounds based on the amount of time that has elapsed since the price has hit/expanded the channel boundaries. Comparing the results of this indicator to the standard Donchian Channel, the readier level of responsiveness may prove self-evident.
METHODOLOGY:
Specifically, the more recently the channel was expanded in one direction, the longer the lookback period grows in that direction. Conversely, if the channel has not been expanded in a given direction, the lookback period will contract so as to allow for a tighter channel.
For example, let the initial lookback period be 20 bars and let the factor argument be 0.1 (or 2 bars to start, as 20*0.1 = 2). Now say the current bar sets a new 20-period high. Then the lookback period for the upper bound is expanded by 2 bars to 22, and the lookback period for the lower bound is contracted by 2 bars to 18, thereby making it simultaneously harder to set new highs and easier to set new lows (and vice versa for hitting new lows). If neither a new high nor a new low is formed, both periods contract by the given factor.
TonyUX EMA Scalper - Buy / SellThis is a simple scalping strategy that works for all time frames... I have only tested it on FOREX
It works by checking if the price is currently in an uptrend and if it crosses the 20 EMA.
If it crosses the 20 EMA and its in and uptrend it will post a BUY SIGNAL.
If it crosses the 20 EMA and its in and down it will post a SELL SIGNAL.
The red line is the highest close of the previous 8 bars --- This is resistance
The green line is the lowest close of the previous 8 bars -- This is support
EMA_ConvergenceFirst I have to give kudos to my son who I asked to take a shot at creating this little indicator. Nice work son!
While trading, one of the things I look for is when price or certain EMA's approach another EMA. The example that I use on this 1 minute SPY chart is an 8 EMA and 20 EMA. I am looking for when the 8 and 20 are within' 3 cents of each other. Many times when they are getting close, price is approaching a top or bottom. I am looking for a candlestick reversal around that area. You may want to know when PRICE is near the 50 EMA: Use EMA 1 and 50 for that. Having it light up on top of the page, or elsewhere, makes it easier to look for the convergence when it occurs. If it lights up for a long period, price may be going sideways. I don't enter into a trade until the EMA starts separating, usually with another candlestick formation.
You are able to change the distance for convergence and two EMA's. Unfortunately you will have to adjust the convergence number up as you increase in time frames. This is designed to see when they are close, not when they cross.
The bars on top of this example are lit up purple due to the 8 and 20 EMA are within' 3 cents of each other.
If you want to overlay the price bars, instead of having it separate, just change overlay to "true"
Enjoy.
FC Session & Levels: Killzone, FVG, BB, OB, MAs, VWAP, Zizag FibFC Session & Levels – Ultimate Multi-Tool Trading Indicator
All-in-one professional-grade indicator combining session analysis, key levels, institutional concepts, and trend tools for futures, forex, crypto, and stocks.
Core Features
Real-time Session High/Low tracking for Asia, London, NY AM/PM, MOC
Dynamic Daily Pivot Points with R1–R3 / S1–S3 levels
Configurable Opening Range Breakout (ORB) 15-min high/low from NY open
Smart VWAP, EMA/SMA crosses, Trend Cloud (EMA38/62)
CHoCH (Change of Character) detection with dotted breakout lines
Fair Value Gaps (FVG) with volume & ATR filtering
Advanced ZigZag + Fibonacci Retracement/Extension levels
Institutional Order Blocks & Breaker Blocks with mitigation tracking
How to Use – Step-by-Step Instructions
1. Add to Chart
Open TradingView → Indicators → Search " FC Session & Levels "
Add to any chart (works on all timeframes, best on 1m–1H)
2. Configure Time Zone
Set Time Zone to UTC-5 (Standard Time) or UTC-4 (Daylight Saving)
NYT sessions auto-adjust
3. Enable Sessions
Toggle: Asia, London, NY AM, NY PM, MOC
Each draws high/low lines + optional labels
Colors fully customizable
4. Pivot & Pre-Market Levels
Daily Pivot (PP) + R1–R3 / S1–S3 auto-calculated
Pre-Day High/Low (purple) & Pre-Week High/Low (blue)
Daily Open line (cyan)
Extend future lines with Extend Future
5. Opening Range Breakout (ORB)
Enable ORB 15min High/Low
Set start: 9:30 AM , end: 9:45 AM (NYT)
Lines extend ± N bars (default 5)
Great for breakout entries
6. VWAP & Moving Averages
Toggle VWAP , MA9/20 cross , MA50/100/200
Trend Cloud : EMA38 (fast) vs EMA62 (slow) → bullish/bearish fill
7. CHoCH – Change of Character
Detects swing breaks with 20-bar lookback
Draws dotted line from swing point to breakout
Labels: "CHoCH" in green (bull) or red (bear)
8. Fair Value Gaps (FVG)
Detects gaps > 0.5× ATR with volume > 1.2× avg
Draws semi-transparent boxes + midline
Max 10 FVGs , auto-expire after 50 bars
9. ZigZag + Fibonacci
ZigZag period: 15 (adjustable)
Auto-draws 0.236, 0.382, 0.5, 0.618, 0.786 levels
Labels show ratio + price
Extends to right on last leg
10. Order Blocks & Breaker Blocks
Detects institutional zones using swing + volume
Filters by size (0–30%) and volume multiplier
Shows last 5 Bull / 5 Bear OBs
Breaker Blocks : when OB is broken → becomes supply/demand
Mitigation tracking : 50%, Close, or Wick
Strength score (0–100) → stronger = bolder color
11. Statistics Dashboard
Toggle Show Statistics Table
Displays: Total OBs, Breakers, Bull/Bear counts
Position: Top/Bottom, Left/Right
12. Alerts
Bullish OB Formation
Bearish OB Formation
Breaker Block Formation
Polarity Change (▲/▼)
Best Practices & Tips
Use on 1m, 3m, 5m, 15m for intraday
Combine ORB + CHoCH for high-probability breakouts
Wait for FVG retest in direction of trend
Strong OBs (>70 strength) = high confluence zones
Use Pre-Week H/L for weekly bias
MOC session (15:50–16:00) = final 10min imbalance
Customization Options
Colors : All lines, boxes, labels
Opacity : Pivot (0–100%), FVG, OB
Line Width : OB/Breaker lines
Display Mode : Boxes, Lines, or Both
Labels : Session, FVG, CHoCH, Polarity
Author : futurescall @ fcalgobot.com . discord.gg
Credit: @LuxAlgo for BB, OB . Zigzag base on @LonesomeTheBlue
Market Breadth - [JTCAPITAL]Market Breadth - is a comprehensive crypto market strength and sentiment indicator designed to visualize the overall bullish or bearish alignment across 40 major cryptocurrencies. By combining multi-asset Exponential Moving Average (EMA) comparisons and smoothing techniques, it offers a clean, aggregated view of the broader market trend—helping traders quickly assess whether the market is dominated by bullish momentum or bearish pressure.
The indicator works by calculating in the following steps:
Symbol Selection and Data Retrieval
The script monitors 40 leading cryptocurrencies based on Market Cap. Each asset’s daily close price is requested using a 1D timeframe. This ensures that every data point reflects the same temporal resolution, allowing the indicator to evaluate global crypto strength rather than individual token volatility.
EMA Comparison per Asset
For each asset, two Exponential Moving Averages (EMAs) are calculated:
A short-term EMA with period emalength (default 10).
A long-term EMA with period emalength2 (default 20).
Each coin receives a score of +1 when the short-term EMA is greater than the long-term EMA (indicating bullish structure), or -1 when it is below (indicating bearish structure). This binary scoring system effectively converts individual price action into a directional sentiment measure.
Market Breadth Aggregation
All 40 individual scores are summed into a single composite value called scores .
If many assets have bullish EMA alignment, the total score becomes strongly positive.
If the majority show bearish alignment, the total score turns negative.
This step transforms scattered price data into one unified market breadth metric—quantifying how many assets participate in the same directional trend.
Smoothing the Breadth Line
To reduce short-term noise and isolate trend direction, the aggregated score is smoothed using an EMA of length = smoothlen (default 15). The resulting smoothed line helps identify sustained shifts in collective sentiment rather than temporary fluctuations.
Visualization and Color Coding
When scores > 0 , the market breadth is bullish and the histogram is colored blue.
When scores < 0 , the breadth turns bearish and the histogram is purple.
The same logic applies to the smoothed line and background color, offering an instant visual cue of market mood transitions.
Buy and Sell Conditions:
The indicator itself does not trigger direct buy/sell signals but rather acts as a market regime filter . Traders can use it as follows:
Buy Filter: When the smoothed value is above zero and rising, the majority of assets confirm an uptrend — this favors long setups or trend continuation entries.
Sell Filter: When the smoothed value is below zero and falling, bearish alignment dominates — ideal for short setups or defensive risk management.
Optional filters could include combining this with RSI or volume-weighted momentum indicators to confirm breadth-based reversals.
Features and Parameters:
emalength – Defines the short-term EMA length used for individual asset trend detection (default 10).
emalength2 – Defines the long-term EMA length (default 20).
smoothlen – Defines the smoothing EMA length for the total market breadth line (default 15).
40 asset inputs – User-editable symbols allow full customization of which cryptos are tracked.
Dynamic color backgrounds – Visual distinction between bullish and bearish phases.
Specifications:
Exponential Moving Average (EMA)
EMA is a type of moving average that places more weight on recent price data, responding faster to market changes compared to SMA. By comparing a short-term and long-term EMA, the indicator captures momentum shifts across each asset individually. The crossover logic (EMA10 > EMA20) signals bullish conditions, while the opposite indicates bearish momentum.
Market Breadth
Market Breadth quantifies how many assets are participating in a directional move. Instead of tracking a single coin’s trend, breadth analysis measures collective sentiment. When most coins’ short-term EMAs are above long-term EMAs, the market shows healthy bullish breadth. Conversely, when most are below, weakness dominates.
Smoothing (EMA on Scores)
After summing the breadth score, the result is smoothed with an additional EMA to mitigate the inherent volatility caused by individual coin reversals. This second-level smoothing transforms raw fluctuations into a readable, trend-consistent curve.
Color Visualization
Visual cues are integral for intuitive interpretation.
Blue Shades: Indicate bullish alignment and collective upward momentum.
Purple Shades: Indicate bearish conditions and potential risk-off phases.
The background tint reinforces visual clarity even when the indicator is overlaid on price charts.
Background Logic
By applying the same color logic to the chart’s background, users can instantly recognize the prevailing market phase.
Use Cases
As a trend confirmation filter for other indicators (e.g., trade only in the direction of positive breadth).
As a divergence tool : when price rises but breadth weakens, it may signal a topping market.
As a macro sentiment monitor : perfect for assessing when the crypto market as a whole transitions from bearish to bullish structure.
Summary
“ Market Breadth - ” transforms the chaotic price movements of 40 cryptocurrencies into a single, powerful visual representation of overall market health. By merging EMA cross analysis with market-wide aggregation and smoothing , it provides traders with a deep understanding of when bullish or bearish forces dominate the ecosystem.
It’s a clean, data-driven approach to identifying shifts in crypto market sentiment — a perfect companion for trend-following, macro analysis, and timing portfolio exposure.
Enjoy!
Easy [CHE] Easy — Minimalist Pine Script for detecting EMA direction changes to define fixed price zones for simple support and resistance visualization, ideal for manual trading workflows.
Summary
This indicator's programming is kept minimalist and super simple, with core logic in under 20 lines for easy comprehension and modification. It creates fixed price zones based on divergences between a base exponential moving average and its smoother counterpart, helping traders spot potential consolidation or reversal areas without dynamic adjustments. By locking the zone at the high and low of the signal bar, it avoids over-expansion in volatile conditions, offering a stable reference line colored by price position relative to the zone. This approach differs from expanding channels by prioritizing simplicity and persistence until a new qualifying signal, reducing visual clutter while highlighting directional bias through midpoint coloring.
Motivation: Why this design?
Traders often face noisy signals from moving averages that flip frequently in sideways markets or lag during breakouts, leading to premature entries or missed opportunities. This indicator addresses that by focusing on confirmed direction shifts between the base and smoothed averages, then anchoring a non-expanding zone to capture the initial price range of the shift. The result is a cleaner tool for marking equilibrium levels, assuming price respects these bounds in ranging or mildly trending conditions.
What’s different vs. standard approaches?
- Reference baseline: Traditional moving average crossovers or simple channels that update every bar.
- Architecture differences:
- Zones are set only on new divergence signals and remain fixed until reset by a gap from the prior zone.
- No ongoing high-low expansion; relies on persistent variables to hold bounds across bars.
- Midpoint plotting with conditional coloring based on close position, plus a highlight for zone initiations.
- Practical effect: Charts show persistent horizontal references instead of drifting lines, making it easier to gauge if price is rejecting or embracing the zone—useful for avoiding false breaks in low-volatility setups.
How it works (technical)
The indicator first computes a base exponential moving average of closing prices over a user-defined length, then applies a second exponential moving average to smooth that base. It checks if both the base and smoothed values are increasing or decreasing compared to their prior values, indicating aligned direction. A signal triggers when this alignment breaks, marking a potential shift.
On a new signal, if the current bar's high and low fall outside any existing zone (or none exists), the zone bounds update to those extremes and persist via dedicated variables. The midpoint of these bounds becomes the primary plot line, colored green if below the close (bullish lean), red if above (bearish lean), or gray otherwise. A secondary thick line highlights the midpoint briefly when a zone first sets, aiding visual confirmation. No higher timeframe data or external fetches are used, so updates occur on each bar close without lookahead.
Parameter Guide
EMA Length — Sets the period for the base moving average; longer values smooth more, reducing signal frequency but increasing lag. Default: 50. Trade-offs/Tips: Shorter for faster response in intraday charts (risks noise); longer for daily trends (may miss early shifts).
Smoother Length — Defines the period for the secondary smoothing on the base average; higher values dampen minor wiggles for stabler direction checks. Default: 3. Trade-offs/Tips: Keep low (2–5) for sensitivity; increase to 7+ if zones trigger too often in choppy markets, at cost of delayed signals.
Reading & Interpretation
The main circle plot at the zone midpoint serves as a dynamic equilibrium line: green suggests price is above the zone (potential strength), red indicates below (potential weakness), and gray shows containment within bounds (neutral consolidation). A sudden thick foreground line at the midpoint flags a fresh zone start, prompting review of the prior bar's context. Absence of a plot means no active zone, implying reliance on price action alone until the next signal.
Practical Workflows & Combinations
- Trend following: Enter long on green midpoint after a higher low touches the zone lower bound, confirmed by structure like higher highs; filter shorts similarly on red with lower highs.
- Exits/Stops: Use the opposite zone bound as a conservative stop (e.g., below lower for longs); trail aggressively to midpoint on strong moves, tightening near gray neutrality.
- Multi-asset/Multi-TF: Defaults work across forex and stocks on 1H–Daily; for crypto volatility, shorten EMA Length to 20–30. Pair with volume oscillators for confirmation, avoiding isolated use.
Behavior, Constraints & Performance
- Repaint/confirmation: Plots update on bar close using historical closes, so confirmed signals hold; live bars may shift until close but without future references.
- security()/HTF: Not used, eliminating related repaint risks.
- Resources: Minimal overhead—no loops, arrays, or bar limits exceeded; suitable for real-time on any timeframe.
- Known limits: Fixed zones may lag in strong trends (price drifts away without reset); signals skip if no gap from prior zone, potentially missing clustered shifts. Assumes standard OHLC data; untested on non-equity assets.
Sensible Defaults & Quick Tuning
Start with EMA Length at 50 and Smoother Length at 3 for balanced daily charts. If signals fire too frequently (e.g., in ranges), extend EMA Length to 100 for fewer but stabler zones. For sluggish response in trends, drop Smoother Length to 2 and EMA Length to 30, monitoring for added noise. In high-vol setups, widen both to 75/5 to filter extremes, trading speed for reliability.
What this indicator is—and isn’t
This is a lightweight visualization layer for EMA-driven zones, aiding manual chart reading and basic signal spotting. It is not a standalone system, predictive model, or automated alert generator—integrate with broader analysis like market structure and risk rules. (Unknown/Optional: No built-in alerts or multi-timeframe scaling.)
Disclaimer
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Do not use this indicator on Heikin-Ashi, Renko, Kagi, Point-and-Figure, or Range charts, as these chart types can produce unrealistic results for signal markers and alerts.
Best regards and happy trading
Chervolino
My script//@version=5
indicator("ICP Análise Completa", overlay=true)
// Médias Móveis
ma50 = ta.sma(close, 50)
ma200 = ta.sma(close, 200)
plot(ma50, title="MA 50", color=color.blue, linewidth=2)
plot(ma200, title="MA 200", color=color.red, linewidth=2)
// Bollinger Bands
bb_middle = ta.sma(close, 20)
bb_std = ta.stdev(close, 20)
bb_upper = bb_middle + 2 * bb_std
bb_lower = bb_middle - 2 * bb_std
plot(bb_upper, title="BB Upper", color=color.green)
plot(bb_middle, title="BB Middle", color=color.gray)
plot(bb_lower, title="BB Lower", color=color.green)
// RSI
rsi = ta.rsi(close, 14)
rsiOverbought = 70
rsiOversold = 30
hline(rsiOverbought, "RSI Overbought", color=color.red)
hline(rsiOversold, "RSI Oversold", color=color.green)
plot(rsi, title="RSI", color=color.purple, linewidth=2, title="RSI (14)", display=display.none)
// MACD
= ta.macd(close, 12, 26, 9)
plot(macdLine, title="MACD Line", color=color.teal, linewidth=2)
plot(signalLine, title="Signal Line", color=color.orange, linewidth=2)
// Alertas visuais
plotshape(close > 7, title="Alvo US$7+", location=location.abovebar, color=color.green, style=shape.labelup, text=">7")
plotshape(close < 5, title="Abaixo US$5", location=location.belowbar, color=color.red, style=shape.labeldown, text="<5")
Avg % Move Dashboard — Body and WicksTitle
Avg % Move Dashboard — Body and Wicks (w/ True Range)
Summary
Compact right-side dashboard showing the average percent move of recent candles:
Body size (absolute % from Open to Close)
Body bias (signed %, with up/down arrow and color)
Full range (High–Low %)
True range (ATR-style % relative to previous close)
Perfect for quickly gauging current market velocity and directional skew on any symbol or timeframe.
How It Works
Body % (per bar): (Close − Open) / Open × 100
Full range % (per bar): (High − Low) / Open × 100
True range % (per bar): max(High−Low, |High−PrevClose|, |Low−PrevClose|) / PrevClose × 100
Averages: Simple moving averages over the last N candles
Rounding: Values rounded to your chosen decimals
Bias row: shows signed average body percent with an ↑/↓ arrow and green/red color; near-zero values can display a neutral ⟷ based on a threshold
Settings
Candles to average (default 20): Window length for SMA calculations.
Decimals: Rounding precision for display.
Dashboard position: Top/Middle/Bottom Right.
Dashboard size: Tiny, Small, Normal, Large, Huge.
Background Color: Panel background.
Text Color (size rows): For non-bias rows.
Near-zero threshold (%): If the average body bias absolute value is below this, show neutral (⟷) instead of bullish/bearish.
What to show (toggles):
Show Body (Open→Close)
Show Full Range (High→Low)
Show True Range (ATR-style)
What You’ll See
Body size: average absolute body percent (magnitude only).
Body bias: average signed body percent with:
↑ and green if bullish
↓ and red if bearish
⟷ and gray if within the near-zero threshold
Full Range: average percent from High to Low.
True Range: average percent true range relative to previous close.
Footer: n = number of candles used.
How to Use
Add to any chart and timeframe; it overlays a table on the right-side.
Use “Body size” to assess typical candle strength.
Use “Body bias” to see directional skew:
Strong positive = persistent buying pressure.
Strong negative = persistent selling pressure.
Near-zero = balanced/sideways conditions.
Compare “Full range” vs “Body size”:
Large range but small body may indicate indecision or wicky conditions.
“True range” offers a classic ATR-style read (relative to prior close), useful for volatility-aware sizing.
Adjust “Candles to average” to your timeframe:
Short-term (scalps): 20–50
Intraday: 50–100
Swing: 100–200+
Best Practices
Pair with structure (S/R, sessions) to avoid false impressions in thin markets.
Increase length on noisy pairs/timeframes to smooth out noise.
Use the near-zero threshold to suppress micro-bias and focus on meaningful shifts.
Alerts
This dashboard is informational and doesn’t define alertconditions in the code. If you’d like, I can add optional alerts (e.g., bias flips from bearish to bullish beyond threshold, or volatility spikes on TR) — just say the word.
Limitations
This panel summarizes recent averages; it’s not a signal generator.
Values can differ across assets/timeframes; tune “Candles to average.”
True Range uses prev close normalization; that’s by design for ATR-style context.
Changelog
v1.0: Initial release — Body size, Body bias (with arrows/colors/neutral), Full Range, True Range, configurable UI.
SJ Fx Session RangeSJ Fx Session Range Indicator
A Professional Forex Session Tracking Tool with Opening Range Analysis
Overview
The SJ Fx Session Range indicator is a comprehensive tool designed to help forex traders visualize major trading sessions (Asia, Europe+London, and New York) along with their first 15-minute opening ranges. Built with Pine Script v5, this indicator provides clear session boundaries, high/low ranges, and customizable opening range analysis to enhance your trading decisions.
Key Features
1. Trading Session Boxes
- Three major forex sessions: Asia, Europe+London, and New York
- Color-coded session boxes with transparent backgrounds for easy visualization
- Automatic session high/low tracking
- Session labels displayed inside boxes for quick identification
- Displays up to 50 historical sessions for pattern analysis
2. Opening Range Analysis
- Tracks first 15-minute opening range for Europe, London, and NY sessions
- Plots high, low, and mid-range levels
- Customizable line colors for each session's opening range
- Background highlights during the first 15 minutes of each session
- Helps identify potential breakout or reversal zones
3. Daylight Saving Time Support
- Built-in DST toggle for easy seasonal adjustment
- Automatically adjusts all session timings by 1 hour when enabled
- Clear tooltip instructions for when to enable/disable DST
- Default timings configured for IST timezone (Asia/Kolkata)
4. User-Friendly Design
- Clean input interface organized by session categories
- Fixed optimal settings for boxes and lines (50-day history)
- All session times are easily customizable with helpful tooltips
- Warning tooltips to prevent accidental timing changes
Default Session Times (when DST is disabled)
- Asia Session: 04:00 - 12:30 IST
- Europe + London Session: 12:30 - 20:00 IST
- New York Session: 20:00 - 02:30 IST
How to Use
1. Add to Chart: Apply the indicator to any forex pair chart
2. Adjust DST: Enable the "Start Daylight Saving Time Change" checkbox on the second Sunday in March; disable on the first Sunday in November
3. Customize Sessions: Toggle individual sessions on/off based on your trading preference
4. Opening Range Colors: Customize the opening range line colors for better visibility
5. Session Times: Default times are optimized for IST; modify only if trading from a different timezone
Technical Specifications
- Version: Pine Script v5
- Overlay: Yes (draws directly on price chart)
- Maximum Objects: 500 boxes, 500 lines
- History: 50 days of session data
- Timezone: Asia/Kolkata (IST) - customizable in code
Use Cases
- Identify high-liquidity trading periods
- Track session volatility patterns
- Monitor opening range breakouts/breakdowns
- Analyze session-specific price action
- Plan entries around major session opens
- Avoid trading during low-liquidity periods
Performance
Optimized for efficient rendering with:
- Fixed 50-day history limit for optimal performance
- Automatic cleanup of old session boxes and lines
- Lightweight code structure for fast chart loading
Customization Options
Available Inputs:
- Enable/disable individual sessions
- Adjust session timings (with safety tooltips)
- Toggle DST on/off
- Show/hide opening range analysis
- Customize opening range line colors for each session
Fixed for Optimal Performance:
- Session box colors (Asia: Aqua, Europe: Green, NY: Red)
- 50-day historical display
- Line width and style
- Mid-range line always displayed
Educational Value
This indicator helps traders:
- Understand forex market structure and session overlaps
- Recognize high-probability trading times
- Develop session-based trading strategies
- Improve timing of trade entries and exits
Open Source License
This script is published under Mozilla Public License 2.0, allowing you to:
- Use freely for personal trading
- Modify and adapt to your needs
- Learn from the code structure
- Share improvements with the community
Credits
Developed by Shantanu Joshi
- Designed for forex traders focusing on session-based strategies
- Built with clean, well-documented Pine Script v5 code
- Regular updates and improvements based on user feedback
Support & Feedback
If you find this indicator useful:
- Give it a thumbs up
- Share your trading results in the comments
- Suggest improvements or new features
- Report any issues for quick resolution
Disclaimer
This indicator is for educational and informational purposes only. It does not constitute financial advice. Always conduct your own research and risk management before making trading decisions. Past performance does not guarantee future results.
Compatible with: CFDs of forex pairs, commodities, indices, and crypto.
Best used on: 5-minutes
Recommended chart type: Candlestick charts
Volatility-Targeted Momentum Portfolio [BackQuant]Volatility-Targeted Momentum Portfolio
A complete momentum portfolio engine that ranks assets, targets a user-defined volatility, builds long, short, or delta-neutral books, and reports performance with metrics, attribution, Monte Carlo scenarios, allocation pie, and efficiency scatter plots. This description explains the theory and the mechanics so you can configure, validate, and deploy it with intent.
Table of contents
What the script does at a glance
Momentum, what it is, how to know if it is present
Volatility targeting, why and how it is done here
Portfolio construction modes: Long Only, Short Only, Delta Neutral
Regime filter and when the strategy goes to cash
Transaction cost modelling in this script
Backtest metrics and definitions
Performance attribution chart
Monte Carlo simulation
Scatter plot analysis modes
Asset allocation pie chart
Inputs, presets, and deployment checklist
Suggested workflow
1) What the script does at a glance
Pulls a list of up to 15 tickers, computes a simple momentum score on each over a configurable lookback, then volatility-scales their bar-to-bar return stream to a target annualized volatility.
Ranks assets by raw momentum, selects the top 3 and bottom 3, builds positions according to the chosen mode, and gates exposure with a fast regime filter.
Accumulates a portfolio equity curve with risk and performance metrics, optional benchmark buy-and-hold for comparison, and a full alert suite.
Adds visual diagnostics: performance attribution bars, Monte Carlo forward paths, an allocation pie, and scatter plots for risk-return and factor views.
2) Momentum: definition, detection, and validation
Momentum is the tendency of assets that have performed well to continue to perform well, and of underperformers to continue underperforming, over a specific horizon. You operationalize it by selecting a horizon, defining a signal, ranking assets, and trading the leaders versus laggards subject to risk constraints.
Signal choices . Common signals include cumulative return over a lookback window, regression slope on log-price, or normalized rate-of-change. This script uses cumulative return over lookback bars for ranking (variable cr = price/price - 1). It keeps the ranking simple and lets volatility targeting handle risk normalization.
How to know momentum is present .
Leaders and laggards persist across adjacent windows rather than flipping every bar.
Spread between average momentum of leaders and laggards is materially positive in sample.
Cross-sectional dispersion is non-trivial. If everything is flat or highly correlated with no separation, momentum selection will be weak.
Your validation should include a diagnostic that measures whether returns are explained by a momentum regression on the timeseries.
Recommended diagnostic tool . Before running any momentum portfolio, verify that a timeseries exhibits stable directional drift. Use this indicator as a pre-check: It fits a regression to price, exposes slope and goodness-of-fit style context, and helps confirm if there is usable momentum before you force a ranking into a flat regime.
3) Volatility targeting: purpose and implementation here
Purpose . Volatility targeting seeks a more stable risk footprint. High-vol assets get sized down, low-vol assets get sized up, so each contributes more evenly to total risk.
Computation in this script (per asset, rolling):
Return series ret = log(price/price ).
Annualized volatility estimate vol = stdev(ret, lookback) * sqrt(tradingdays).
Leverage multiplier volMult = clamp(targetVol / vol, 0.1, 5.0).
This caps sizing so extremely low-vol assets don’t explode weight and extremely high-vol assets don’t go to zero.
Scaled return stream sr = ret * volMult. This is the per-bar, risk-adjusted building block used in the portfolio combinations.
Interpretation . You are not levering your account on the exchange, you are rescaling the contribution each asset’s daily move has on the modeled equity. In live trading you would reflect this with position sizing or notional exposure.
4) Portfolio construction modes
Cross-sectional ranking . Assets are sorted by cr over the chosen lookback. Top and bottom indices are extracted without ties.
Long Only . Averages the volatility-scaled returns of the top 3 assets: avgRet = mean(sr_top1, sr_top2, sr_top3). Position table shows per-asset leverages and weights proportional to their current volMult.
Short Only . Averages the negative of the volatility-scaled returns of the bottom 3: avgRet = mean(-sr_bot1, -sr_bot2, -sr_bot3). Position table shows short legs.
Delta Neutral . Long the top 3 and short the bottom 3 in equal book sizes. Each side is sized to 50 percent notional internally, with weights within each side proportional to volMult. The return stream mixes the two sides: avgRet = mean(sr_top1,sr_top2,sr_top3, -sr_bot1,-sr_bot2,-sr_bot3).
Notes .
The selection metric is raw momentum, the execution stream is volatility-scaled returns. This separation is deliberate. It avoids letting volatility dominate ranking while still enforcing risk parity at the return contribution stage.
If everything rallies together and dispersion collapses, Long Only may behave like a single beta. Delta Neutral is designed to extract cross-sectional momentum with low net beta.
5) Regime filter
A fast EMA(12) vs EMA(21) filter gates exposure.
Long Only active when EMA12 > EMA21. Otherwise the book is set to cash.
Short Only active when EMA12 < EMA21. Otherwise cash.
Delta Neutral is always active.
This prevents taking long momentum entries during obvious local downtrends and vice versa for shorts. When the filter is false, equity is held flat for that bar.
6) Transaction cost modelling
There are two cost touchpoints in the script.
Per-bar drag . When the regime filter is active, the per-bar return is reduced by fee_rate * avgRet inside netRet = avgRet - (fee_rate * avgRet). This models proportional friction relative to traded impact on that bar.
Turnover-linked fee . The script tracks changes in membership of the top and bottom baskets (top1..top3, bot1..bot3). The intent is to charge fees when composition changes. The template counts changes and scales a fee by change count divided by 6 for the six slots.
Use case: increase fee_rate to reflect taker fees and slippage if you rebalance every bar or trade illiquid assets. Reduce it if you rebalance less often or use maker orders.
Practical advice .
If you rebalance daily, start with 5–20 bps round-trip per switch on liquid futures and adjust per venue.
For crypto perp microcaps, stress higher cost assumptions and add slippage buffers.
If you only rotate on lookback boundaries or at signals, use alert-driven rebalances and lower per-bar drag.
7) Backtest metrics and definitions
The script computes a standard set of portfolio statistics once the start date is reached.
Net Profit percent over the full test.
Max Drawdown percent, tracked from running peaks.
Annualized Mean and Stdev using the chosen trading day count.
Variance is the square of annualized stdev.
Sharpe uses daily mean adjusted by risk-free rate and annualized.
Sortino uses downside stdev only.
Omega ratio of sum of gains to sum of losses.
Gain-to-Pain total gains divided by total losses absolute.
CAGR compounded annual growth from start date to now.
Alpha, Beta versus a user-selected benchmark. Beta from covariance of daily returns, Alpha from CAPM.
Skewness of daily returns.
VaR 95 linear-interpolated 5th percentile of daily returns.
CVaR average of the worst 5 percent of daily returns.
Benchmark Buy-and-Hold equity path for comparison.
8) Performance attribution
Cumulative contribution per asset, adjusted for whether it was held long or short and for its volatility multiplier, aggregated across the backtest. You can filter to winners only or show both sides. The panel is sorted by contribution and includes percent labels.
9) Monte Carlo simulation
The panel draws forward equity paths from either a Normal model parameterized by recent mean and stdev, or non-parametric bootstrap of recent daily returns. You control the sample length, number of simulations, forecast horizon, visibility of individual paths, confidence bands, and a reproducible seed.
Normal uses Box-Muller with your seed. Good for quick, smooth envelopes.
Bootstrap resamples realized returns, preserving fat tails and volatility clustering better than a Gaussian assumption.
Bands show 10th, 25th, 75th, 90th percentiles and the path mean.
10) Scatter plot analysis
Four point-cloud modes, each plotting all assets and a star for the current portfolio position, with quadrant guides and labels.
Risk-Return Efficiency . X is risk proxy from leverage, Y is expected return from annualized momentum. The star shows the current book’s composite.
Momentum vs Volatility . Visualizes whether leaders are also high vol, a cue for turnover and cost expectations.
Beta vs Alpha . X is a beta proxy, Y is risk-adjusted excess return proxy. Useful to see if leaders are just beta.
Leverage vs Momentum . X is volMult, Y is momentum. Shows how volatility targeting is redistributing risk.
11) Asset allocation pie chart
Builds a wheel of current allocations.
Long Only, weights are proportional to each long asset’s current volMult and sum to 100 percent.
Short Only, weights show the short book as positive slices that sum to 100 percent.
Delta Neutral, 50 percent long and 50 percent short books, each side leverage-proportional.
Labels can show asset, percent, and current leverage.
12) Inputs and quick presets
Core
Portfolio Strategy . Long Only, Short Only, Delta Neutral.
Initial Capital . For equity scaling in the panel.
Trading Days/Year . 252 for stocks, 365 for crypto.
Target Volatility . Annualized, drives volMult.
Transaction Fees . Per-bar drag and composition change penalty, see the modelling notes above.
Momentum Lookback . Ranking horizon. Shorter is more reactive, longer is steadier.
Start Date . Ensure every symbol has data back to this date to avoid bias.
Benchmark . Used for alpha, beta, and B&H line.
Diagnostics
Metrics, Equity, B&H, Curve labels, Daily return line, Rolling drawdown fill.
Attribution panel. Toggle winners only to focus on what matters.
Monte Carlo mode with Normal or Bootstrap and confidence bands.
Scatter plot type and styling, labels, and portfolio star.
Pie chart and labels for current allocation.
Presets
Crypto Daily, Long Only . Lookback 25, Target Vol 50 percent, Fees 10 bps, Regime filter on, Metrics and Drawdown on. Monte Carlo Bootstrap with Recent 200 bars for bands.
Crypto Daily, Delta Neutral . Lookback 25, Target Vol 50 percent, Fees 15–25 bps, Regime filter always active for this mode. Use Scatter Risk-Return to monitor efficiency and keep the star near upper left quadrants without drifting rightward.
Equities Daily, Long Only . Lookback 60–120, Target Vol 15–20 percent, Fees 5–10 bps, Regime filter on. Use Benchmark SPX and watch Alpha and Beta to keep the book from becoming index beta.
13) Suggested workflow
Universe sanity check . Pick liquid tickers with stable data. Thin assets distort vol estimates and fees.
Check momentum existence . Run on your timeframe. If slope and fit are weak, widen lookback or avoid that asset or timeframe.
Set risk budget . Choose a target volatility that matches your drawdown tolerance. Higher target increases turnover and cost sensitivity.
Pick mode . Long Only for bull regimes, Short Only for sustained downtrends, Delta Neutral for cross-sectional harvesting when index direction is unclear.
Tune lookback . If leaders rotate too often, lengthen it. If entries lag, shorten it.
Validate cost assumptions . Increase fee_rate and stress Monte Carlo. If the edge vanishes with modest friction, refine selection or lengthen rebalance cadence.
Run attribution . Confirm the strategy’s winners align with intuition and not one unstable outlier.
Use alerts . Enable position change, drawdown, volatility breach, regime, momentum shift, and crash alerts to supervise live runs.
Important implementation details mapped to code
Momentum measure . cr = price / price - 1 per symbol for ranking. Simplicity helps avoid overfitting.
Volatility targeting . vol = stdev(log returns, lookback) * sqrt(tradingdays), volMult = clamp(targetVol / vol, 0.1, 5), sr = ret * volMult.
Selection . Extract indices for top1..top3 and bot1..bot3. The arrays rets, scRets, lev_vals, and ticks_arr track momentum, scaled returns, leverage multipliers, and display tickers respectively.
Regime filter . EMA12 vs EMA21 switch determines if the strategy takes risk for Long or Short modes. Delta Neutral ignores the gate.
Equity update . Equity multiplies by 1 + netRet only when the regime was active in the prior bar. Buy-and-hold benchmark is computed separately for comparison.
Tables . Position tables show current top or bottom assets with leverage and weights. Metric table prints all risk and performance figures.
Visualization panels . Attribution, Monte Carlo, scatter, and pie use the last bars to draw overlays that update as the backtest proceeds.
Final notes
Momentum is a portfolio effect. The edge comes from cross-sectional dispersion, adequate risk normalization, and disciplined turnover control, not from a single best asset call.
Volatility targeting stabilizes path but does not fix selection. Use the momentum regression link above to confirm structure exists before you size into it.
Always test higher lag costs and slippage, then recheck metrics, attribution, and Monte Carlo envelopes. If the edge persists under stress, you have something robust.
Multi-Session Range Boxes (Asia, Europe, New York)## What this script does
**Multi-Session ORB (NY / London / Asia) - One Indicator** builds Opening Range Boxes for the three major trading sessions using one unified engine:
- New York session ORB
- London session ORB
- Asia session ORB
It is designed for traders who trade ORB and session-based structure and want all three sessions managed consistently by a single tool, instead of stacking multiple separate indicators.
---
## Core Logic & How It Works
For each enabled session, the script:
1. **Defines a configurable Opening Range window**
- Example defaults:
- NY: 09:30–09:45
- London: 03:00–03:15 (ET)
- Asia: 20:00–20:15 (ET)
2. **Builds the Opening Range**
- During the chosen window, it continuously tracks the highest high and lowest low.
- At the end of the window, that high/low becomes the official ORB for that session.
3. **Draws and extends the ORB box**
- A box is drawn from the start of the ORB window to its end, between the ORB high and low.
- During the user-defined “Extend/Show Until” window for that session, the box is extended in time so you can see how price behaves relative to that fixed opening range.
4. **Detects breakouts**
- During the extension window:
- If price crosses above the ORB high → potential long breakout condition.
- If price crosses below the ORB low → potential short breakout condition.
- These conditions are session-specific (NY, London, Asia) and exposed via alertconditions.
5. **Alerts with structured messages**
- Alerts are provided for:
- NY ORB Breakout UP / DOWN
- London ORB Breakout UP / DOWN
- Asia ORB Breakout UP / DOWN
- Messages are JSON-style, making them easy to integrate with webhooks or bots.
---
## Why this is a single, original tool (not a random mashup)
- Uses **one shared ORB function** to manage all sessions consistently.
- Encodes both:
- Visual structure (session ranges as bands on price).
- Mechanical logic (session-specific breakout signals + automation-ready alerts).
- Focuses specifically on global session ORB behavior in a compact overlay, instead of recreating generic tools or hiding basic code as a closed-source clone.
This makes it:
- Transparent: logic is clearly visible in the code.
- Practical: directly supports ORB traders across NY / London / Asia.
- Distinct: three sessions, one engine, one indicator.
---
## How to Use
1. **Session visualization**
- Enable/disable NY, London, and Asia ranges as needed.
- Use the colored bands to see where current price sits relative to each session’s ORB.
- Default: New York is highlighted in yellow for quick recognition.
2. **Strategy building**
- Use the ORB high/low as key decision levels:
- Trade confirmed breakouts.
- Fade failed breakouts back into the range.
- Track how later sessions interact with earlier session ranges.
3. **Alerts for automation**
- Set alerts on the built-in conditions to:
- Trigger entries in your own system.
- Send signals to a Discord/Telegram/bot via webhooks.
- No extra indicator is required to identify the session or the breakout.
---
## Publication Notes
- Title uses standard ASCII characters, as required.
- Chart for publication should be kept **clean**:
- Candles + this ORB indicator only, or any additional drawings strictly used to illustrate how to read the ranges.
- Description explains:
- What the script does,
- How it does it,
- How traders can use it,
- Why it is a coherent, original tool rather than an arbitrary mashup.
Multi-Session ORB (NY / London / Asia) - One Indicator## What this script does
**Multi-Session ORB (NY / London / Asia) - One Indicator** builds Opening Range Boxes for the three major trading sessions using one unified engine:
- New York session ORB
- London session ORB
- Asia session ORB
It is designed for traders who trade ORB and session-based structure and want all three sessions managed consistently by a single tool, instead of stacking multiple separate indicators.
---
## Core Logic & How It Works
For each enabled session, the script:
1. **Defines a configurable Opening Range window**
- Example defaults:
- NY: 09:30–09:45
- London: 03:00–03:15 (ET)
- Asia: 20:00–20:15 (ET)
2. **Builds the Opening Range**
- During the chosen window, it continuously tracks the highest high and lowest low.
- At the end of the window, that high/low becomes the official ORB for that session.
3. **Draws and extends the ORB box**
- A box is drawn from the start of the ORB window to its end, between the ORB high and low.
- During the user-defined “Extend/Show Until” window for that session, the box is extended in time so you can see how price behaves relative to that fixed opening range.
4. **Detects breakouts**
- During the extension window:
- If price crosses above the ORB high → potential long breakout condition.
- If price crosses below the ORB low → potential short breakout condition.
- These conditions are session-specific (NY, London, Asia) and exposed via alertconditions.
5. **Alerts with structured messages**
- Alerts are provided for:
- NY ORB Breakout UP / DOWN
- London ORB Breakout UP / DOWN
- Asia ORB Breakout UP / DOWN
- Messages are JSON-style, making them easy to integrate with webhooks or bots.
---
## Why this is a single, original tool (not a random mashup)
- Uses **one shared ORB function** to manage all sessions consistently.
- Encodes both:
- Visual structure (session ranges as bands on price).
- Mechanical logic (session-specific breakout signals + automation-ready alerts).
- Focuses specifically on global session ORB behavior in a compact overlay, instead of recreating generic tools or hiding basic code as a closed-source clone.
This makes it:
- Transparent: logic is clearly visible in the code.
- Practical: directly supports ORB traders across NY / London / Asia.
- Distinct: three sessions, one engine, one indicator.
---
## How to Use
1. **Session visualization**
- Enable/disable NY, London, and Asia ranges as needed.
- Use the colored bands to see where current price sits relative to each session’s ORB.
- Default: New York is highlighted in yellow for quick recognition.
2. **Strategy building**
- Use the ORB high/low as key decision levels:
- Trade confirmed breakouts.
- Fade failed breakouts back into the range.
- Track how later sessions interact with earlier session ranges.
3. **Alerts for automation**
- Set alerts on the built-in conditions to:
- Trigger entries in your own system.
- Send signals to a Discord/Telegram/bot via webhooks.
- No extra indicator is required to identify the session or the breakout.
---
## Publication Notes
- Title uses standard ASCII characters, as required.
- Chart for publication should be kept **clean**:
- Candles + this ORB indicator only, or any additional drawings strictly used to illustrate how to read the ranges.
- Description explains:
- What the script does,
- How it does it,
- How traders can use it,
- Why it is a coherent, original tool rather than an arbitrary mashup.
Мой скрипт//@version=5
indicator("Fibonacci Yearly Levels – Pro (by Pablo)", overlay=true)
// 1) Фиксация закрытия прошлого года
var float year_close = na
isNewYear = ta.change(year(time)) // true на первом баре нового года
if isNewYear
year_close := close // закрытие последнего бара прошлого года
year_close := nz(year_close, close) // первичная инициализация на истории
// 2) Уровни вверх (базовые + расширения)
up5 = year_close * 1.05
up8 = year_close * 1.08
up13 = year_close * 1.13
up21 = year_close * 1.21
up34 = year_close * 1.34
up54 = year_close * 1.54
up89 = year_close * 1.89 // расширение
up144 = year_close * 2.44 // расширение
up233 = year_close * 3.33 // расширение
// 3) Уровни вниз (симметрично и только позитивные цены)
dn5 = year_close * 0.95
dn8 = year_close * 0.92
dn13 = year_close * 0.87
dn21 = year_close * 0.79
dn34 = year_close * 0.66
dn54 = year_close * 0.46
dn89 = year_close * 0.11 // 1 - 0.89 = 0.11 (ниже -144% и -233% не рисуем — это < 0)
// 4) Плоты уровней (title — константы)
plot(year_close, color=color.yellow, linewidth=2, title="Year Close")
// вверх
plot(up5, color=color.new(color.green, 70), title="+5%")
plot(up8, color=color.new(color.green, 60), title="+8%")
plot(up13, color=color.new(color.green, 50), title="+13%")
plot(up21, color=color.new(color.green, 40), title="+21%")
plot(up34, color=color.new(color.green, 30), title="+34%")
plot(up54, color=color.new(color.green, 20), title="+54%")
plot(up89, color=color.new(color.green, 10), title="+89%")
plot(up144, color=color.new(color.green, 0), title="+144%")
plot(up233, color=color.new(color.green, 0), linewidth=2, style=plot.style_circles, title="+233%")
// вниз
plot(dn5, color=color.new(color.red, 70), title="-5%")
plot(dn8, color=color.new(color.red, 60), title="-8%")
plot(dn13, color=color.new(color.red, 50), title="-13%")
plot(dn21, color=color.new(color.red, 40), title="-21%")
plot(dn34, color=color.new(color.red, 30), title="-34%")
plot(dn54, color=color.new(color.red, 20), title="-54%")
plot(dn89, color=color.new(color.red, 10), title="-89%")
// -144% и -233% не отрисовываем — это отрицательные цены
// 5) Сигналы входов по методике (пробой ±8% с подтверждением)
longEntry = ta.crossover(close, up8) // LONG при пробое +8% снизу вверх
shortEntry = ta.crossunder(close, dn8) // SHORT при пробое -8% сверху вниз
plotshape(longEntry, title="Long Entry", style=shape.triangleup, color=color.lime,
size=size.small, location=location.belowbar, text="LONG")
plotshape(shortEntry, title="Short Entry", style=shape.triangledown, color=color.red,
size=size.small, location=location.abovebar, text="SHORT")
// (опционально — включи алерты)
alertcondition(longEntry, title="LONG entry (+8%)", message="LONG: price crossed above +8% yearly level")
alertcondition(shortEntry, title="SHORT entry (-8%)", message="SHORT: price crossed below -8% yearly level")
Flow_RSI_StochRSI_Volume//@version=5
indicator("Flow + RSI + StochRSI + Volume - Panel", overlay=false)
// ---- Inputs
cmfLen = input.int(20, "CMF Length", minval=2)
rsiLen = input.int(14, "RSI Length", minval=2)
srsiLen = input.int(14, "StochRSI Base Length", minval=2)
kLen = input.int(3, "%K Smoothing", minval=1)
dLen = input.int(3, "%D Smoothing", minval=1)
// ---- CMF (세력 유입)
rng = high - low
mfm = rng != 0 ? ((close - low) - (high - close)) / rng : 0.0
mfv = mfm * volume
cmf = ta.sma(mfv, cmfLen) / ta.sma(volume, cmfLen)
// ---- RSI
rsi = ta.rsi(close, rsiLen)
// ---- StochRSI (%K, %D)
rsiLL = ta.lowest(rsi, srsiLen)
rsiHH = ta.highest(rsi, srsiLen)
base = (rsiHH - rsiLL) != 0 ? (rsi - rsiLL) / (rsiHH - rsiLL) * 100.0 : 0.0
k = ta.sma(base, kLen)
d = ta.sma(k, dLen)
// ---- Volume (거래량)
vol = volume
vma20 = ta.sma(volume, 20)
// ---- Plots (색상 지정 없이 기본값 사용)
plot(cmf, title="CMF (Flow)")
hline(0, "CMF Zero")
plot(rsi, title="RSI")
hline(30, "RSI 30")
hline(50, "RSI 50")
hline(70, "RSI 70")
plot(k, title="StochRSI %K")
plot(d, title="StochRSI %D")
plot(vol, title="Volume", style=plot.style_histogram)
plot(vma20, title="Vol MA20")
Multi EMA + Indicators + Mini-Dashboard + Reversals v6📘 Multi EMA + Indicators + Mini-Dashboard + Reversals v6
🧩 Overview
This indicator is a multi-EMA setup that combines trend, momentum, and reversal analysis in a single visual framework.
It integrates four exponential moving averages (EMAs), key oscillators (RSI, MACD, Stochastic, CCI), volatility filtering (ATR), and a dynamic mini-dashboard that summarizes all signals in real time.
Its purpose is to help traders visually confirm trend alignment, filter valid entries, and identify possible trend continuation or reversal points.
It can display buy/sell arrows, detect reversal candles, and issue alerts when trading conditions are met.
⚙️ Core Components
1. Moving Averages (EMA Setup)
EMA1 (fast) and EMA2 (medium) define the short-term trend and trigger bias.
When the price is above both EMAs → bullish bias.
When below → bearish bias.
EMA3 and EMA4 act as trend filters. Their slopes (up or down) confirm overall momentum and help validate signals.
Each EMA has customizable lengths, sources, and colors for up/down trends.
This “EMA stack” is the foundation of the setup — a structured trend-following framework that adapts to market speed and volatility.
2. Momentum and Confirmation Filters
Each indicator can be individually enabled or disabled for flexibility.
RSI: confirms direction (above/below 50).
MACD: detects momentum crossover (MACD > Signal for bullish confirmation).
Stochastic: identifies trend continuation (K > D for longs, K < D for shorts).
CCI: adds trend bias above/below a threshold.
ATR Filter: filters out small, low-volatility candles to reduce noise.
You can activate only the filters that fit your trading plan — for instance, trend traders often use RSI and MACD, while scalpers may rely on Stochastic and ATR.
3. Reversal Detection
The indicator includes an optional Reversal Section that independently detects potential turning points.
It combines multiple configurable criteria:
Candlestick patterns (Bullish Hammer, Shooting Star).
Large Candle filter — detects unusually large bars (relative to close).
Price-to-EMA distance — identifies overextended moves that might revert.
RSI Divergence — detects potential momentum shifts.
RSI Overbought/Oversold zones (70/30 by default).
Doji Candles — sign of indecision.
A bullish or bearish reversal signal appears when enough selected criteria are met.
All sub-modules can be toggled on/off individually, giving you full control over sensitivity.
4. Signal Logic
Buy and sell signals are triggered when EMA alignment and the chosen confirmations agree:
Buy Signal
→ Price above EMA1 & EMA2
→ Confirmations (RSI/MACD/Stoch/CCI/ATR) pass
→ Trend filters (EMA3/EMA4) point upward
Sell Signal
→ Price below EMA1 & EMA2
→ Confirmations align bearishly
→ Trend filters (EMA3/EMA4) slope downward
Reversal signals can appear independently, even against the current EMA trend, depending on your settings.
5. Visual Dashboard
A mini-dashboard appears near the chart showing:
Current trade bias (LONG / SHORT / NEUTRAL)
EMA3 and EMA4 trend directions (↑ / ↓)
Quick visual bars (🟩 / 🟥) for each filter: RSI, MACD, Stoch, ATR, CCI, EMA filters
Reversal criteria status (Doji, RSI divergence, candle size, etc.)
This panel gives you a compact overview of all indicator states at a glance.
The color of the panel changes dynamically — green for bullish, red for bearish, gray for neutral.
6. Alerts
Built-in alerts allow automation or notifications:
Buy Alert
Sell Alert
Reversal Buy
Reversal Sell
You can connect these alerts to TradingView notifications or external bots for semi-automated execution.
💡 How to Use
✅ Trend-Following Setup
Focus on trades in the direction of EMA1 & EMA2.
Confirm with EMA3 & EMA4 trending in the same direction.
Use RSI/MACD/Stoch filters to ensure momentum supports the trade.
Avoid entries when ATR filter indicates low volatility.
🔄 Reversal Setup
Enable the Reversal section for potential tops/bottoms.
Look for reversal buy signals near support zones or after strong downtrends.
Use RSI divergence or Doji + Hammer signals as confirmation.
Combine with key chart areas (supply/demand or previous swing levels).
⚖️ Combination Approach
Trade continuation signals when all EMAs are aligned and filters are green.
Trade reversals only when at a key area (support/resistance) and confirmed by reversal conditions.
Always check higher-timeframe bias before entering a trade.
🧭 Practical Tips
Use different EMA sets for different timeframes:
9/21/50/100 for swing or trend trades.
5/13/34/89 for intraday scalping.
Turn off filters you don’t use to reduce lag.
Always validate signals with price structure, not just indicator alignment.
Practice in replay mode before live trading.
🗺️ Key Chart Confluence (Highly Recommended)
Although the indicator provides structured signals, its best use is in confluence with:
Support and resistance levels
Supply/demand zones
Trendlines and channels
Liquidity pools
Volume clusters
Signals aligned with strong key areas on the chart tend to have greater reliability than isolated indicator triggers.
I use EMA 1 - 20 Open ; EMA 2 - 20 Close ; EMA 3 - 50 ; EMA 4 - 200 or 100 , but that's me...
⚠️ Important Disclaimer
This indicator is a technical tool, not a guarantee of results.
Trading involves risk, and no signal is ever 100% accurate.
Every trader should develop a personal strategy, use proper risk management, and adapt settings to their instrument and timeframe.
Always combine indicator signals with key chart areas, higher-timeframe context, and your own analysis before taking a trade.
Holographic Market Microstructure | AlphaNattHolographic Market Microstructure | AlphaNatt
A multidimensional, holographically-rendered framework designed to expose the invisible forces shaping every candle — liquidity voids, smart money footprints, order flow imbalances, and structural evolution — in real time.
---
📘 Overview
The Holographic Market Microstructure (HMS) is not a traditional indicator. It’s a visual architecture built to interpret the true anatomy of the market — a living data structure that fuses price, volume, and liquidity into one coherent holographic layer.
Instead of reacting to candles, HMS visualizes the market’s underlying micro-dynamics : where liquidity hides, where volume flows, and how structure morphs as smart money accumulates or distributes.
Designed for system-based traders, volume analysts, and liquidity theorists who demand to see the unseen — the invisible grid driving every price movement.
---
🔬 Core Analytical Modules
Microstructure Analysis
Deconstructs each bar’s internal composition to identify imbalance between aggressive buying and selling. Using a configurable Imbalance Ratio and Liquidity Threshold , the algorithm marks low-liquidity zones and price inefficiencies as “liquidity voids.”
• Detects hidden supply/demand gaps.
• Quantifies micro-level absorption and exhaustion.
• Reveals flow compression and expansion phases.
Smart Money Tracking
Applies advanced volume-rate-of-change and price momentum relationships to map institutional activity.
• Accumulation Zones – Where price rises on expanding volume.
• Distribution Zones – Where price declines on rising volume.
• Automatically visualized as glowing boxes, layered through time to simulate footprint persistence.
Fractal Structure Mapping
Reveals the recursive nature of price formation. HMS detects fractal highs/lows, then connects them into an evolving structure.
• Defines nested market structure across multiple scales.
• Maps trend progression and transition points.
• Renders with adaptive glow lines to reflect depth and strength.
Volume Heat Map
Transforms historical volume data into a 3D holographic heat projection.
• Each band represents a volume-weighted price level.
• Gradient brightness = relative participation intensity.
• Helps identify volume nodes, voids, and liquidity corridors.
HUD Display System
Real-time analytical dashboard summarizing the system’s internal metrics directly on the chart.
• Flow, Structure, Smart$, Liquidity, and Divergence — all live.
• Designed for both scalpers and swing traders to assess micro-context instantly.
---
🧠 Smart Money Intelligence Layer
The Smart Money Index dynamically evaluates the harmony (or conflict) between price momentum and volume acceleration. When institutions accumulate or distribute discreetly, volume surges ahead of price. HMS detects this divergence and overlays it as glowing smart money zones.
◈ ACCUM → Institutional absorption, early uptrend formation.
◈ DISTRIB → Distribution and top-heavy conditions.
○ IDLE → Neutral flow equilibrium.
Divergences between price and volume are signaled using holographic alerts ( ⚠ ALERT ) to highlight exhaustion or trap conditions — often precursors to structural reversals.
---
🌀 Fractal Market Structure Engine
The fractal subsystem recursively identifies local pivot symmetry, connecting micro-structural highs and lows into a holographic skeleton.
• Bullish Structure — Higher highs & higher lows align (▲ BULLISH).
• Bearish Structure — Lower highs & lower lows dominate (▼ BEARISH).
• Ranging — Fractal symmetry balance (◆ RANGING).
Each transition is visually represented through adaptive glow intensity, producing a living contour of market evolution .
---
🔥 Volume Heat Map Projection
The heatmap acts as a volumetric X-ray of the recent 100–300 bars. Each horizontal segment reflects liquidity density, rendered with gradient opacity from cold (inactive) to hot (highly active).
• Detects hidden accumulation shelves and distribution ridges.
• Identifies imbalanced liquidity corridors (voids).
• Reveals the invisible scaffolding of the order book.
When combined with smart money zones and structure lines, it creates a multi-layered holographic perspective — allowing traders to see liquidity clusters and their interaction with evolving structure in real time.
---
💎 Holographic Visual Engine
Every element of HMS is dynamically color-mapped to its visual theme . Each theme carries a distinct personality:
Aeon — Neon blue plasma aesthetic; futuristic and fluid.
Cyber — High-contrast digital energy; circuit-like clarity.
Quantum — Deep space gradients; reflective of non-linear flow.
Neural — Organic transitions; biological intelligence simulation.
Plasma — Vapor-bright gradients; high-energy reactive feedback.
Crystal — Minimalist, transparent geometry; pristine data visibility.
Optional Glow Effects and Pulse Animations create a living hologram that responds to real-time market conditions.
---
🧭 HUD Analytics Table
A live data matrix placed anywhere on-screen (top, middle, or side). It summarizes five critical systems:
Flow: Order flow bias — ▲ BUYING / ▼ SELLING / ◆ NEUTRAL.
Struct: Microstructure direction — ▲ BULLISH / ▼ BEARISH / ◆ RANGING.
Smart$: Institutional behavior — ◈ ACCUM / ◈ DISTRIB / ○ IDLE.
Liquid: Market efficiency — ⚡ VOID / ● NORMAL.
Diverg: Price/Volume correlation — ⚠ ALERT / ✓ CLEAR.
Each metric’s color dynamically adjusts according to live readings, effectively serving as a neural HUD layer for rapid interpretation.
---
🚨 Alert Conditions
Stay informed in real time with built-in alerts that trigger under specific structural or liquidity conditions.
Liquidity Void Detected — Market inefficiency or thin volume region identified.
Strong Order Flow Detected — Aggressive buying or selling momentum shift.
Smart Money Activity — Institutional accumulation or distribution underway.
Price/Volume Divergence — Volume fails to confirm price trend.
Market Structure Shift — Fractal structure flips directional bias.
---
⚙️ Customization Parameters
Adjustable Microstructure Depth (20–200 bars).
Configurable Imbalance Ratio and Liquidity Threshold .
Adaptive Smart Money Sensitivity via Accumulation Threshold (%).
Multiple Fractal Depth Layers for precise structural analysis.
Scalable Heatmap Resolution (5–20 levels) and opacity control.
Selectable HUD Position to suit personal layout preferences.
Each parameter adjusts the balance between visual clarity and data density , ensuring optimal performance across intraday and macro timeframes alike.
---
🧩 Trading Application
Identify early signs of institutional activity before breakouts.
Track structure transitions with fractal precision.
Locate hidden liquidity voids and high-value areas.
Confirm strength of trends using order-flow bias.
Detect volume-based divergences that often precede reversals.
HMS is designed not just for observation — but for contextual understanding . Its purpose is to help traders anchor strategies in liquidity and flow dynamics rather than surface-level price action.
---
🪞 Philosophy
Markets are holographic. Each candle contains a reflection of every other candle — a fractal within a fractal, a structure within a structure. The HMS is built to reveal that reflection, allowing traders to see through the market’s multidimensional fabric.
---
Developed by: AlphaNatt
Version: v6
Category: Market Microstructure | Volume Intelligence
Framework: PineScript v6 | Holographic Visualization System
Not financial advice
Exhaustion Reversal Signals - ENHANCEDOverview
This is a reversal detection indicator that combines multiple technical analysis components to identify potential market turning points.
Core Components
1. Range Oscillator
Measures price deviation from a moving average (EMA/SMA) normalized by ATR
Values above +100 = bullish exhaustion zone
Values below -100 = bearish exhaustion zone
Detects momentum flattening (slope deceleration)
2. Stochastic Oscillator
Standard %K and %D with customizable parameters
Crossover detection (K crossing above/below D)
Oversold (<20) and Overbought (>80) zones
Momentum calculation (rate of change in K)
3. 🚀 Advanced Features
Early Detection System:
Identifies momentum exhaustion before confirmed crossovers
Detects when oscillator slope flattens (approaching zero)
Provides "advance warning" signals with relaxed thresholds
............................................................................................
Trend Filter:
50-period EMA for trend context
Three strength modes:
Soft: Allow all signals
Medium: Prefer trend-aligned signals
Strict: Only counter-trend reversals
Confidence Scoring (0-100%):
Oscillator extremity (30 pts)
Stochastic position (25 pts)
K-D divergence strength (20 pts)
Momentum alignment (15 pts)
Trend alignment (10 pts)
Minimum confidence threshold filtering
Visual Enhancements:
Dynamic background gradient (red→green based on oscillator)
Momentum bar coloring when slope flattens
Transparency adjustments based on momentum






















