Power Hour Breakout Signals [LuxAlgo]The Power Hour Breakout tool helps traders identify key price levels from the Power Hour and spot breakouts from those levels easily. This tool features Power Hour extensions, Fibonacci levels, and session break marks for the trader's convenience.
🔶 USAGE
The Power Hour is defined as the last hour of the trading session and is set by default from 3:00 p.m. to 4:00 p.m. New York time. During this period, volume and volatility enter the market. Traders using higher timeframes may use this period to enter or exit positions by placing MOC (Market on Close) orders.
This tool highlights the Power Hour and the top and bottom price levels. Each time prices break out from these levels, a signal is displayed on the chart.
We can use the Power Hour to gauge market sentiment:
Bullish sentiment: Price trades above the Power Hour.
Mixed sentiment: Price trades within the Power Hour.
Bearish sentiment: Price trades below the Power Hour.
🔹 Displaying Power Hours and Breakouts
By default, all detected Power Hours are displayed. Traders can manually adjust this number by disabling the "Display All" parameter in the Settings panel.
Breakouts are displayed by default, too, but this feature can be disabled as well.
The chart above shows different configurations of these parameters.
🔹 Power Hour Extensions
Traders can use Power Hour extensions as potential targets for breakout signals.
In the settings panel, traders can select the percentage of the Power Hour price range to use for each extension. For example, 100% uses the full range, 200% uses the range twice, and so on.
As seen on the chart, traders can configure different percentages for the top and bottom extensions.
🔹 Fibonacci Levels
Traders can display default or custom Fibonacci levels on the Power Hour range to identify retracement opportunities and evaluate market movement strength. Each level can be enabled or disabled, as well as customized by level, color, and line style.
For example, as we can see on the chart, prices attempt to break out at the Power Hour top level, then retrace to the 0.618 Fibonacci level, and then rise to the 200% Power Hour top extension.
🔶 SETTINGS
Display Last X Power Hours: Select how many Power Hours to display or enable the Display All feature.
Power Hour (NY Time): Choose a custom Power Hour in New York time.
🔹 Breakouts
Breakouts: Enable or disable breakouts.
Bullish Breakout: Select color for bullish breakouts.
Bearish Breakout: Select color for bearish breakouts.
🔹 Extensions
Top Extension: Enable or disable the top extension and choose the percentage of Power Hour to use.
Bottom extension: Enable or disable the bottom extension and choose the percentage of Power Hour to use.
🔹 Fibonacci Levels
Display Fibonacci: Enable or disable Fibonacci levels.
Reverse: Reverse Fibonacci levels.
Levels, Colors & Style
Display Labels: Enable or disable labels and choose text size.
🔹 Style
Power Hour Colors
Extension Transparency: Choose the extension's transparency. 0 is solid, and 100 is fully transparent.
Session Breaks: Enable or disable session breaks.
Indicators and strategies
ICT Venom Trading Model [TradingFinder] SMC NY Session 2025SetupIntroduction
The ICT Venom Model is one of the most advanced strategies in the ICT framework, designed for intraday trading on major US indices such as US100, US30, and US500. This model is rooted in liquidity theory, time and price dynamics, and institutional order flow.
The Venom Model focuses on detecting Liquidity Sweeps, identifying Fair Value Gaps (FVG), and analyzing Market Structure Shifts (MSS). By combining these ICT core concepts, traders can filter false breakouts, capture sharp reversals, and align their entries with the real institutional liquidity flow during the New York Session.
Key Highlights of ICT Venom Model :
Intraday focus : Optimized for US indices (US100, US30, US500).
Time element : Critical window is 08:00–09:30 AM (Venom Box).
Liquidity sweep logic : Price grabs liquidity at 09:30 AM open.
Confirmation tools : MSS, CISD, FVG, and Order Blocks.
Dual setups : Works in both Bullish Venom and Bearish Venom conditions.
At its core, the ICT Venom Strategy is a framework that explains how institutional players manipulate liquidity pools by engineering false breakouts around the initial range of the market. Between 08:00 and 09:30 AM New York time, a range called the “Venom Box” is formed.
This range acts as a trap for retail traders, and once the 09:30 AM market open occurs, price usually sweeps either the high or the low of this box to collect stop-loss liquidity. After this liquidity grab, the market often reverses sharply, giving birth to a classic Bullish Venom Setup or Bearish Venom Setup
The Venom Model (ICT Venom Trading Strategy) is not just a pattern recognition tool but a precise institutional trading model based on time, liquidity, and market structure. By understanding the Initial Balance Range, watching for Liquidity Sweeps, and entering trades from FVG zones or Order Blocks, traders can anticipate market reversals with high accuracy. This strategy is widely respected among ICT followers because it offers both risk management discipline and clear entry/exit conditions. In short, the Venom Model transforms liquidity manipulation into actionable trading opportunities.
Bullish Setup :
Bearish Setup :
🔵 How to Use
The ICT Venom Model is applied by observing price behavior during the early hours of the New York session. The first step is to define the Initial Range, also called the Venom Box, which is formed between 08:00 and 09:30 AM EST. This range marks the high and low points where institutional traders often create traps for retail participants. Once the official market opens at 09:30 AM, price usually sweeps either the top or bottom of this box to collect liquidity.
After this liquidity grab, the market tends to reverse in alignment with the true directional bias. To confirm the setup, traders look for signals such as a Market Structure Shift (MSS), Change in State of Delivery (CISD), or the appearance of a Fair Value Gap (FVG). These elements validate the reversal and provide precise levels for trade execution.
🟣 Bullish Setup
In a Bullish Venom Setup, the market first sweeps the low of the Venom Box after 09:30 AM, triggering sell-side liquidity collection. This downward move is often sharp and deceptive, designed to stop out retail long positions and attract new sellers. Once liquidity is taken, the market typically shifts direction, forming an MSS or CISD that signals a reversal to the upside.
Traders then wait for price to retrace into a Fair Value Gap or a demand-side Order Block created during the reversal leg. This retracement offers the ideal entry point for long positions. Stop-loss placement should be just below the liquidity sweep low, while profit targets are set at the Venom Box high and, if momentum continues, at higher session or daily highs.
🟣 Bearish Setup
In a Bearish Venom Setup, the process is similar but reversed. After the Initial Range is defined, if price breaks above the Venom Box high following the 09:30 AM open, it signals a false breakout designed to collect buy-side liquidity. This move usually traps eager buyers and clears out stop-losses above the high.
After the liquidity sweep, confirmation comes through an MSS or CISD pointing to a reversal downward. At this stage, traders anticipate a retracement into a Fair Value Gap or a supply-side Order Block formed during the reversal. Short entries are taken within this zone, with stop-loss positioned just above the liquidity sweep high. The logical profit targets include the Venom Box low and, in stronger bearish momentum, deeper session or daily lows.
🔵 Settings
Refine Order Block : Enables finer adjustments to Order Block levels for more accurate price responses.
Mitigation Level OB : Allows users to set specific reaction points within an Order Block, including: Proximal: Closest level to the current price. 50% OB: Midpoint of the Order Block. Distal: Farthest level from the current price.
FVG Filter : The Judas Swing indicator includes a filter for Fair Value Gap (FVG), allowing different filtering based on FVG width: FVG Filter Type: Can be set to "Very Aggressive," "Aggressive," "Defensive," or "Very Defensive." Higher defensiveness narrows the FVG width, focusing on narrower gaps.
Mitigation Level FVG : Like the Order Block, you can set price reaction levels for FVG with options such as Proximal, 50% OB, and Distal.
CISD : The Bar Back Check option enables traders to specify the number of past candles checked for identifying the CISD Level, enhancing CISD Level accuracy on the chart.
🔵 Conclusion
The ICT Venom Model is more than just a reversal setup; it is a complete intraday trading framework that blends liquidity theory, time precision, and market structure analysis. By focusing on the Initial Range between 08:00 and 09:30 AM New York time and observing how price reacts at the 09:30 AM open, traders can identify liquidity sweeps that reveal institutional intentions.
Whether in a Bullish Venom Setup or a Bearish Venom Setup, the model allows for precise entries through Fair Value Gaps (FVGs) and Order Blocks, while maintaining clear risk management with well-defined stop-loss and target levels.
Ultimately, the ICT Venom Model provides traders with a structured way to filter false moves and align their trades with institutional order flow. Its strength lies in transforming liquidity manipulation into actionable opportunities, giving intraday traders an edge in timing, accuracy, and consistency. For those who master its logic, the Venom Model becomes not only a strategy for entry and exit, but also a deeper framework for understanding how liquidity truly drives price in the New York session.
Extreme Pressure Zones Indicator (EPZ) [BullByte]Extreme Pressure Zones Indicator(EPZ)
The Extreme Pressure Zones (EPZ) Indicator is a proprietary market analysis tool designed to highlight potential overbought and oversold "pressure zones" in any financial chart. It does this by combining several unique measurements of price action and volume into a single, bounded oscillator (0–100). Unlike simple momentum or volatility indicators, EPZ captures multiple facets of market pressure: price rejection, trend momentum, supply/demand imbalance, and institutional (smart money) flow. This is not a random mashup of generic indicators; each component was chosen and weighted to reveal extreme market conditions that often precede reversals or strong continuations.
What it is?
EPZ estimates buying/selling pressure and highlights potential extreme zones with a single, bounded 0–100 oscillator built from four normalized components. Context-aware weighting adapts to volatility, trendiness, and relative volume. Visual tools include adaptive thresholds, confirmed-on-close extremes, divergence, an MTF dashboard, and optional gradient candles.
Purpose and originality (not a mashup)
Purpose: Identify when pressure is building or reaching potential extremes while filtering noise across regimes and symbols.
Originality: EPZ integrates price rejection, momentum cascade, pressure distribution, and smart money flow into one bounded scale with context-aware weighting. It is not a cosmetic mashup of public indicators.
Why a trader might use EPZ
EPZ provides a multi-dimensional gauge of market extremes that standalone indicators may miss. Traders might use it to:
Spot Reversals: When EPZ enters an "Extreme High" zone (high red), it implies selling pressure might soon dominate. This can hint at a topside reversal or at least a pause in rallies. Conversely, "Extreme Low" (green) can highlight bottom-fish opportunities. The indicator's divergence module (optional) also finds hidden bullish/bearish divergences between price and EPZ, a clue that price momentum is weakening.
Measure Momentum Shifts: Because EPZ blends momentum and volume, it reacts faster than many single metrics. A rising MPO indicates building bullish pressure, while a falling MPO shows increasing bearish pressure. Traders can use this like a refined RSI: above 50 means bullish bias, below 50 means bearish bias, but with context provided by the thresholds.
Filter Trades: In trend-following systems, one could require EPZ to be in the bullish (green) zone before taking longs, or avoid new trades when EPZ is extreme. In mean-reversion systems, one might specifically look to fade extremes flagged by EPZ.
Multi-Timeframe Confirmation: The dashboard can fetch a higher timeframe EPZ value. For example, you might trade a 15-minute chart only when the 60-minute EPZ agrees on pressure direction.
Components and how they're combined
Rejection (PRV) – Captures price rejection based on candle wicks and volume (see Price Rejection Volume).
Momentum Cascade (MCD) – Blends multiple momentum periods (3,5,8,13) into a normalized momentum score.
Pressure Distribution (PDI) – Measures net buy/sell pressure by comparing volume on up vs down candles.
Smart Money Flow (SMF) – An adaptation of money flow index that emphasizes unusual volume spikes.
Each of these components produces a 0–100 value (higher means more bullish pressure). They are then weighted and averaged into the final Market Pressure Oscillator (MPO), which is smoothed and scaled. By combining these four views, EPZ stands out as a comprehensive pressure gauge – the whole is greater than the sum of parts
Context-aware weighting:
Higher volatility → more PRV weight
Trendiness up (RSI of ATR > 25) → more MCD weight
Relative volume > 1.2x → more PDI weight
SMF holds a stable weight
The weighted average is smoothed and scaled into MPO ∈ with 50 as the neutral midline.
What makes EPZ stand out
Four orthogonal inputs (price action, momentum, pressure, flow) unified in a single bounded oscillator with consistent thresholds.
Adaptive thresholds (optional) plus robust extreme detection that also triggers on crossovers, so static thresholds work reliably too.
Confirm Extremes on Bar Close (default ON): dots/arrows/labels/alerts print on closed bars to avoid repaint confusion.
Clean dashboard, divergence tools, pre-alerts, and optional on-price gradients. Visual 3D layering uses offsets for depth only,no lookahead.
Recommended markets and timeframes
Best: liquid symbols (index futures, large-cap equities, major FX, BTC/ETH).
Timeframes: 5–15m (more signals; consider higher thresholds), 1H–4H (balanced), 1D (clear regimes).
Use caution on illiquid or very low TFs where wick/volume geometry is erratic.
Logic and thresholds
MPO ∈ ; 50 = neutral. Above 50 = bullish pressure; below 50 = bearish.
Static thresholds (defaults): thrHigh = 70, thrLow = 30; warning bands 5 pts inside extremes (65/35).
Adaptive thresholds (optional):
thrHigh = min(BaseHigh + 5, mean(MPO,100) + stdev(MPO,100) × ExtremeSensitivity)
thrLow = max(BaseLow − 5, mean(MPO,100) − stdev(MPO,100) × ExtremeSensitivity)
Extreme detection
High: MPO ≥ thrHigh with peak/slope or crossover filter.
Low: MPO ≤ thrLow with trough/slope or crossover filter.
Cooldown: 5 bars (default). A new extreme will not print until the cooldown elapses, even if MPO re-enters the zone.
Confirmation
"Confirm Extremes on Bar Close" (default ON) gates extreme markers, pre-alerts, and alerts to closed bars (non-repainting).
Divergences
Pivot-based bullish/bearish divergence; tags appear only after left/right bars elapse (lookbackPivot).
MTF
HTF MPO retrieved with lookahead_off; values can update intrabar and finalize at HTF close. This is disclosed and expected.
Inputs and defaults (key ones)
Core: Sensitivity=1.0; Analysis Period=14; Smoothing=3; Adaptive Thresholds=OFF.
Extremes: Base High=70, Base Low=30; Extreme Sensitivity=1.5; Confirm Extremes on Bar Close=ON; Cooldown=5; Dot size Small/Tiny.
Visuals: Heatmap ON; 3D depth optional; Strength bars ON; Pre-alerts OFF; Divergences ON with tags ON; Gradient candles OFF; Glow ON.
Dashboard: ON; Position=Top Right; Size=Normal; MTF ON; HTF=60m; compact overlay table on price chart.
Advanced caps: Max Oscillator Labels=80; Max Extreme Guide Lines=80; Divergence objects=60.
Dashboard: what each element means
Header: EPZ ANALYSIS.
Large readout: Current MPO; color reflects state (extreme, approaching, or neutral).
Status badge: "Extreme High/Low", "Approaching High/Low", "Bullish/Neutral/Bearish".
HTF cell (when MTF ON): Higher-timeframe MPO, color-coded vs extremes; updates intrabar, settles at HTF close.
Predicted (when MTF OFF): Simple MPO extrapolation using momentum/acceleration—illustrative only.
Thresholds: Current thrHigh/thrLow (static or adaptive).
Components: ASCII bars + values for PRV, MCD, PDI, SMF.
Market metrics: Volume Ratio (x) and ATR% of price.
Strength: Bar indicator of |MPO − 50| × 2.
Confidence: Heuristic gauge (100 in extremes, 70 in warnings, 50 with divergence, else |MPO − 50|). Convenience only, not probability.
How to read the oscillator
MPO Value (0–100): A reading of 50 is neutral. Values above ~55 are increasingly bullish (green), while below ~45 are increasingly bearish (red). Think of these as "market pressure".
Extreme Zones: When MPO climbs into the bright orange/red area (above the base-high line, default 70), the chart will display a dot and downward arrow marking that extreme. Traders often treat this as a sign to tighten stops or look for shorts. Similarly, a bright green dot/up-arrow appears when MPO falls below the base-low (30), hinting at a bullish setup.
Heatmap/Candles: If "Pressure Heatmap" is enabled, the background of the oscillator pane will fade green or red depending on MPO. Users can optionally color the price candles by MPO value (gradient candles) to see these extremes on the main chart.
Prediction Zone(optional): A dashed projection line extends the MPO forward by a small number of bars (prediction_bars) using current MPO momentum and acceleration. This is a heuristic extrapolation best used for short horizons (1–5 bars) to anticipate whether MPO may touch a warning or extreme zone. It is provisional and becomes less reliable with longer projection lengths — always confirm predicted moves with bar-close MPO and HTF context before acting.
Divergences: When price makes a higher high but EPZ makes a lower high (bearish divergence), the indicator can draw dotted lines and a "Bear Div" tag. The opposite (lower low price, higher EPZ) gives "Bull Div". These signals confirm waning momentum at extremes.
Zones: Warning bands near extremes; Extreme zones beyond thresholds.
Crossovers: MPO rising through 35 suggests easing downside pressure; falling through 65 suggests waning upside pressure.
Dots/arrows: Extreme markers appear on closed bars when confirmation is ON and respect the 5-bar cooldown.
Pre-alert dots (optional): Proximity cues in warning zones; also gated to bar close when confirmation is ON.
Histogram: Distance from neutral (50); highlights strengthening or weakening pressure.
Divergence tags: "Bear Div" = higher price high with lower MPO high; "Bull Div" = lower price low with higher MPO low.
Pressure Heatmap : Layered gradient background that visually highlights pressure strength across the MPO scale; adjustable intensity and optional zone overlays (warning / extreme) for quick visual scanning.
A typical reading: If the oscillator is rising from neutral towards the high zone (green→orange→red), the chart may see strong buying culminating in a stall. If it then turns down from the extreme, that peak EPZ dot signals sell pressure.
Alerts
EPZ: Extreme Context — fires on confirmed extremes (respects cooldown).
EPZ: Approaching Threshold — fires in warning zones if no extreme.
EPZ: Divergence — fires on confirmed pivot divergences.
Tip: Set alerts to "Once per bar close" to align with confirmation and avoid intrabar repaint.
Practical usage ideas
Trend continuation: In positive regimes (MPO > 50 and rising), pullbacks holding above 50 often precede continuation; mirror for bearish regimes.
Exhaustion caution: E High/E Low can mark exhaustion risk; many wait for MPO rollover or divergence to time fades or partial exits.
Adaptive thresholds: Useful on assets with shifting volatility regimes to maintain meaningful "extreme" levels.
MTF alignment: Prefer setups that agree with the HTF MPO to reduce countertrend noise.
Examples
Screenshots captured in TradingView Replay to freeze the bar at close so values don't fluctuate intrabar. These examples use default settings and are reproducible on the same bars; they are for illustration, not cherry-picking or performance claims.
Example 1 — BTCUSDT, 1h — E Low
MPO closed at 26.6 (below the 30 extreme), printing a confirmed E Low. HTF MPO is 26.6, so higher-timeframe pressure remains bearish. Components are subdued (Momentum/Pressure/Smart$ ≈ 29–37), with Vol Ratio ≈ 1.19x and ATR% ≈ 0.37%. A prior Bear Div flagged weakening impulse into the drop. With cooldown set to 5 bars, new extremes are rate-limited. Many traders wait for MPO to curl up and reclaim 35 or for a fresh Bull Div before considering countertrend ideas; if MPO cannot reclaim 35 and HTF stays weak, treat bounces cautiously. Educational illustration only.
Example 2 — ETHUSD, 30m — E High
A strong impulse pushed MPO into the extreme zone (≥ 70), printing a confirmed E High on close. Shortly after, MPO cooled to ~61.5 while a Bear Div appeared, showing momentum lag as price pushed a higher high. Volume and volatility were elevated (≈ 1.79x / 1.25%). With a 5-bar cooldown, additional extremes won't print immediately. Some treat E High as exhaustion risk—either waiting for MPO rollover under 65/50 to fade, or for a pullback that holds above 50 to re-join the trend if higher-timeframe pressure remains constructive. Educational illustration only.
Known limitations and caveats
The MPO line itself can change intrabar; extreme markers/alerts do not repaint when "Confirm Extremes on Bar Close" is ON.
HTF values settle at the close of the HTF bar.
Illiquid symbols or very low TFs can be noisy; consider higher thresholds or longer smoothing.
Prediction line (when enabled) is a visual extrapolation only.
For coders
Pine v6. MTF via request.security with lookahead_off.
Extremes include crossover triggers so static thresholds also yield E High/E Low.
Extreme markers and pre-alerts are gated by barstate.isconfirmed when confirmation is ON.
Arrays prune oldest objects to respect resource limits; defaults (80/80/60) are conservative for low TFs.
3D layering uses negative offsets purely for drawing depth (no lookahead).
Screenshot methodology:
To make labels legible and to demonstrate non-repainting behavior, the examples were captured in TradingView Replay with "Confirm Extremes on Bar Close" enabled. Replay is used only to freeze the bar at close so plots don't change intrabar. The examples use default settings, include both Extreme Low and Extreme High cases, and can be reproduced by scrolling to the same bars outside Replay. This is an educational illustration, not a performance claim.
Disclaimer
This script is for educational purposes only and does not constitute financial advice. Markets involve risk; past behavior does not guarantee future results. You are responsible for your own testing, risk management, and decisions.
ATR Volatility and Trend AnalysisATR Volatility and Trend Analysis
Unlock the power of the Average True Range (ATR) with the ATR Volatility and Trend Analysis indicator. This comprehensive tool is designed to provide traders with a multi-faceted view of market dynamics, combining volatility analysis, dynamic support and resistance levels, and trend detection into a single, easy-to-use indicator.
How It Works
The ATR Volatility and Trend Analysis indicator is built upon the core concept of the ATR, a classic measure of market volatility. It expands on this by providing several key features:
Dynamic ATR Bands: The indicator plots three sets of upper and lower bands around the price. These bands are calculated by multiplying the current ATR value by user-defined multipliers. They act as dynamic support and resistance levels, widening during volatile periods and contracting during calm markets.
Volatility Breakout Signals: Identify potential breakouts with precision. The indicator generates a signal when the current ATR value surges above its own moving average by a specified threshold, indicating a significant increase in volatility that could lead to a strong price move.
Trend Detection: The indicator determines the market trend by analyzing both price action and ATR behavior. A bullish trend is signaled when the price is above its moving average and volatility is increasing. Conversely, a bearish trend is signaled when the price is below its moving average and volatility is increasing.
How to Use the ATR Multi-Band Indicator
Identify Support and Resistance: Use the ATR bands as key levels. Price approaching the outer bands may indicate overbought or oversold conditions, while a break of the bands can signal a strong continuation.
Confirm Breakouts: Look for a volatility breakout signal to confirm the strength behind a price move. A breakout from a consolidation range accompanied by a volatility signal is a strong indicator of a new trend.
Trade with the Trend: Use the background coloring and trend signals to align your trades with the dominant market direction. Enter long positions during confirmed bullish trends and short positions during bearish trends.
Set Up Alerts: The indicator includes alerts for band crosses, trend changes, and volatility breakouts, ensuring you never miss a potential trading opportunity.
What makes it different?
While many indicators use ATR, the ATR Volatility and Trend Analysis tool is unique in its integration of multiple ATR-based concepts into a single, cohesive system. It doesn't just show volatility; it interprets it in the context of price action to deliver actionable trend and breakout signals, making it a complete solution for ATR-based analysis.
Disclaimer
This indicator is designed as a technical analysis tool and should be used in conjunction with other forms of analysis and proper risk management.
Past performance does not guarantee future results, and traders should thoroughly test any strategy before implementing it with real capital.
Synthetic Implied APROverview
The Synthetic Implied APR is an artificial implied APR, designed to imitate the implied APR seen when trading cryptocurrency funding rates. It combines real-time funding rates with premium data to calculate an artificial market expectation of the annualized funding rate.
The (actual) implied APR is the market's expectation of the annualized funding rate. This is dependent on bid/ask impacts of the implied APR, something which is currently unavailable to fetch with TradingView. In essence, an implied APR of X% means traders believe that asset's funding fees to average X% when annualized.
What's important to understand, is that the actual value of the synthetic implied APR is not relevant. We only simply use its relative changes when we trade (i.e if it crosses above/below its MA for a given weight). Even for the same asset, the implied APRs will change depending on days to maturity.
How it calculates
The synthetic implied APR is calculated with these steps:
Collects premium data from perpetual futures markets using optimized lower timeframe requests (check my 'Predicted Funding Rates' indicator)
Calculates the funding rate by adding the premium to an interest rate component (clamped within exchange limits)
Derives the underlying APR from the 8-hour funding rate (funding rate × 3 × 365)
Apply a weighed formula that imitates both the direction (underlying APR) with the volatility of prices (from the premium index and funding)
premium_component = (prem_avg / 50 ) * 365
weighedprem = (weight * fr) + ((1 - weight) * apr) + (premium_component * 0.3)
impliedAPR = math.avg(weighedprem, ta.sma(apr, maLength))
How to use it: Generally
Preface: Funding rates are an indication of market sentiment
If funding is positive, generally the market is bullish as longs are willing to pay shorts funding
If funding is negative, generally the market is bearish as shorts are willing to pay longs funding
So, this script can be used like a typical oscillator:
Bullish: If implied APR > MA OR if implied APR MA is green
Bearish: If implied APR < MA OR if implied APR MA is red
The components:
Synthetic Implied APR: The main metric. At current setting of 0.7, it imitates volatility
Weight: The higher the value, the smoother the synthetic implied APR is (and MA too). This value is very important to the imitation. At 0.7, it imitates the actual volatility of the implied APR. At weight = 1, it becomes very smooth. Perfect for trading
Synthetic Implied APR Moving Average: A moving average of the Synthetic implied APR. Can choose from multiple selections, (SMA, EMA, WMA, HMA, VWMA, RMA)
How to use it: Trading Funding
When trading funding there're multiple ways to use it with different settings
Trade funding rates with trend changes
Settings: Weight = 1
Method 1: When the implied APR MA turns green, long funding rates (or short if red)
Method 2: When the implied APR crosses above the MA, long funding rates (or short when crosses below)
Trade funding rates with MA pullbacks
Settings: Weight = 0.7, timeframe 15m
In an uptrend: When implied APR crosses below then above the script, long funding opportunity
In an downtrend: When implied APR crosses above then below the script, shortfunding opportunity
You can determine the trend with the method before, using a weight of 1
To trade funding rates, it's best to have these 3 scripts at these settings:
Predicted Funding Rates: This allows you to see the predicted funding rates and see if they've maxxed out for added confluence too (+/-0.01% usually for Binance BTC futures)
Synthetic implied APR: At weight 1, the MA provides a good trend (whether close above/below or colour change)
Synthetic implied APR: At weight 0.7, it provides a good imitation of volatility
How to use it: Trading Futures
When trading futures:
You can determine roughly what the trend is, if the assumption is made that funding rates can help identify trends if used as a sentiment indicator. It should be supplemented with traditional trend trading methods
To prevent whipsaws, weight should remain high
Long trend: When the implied APR MA turns green OR when it crosses above its MA
Short trend: When the implied APR MA turns red OR when it below above its MA
Why it's original
This indicator introduces a unique synthetic weighting system that combines funding rates, underlying APR, and premium components in a way not found in existing TradingView scripts. Trading funding rates is a niche area, there aren't that many scripts currently available. And to my knowledge, there's no synthetic implied APR scripts available on TradingView either. So I believe this script to be original in that sense.
Notes
Because it depends on my triangular weighting algos, optimal accuracy is found on timeframes that are 4H or less. On higher timeframes, the accuracy drops off. Best timeframes for intraday trading using this are 15m or 1 hour
The higher the timeframe, the lower the MA one should use. At 1 hour, 200 or higher is best. At say, 4h, length of 50 is best
Only works for coins that have a Binance premium index
Inputs
Funding Period - Select between "1 Hour" or "8 Hour" funding cycles. 8 hours is standard for Binance
Table - Toggle the information dashboard on/off to show or hide real-time metrics including funding rate, premium, and APR value
Weight - Controls the balance between funding rate (higher values = smoother) and APR (lower values = more responsive) in the calculation, ranging from 0.0 to 1.0. Default is 0.7, this imitates the volatility
Auto Timeframe Implied Length - Automatically calculates optimal smoothing length based on your chart timeframe for consistent behavior across different time periods
Manual Implied Length - Sets a fixed smoothing length (in bars) when auto mode is disabled, with lower values being more responsive and higher values being smoother
Show Implied APR MA - Displays an additional moving average line of the Synthetic Implied APR to help identify trend direction and crossover signals
MA Type for Implied APR - Selects the calculation method (SMA, EMA, WMA, HMA, VWMA, or RMA) for the moving average, each offering different responsiveness and lag characteristics
MA Length for Implied APR - Sets the lookback period (1-500 bars) for the moving average, with shorter lengths providing more signals and longer lengths filtering noise
Show Underlying APR - Displays the raw APR calculation (without synthetic weighting) as a reference line to compare against the main indicator
Bullish Color - Sets the color for positive values in the table and rising MA line
Bearish Color - Sets the color for negative values in the table and falling MA line
Table Background - Customizes the background color and transparency of the information dashboard
Table Text Color - Sets the color for label text in the left column of the information table
Table Text Size - Controls the font size of table text with options from Tiny to Huge
Normalized WMA Oscillator | OquantNormalized WMA Oscillator | Oquant
The Normalized WMA Oscillator is a trend-momentum indicator designed to help traders visualize the relative position of a Weighted Moving Average (WMA) within its recent price range.
What is a WMA and How It Works:
A Weighted Moving Average (WMA) is a type of moving average that gives more weight to recent price data, making it more responsive to price changes compared to a simple moving average. Each price point in the lookback period is multiplied by a weighting factor, with the most recent prices having the highest weights. The WMA helps traders identify potential trends more quickly.
This indicator applies min-max normalization to the standard WMA, scaling its values between 0 and 1 over a configurable lookback period. This allows traders to see whether the WMA is near its recent highs, lows, or midpoint, regardless of the absolute price level.
Key Features:
WMA Source Input: Choose price source for wma calculation.
Customizable WMA Length: Adjust the sensitivity of the WMA.
Min-Max Normalization Length: Smooth the scaling of WMA values between 0 and 1.
Signal Thresholds: Configurable upper and lower thresholds to indicate potential entries.
Visual Alerts: Color-coded oscillator and candles plot for bullish (green) and bearish (purple) signals.
Alerts Ready: Built-in alert conditions for crossovers and crossunders of the oscillator.
How It Works:
Calculate the WMA on the selected source.
Normalize its value using the minimum and maximum WMA values over the specified lookback period.
Generate long signals when the normalized WMA moves above the upper threshold, and short signals when it moves below the lower threshold.
Plot the oscillator and candles in green for bullish signals and purple for bearish signals.
Inputs:
Source: Data used for WMA calculation.
WMA Length: Period for Weighted Moving Average.
Min-Max Length: Lookback period for min-max scaling.
Upper Threshold: Level above which a long signal is considered.
Lower Threshold: Level below which a short signal is considered.
⚠️ Disclaimer: This indicator is intended for educational and informational purposes only. Trading/investing involves risk, and past performance does not guarantee future results. Always test and evaluate indicators/strategies before applying them in live markets. Use at your own risk.
ICT Suspension BlocksICT Suspension Blocks Indicator
The ICT Suspension Blocks (SB) indicator automatically detects and highlights suspension blocks on your chart — powerful price zones based on volume imbalances that act as strong support/resistance levels.
🔎 What is a Suspension Block?
A suspension block is formed when a single candle shows volume imbalance at both its high and low, creating a “suspension effect” where price often reacts.
Works similarly to a Fair Value Gap (FVG)
Acts as a high-probability reaction zone
Provides traders with clear reference points for entries, exits, and risk management
📊 How the Indicator Works
Identifies bullish and bearish suspension blocks using body gap imbalances.
Draws colored zones (green = bullish, red = bearish) directly on the chart.
Extends zones forward until they are inversed by price action.
Once inversed, zones switch to a neutral color, allowing traders to annotate/extend them manually if desired.
⚙️ Features
Customizable colors for bullish, bearish, and inversed zones
Extend blocks indefinitely forward or limit them to a set number of bars
Adjustable maximum number of displayed blocks for performance control
✅ Why Use This Indicator?
Quickly spot high-probability price reaction zones
Identify strong support/resistance levels created by institutional order flow
Combine with other ICT concepts (FVGs, order blocks, liquidity grabs) for confluence
It is based on these lectures by the Inner Circle Trader , Michael J. Huddleston
ICT Suspension Block & Review September 30, 2025
ICT 2024 Mentorship \ Limit Orders & Volatility Pinball Drills \ October 01, 2024
RSI Trendlines and Divergences█OVERVIEW
The "RSI Trendlines and Divergences" indicator is an advanced technical analysis tool that leverages the Relative Strength Index (RSI) to draw trendlines and detect divergences. Designed for traders seeking precise market signals, the indicator identifies key pivot points on the RSI chart, draws trendlines between pivots, and detects bullish and bearish divergences. It offers flexible settings, background coloring for breakout signals, and divergence labels, supported by alerts for key events. The indicator is universal and works across all markets (stocks, forex, cryptocurrencies) and timeframes.
█CONCEPTS
The indicator was developed to provide an alternative signal source for the RSI oscillator. Trendline breakouts and bounces off trendlines offer a broader perspective on potential price behavior. Combining these with traditional RSI signal interpretation can serve as a foundation for creating various trading strategies.
█FEATURES
- RSI and Pivot Calculation: Calculates RSI based on the selected source price (default: close) with a customizable period (default: 14). Identifies pivot points on RSI and price for trendlines and divergences.
- RSI Trendlines: Draws trendlines connecting RSI pivots (upper for downtrends, lower for uptrends) with optional extension (default: 30 bars). The trendline appears and generates a signal only after the first RSI crossover. Lines are colored (red for upper, green for lower).
- Trendline Fill: Widens the trendline with a tolerance margin expressed in RSI points, reducing signal noise and visually highlighting trend zones. Breaking this zone is a condition for generating signals, minimizing false signals. The tolerance margin can be increased or decreased.
- Divergence Detection: Identifies bullish and bearish divergences based on RSI and price pivots, displaying labels (“Bull” for bullish, “Bear” for bearish) with adjustable transparency. Divergence labels appear with a delay equal to the specified pivot length (default: 5). Higher values yield stronger signals but with greater delay.
- Breakout Signals: Generates signals when RSI crosses the trendline (bullish for upper lines, bearish for lower lines), with background coloring for signal confirmation.
- Alerts: Built-in alerts for:
Detection of bullish and bearish divergences.
Upper trendline crossover (bullish signal).
Lower trendline crossover (bearish signal).
- Customization: Allows adjustment of RSI length, pivot settings, line colors, fills, labels, and transparency of signals and background.
█HOW TO USE
Add the indicator to your TradingView chart via the Pine Editor or Indicators menu.
Configuring Settings.
RSI Settings
- RSI Length: Period for RSI calculation (default: 14).
- SMA Length: Period for RSI moving average (default: 9).
- Source: Source price for RSI (default: close).
Pivot Settings for Trend
- Left Bars for Pivot: Number of bars back for detecting pivots (default: 10).
- Right Bars for Pivot: Number of bars forward for confirming pivots (default: 10).
- Extension after Second Pivot: Number of bars to extend the trendline (default: 30, 0 = none). Extension increases the number of signals, while shortening reduces them.
- Tolerance: Deviation in RSI points to widen the breakout margin, reducing signal noise (default: 3.0).
Divergence Settings
- Enable Divergence Detection: Enables/disables divergence detection (default: enabled).
- Pivot Length for Divergence: Pivot period for divergences (default: 5).
Style Settings
- Upper Trendline Color: Color for downtrend lines (default: red).
- Upper Fill Color: Fill color for upper lines (default: red, transparency 70).
- Lower Trendline Color: Color for uptrend lines (default: green).
- Lower Fill Color: Fill color for lower lines (default: green, transparency 70).
- SMA Color: Color for RSI moving average (default: yellow).
- Bullish Divergence Color: Color for bullish labels (default: green).
- Bearish Divergence Color: Color for bearish labels (default: red).
- Text Color: Color for label text (default: white).
- Divergence Label Transparency: Transparency of labels (0-100, default: 40).
- Signal Background Transparency: Transparency of breakout signal background (0-100, default: 80).
Interpreting Signals
- Trendlines: Upper lines (red) indicate RSI downtrends, lower lines (green) indicate uptrends. The trendline appears and generates a signal only after the first RSI crossover. Trendline breakouts suggest potential trend reversals.
- Divergences: “Bull” labels indicate bullish divergence (potential rise), “Bear” labels indicate bearish divergence (potential decline), with a delay based on pivot length (default: 5). Divergences serve as confirmation or warning of trend reversal, not as standalone signals.
- Signal Background: Green background signals bullish breakouts, red background signals bearish breakouts.
- RSI Levels: Horizontal lines at 70 (overbought), 50 (midline), and 30 (oversold) help assess market zones.
- Alerts: Set up alerts in TradingView for divergences or trendline breakouts.
Combining with Other Tools: Use with support/resistance levels, Fibonacci levels, or other indicators for signal confirmation.
█APPLICATIONS
The "RSI Trendlines and Divergence" indicator is designed to identify trends and potential reversal points, supporting both trend-following and reversal strategies:
- Trend Confirmation: Trendlines indicate the RSI trend direction, with breakouts signaling potential reversals. The indicator is functional in traditional RSI usage, allowing classic RSI interpretation (e.g., returning from overbought/oversold zones). Combining trendline breakouts with RSI signal levels, such as a return from overbought or oversold zones paired with a trendline breakout, strengthens the signal.
- Divergence Detection: Divergences serve as confirmation or warning of trend reversal, not as standalone signals.
█NOTES
- Adjust settings (e.g., RSI length, pivots, tolerance) to suit your trading style and timeframe.
- Combine with other technical analysis tools to enhance signal accuracy.
Actually Engulfing CandlesticksThis thing attempts to find price reversals with actually engulfing candlesticks with volume spikes and RSI values as confirmation. It works well on mean reverting assets I guess.
Green dots below bars = bullish reversal
Fuchsia dots above bars = bearish reversal
Have fun!
FibPulse144 [CHE] FibPulse144 — ADX-gated 13/21 crossover with 144-trend regime and closed-bar labels
Summary
FibPulse144 combines a fast moving-average crossover with a 144-period trend regime and an ADX strength gate. Signals are confirmed on closed bars only and drawn as labels on the price chart, while an ADX line in a separate pane provides context. Color gradients are derived from normalized ADX, so visual intensity reflects trend strength without changing the underlying logic. The approach reduces false flips during weak conditions and keeps entries aligned with the dominant trend.
Motivation: Why this design?
Traditional crossover signals can flip repeatedly during sideways phases and often trigger against the higher-time regime. By requiring alignment with a slower trend proxy and by gating entries through a rising ADX condition, FibPulse144 favors structurally cleaner transitions. Gradient coloring communicates strength visually, helping users temper aggressiveness without additional indicators.
What’s different vs. standard approaches?
Baseline: Classic dual-MA crossover with unconditional signals.
Architecture differences:
Two-bar regime confirmation against a 144-period trend average.
Pending-signal logic that waits for regime and optional ADX approval.
ADX strength gate using the prior reading relative to a user threshold and earlier value.
Gradient colors scaled by an ADX window with gamma controls.
Price-chart labels enforced via overlay on an otherwise pane-based indicator.
Practical effect: Fewer signals during weak or choppy conditions, labels that appear only after a bar closes, and color intensity that mirrors trend quality.
How it works (technical)
The script computes fast and slow moving averages using the selected method and lengths. A separate 144-length average defines the regime using a two-bar confirmation above or below it. Crossovers are observed on the previous bar to avoid intrabar ambiguity; once a prior crossover is detected, it is stored as pending. A pending long requires regime alignment and, if enabled, an ADX condition based on the previous reading being above the threshold and greater than an earlier reading. The state machine holds neutral, long, or short until an exit condition or ADX reset is met. ADX is normalized within a user window, scaled with gamma, and mapped to up and down color palettes to render gradients. Labels on the price panel are forced to overlay, while the ADX line and threshold guide remain in a separate pane.
Parameter Guide
Source — Input data for all calculations. Default: close. Tip: keep consistent with your chart.
MA Type — EMA or SMA. Default: EMA. EMA reacts faster; SMA is smoother.
Fast / Slow — Fast and slow lengths for crossover. Defaults: 13 and 21. Shorter reacts earlier; longer reduces noise.
Trend — Regime average length. Default: 144. Larger values stabilize regime; smaller values increase sensitivity.
Use 144 as trend filter — Enables regime gating. Default: true. Disable to allow raw crossovers.
Use ADX filter — Requires ADX strength. Default: true. Disable to allow signals regardless of strength.
ADX Len — DI and ADX smoothing length. Default: 14. Higher values smooth strength; lower values react faster.
ADX Thresh — Minimum strength for signals. Default: 25. Raise to reduce flips; lower to capture earlier moves.
Entry/Exit labels (price) — Price-panel labels on state changes. Default: true.
Signal labels in ADX pane — Small markers at the ADX value on entries. Default: true.
Label size — tiny, small, normal, large. Default: normal.
Enable barcolor — Optional candle tint by regime and gradient. Default: false.
Enable gradient — Turns on ADX-driven color blending. Default: true.
Window — Bars used to normalize ADX for colors. Default: 100; minimum: 5.
Gamma bars / Gamma plots — Nonlinear scaling for bar and line intensities. Default: 0.80; between 0.30 and 2.00.
Gradient transp (0–90) — Transparency for gradient colors. Default: 0.
MA fill transparency (0–100) — Fill opacity between fast and slow lines. Default: 65.
Palette colors (Up/Down) — Dark and neon endpoints for up and down gradients. Defaults as in the code.
Reading & Interpretation
Fast/Slow lines: When the fast line is above the slow line, the line and fill use the long palette; when below, the short palette is used.
Trend MA (144): Neutral gray line indicating the regime boundary.
Labels on price: “LONG” appears when the state turns long; “SHORT” when it turns short. Labels appear only after the bar closes and conditions are satisfied.
ADX pane: The ADX line shows current strength. The dotted threshold line is the user level for gating. Optional small markers indicate entries at the ADX value.
Bar colors (optional): Candle tint intensity reflects normalized ADX. Higher intensity implies stronger conditions.
Practical Workflows & Combinations
Trend following: Use long entries when fast crosses above slow and price has held above the trend average for two bars, with ADX above threshold. Mirror this for shorts below the trend average.
Exits and stops: Consider reducing exposure when price closes on the opposite side of the trend average for two consecutive bars or when ADX fades below the threshold if the ADX filter is enabled.
Structure confirmation: Combine with higher-timeframe structure such as swing highs and lows or a simple market structure overlay for confirmation.
Multi-asset/Multi-TF: Works across liquid assets. For lower timeframes, consider a slightly lower ADX threshold; for higher timeframes, maintain or raise the threshold to avoid unnecessary flips.
Behavior, Constraints & Performance
Repaint/confirmation: Signals are based on previous-bar crossovers and are confirmed on bar close. No higher-timeframe or security calls are used. Intrabar markers are not relied upon.
Resources: The script declares `max_bars_back` of 2000, uses no loops or arrays, and employs persistent variables for pending signals and state.
Known limits: Crossover systems can lag after sudden reversals. During tight ranges, disabling the ADX filter may increase flips; keeping it enabled may skip early transitions.
Sensible Defaults & Quick Tuning
Starting point: EMA, 13/21/144, ADX length 14, ADX threshold 25, gradients on, barcolor off.
Too many flips: Increase ADX threshold or length; increase trend length; consider SMA instead of EMA.
Too sluggish: Lower ADX threshold slightly; shorten fast and slow lengths; reduce the trend length.
Colors overpowering: Increase gradient transparency or reduce gamma values toward one.
What this indicator is—and isn’t
This is a visualization and signal layer that combines crossover, regime, and strength gating. It does not predict future movements, manage risk, or execute trades. Use it alongside clear structure, risk controls, and a defined position management plan.
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
Integrated Rally + Price % Change DashboardUpdate: Integrated Rally & Price % Change Dashboard 📊
What’s New:
Rally Status added to alerts: Now, every price change alert also shows whether the rally is Getting Stronger or Weakening.
Maintains existing features: Price % Change, OBV trend with % change, ADX value, and Rally Strength visualized in a configurable dashboard.
Fully configurable font size, vertical/horizontal layout, and dashboard position.
Immediate, actionable alerts for intraday traders.
Change Log:
Added rally status to price change alerts for better context on momentum.
Doji @ Simple Areas — Strategy (v7)Twisted FX — Doji @ Simple Areas — Strategy (v7) Educational strategy for standard candles. No financial advice. Use realistic commission + slippage in backtests. For community chat or videos, see the author’s Signature on their profile.
Summary : Doji reversals only where it matters—inside/near ATR-sized supply/demand areas built from swing pivots. Optional quality gating, HTF confluence, and zone-strength scoring help keep the good trades and filter the noise.
What it does
Builds supply/demand areas from swing pivots when the departure is strong enough (ATR-scaled).
Maintains zone lifecycle: tracks touches, confirms retests, expires old zones, and flips a broken zone into the opposite side (optional).
Waits for a doji near/in a zone (strict or loose definition), with optional next-bar confirmation.
Resolves side using (a) which zone you’re closest to, (b) penetration depth, and/or (c) EMA trend.
Optional filters: K-of-4 quality checks, HTF EMA gate, HTF swing-band proximity, and zone strength score.
How signals form
Detect doji (strict: tiny body+both wicks; loose: body ≤ range fraction)
Check near/inside zone (ATR proximity)
Choose side (penetration vs distance; EMA trend optional; prev-candle flip optional)
Optional next-bar confirmation away from the touched zone
Pass quality mode + strength gates; enter at close, stop beyond doji wick (+buffer), TP via RR multiple
Quality modes
Off: widest coverage
Soft: pass K-of-4 (wick rejection, edge-band close, fresh touch, approach impulse)
Strict: auto-tightens thresholds (deeper wick, tighter band, stronger approach, fresher touch) + “rescue” if nearby zone is very strong
Zone strength (0–10)
Based on retests, post-touch reaction, age, and integrity (not broken); separate minimums for Soft/Strict
HTF confluence (optional)
HTF EMA trend gate (longs with uptrend, shorts with downtrend)
HTF swing-band proximity (ATR band around HTF swings)
Defaults are off so you can evaluate the core edge first
Options to play with
Zones/visuals: pivot length, zone half-ATR, min departure, expiry, break tolerance, de-dupe, extend right, Show zones, Hide unconfirmed, nearest-K highlight
Confirmation: retest window (bars), wick-based retest depth (ATR), min bars between signals
Doji rules: strict/loose, body fraction, min range (ATR), near-zone distance (ATR)
Side resolver: use trend (EMAs), use penetration, prev-candle flip, next-bar confirm + confirm ATR
Quality: mode Off/Soft/Strict, K setting, wick penetration ATR, edge-band fraction, approach lookback/min ATR, fresh-touch spacing
Strength gate: min strength Soft/Strict
Risk: RR multiple, stop buffer (micropips/ticks), Fixed qty or Risk % of equity
HTF: timeframe, EMA lengths, swing len, HTF ATR band size
Defaults
Quality mode: Off
HTF trend gate: Off
Show zones: On
Flip on break: On
Tuning tips
Too few trades: Quality → Off/Soft, raise proxATR, lower minRetestsToShow, widen confirm window, enable wick-based retest
Too many losers: try Soft/Strict, raise minStrength*, enable next-bar confirm, raise approachMinATR, enable HTF trend
Confirmed-only is empty: lower minRetestsToShow (e.g., 1) and enable wick-based retest so strong rejections count
Visuals & debug
Toggle “Show zones” and “Hide unconfirmed”; nearest-K highlight brings focus
Debug mode prints veto reasons (quality/HTF/strength/prevFlip/confirm) to help tuning
Notes
Zones come from confirmed pivots; brand-new structure needs a few bars to appear
Research/education only; not financial advice
Changelog (v7.1.5)
Safer arrays, stable nearest-K highlight, strict tuned with rescue, zone-strength consistency loops, defaults set to Quality Off & HTF gate Off, debug veto labels
Keywords
supply demand, doji, wick rejection, ATR, EMA, HTF, RR, confluence, strict filter, zone strength, FX/crypto/indices
HA + EMA Entry/Exit (First Wick Candle Exit)Strategy Logic -
Entry Signals:
BUY: HA candle crosses above 50 EMA
SELL: HA candle crosses below 50 EMA
Exit Signals:
Exit Long: After a BUY, trigger when:
HA candle is solid red (haClose < haOpen)
Candle has a lower wick (haLow < haClose)
Exit Short: After a SELL, trigger when:
HA candle is solid green (haClose > haOpen)
Candle has an upper wick (haHigh > haClose)
Updated -
After a BUY signal:
Look for a red Heikin Ashi candle (haClose < haOpen)
It must have only a lower wick:
✅ haLow < haClose (lower wick exists)
✅ haHigh == haOpen (no upper wick)
After a SELL signal:
Look for a green Heikin Ashi candle (haClose > haOpen)
It must have only an upper wick:
✅ haHigh > haClose (upper wick exists)
✅ haLow == haOpen (no lower wick)
ORB Pro w/ Filters + Debug + ORB Fib + Golden Pocket + HTF Trend🚀 ORB Pro – Advanced Opening Range Breakout System
A professional ORB indicator with built-in filters, retest confirmation, EMA/HTF trend alignment, and automatic risk/reward targets. Designed to eliminate false breakouts and give traders clean LONG/SHORT signals with Fibonacci and debug overlays for maximum precision.
This script is an advanced Opening Range Breakout (ORB) system designed for futures, indices, and options traders who want more precision, cleaner entries, and higher win probability. It combines classic ORB logic with modern filters, Fibonacci confluence, and higher-timeframe trend confirmation.
The indicator automatically:
Plots the ORB box based on user-defined NY session times (default: 9:30–9:45 EST).
Generates long/short signals when price breaks the ORB range, with optional conditions like:
Candle close outside the range
Retest confirmation (with tolerance %)
Volume spike validation
EMA trend alignment
Higher-timeframe EMA slope alignment
Cooldown filters to prevent over-trading
Integrates Fibonacci retracements & extensions from the ORB box for confluence levels.
Includes Golden Pocket (0.5–0.618) retests for precision entries
Risk/Reward visualization — automatically plots stop loss and take profit levels based on user-defined R:R or fixed % levels.
Debug mode overlay to show why a signal is blocked (e.g., low volume, ORB too small, too late, wrong trend).
This tool is built for scalpers, day traders, and 0DTE options traders who need both flexibility and discipline.
⚙️ Inputs & Features
ORB Settings
ORB Start & End Time (NY) → Default: 9:30–9:45
Require Candle Close → Ensures breakouts are confirmed, not wick traps.
Retest Confirmation → Optional retest before entry (tolerance % adjustable).
Filters
Volume Spike → Validates breakouts only with above-average volume.
EMA Trend Filter → Confirms trade direction with EMA slope.
Higher Timeframe Trend → Optional (e.g., 15m ORB with 1h EMA alignment).
Cooldown Bars → Prevents consecutive false signals.
ORB Size Filter → Blocks signals when ORB is too small/too large.
Fibonacci Levels
Retracements: 0.236, 0.382, 0.5, 0.618, 0.786
Extensions: 1.272, 1.618
Golden Pocket Retest filter for high-probability trades
Risk Management
R:R Stops/Targets → Automatically plots SL/TP levels.
Custom Stop % / Take Profit % if not using R:R
Debug Overlay → Explains why signals are blocked
🧑💻 How to Use
Load the indicator on your chart (works best on 1m, 5m, and 15m).
Adjust ORB window (default 9:30–9:45 EST).
Select filters (candle close, retest, volume, EMA, HTF trend).
Watch for Long/Short labels outside ORB box with filters aligned.
Manage trades using plotted SL/TP levels or your own Webull/R:R calculator.
✅ Best Use Cases
Futures (NQ1!, ES1!)
ETFs (QQQ, SPY, IWM)
0DTE Options Trading
Scalping around market open
⚠️ Disclaimer
This tool is for educational purposes only. It does not constitute financial advice. Trading carries risk, and past performance does not guarantee future results. Always test on paper trading before using real capital.
-----------------------------------------
ORB Pro w/ Filters + Debug + ORB Fib + Golden Pocket + HTF Trend
A professional Opening Range Breakout (ORB) toolkit designed for intraday traders who want precision entries, risk-managed exits, and layered confirmation filters. Built for futures, stocks, and ETFs (e.g. NQ, ES, QQQ).
🔎 Core Logic
This script plots and trades breakouts from the Opening Range (9:30 – 9:45 NY time), then applies multiple confirmation filters before signaling a LONG or SHORT setup:
ORB Box: Defines the first 15 minutes of market activity (customizable).
Breakout Candle Confirmation: Requires a candle close outside the ORB box.
Retest Confirmation: Price must retest the ORB edge within tolerance before triggering.
Trend Filter: EMA confirmation to align trades with intraday trend.
Higher-Timeframe Trend Filter: Optional (default: 45-minute EMA) to avoid countertrend trades.
Fibonacci Levels: Auto-plot retracements (0.236 → 0.786) for confluence and trade management.
Golden Pocket Retest (Optional): Adds an extra precision filter at 0.5–0.618 retracement.
⚙️ Default Settings (Optimized for Beginners)
These are the pre-configured inputs so traders can load and trade immediately:
ORB Session: 9:30 – 9:45 NY
✅ Require Candle Close Outside ORB
✅ Require Retest Confirmation (tolerance 0.333%)
❌ Require Volume Spike (off by default, optional toggle)
✅ Require EMA Trend (50 EMA intraday)
✅ Require Higher-TF Trend (45m, EMA 21)
❌ Higher-TF EMA slope required (off)
✅ Cooldown Between Signals (10 bars)
ORB % Range: Min 0.3%, Max 0.5%
Max Minutes After ORB: 180
✅ ORB-based Risk/Reward Stops & Targets (default: 2R)
Stop Loss: 0.5% (if not R:R)
Take Profit: 1% (if not R:R)
✅ Debug Overlay (shows why signals are blocked)
✅ Fibonacci Retracements Plotted
❌ Extensions (off by default, toggle if needed)
✅ Golden Pocket Retest available, tolerance 0.11 (optional)
📈 Signals
Green "LONG" Label: Valid breakout above ORB with trend confirmation.
Red "SHORT" Label: Valid breakdown below ORB with trend confirmation.
Blocked (debug text): Signal suppressed by filters (low volume, too late, no retest, etc.).
🎯 Trade Management
Default R:R is 2:1 (stop at ORB edge, TP projected).
For manual trading (e.g., Webull, IBKR), you can use the plotted TP/SL boxes directly.
Fibonacci + Golden Pocket give additional profit-taking levels and retest filters.
✅ Best Practices
Use 15m chart for main ORB entries.
Confirm direction with HTF trend (45m EMA by default).
Avoid signals blocked by “Low Volume” or “Too Late” (debug helps identify).
Adjust ORB % range for asset volatility (tight for ETFs, wider for futures).
🚀 Why ORB Pro?
This is more than a standard ORB indicator. It’s a professional breakout system with filters designed to avoid false breakouts, automatically handle risk/reward, and guide traders with clear visual signals. Perfect for both systematic day traders and discretionary scalpers who want structure and confidence.
👉 Recommended starting point:
Load defaults → trade the 15m ORB with EMA + HTF filters on → let the script handle retests and stop/target placement.
Universal Breakout Strategy [KedArc Quant]Description:
A flexible breakout framework where you can test different logics (Prev Day, Bollinger, Volume, ATR, EMA Trend, RSI Confirm, Candle Confirm, Time Filter) under one system.
Choose your breakout mode, and the strategy will handle entries, exits, and optional risk management (ATR stops, take-profits, daily loss guard, cooldowns).
An on-chart info table shows live mode values (like Prev High/Low, Bollinger levels, RSI, etc.) plus P&L stats for quick analysis.
Use it to compare which breakout style works best on your instrument and timeframe, whether intraday, swing, or positional trading
🔑 Why it’s useful
* Flexibility: Switch between breakout strategies without loading different indicators.
* Clarity: On-chart info table displays current mode, relevant indicator levels, and live strategy P&L stats.
* Testing efficiency: Quickly A/B test different breakout styles under the same backtest environment.
* Transparency: Every trade is rule-based and displayed with entry/exit markers.
🚀 How it helps traders
* Lets you experiment with breakout strategies quickly without loading multiple scripts.
* Helps identify which breakout method fits your instrument & timeframe.
* Gives clear on-chart visual + statistical feedback for confident decision-making.
⚙️ Input Configuration
* Breakout Mode → choose which strategy to test:
* *Prev Day* → breakouts of yesterday’s High/Low.
* *Bollinger* → Upper/Lower BB pierce.
* *Volume* → Breakout confirmed with volume above average.
* *ATR Stop* → Wide range breakout using ATR filter.
* *Time Filter* → Breakouts inside defined session hours.
* *EMA Trend* → Breakouts only in EMA fast > slow alignment.
* *RSI Confirm* → Breakouts with RSI confirmation (e.g. >55 for longs).
* *Candle Confirm* → Breakouts validated by bullish/bearish candle.
* Lookback / ATR / Bollinger inputs → adjust sensitivity.
* Intrabar mode → option to evaluate breakouts using bar highs/lows instead of closes.
* Table options → show/hide info table, show/hide P&L stats, choose corner placement.
📈 Entry & Exit Logic
* Entry → occurs when breakout condition of chosen mode is met.
* Exit → default exits via opposite signals or optional stop/target if enabled.
* Session filter → optional auto-flat at session end.
* P&L management → optional daily loss guard, cooldown between trades, and ATR-based stop/take profit.
❓ FAQ — Choosing the best setup
Q: Which strategy should I use for which chart?
* *Prev Day Breakouts*: Best on indices, FX, and liquid futures with strong daily levels.
* *Bollinger*: Works well in range-bound environments, or crypto pairs with volatility compression.
* *Volume*: Good on equities where breakout strength is tied to volume spikes.
* *ATR Stop*: Suits volatile instruments (commodities, crypto).
* *EMA Trend*: Useful in trending markets (stocks, indices).
* *RSI Confirm*: Adds momentum filter, better for swing trades.
* *Candle Confirm*: Ideal for scalpers needing visual confirmation.
* *Time Filter*: For intraday traders who want signals only in high-liquidity sessions.
Q: What timeframe should I use?
* Intraday traders → 5m to 15m (Time Filter, Candle Confirm).
* Swing traders → 1H to 4H (EMA Trend, RSI Confirm, ATR Stop).
* Position traders → Daily (Prev Day, Bollinger).
* Breakout
A trade entry condition triggered when price crosses above a resistance level (for longs) or below a support level (for shorts).
* Prev Day High/Low
Formula:
Prev High = High of (Day )
Prev Low = Low of (Day )
* Bollinger Bands
Formula:
Basis = SMA(Close, Length)
Upper Band = Basis + (Multiplier × StdDev(Close, Length))
Lower Band = Basis – (Multiplier × StdDev(Close, Length))
* Volume Confirmation
A breakout is only valid if:
Volume > SMA(Volume, Length)
* ATR (Average True Range)
Measures volatility.
Formula:
ATR = SMA(True Range, Length)
where True Range = max(High–Low, |High–Close |, |Low–Close |)
* EMA (Exponential Moving Average)
Weighted moving average giving more weight to recent prices.
Formula:
EMA = (Price × α) + (EMA × (1–α))
with α = 2 / (Length + 1)
* RSI (Relative Strength Index)
Momentum oscillator scaled 0–100.
Formula:
RSI = 100 – (100 / (1 + RS))
where RS = Avg(Gain, Length) ÷ Avg(Loss, Length)
* Candle Confirmation
Bullish candle: Close > Open AND Close > Close
Bearish candle: Close < Open AND Close < Close
Win Rate (%)
Formula:
Win Rate = (Winning Trades ÷ Total Trades) × 100
* Average Trade P&L
Formula:
Avg Trade = Net Profit ÷ Total Trades
📊 Performance Notes
The Universal Breakout Strategy is designed as a framework rather than a single-asset optimized system. Results will vary depending on the chart, timeframe, and asset chosen.
On the current defaults (15-minute, INR-denominated example), the backtest produced 132 trades over the selected period. This provides a statistically sufficient sample size.
Win rate (~35%) is relatively low, but this is balanced by a positive reward-to-risk ratio (~1.8). In practice, a lower win rate with larger wins versus smaller losses is sustainable.
The average P&L per trade is close to breakeven under default settings. This is expected, as the strategy is not tuned for a single symbol but offered as a universal breakout framework.
Commissions (0.1%) and slippage (1 tick) are included in the simulation, ensuring realistic conditions.
Risk management is conservative, with order sizing set at 1 unit per trade. This avoids over-leveraging and keeps exposure well under the 5-10% equity risk guideline.
👉 Traders are encouraged to:
Experiment with inputs such as ATR period, breakout length, or Bollinger parameters.
Test across different timeframes and instruments (equities, futures, forex, crypto) to find optimal setups.
Combine with filters (trend direction, volatility regimes, or volume conditions) for further refinement.
⚠️ Disclaimer This script is provided for educational purposes only.
Past performance does not guarantee future results.
Trading involves risk, and users should exercise caution and use proper risk management when applying this strategy.
High Time Frame (HTF) Swing PointsPlots levels for simple swing points from up to five higher timeframes. Will default with 5 minute, 15 minute, 1 hour, 4 hour and 1 day timeframes
CRT (Candle Range Theory)+ Daily Bias - Milana Trades Overview
This indicator combines Candle Range Theory (CRT) with a Daily & Weekly Bias model, providing traders with both short-term CRT candle detection and higher-timeframe directional context. It is designed to help traders identify liquidity traps, potential reversals, and overall market bias in a structured and visual way.
🔹 1. Candle Range Theory (CRT)
The CRT module focuses on detecting CRT candles (false breakouts) and marking key high/low ranges.
Bullish CRT :
Occurs when the price makes a lower low compared to the previous candle but closes bullish (close > open).
→ Signals potential upside reversal.
Bearish CRT :
Occurs when the price makes a higher high compared to the previous candle but closes bearish (close < open).
→ Signals potential downside reversal.
When a CRT is detected:
The indicator plots dotted lines and levels from the trap candle’s high/low.
Labels (CRT, CRT H, CRT L) are drawn for easy visualization.
Previous CRT levels/labels can be cleared automatically if desired.
Alerts are triggered once a trap is confirmed (on candle close).
🔹 2. Daily & Weekly Bias
The bias model provides directional context based on daily and weekly candle close
Bias is determined by analyzing:
Breaks of previous highs/lows.
Failed breaks (false moves beyond prior levels).
Inside bars (neutral conditions).
Possible Bias States:
The logic Daily BIAS
Close Above PDH → BULLISH
Close Below PDL → BEARISH
Failed Close Above → BEARISH
Failed Close Below → BULLISH
Inside Range → NEUTRAL
Both Daily and Weekly bias are calculated and displayed in a structured table.
⚠️ Important Note on Daily Bias
The Daily Bias provided by this indicator should be treated as a technical reference, not an absolute signal. Market structure is complex, and automatic bias detection may not always capture context such as news events, liquidity zones, or higher-timeframe confluence.
👉 Always prioritize your own market analysis and discretion over the indicator’s bias. Use the Daily/Weekly bias as a guideline to support your view, rather than as a rule to follow blindly.
🔹 3. Bias Table
A clean on-chart table (top-right corner by default) displays:
Timeframe (Daily / Weekly).
Current bias (Bullish, Bearish, Neutral).
The table is fully customizable:
Colors (header, text, row backgrounds).
Option to show/hide Daily or Weekly bias.
🔹 4. Alerts
The indicator supports real-time alerts:
Bearish CRT detected
Bullish CRT detected
These alerts trigger only on confirmed candle closes, ensuring reliable signals.
🔹 5. Settings
CRT Module
Length → How many bars CRT levels extend.
Clear Broken → Automatically clear past CRT lines when a new trap is detected.
Trap Candle Colors → Define bullish/bearish trap highlight colors.
CRT Line/Label Styling → Customize line style, width, label size, and text/background colors.
Bias Module
Show Table → Enable/disable bias table.
Show Daily / Show Weekly Bias → Toggle specific timeframes.
Colors → Set bullish, bearish, and neutral bias colors.
Table Styling → Customize background, border, header, and row colors.
🔹 6. How to Use
Look for trap candle signals (CRT labels) near important liquidity levels.
Use the Daily & Weekly bias table to confirm whether the broader trend supports the trap signal.
Align CRT signals with bias direction for higher-probability setups.
Use alerts to stay notified of trap events without monitoring the chart constantly.
See the levels. Feel the flow
2MA Cross with Glow Effects 2MA Cross with Glow Effects
Overview
This indicator enhances the classic moving average crossover strategy with a dynamic and visually appealing "glow" effect. It plots two customisable moving averages on the chart and illuminates the area around them when a crossover occurs, providing a clear and intuitive signal for potential trend changes.
Features
Dual Moving Averages: Configure two independent moving averages to suit your trading style.
Multiple MA Types: Choose from a wide range of moving average types for each line, including:
SMA (Simple Moving Average)
EMA (Exponential Moving Average)
WMA (Weighted Moving Average)
VWMA (Volume-Weighted Moving Average)
RMA (Relative Moving Average)
HMA (Hull Moving Average)
ALMA (Arnaud Legoux Moving Average)
LSMA (Least Squares Moving Average)
Customisable Appearance: Adjust the length, line width, and color for each moving average.
Unique Glow Effect: A configurable glow appears around the moving averages during a crossover, providing an unmistakable visual cue. You can control the intensity and width of this effect.
How It Works
The core of the indicator is the calculation of two moving averages based on the user's selected type and length. The script continuously monitors the relationship between these two MAs.
The "glow" is a sophisticated visual effect achieved by using Pine Script's `fill()` function to create a smooth, colored gradient around the MA lines. The glow is conditionally rendered:
When the first moving average (MA1) crosses above the second (MA2), MA1 will glow above its line.
When MA1 crosses below MA2, it will glow below its line.
The same logic is applied to MA2, creating a dual-glow effect that clearly shows which MA is dominant.
To ensure a consistent visual appearance across different chart timeframes, the indicator incorporates a `tfMultiplier` that automatically adjusts the glow's width.
How to Use
This indicator can be used in the same way as a standard moving average crossover strategy
Bullish Signal: Look for the shorter-period moving average to cross above the longer-period moving average. The glow effect will make this event highly visible.
Bearish Signal: Look for the shorter-period moving average to cross below the longer-period moving average.
Traders can use this for trend identification, entry/exit signals, and as a component of a more comprehensive trading system. For example, a common setup is using a 20-period EMA and a 50-period EMA to capture medium-term trends.
Disclaimer
This indicator is designed as a technical analysis tool and should be used in conjunction with other forms of analysis and proper risk management.
Past performance does not guarantee future results, and traders should thoroughly test any strategy before implementing it with real capital.
SuperTrend Optimizer Remastered[CHE] SuperTrend Optimizer Remastered — Grid-ranked SuperTrend with additive or multiplicative scoring
Summary
This indicator evaluates a fixed grid of one hundred and two SuperTrend parameter pairs and ranks them by a simple flip-to-flip return model. It auto-selects the currently best-scoring combination and renders its SuperTrend in real time, with optional gradient coloring for faster visual parsing. The original concept is by KioseffTrading Thanks a lot for it.
For years I wanted to shorten the roughly two thousand three hundred seventy-one lines; I have now reduced the core to about three hundred eighty lines without triggering script errors. The simplification is generalizable to other indicators. A multiplicative return mode was added alongside the existing additive aggregation, enabling different rankings and often more realistic compounding behavior.
Motivation: Why this design?
SuperTrend is sensitive to its factor and period. Picking a single pair statically can underperform across regimes. This design sweeps a compact parameter grid around user-defined lower bounds, measures flip-to-flip outcomes, and promotes the combination with the strongest cumulative return. The approach keeps the visual footprint familiar while removing manual trial-and-error. The multiplicative mode captures compounding effects; the additive mode remains available for linear aggregation.
Originally (by KioseffTrading)
Very long script (~2,371 lines), monolithic structure.
SuperTrend optimization with additive (cumulative percentage-sum) scoring only.
Heavier use of repetitive code; limited modularity and fewer UI conveniences.
No explicit multiplicative compounding option; rankings did not reflect sequence-sensitive equity growth.
Now (remastered by CHE)
Compact core (~380 lines) with the same functional intent, no compile errors.
Adds multiplicative (compounding) scoring alongside additive, changing rankings to reflect real equity paths and penalize drawdown sequences.
Fixed 34×3 grid sweep, live ranking, gradient-based bar/wick/line visuals, top-table display, and an optional override plot.
Cleaner arrays/state handling, last-bar table updates, and reusable simplification pattern that can be applied to other indicators.
What’s different vs. standard approaches?
Baseline: A single SuperTrend with hand-picked inputs.
Architecture differences:
Fixed grid of thirty-four factor offsets across three ATR offsets.
Per-combination flip-to-flip backtest with additive or multiplicative aggregation.
Live ranking with optional “Best” or “Worst” table output.
Gradient bar, wick, and line coloring driven by consecutive trend counts.
Optional override plot to force a specific SuperTrend independent of ranking.
Practical effect: Charts show the currently best-scoring SuperTrend, not a static choice, plus an on-chart table of top performers for transparency.
How it works (technical)
For each parameter pair, the script computes SuperTrend value and direction. It monitors direction transitions and treats a change from up to down as a long entry and the reverse as an exit, measuring the move between entry and exit using close prices. Results are aggregated per pair either by summing percentage changes or by compounding return factors and then converting to percent for comparison. On the last bar, open trades are included as unrealized contributions to ranking. The best combination’s line is plotted, with separate styling for up and down regimes. Consecutive regime counts are normalized within a rolling window and mapped to gradients for bars, wicks, and lines. A two-column table reports the best or worst performers, with an optional row describing the parameter sweep.
Parameter Guide
Factor (Lower Bound) — Starting SuperTrend factor; the grid adds offsets between zero and three point three. Default three point zero. Higher raises distance to price and reduces flips.
ATR Period (Lower Bound) — Starting ATR length; the grid adds zero, one, and two. Default ten. Longer reduces noise at the cost of responsiveness.
Best vs Worst — Ranks by top or bottom cumulative return. Default Best. Use Worst for stress tests.
Calculation Mode — Additive sums percents; Multiplicative compounds returns. Multiplicative is closer to equity growth and can change the leaderboard.
Show in Table — “Top Three” or “All”. Fewer rows keep charts clean.
Show “Parameters Tested” Label — Displays the effective sweep ranges for auditability.
Plot Override SuperTrend — If enabled, the override factor and ATR are plotted instead of the ranked winner.
Override Factor / ATR Period — Values used when override is on.
Light Mode (for Table) — Adjusts table colors for bright charts.
Gradient/Coloring controls — Toggles for gradient bars and wick coloring, window length for normalization, gamma for contrast, and transparency settings. Use these to emphasize or tone down visual intensity.
Table Position and Text Size — Places the table and sets typography.
Reading & Interpretation
The auto SuperTrend plots one line for up regimes and one for down regimes. Color intensity reflects consecutive trend persistence within the chosen window. A small square at the bottom encodes the same gradient as a compact status channel. Optional wick coloring uses the same gradient for maximum contrast. The performance table lists parameter pairs and their cumulative return under the chosen aggregation; positive values are tinted with the up color, negative with the down color. “Long” labels mark flips that open a long in the simplified model.
Practical Workflows & Combinations
Trend following: Use the auto line as your primary bias. Enter on flips aligned with structure such as higher highs and higher lows. Filter with higher-timeframe trend or volatility contraction.
Exits/Stops: Consider conservative exits when color intensity fades or when the opposite line is approached. Aggressive traders can trail near the plotted line.
Override mode: When you want stability across instruments, enable override and standardize factor and ATR; keep the table visible for sanity checks.
Multi-asset/Multi-TF: Defaults travel well on liquid instruments and intraday to daily timeframes. Heavier assets may prefer larger lower bounds or multiplicative mode.
Behavior, Constraints & Performance
Repaint/confirmation: Signals are based on SuperTrend direction; confirmation is best assessed on closed bars to avoid mid-bar oscillation. No higher-timeframe requests are used.
Resources: One hundred and two SuperTrend evaluations per bar, arrays for state, and a last-bar table render. This is efficient for the grid size but avoid stacking many instances.
Known limits: The flip model ignores costs, slippage, and short exposure. Rapid whipsaws can degrade both aggregation modes. Gradients are cosmetic and do not change logic.
Sensible Defaults & Quick Tuning
Start with the provided lower bounds and “Top Three” table.
Too many flips → raise the lower bound factor or period.
Too sluggish → lower the bounds or switch to additive mode.
Rankings feel unstable → prefer multiplicative mode and extend the normalization window.
Visuals too strong → increase gradient transparency or disable wick coloring.
What this indicator is—and isn’t
This is a parameter-sweep and visualization layer for SuperTrend selection. It is not a complete trading system, not predictive, and does not include position sizing, transaction costs, or risk management. Combine with market structure, higher-timeframe context, and explicit risk controls.
Attribution and refactor note: The original work is by KioseffTrading. The script has been refactored from approximately two thousand three hundred seventy-one lines to about three hundred eighty core lines, retaining behavior without compiler errors. The general simplification pattern is reusable for other indicators.
Metadata
Name/Tag: SuperTrend Optimizer Remastered
Pine version: v6
Overlay or separate pane: true (overlay)
Core idea/principle: Grid-based SuperTrend selection by cumulative flip returns with additive or multiplicative aggregation.
Primary outputs/signals: Auto-selected SuperTrend up and down lines, optional override lines, gradient bar and wick colors, “Long” labels, performance table.
Inputs with defaults: See Parameter Guide above.
Metrics/functions used: SuperTrend, ATR, arrays, barstate checks, windowed normalization, gamma-based contrast adjustment, table API, gradient utilities.
Special techniques: Fixed grid sweep, compounding vs linear aggregation, last-bar UI updates, gradient encoding of persistence.
Performance/constraints: One hundred and two SuperTrend calls, arrays of length one hundred and two, label budget, last-bar table updates, no higher-timeframe requests.
Recommended use-cases/workflows: Trend bias selection, quick parameter audits, override standardization across assets.
Compatibility/assets/timeframes: Standard OHLC charts across intraday to daily; liquid instruments recommended.
Limitations/risks: Costs and slippage omitted; mid-bar instability possible; not suitable for synthetic chart types.
Debug/diagnostics: Ranking table, optional tested-range label; internal counters for consecutive trends.
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
Ichimoku Cloud Indicator [TradingFinder] Kinko Hyo Cross Alerts🔵 Introduction
The Ichimoku Cloud (Ichimoku Kinko Hyo) is one of the most powerful and complete trading indicators in technical analysis. Originally developed by Japanese journalist Goichi Hosoda, the Ichimoku system combines multiple tools in one indicator, providing traders with instant insights into trend direction, support and resistance levels, and momentum. Unlike simple moving averages (SMA – Simple Moving Average), the Ichimoku Cloud (Kumo – Cloud) integrates dynamic elements that help traders forecast potential price action with greater clarity.
The Ichimoku Indicator (Ichimoku Signal System) is widely used across global markets, from Forex trading (FX – Foreign Exchange) to stocks, indices, and even cryptocurrencies. Its popularity comes from its ability to generate clear buy signals and sell signals based on the interaction of its components: Tenkan Sen (Conversion Line), Kijun Sen (Base Line), Senkou Span A, Senkou Span B, and Chikou Span (Lagging Line). When combined, these lines create the Ichimoku Cloud, which visually represents the balance between price action and market structure.
Ichimoku Cloud Lines Formulas :
Conversion Line (Tenkan Sen / Conversion Line) : Average of the highest high and lowest low over the past 9 periods => (9-PH + 9-PL) ÷ 2
Base Line (Kijun Sen / Base Line) : Average of the highest high and lowest low over the past 26 periods => (26-PH + 26-PL) ÷ 2
Leading Span A (Senkou Span A / Leading Span A) : Average of the Conversion Line and Base Line, plotted 26 periods ahead => (Tenkan Sen + Kijun Sen) ÷ 2
Leading Span B (Senkou Span B / Leading Span B) : Average of the highest high and lowest low over the past 52 periods, plotted 26 periods ahead => (52-PH + 52-PL) ÷ 2
Lagging Span (Chikou Span / Lagging Span) : Current closing price, plotted 26 periods behind.
One of the biggest advantages of the Ichimoku Trading Strategy (Ichimoku Cloud Trading System) is that it allows traders to identify the market condition at a glance. When the price is above the Kumo (Cloud), it indicates a bullish trend (uptrend). When the price is below the Kumo, the market is in a bearish trend (downtrend). And when the price is inside the cloud, the market is ranging (sideways trend). This simplicity and visual clarity make Ichimoku an essential indicator for both beginner traders and professional analysts.
The Ichimoku Cloud Indicator (Ichimoku Technical Analysis Tool) continues to be one of the most reliable charting methods. Traders often consider it superior to basic moving averages (MA – Moving Average) or exponential moving averages (EMA – Exponential Moving Average), because it not only shows trend direction but also highlights potential future support and resistance levels. With its unique combination of trend analysis, price forecasting, and trading signals, Ichimoku remains a core strategy in modern trading systems.
🔵 How to Use
The Ichimoku Cloud is more than just a set of lines; it’s a complete trading system that helps traders identify trends, momentum, and key support and resistance levels. By combining its five lines Conversion Line, Base Line, Leading Span A, Leading Span B, and Lagging Span traders can develop clear buy and sell strategies.
🟣 Identifying Trend Direction
Bullish Trend (Uptrend) : Price is above the cloud (Kumo), and the cloud is green. Leading Span A is above Leading Span B, signaling strong upward momentum.
Bearish Trend (Downtrend) : Price is below the cloud, and the cloud is red. Leading Span A is below Leading Span B, confirming a downward momentum.
Ranging / Sideways Market : Price is inside the cloud, indicating indecision and consolidation. Traders often avoid opening strong positions during these periods.
🟣 Buy Strategies
Conversion/Base Line Crossover : A buy signal occurs when the Conversion Line (Tenkan Sen) crosses above the Base Line (Kijun Sen). The signal is strongest when this crossover happens above the cloud.
Price Above Base Line : If the price moves above the Base Line while in an uptrend, it confirms bullish momentum and provides a favorable entry point.
Cloud Support Pullback : During a pullback in an uptrend, the price may touch or slightly enter the cloud. Traders can use the cloud as a dynamic support zone for buying opportunities.
Lagging Span Confirmation : Ensure the Lagging Span (Chikou Span) is above the price of 26 periods ago to confirm the strength of the bullish trend.
🟣 Sell Strategies
Conversion/Base Line Crossover : A sell signal is generated when the Conversion Line (Tenkan Sen) crosses below the Base Line (Kijun Sen). This signal is strongest when it occurs below the cloud.
Price Below Base Line : If the price falls below the Base Line in a downtrend, it confirms bearish momentum and strengthens the sell setup.
Cloud Resistance Pullback : During a bounce in a downtrend, the cloud acts as a resistance zone. Traders can enter sell positions when price approaches or touches the cloud from below.
Lagging Span Confirmation : The Lagging Span should be below the price of 26 periods ago, confirming downward momentum.
🟣 Cloud Breakout Signals
A strong buy occurs when the price breaks above the cloud from below, signaling a potential trend reversal.
A strong sell occurs when the price breaks below the cloud from above, indicating a shift toward a bearish trend.
🟣 Combining Signals for Stronger Entries
For higher probability trades, combine multiple signals : trend direction (cloud color and position), crossovers (Tenkan/Kijun), and Lagging Span position.
Avoid trading against the overall trend. For example, avoid buying when price is below a red cloud or selling when price is above a green cloud.
🔵 Setting
Tenkan Sen Period : Lookback period for Conversion Line (default: 9).
Kijun Sen Period : Lookback period for Base Line (default: 26).
Span B Period : Lookback period for Leading Span B, forms one Cloud boundary (default: 52).
Shift Lines : Periods forward for Cloud / backward for Lagging Span (default: 26).
Cross Tenkan/Kijun Alert : Alert on Conversion/Base Line crossover.
Cross Price/Tenkan Alert : Alert when price crosses Tenkan Sen.
Cross Price/Kijun Alert : Alert when price crosses Kijun Sen
🔵 Conclusion
The Ichimoku Cloud (Ichimoku Kinko Hyo) is much more than a simple indicator it is a complete trading system that combines trend detection, momentum analysis, and support/resistance identification in one view. By interpreting the position of price relative to the cloud, the interaction between Tenkan Sen (Conversion Line) and Kijun Sen (Base Line), the leading spans (Senkou Span A and B), and the Chikou Span (Lagging Line), traders can identify potential buy and sell opportunities with higher confidence.
The main advantage of the Ichimoku Cloud is its ability to provide a “one-look equilibrium” snapshot of the market. It highlights bullish trends when the price is above the cloud, bearish conditions when the price is below it, and indecision or transition when the price is inside the cloud. Crossovers, cloud breakouts, and confirmations by the Chikou Span strengthen the trading signals.
However, traders should keep in mind the limitations of the Ichimoku system. It is based on historical data and should not be used in isolation. Combining it with other tools such as RSI, volume analysis, or candlestick patterns can significantly improve accuracy and reduce false signals.
Open Range Breakout (ORB) with Alerts and LabelsThis is a classic 5min ORB indicator that highlights the orb range for your chosen session. This makes it easy to reference the range later in the trading day. In addition to the original orb signals for both buy and sell you can play off that zone for powerful entries later in the session. The signals give TP1 1:1 TP2 2:1
Options
You can set the name of the session
The color of the range.
The buffer for the SL
How many entries for the orb
CRT Candle + EMA Cross StrategyCRT with EMA Crossover:
CRT Candle:
Highlights the qualifying candle with a yellow triangle.
Shows “CRT” text on top.
EMA 9/16 Crosses:
Bullish cross → green triangle below candle.
Bearish cross → red triangle above candle.
EMA 200:
Plotted as trend reference.
Works multi-timeframe for CRT detection.
Clean and visual, no trades, purely signals.
Bazaarbull - Smart Money Concepts// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © Bazaarbull
//
//@version=5
indicator("Bazaarbull - Smart Money Concepts", "Bazaarbull - Smart Money Concepts ",
overlay = true,
max_bars_back = 5000,
max_boxes_count = 500,
max_labels_count = 500,
max_lines_count = 500,
max_polylines_count = 100)
plot(na)
//
MSG = "MARKET STRUCTURE"
VBG = "VOLUMETRIC ORDER BLOCKS"
MST = "Limit market structure calculation to improve memory speed time"
SLT = " Limit swing structure to tot bars back"
IDT = " Start date of the internal structure"
CST = "Color candle based on trend detection system"
OBT = "Display internal buy and sell activity"
OBD = "Show Last number of orderblock"
OBMT = " Use Length to adjust cordinate of the orderblocks Use whole candle body"
_ ='
------------
–––––––––––––––––––––––––– INPUTS –––––––––––––––––––––––––––
------------ '//{
bool windowsis = input.bool(true, "Window", inline="kla", group=MSG)
int mswindow = input.int(5000, "", tooltip=MST,group=MSG, inline="kla", minval=1000)
bool showSwing = input.bool(true, "Swing", inline="scss", group=MSG)
int swingLimit = input.int(100, "", tooltip=SLT, inline="scss", group=MSG, minval=10, maxval=200)
color swingcssup = input.color(#089981, "", inline="scss", group=MSG)
color swingcssdn = input.color(#f23645, "", inline="scss", group=MSG)
bool showMapping = input.bool(false, "Mapping Structure", inline="mapping", group=MSG)
string mappingStyle = input.string("----", "", options= , inline="mapping", group=MSG)
color mappingcss = input.color(color.silver, "", tooltip="Display Mapping Structure", inline="mapping", group=MSG)
bool candlecss = input.bool(false, "Color Candles", tooltip=CST, group=MSG, inline="txt")
string mstext = input.string("Tiny", "", options= ,
inline="txt", group=MSG)
string msmode = input.string("Adjusted Points", "Algorithmic Logic", options=
, inline="node", group=MSG)
int mslen = input.int(5, "", inline="node", group=MSG, minval=2)
bool buildsweep = input.bool(true, "Build Sweep (x)", "Build sweep on market structure", "znc", MSG)
bool msbubble = input.bool(true, "Bubbles", tooltip="Display Circle Bubbles", inline="bubbles", group=MSG)
bool obshow = input.bool(true, "Show Last", tooltip=OBD, group=VBG, inline="obshow")
int oblast = input.int(5, "", group=VBG, inline="obshow", minval=0)
color obupcs = input.color(color.new(#089981, 90), "", inline="obshow", group=VBG)
color obdncs = input.color(color.new(#f23645, 90), "", inline="obshow", group=VBG)
bool obshowactivity = input.bool(true, "Show Buy/Sell Activity", inline="act", group=VBG, tooltip=OBT)
color obactup = input.color(color.new(#089981, 50), "", inline="act", group=VBG)
color obactdn = input.color(color.new(#f23645, 50), "", inline="act", group=VBG)
obshowbb = input.bool(false, "Show Breakers", inline="bb", group=VBG, tooltip="Display Breakers")
color bbup = input.color(color.new(#089981, 100), "", inline="bb", group=VBG)
color bbdn = input.color(color.new(#f23645, 100), "", inline="bb", group=VBG)
obmode = input.string("Length", "Construction", options= , tooltip=OBMT, inline="atr", group=VBG)
len = input.int(5, "", inline="atr", group=VBG, minval=1)
obmiti = input.string("Close", "Mitigation Method", options= ,
tooltip="Mitigation method for when to trigger order blocks", group=VBG)
obtxt = input.string("Normal", "Metric Size", options= ,
tooltip="Order block Metrics text size", inline="txt", group=VBG)
showmetric = input.bool(true, "Show Metrics", group=VBG)
showline = input.bool(true, "Show Mid-Line", group=VBG)
overlap = input.bool(true, "Hide Overlap", group=VBG, inline="ov")
wichlap = input.string("Recent", "", options= , inline="ov", group=VBG)
fvg_enable = input.bool(false, "", inline="1", group="FAIR VALUE GAP", tooltip="Display fair value gap")
what_fvg = input.string("FVG", "", inline="1", group="FAIR VALUE GAP", tooltip="Display fair value gap",
options= )
fvg_num = input.int(5, "Show Last", inline="1a", group="FAIR VALUE GAP", tooltip="Number of fvg to show", minval=0)
fvg_upcss = input.color(color.new(#089981, 80), "", inline="1", group="FAIR VALUE GAP")
fvg_dncss = input.color(color.new(#f23645, 80), "", inline="1", group="FAIR VALUE GAP")
fvgbbup = input.color(color.new(#089981, 100), "", inline="1", group="FAIR VALUE GAP")
fvgbbdn = input.color(color.new(#f23645, 100), "", inline="1", group="FAIR VALUE GAP")
fvg_src = input.string("Close", "Mitigation",
inline="3",
group="FAIR VALUE GAP",
tooltip=" Use the close of the body as trigger Use the extreme point of the body as trigger",
options= )
fvgthresh = input.float(0, "Threshold", tooltip="Filter out non significative FVG", group="FAIR VALUE GAP",
inline="asd", minval=0, maxval=2, step=0.1)
fvgoverlap = input.bool(true, "Hide Overlap", "Hide overlapping FVG", group="FAIR VALUE GAP")
fvgline = input.bool(true, "Show Mid-Line", group="FAIR VALUE GAP")
fvgextend = input.bool(false, "Extend FVG", group="FAIR VALUE GAP")
dispraid = input.bool(false, "Display Raids", inline="raid", group="FAIR VALUE GAP")
//}
_ ='
------------
–––––––––––––––––––––––––– UDT –––––––––––––––––––––––––––
------------ '//{
type hqlzone
box pbx
box ebx
box lbx
label plb
label elb
label lbl
type Zphl
line top
line bottom
label top_label
label bottom_label
bool stopcross
bool sbottomcross
bool itopcross
bool ibottomcross
string txtup
string txtdn
float topy
float bottomy
float topx
float bottomx
float tup
float tdn
int tupx
int tdnx
float itopy
float itopx
float ibottomy
float ibottomx
float uV
float dV
type entered
bool normal = false
bool breaker = false
type store
line ln
label lb
box bx
linefill lf
type structure
int zn
float zz
float bos
float choch
int loc
int temp
int trend
int start
float main
int xloc
bool upsweep
bool dnsweep
string txt = na
type drawms
int x1
int x2
float y
string txt
color css
string style
type ob
bool bull
float top
float btm
float avg
int loc
color css
float vol
int dir
int move
int blPOS
int brPOS
int xlocbl
int xlocbr
bool isbb = false
int bbloc
type FVG
float top = na
float btm = na
int loc = bar_index
bool isbb = false
int bbloc = na
bool israid = false
float raidy = na
int raidloc = na
int raidx2 = na
bool active = false
color raidcs = na
type SFP
float y
int loc
float ancor
type sfpbuildlbl
int x
float y
string style
color css
string txt
type sfpbuildline
int x1
int x2
float y
color css
float ancor
int loc
type equalbuild
int x1
float y1
int x2
float y2
color css
string style
type equalname
int x
float y
string txt
color css
string style
type ehl
float pt
int t
float pb
int b
type sellbuyside
float top
float btm
int loc
color css
string txt
float vol
type timer
bool start = false
int count = 0
//}
_ ='
------------
–––––––––––––––––––––––––– SETUP –––––––––––––––––––––––––––
------------ '//{
var store bin = store.new(
array.new< line >()
, array.new< label >()
, array.new< box >()
, array.new()
)
var entered blobenter = entered.new()
var entered brobenter = entered.new()
var entered blfvgenter = entered.new()
var entered brfvgenter = entered.new()
var entered blarea = entered.new()
var entered brarea = entered.new()
var timer lc = timer.new ()
if barstate.islast
for obj in bin.ln
obj.delete()
for obj in bin.lb
obj.delete()
for obj in bin.bx
obj.delete()
for obj in bin.lf
obj.delete()
bin.ln.clear()
bin.lb.clear()
bin.bx.clear()
bin.lf.clear()
invcol = #ffffff00
float atr = (ta.atr(200) / (5/len))
//}
_ ='
------------
–––––––––––––––––––––––––– UTILITY –––––––––––––––––––––––––––
------------ '//{
method txSz(string s) =>
out = switch s
"Tiny" => size.tiny
"Small" => size.small
"Normal" => size.normal
"Large" => size.large
"Huge" => size.huge
"Auto" => size.auto
out
method lstyle(string style) =>
out = switch style
'⎯⎯⎯⎯' => line.style_solid
'----' => line.style_dashed
'····' => line.style_dotted
ghl() => [high , low , close , open , close, open, high, low, high , low , ta.atr(200)]
method IDMIDX(bool use_max, int loc) =>
min = 99999999.
max = 0.
idx = 0
if use_max
for i = 0 to (bar_index - loc)
max := math.max(high , max)
min := max == high ? low : min
idx := max == high ? i : idx
else
for i = 0 to (bar_index - loc)
min := math.min(low , min)
max := min == low ? high : max
idx := min == low ? i : idx
idx
SFPData() => [high, high , high , low, low , low , close, volume, time, bar_index , time ]
SFPcords() =>
RealTF = barstate.isrealtime ? 0 : 1
= SFPData()
[h , h1 , h2 , l , l1 , l2 , c , v , t , n , t1 ]
method find(structure ms, bool use_max, bool sweep, bool useob) =>
min = 99999999.
max = 0.
idx = 0
if not sweep
if ((bar_index - ms.loc) - 1) > 0
if use_max
for i = 0 to (bar_index - ms.loc) - 1
max := math.max(high , max)
min := max == high ? low : min
idx := max == high ? i : idx
if useob
if high > high
max := high
min := low
idx := idx + 1
else
for i = 0 to (bar_index - ms.loc) - 1
min := math.min(low , min)
max := min == low ? high : max
idx := min == low ? i : idx
if useob
if low < low
max := high
min := low
idx := idx + 1
else
if use_max
for i = 0 to (bar_index - ms.loc)
max := math.max(high , max)
min := max == high ? low : min
idx := max == high ? i : idx
if useob
if high > high
max := high
min := low
idx := idx + 1
else
for i = 0 to (bar_index - ms.loc)
min := math.min(low , min)
max := min == low ? high : max
idx := min == low ? i : idx
if useob
if low < low
max := high
min := low
idx := idx + 1
else
if ((bar_index - ms.xloc) - 1) > 0
if use_max
for i = 0 to (bar_index - ms.xloc) - 1
max := math.max(high , max)
min := max == high ? low : min
idx := max == high ? i : idx
if useob
if high > high
max := high
min := low
idx := idx + 1
else
for i = 0 to (bar_index - ms.xloc) - 1
min := math.min(low , min)
max := min == low ? high : max
idx := min == low ? i : idx
if useob
if low < low
max := high
min := low
idx := idx + 1
else
if use_max
for i = 0 to (bar_index - ms.xloc)
max := math.max(high , max)
min := max == high ? low : min
idx := max == high ? i : idx
if useob
if high > high
max := high
min := low
idx := idx + 1
else
for i = 0 to (bar_index - ms.xloc)
min := math.min(low , min)
max := min == low ? high : max
idx := min == low ? i : idx
if useob
if low < low
max := high
min := low
idx := idx + 1
idx
method fnOB(ob block, bool bull, float cords, int idx) =>
switch bull
true =>
blobenter.normal := false
blobenter.breaker := false
block.unshift(
ob.new(
true
, cords
, low
, math.avg(cords, low )
, time
, obupcs
, volume
, close > open ? 1 : -1
, 1
, 1
, 1
, time
)
)
false =>
brobenter.normal := false
brobenter.breaker := false
block.unshift(
ob.new(
false
, high
, cords
, math.avg(cords, high )
, time
, obdncs
, volume
, close > open ? 1 : -1
, 1
, 1
, 1
, time
)
)
method mitigated(ob block) =>
if barstate.isconfirmed
for in block
if not stuff.isbb
switch stuff.bull
true =>
if obmiti == "Close" ? math.min(close, open) < stuff.btm : obmiti == "Wick" ? low < stuff.btm : obmiti == "Avg" ? low < stuff.avg : na
stuff.isbb := true
stuff.bbloc := time
if not obshowbb
block.remove(i)
false =>
if obmiti == "Close" ? math.max(close, open) > stuff.top : obmiti == "Wick" ? high > stuff.top : obmiti == "Avg" ? high > stuff.avg : na
stuff.isbb := true
stuff.bbloc := time
if not obshowbb
block.remove(i)
else
switch stuff.bull
true =>
if obmiti == "Close" ? math.max(close, open) > stuff.top : obmiti == "Wick" ? high > stuff.top : obmiti == "Avg" ? high > stuff.avg : na
block.remove(i)
false =>
if obmiti == "Close" ? math.min(close, open) < stuff.btm : obmiti == "Wick" ? low < stuff.btm : obmiti == "Avg" ? low < stuff.avg : na
block.remove(i)
overlap(ob bull, ob bear) =>
if bull.size() > 1
for i = bull.size() - 1 to 1
stuff = bull.get(i)
current = bull.get(0)
v = wichlap == "Recent" ? i : 0
switch
stuff.btm > current.btm and stuff.btm < current.top => bull.remove(v)
stuff.top < current.top and stuff.btm > current.btm => bull.remove(v)
stuff.top > current.top and stuff.btm < current.btm => bull.remove(v)
stuff.top < current.top and stuff.top > current.btm => bull.remove(v)
if bear.size() > 1
for i = bear.size() - 1 to 1
stuff = bear.get(i)
current = bear.get(0)
v = wichlap == "Recent" ? i : 0
switch
stuff.btm > current.btm and stuff.btm < current.top => bear.remove(v)
stuff.top < current.top and stuff.btm > current.btm => bear.remove(v)
stuff.top > current.top and stuff.btm < current.btm => bear.remove(v)
stuff.top < current.top and stuff.top > current.btm => bear.remove(v)
if bull.size() > 0 and bear.size() > 0
for i = bull.size() - 1 to 0
stuff = bull.get(i)
current = bear.get(0)
v = wichlap == "Recent" ? 0 : i
switch
stuff.btm > current.btm and stuff.btm < current.top => bull.remove(v)
stuff.top < current.top and stuff.btm > current.btm => bull.remove(v)
stuff.top > current.top and stuff.btm < current.btm => bull.remove(v)
stuff.top < current.top and stuff.top > current.btm => bull.remove(v)
if bull.size() > 0 and bear.size() > 0
for i = bear.size() - 1 to 0
stuff = bear.get(i)
current = bull.get(0)
v = wichlap == "Recent" ? 0 : i
switch
stuff.btm > current.btm and stuff.btm < current.top => bear.remove(v)
stuff.top < current.top and stuff.btm > current.btm => bear.remove(v)
stuff.top > current.top and stuff.btm < current.btm => bear.remove(v)
stuff.top < current.top and stuff.top > current.btm => bear.remove(v)
overlapFVG(FVG blFVG, FVG brFVG) =>
if blFVG.size() > 1
for i = blFVG.size() - 1 to 1
stuff = blFVG.get(i)
current = blFVG.get(0)
switch
stuff.btm > current.btm and stuff.btm < current.top => blFVG.remove(i)
stuff.top < current.top and stuff.btm > current.btm => blFVG.remove(i)
stuff.top > current.top and stuff.btm < current.btm => blFVG.remove(i)
stuff.top < current.top and stuff.top > current.btm => blFVG.remove(i)
if brFVG.size() > 1
for i = brFVG.size() - 1 to 1
stuff = brFVG.get(i)
current = brFVG.get(0)
switch
stuff.btm > current.btm and stuff.btm < current.top => brFVG.remove(i)
stuff.top < current.top and stuff.btm > current.btm => brFVG.remove(i)
stuff.top > current.top and stuff.btm < current.btm => brFVG.remove(i)
stuff.top < current.top and stuff.top > current.btm => brFVG.remove(i)
if blFVG.size() > 0 and brFVG.size() > 0
for i = blFVG.size() - 1 to 0
stuff = blFVG.get(i)
current = brFVG.get(0)
switch
stuff.btm > current.btm and stuff.btm < current.top => blFVG.remove(i)
stuff.top < current.top and stuff.btm > current.btm => blFVG.remove(i)
stuff.top > current.top and stuff.btm < current.btm => blFVG.remove(i)
stuff.top < current.top and stuff.top > current.btm => blFVG.remove(i)
if blFVG.size() > 0 and brFVG.size() > 0
for i = brFVG.size() - 1 to 0
stuff = brFVG.get(i)
current = blFVG.get(0)
switch
stuff.btm > current.btm and stuff.btm < current.top => brFVG.remove(i)
stuff.top < current.top and stuff.btm > current.btm => brFVG.remove(i)
stuff.top > current.top and stuff.btm < current.btm => brFVG.remove(i)
stuff.top < current.top and stuff.top > current.btm => brFVG.remove(i)
method umt(ob metric) =>
switch metric.dir
1 =>
switch metric.move
1 => metric.blPOS := metric.blPOS + 1, metric.move := 2
2 => metric.blPOS := metric.blPOS + 1, metric.move := 3
3 => metric.brPOS := metric.brPOS + 1, metric.move := 1
-1 =>
switch metric.move
1 => metric.brPOS := metric.brPOS + 1, metric.move := 2
2 => metric.brPOS := metric.brPOS + 1, metric.move := 3
3 => metric.blPOS := metric.blPOS + 1, metric.move := 1
if (time - time ) == (time - time )
metric.xlocbl := metric.loc + (time - time ) * metric.blPOS
metric.xlocbr := metric.loc + (time - time ) * metric.brPOS
method display(ob id, ob full, int i) =>
if not id.isbb
bin.bx.unshift(box.new (top = id.top, bottom = id.btm, left = id.loc, right = time , border_color = na , bgcolor = id.css, xloc = xloc.bar_time))
bin.bx.unshift(box.new (top = id.top, bottom = id.btm, left = time , right = time + 1 , border_color = na , bgcolor = id.css, xloc = xloc.bar_time, extend = extend.right))
else
bin.bx.unshift(box.new (top = id.top, bottom = id.btm, left = id.loc , right = id.bbloc , border_color = na , bgcolor = id.css , xloc = xloc.bar_time))
bin.bx.unshift(box.new (top = id.top, bottom = id.btm, left = id.bbloc , right = time , border_color = id.css , bgcolor = id.bull ? bbup : bbdn , xloc = xloc.bar_time, border_width = 2))
bin.bx.unshift(box.new (top = id.top, bottom = id.btm, left = time , right = time + 1 , border_color = id.css , bgcolor = id.bull ? bbup : bbdn , xloc = xloc.bar_time, extend = extend.right))
if obshowactivity
bin.bx.unshift(box.new (top = id.top, bottom = id.avg, left = id.loc , right = id.xlocbl, border_color = na , bgcolor = obactup, xloc = xloc.bar_time))
bin.bx.unshift(box.new (top = id.avg, bottom = id.btm, left = id.loc , right = id.xlocbr, border_color = na , bgcolor = obactdn, xloc = xloc.bar_time))
if showline
bin.ln.unshift(line.new(
x1 = id.loc
, x2 = time
, y1 = id.avg
, y2 = id.avg
, color = color.new(id.css, 0)
, xloc = xloc.bar_time
, style = line.style_dashed
)
)
if showmetric
if i == math.min(oblast - 1, full.size() - 1)
float tV = 0
float dV = array.new()
seq = math.min(oblast - 1, full.size() - 1)
for j = 0 to seq
cV = full.get(j)
tV += cV.vol
if j == seq
for y = 0 to seq
dV.push(
math.floor(
(full.get(y).vol / tV) * 100)
)
ids = full.get(y)
bin.lb.unshift(label.new(
bar_index - 1
, ids.avg
, textcolor = color.new(ids.css, 0)
, style = label.style_label_left
, size = obtxt.txSz()
, color = #ffffff00
, text =
str.tostring(
math.round(full.get(y).vol, 3), format = format.volume) + " (" + str.tostring(dV.get(y)) + "%)"
)
)
method dispFVG(FVG fvg, int i, bool bull) =>
ext = fvgextend ? extend.right : extend.none
if not fvg.isbb
bin.bx.unshift(box .new(top = fvg.top, bottom = fvg.btm, left = fvg.loc , right = time , border_color = na , bgcolor = bull ? fvg_upcss : fvg_dncss , xloc = xloc.bar_time, extend = ext))
if fvgline
bin.ln.unshift(line.new(x1 = fvg.loc, x2 = time , y1 = math.avg(fvg.top, fvg.btm), y2 = math.avg(fvg.top, fvg.btm), xloc = xloc.bar_time, color = color.new(bull ? fvg_upcss : fvg_dncss, 0) , extend = ext))
if dispraid
bin.ln.unshift(line.new(x1 = fvg.raidloc, x2 = fvg.raidx2, y1 = fvg.raidy, y2 = fvg.raidy, xloc = xloc.bar_time, color = fvg.raidcs))
bin.lb.unshift(label.new(x = int(math.avg(fvg.raidloc, fvg.raidx2)), y = fvg.raidy, text = "x", xloc = xloc.bar_time, textcolor = fvg.raidcs, style = bull ? label.style_label_up : label.style_label_down, size = size.small, color = #ffffff00))
else
bin.bx.unshift(box .new(top = fvg.top , bottom = fvg.btm, left = fvg.loc , right = fvg.bbloc , border_color = na , bgcolor = bull ? fvg_upcss : fvg_dncss, xloc = xloc.bar_time))
bin.bx.unshift(box .new(top = fvg.top , bottom = fvg.btm, left = fvg.bbloc , right = time , border_color = bull ? fvg_dncss : fvg_upcss , bgcolor = bull ? fvg_dncss : fvg_upcss, xloc = xloc.bar_time, extend = ext))
if fvgline
bin.ln.unshift(line.new(x1 = fvg.loc , x2 = fvg.bbloc , y1 = math.avg(fvg.top, fvg.btm), y2 = math.avg(fvg.top, fvg.btm), color = color.new(bull ? fvg_upcss : fvg_dncss, 0) , xloc = xloc.bar_time))
bin.ln.unshift(line.new(x1 = fvg.bbloc, x2 = time , y1 = math.avg(fvg.top, fvg.btm), y2 = math.avg(fvg.top, fvg.btm), color = color.new(bull ? fvg_dncss : fvg_upcss, 0) , xloc = xloc.bar_time, extend = ext, style = line.style_dashed))
//}
_ ='
------------
–––––––––––––––––––––––––– FUNCTION –––––––––––––––––––––––––––
------------ '//{
mapping() =>
var float up = na
var float dn = na
var float point = na
var int trend = 0
var int idx = na
var int sum = na
var int project = na
var chart.point charts = array.new()
if na(up)
up := high
idx := bar_index
if na(dn)
dn := low
idx := bar_index
if high > up
if trend == -1
id = IDMIDX(false, idx)
charts.unshift(
chart.point.from_time(
time
, low
)
)
idx := bar_index
point := low
sum := time
up := high
dn := low
project := time
trend := 1
if low < dn
if trend == 1
id = IDMIDX(true, idx)
charts.unshift(
chart.point.from_time(
time
, high
)
)
idx := bar_index
point := high
sum := time
up := high
dn := low
project := time
trend := -1
if barstate.islast
var line ln = na
var polyline pl = na
ln.delete()
pl.delete()
ln := na
pl := na
ln := line.new(
x1 = sum
, x2 = project
, y1 = point
, y2 = trend == 1 ? up : dn
, xloc = xloc.bar_time
, color = color.red
)
pl := polyline.new(
charts
, line_color = mappingcss
, xloc = xloc.bar_time
, line_style = mappingStyle.lstyle()
)
dFVG() =>
= ghl()
var FVG blFVG = array.new()
var FVG brFVG = array.new()
bool upfvg = false
bool dnfvg = false
float blth = l1 + (fvatr * fvgthresh)
float brth = h1 - (fvatr * fvgthresh)
cc = timeframe.change()
switch
what_fvg == "FVG" or what_fvg == "Breakers" =>
if l > h2 and cc and c1 > blth
upfvg := true
if l2 > h and cc and c1 < brth
dnfvg := true
if upfvg
if blFVG.size() > 0
fvg = blFVG.get(0)
if fvg.israid == true and fvg.active == false
fvg.active := true
fvg.raidloc := na
fvg.raidx2 := na
fvg.raidy := na
fvg.raidcs := #ffffff00
blFVG.unshift(
FVG.new(
l
, h2
, time
, false
, na
)
)
if dnfvg
if brFVG.size() > 0
fvg = brFVG.get(0)
if fvg.israid == true and fvg.active == false
fvg = brFVG.get(0)
fvg.active := true
fvg.active := true
fvg.raidloc := na
fvg.raidx2 := na
fvg.raidy := na
fvg.raidcs := #ffffff00
brFVG.unshift(
FVG.new(
l2
, h
, time
, false
, na
)
)
if blFVG.size() > 0
for in blFVG
if not fvg.isbb
if fvg_src == "Close" ? math.min(c, o) < fvg.btm : fvg_src == "Wick" ? l < fvg.btm : fvg_src == "Avg" ? l < math.avg(fvg.top, fvg.btm) : na
fvg.isbb := true
fvg.bbloc := time
if what_fvg == "FVG"
blFVG.remove(i)
else
if (fvg_src == "Close" ? math.max(c, o) > fvg.top : fvg_src == "Wick" ? h > fvg.top : fvg_src == "Avg" ? h > math.avg(fvg.top, fvg.btm) : na) and what_fvg == "Breakers"
blFVG.remove(i)
if brFVG.size() > 0
for in brFVG
if not fvg.isbb
if (fvg_src == "Close" ? math.max(c, o) > fvg.top : fvg_src == "Wick" ? h > fvg.top : fvg_src == "Avg" ? h > math.avg(fvg.top, fvg.btm) : na)
fvg.isbb := true
fvg.bbloc := time
if what_fvg == "FVG"
brFVG.remove(i)
else
if (fvg_src == "Close" ? math.min(c, o) < fvg.btm : fvg_src == "Wick" ? l < fvg.btm : fvg_src == "Avg" ? l < math.avg(fvg.top, fvg.btm) : na) and what_fvg == "Breakers"
brFVG.remove(i)
if fvgoverlap
overlapFVG(blFVG, brFVG)
if dispraid
for in blFVG
if not fvg.israid and not fvg.isbb
if low < fvg.top and close > fvg.top
fvg.israid := true
fvg.raidloc := time
fvg.raidx2 := time
fvg.raidy := low
fvg.raidcs := chart.fg_color
else
if low <= fvg.raidy and fvg.active == false and not fvg.isbb
fvg.active := true
fvg.raidx2 := time
else
if fvg.active == false and not fvg.isbb
fvg.raidx2 := time
for in brFVG
if not fvg.israid and not fvg.isbb
if high > fvg.btm and close < fvg.btm and not fvg.isbb
fvg.israid := true
fvg.raidloc := time
fvg.raidy := high
fvg.raidx2 := time
fvg.raidcs := chart.fg_color
else
if high >= fvg.raidy and fvg.active == false and not fvg.isbb
fvg.active := true
fvg.raidx2 := time
else
if fvg.active == false and not fvg.isbb
fvg.raidx2 := time
if barstate.islast
if blFVG.size() > 0 and fvg_num > 0
for i = 0 to math.min(fvg_num - 1, blFVG.size() - 1)
fvg = blFVG.get(i)
dispFVG(fvg, i, true)
if brFVG.size() > 0 and fvg_num > 0
for i = 0 to math.min(fvg_num - 1, brFVG.size() - 1)
fvg = brFVG.get(i)
dispFVG(fvg, i, false)
structure(color upcss, color dncss, bool draw, bool internal, int limit) =>
var structure ms = structure.new(start = 0)
var ob blob = array.new< ob >()
var ob brob = array.new< ob >()
var drawms bldw = array.new< drawms >()
var drawms brdw = array.new< drawms >()
var sellbuyside sellside = array.new()
var sellbuyside buyside = array.new()
bool crossup = false
bool crossdn = false
var float up = na
var float dn = na
idbull = ms.find(false, false, true)
idbear = ms.find(true , false, true)
btmP = obmode == "Length" ? (high - 1 * atr ) < low ? low : (high - 1 * atr ) : low
topP = obmode == "Length" ? (low + 1 * atr ) > high ? high : (low + 1 * atr ) : high
atr = ta.atr (200)
buy = low + atr
sel = high - atr
ph = ta.pivothigh(high, mslen, mslen)
pl = ta.pivotlow (low , mslen, mslen)
var int phn = array.new< int >(1, na)
var int pln = array.new< int >(1, na)
var float php = array.new(1, na)
var float plp = array.new(1, na)
if internal
blob.clear()
brob.clear()
if ph
phn.unshift(bar_index )
php.unshift(high )
if pl
pln.unshift(bar_index )
plp.unshift(low )
if php.size() > 0
if high > php.get(0)
php.clear()
phn.clear()
if plp.size() > 0
if low < plp.get(0)
plp.clear()
pln.clear()
if na(up)
up := high
if na(dn)
dn := low
if high > up
up := high
dn := low
crossup := true
if low < dn
up := high
dn := low
crossdn := true
if ms.start == 0
ms := structure.new(bar_index, na, high, low , bar_index, bar_index, 0, 1, na, bar_index)
if draw
bldw.unshift(drawms.new(time, time, high , "CHoCH" , upcss, line.style_dashed))
brdw.unshift(drawms.new(time, time, low , "CHoCH" , dncss, line.style_dashed))
ms.upsweep := false
ms.dnsweep := false
if ms.start == 1
switch
low <= ms.choch and close >= ms.choch and buildsweep =>
ms.dnsweep := true
ms.choch := low
ms.xloc := bar_index
if draw
dw = brdw.get(0)
dw.x2 := time
dw.style := line.style_dotted
dw.txt := "x"
brdw.unshift(
drawms.new(
time
, time
, low
, "CHoCH"
, dncss
, line.style_dashed
)
)
high >= ms.bos and close <= ms.bos and buildsweep =>
ms.upsweep := true
ms.bos := high
ms.xloc := bar_index
if draw
dw = bldw.get(0)
dw.x2 := time
dw.style := line.style_dotted
dw.txt := "x"
bldw.unshift(
drawms.new(
time
, time
, high
, "CHoCH"
, upcss
, line.style_dashed
)
)
close <= ms.choch =>
ms.txt := "choch"
lc.start := true
lc.count := 0
blob.fnOB(true, topP, idbull)
ms.trend := -1
ms.choch := ms.bos
ms.bos := na
ms.start := 2
ms.loc := bar_index
ms.main := low
ms.temp := ms.loc
ms.xloc := bar_index
if draw
dw = brdw.get(0)
dw.x2 := time
dw.style := internal ? line.style_dashed : line.style_solid
close >= ms.bos =>
ms.txt := "choch"
lc.start := true
lc.count := 0
brob.fnOB(false, btmP, idbear)
ms.trend := 1
ms.choch := ms.choch
ms.bos := na
ms.start := 2
ms.loc := bar_index
ms.main := high
ms.temp := ms.loc
ms.xloc := bar_index
if draw
dw = bldw.get(0)
dw.x2 := time
dw.style := internal ? line.style_dashed : line.style_solid
if ms.start == 2
switch ms.trend
-1 =>
if low <= ms.main
ms.main := low
ms.temp := bar_index
if bar_index % mslen * 2 == 0
if not na(ms.bos) and msmode == "Adjusted Points" and php.size() > 0
if php.get(0) < ms.choch
// ms.xloc := phn.get(0)
ms.choch := php.get(0)
ms.loc := phn.get(0)
ms.xloc := phn.get(0)
ms.temp := phn.get(0)
if draw
choch = bldw.get(0)
choch.x1 := time
choch.x2 := time
choch.y := php.get(0)
if na(ms.bos)
if crossup and close > open and close > open
ms.bos := ms.main
ms.loc := ms.temp
ms.xloc := ms.loc
if draw
brdw.unshift(
drawms.new(
time
, time
, low
, "BOS"
, dncss
, line.style_dashed
)
)
if not na(ms.bos) and draw
dw = brdw.get(0)
dw.x2 := time
if draw
choch = bldw.get(0)
choch.x2 := time
switch
low <= ms.bos and close >= ms.bos and not na(ms.bos) and buildsweep =>
ms.dnsweep := true
ms.bos := low
if draw
dw = brdw.get(0)
dw.x2 := time
dw.style := line.style_dotted
dw.txt := "x"
brdw.unshift(
drawms.new(
time
, time
, low
, "BOS"
, dncss
, line.style_dashed
)
)
ms.xloc := bar_index
close <= ms.bos and not na(ms.bos) =>
ms.txt := "bos"
ms.zz := ms.bos
ms.zn := bar_index
lc.start := true
lc.count := 0
brob.fnOB(false, btmP, idbear)
id = ms.find(true, false, false)
ms.xloc := bar_index
ms.bos := na
ms.choch := high
ms.loc := bar_index
if draw
dw = brdw.get(0)
dw.x2 := time
dw.style := internal ? line.style_dashed : line.style_solid
choch = bldw.get(0)
choch.x1 := time
choch.x2 := time
choch.y := high
switch
high >= ms.choch and close <= ms.choch and buildsweep =>
ms.upsweep := true
ms.choch := high
ms.xloc := bar_index
if draw
dw = bldw.get(0)
dw.x2 := time
dw.style := line.style_dotted
dw.txt := "x"
bldw.unshift(
drawms.new(
time
, time
, high
, "CHoCH"
, upcss
, line.style_dashed
)
)
close >= ms.choch =>
ms.txt := "choch"
ms.zz := ms.choch
ms.zn := bar_index
lc.start := true
lc.count := 0
blob.fnOB(true, topP, idbull)
id = ms.find(false, false, false)
switch
na(ms.bos) =>
ms.choch := low
if draw
brdw.unshift(
drawms.new(
time
, time
, low
, "BOS"
, dncss
, line.style_dashed
)
)
choch = brdw.get(0)
choch.x1 := time
=> ms.choch := ms.bos//low < low ? low : low
ms.bos := na
ms.main := high
ms.trend := 1
ms.loc := bar_index
ms.xloc := bar_index
ms.temp := ms.loc
if draw
dw = bldw.get(0)
dw.x2 := time
dw.txt := "CHoCH"
dw.style := internal ? line.style_dashed : line.style_solid
choch = brdw.get(0)
choch.x2 := time
choch.y := ms.choch
choch.txt := "CHoCH"
ms.xloc := bar_index
blarea.normal := false
1 =>
if high >= ms.main
ms.main := high
ms.temp := bar_index
if na(ms.bos)
if crossdn and close < open and close < open
ms.bos := ms.main
ms.loc := ms.temp
ms.xloc := ms.loc
if draw
bldw.unshift(
drawms.new(
time
, time
, high
, "BOS"
, upcss
, line.style_dashed
)
)
if bar_index % mslen * 2 == 0
if not na(ms.bos) and msmode == "Adjusted Points" and plp.size() > 0
if plp.get(0) > ms.choch
// ms.xloc := pln.get(0)
ms.choch := plp.get(0)
ms.loc := pln.get(0)
ms.xloc := pln.get(0)
ms.temp := pln.get(0)
// ms.loc := pln.get(0)
if draw
choch = brdw.get(0)
choch.x1 := time
choch.x2 := time
choch.y := plp.get(0)
if not na(ms.bos) and draw
dw = bldw.get(0)
dw.x2 := time
if draw
choch = brdw.get(0)
choch.x2 := time
switch
high >= ms.bos and close <= ms.bos and not na(ms.bos) and buildsweep =>
ms.upsweep := true
ms.bos := high
if draw
dw = bldw.get(0)
dw.x2 := time
dw.style := line.style_dotted
dw.txt := "x"
bldw.unshift(
drawms.new(
time
, time
, high
, "BOS"
, upcss
, line.style_dashed
)
)
ms.xloc := bar_index
close >= ms.bos and not na(ms.bos) =>
ms.txt := "bos"
ms.zz := ms.bos
ms.zn := bar_index
lc.start := true
lc.count := 0
blob.fnOB(true, topP, idbull)
id = ms.find(false, false, false)
ms.xloc := bar_index
ms.bos := na
ms.choch := low
ms.loc := bar_index
if draw
dw = bldw.get(0)
dw.x2 := time
dw.style := internal ? line.style_dashed : line.style_solid
choch = brdw.get(0)
choch.x1 := time
choch.x2 := time
choch.y := low
switch
low <= ms.choch and close >= ms.choch and buildsweep =>
ms.dnsweep := true
ms.choch := low
ms.xloc := bar_index
if draw
dw = brdw.get(0)
dw.x2 := time
dw.style := line.style_dotted
dw.txt := "x"
brdw.unshift(
drawms.new(
time
, time
, low
, "CHoCH"
, dncss
, line.style_dashed
)
)
close <= ms.choch =>
ms.txt := "choch"
ms.zz := ms.choch
ms.zn := bar_index
lc.start := true
lc.count := 0
brob.fnOB(false, btmP, idbear)
id = ms.find(true, false, false)
switch
na(ms.bos) =>
ms.choch := high
if draw
bldw.unshift(
drawms.new(
time
, time
, high
, "BOS"
, upcss
, line.style_dashed
)
)
choch = bldw.get(0)
choch.x1 := time
=> ms.choch := ms.bos//high > high ? high : high
ms.bos := na
ms.main := low
ms.trend := -1
ms.loc := bar_index
ms.temp := ms.loc
if draw
dw = brdw.get(0)
dw.x2 := time
dw.txt := "CHoCH"
dw.style := internal ? line.style_dashed : line.style_solid
choch = bldw.get(0)
choch.y := ms.choch
choch.x2 := time
choch.txt := "CHoCH"
ms.xloc := bar_index
if blob.size() > 0
ob = blob.get(0)
if not ob.isbb
if low < ob.top
if blobenter.normal == false
blobenter.normal := true
else
if high > ob.btm
if blobenter.breaker == false
blobenter.breaker := true
if brob.size() > 0
ob = brob.get(0)
if not ob.isbb
if high > ob.btm
if brobenter.normal == false
brobenter.normal := true
else
if low < ob.top
if brobenter.breaker == false
brobenter.breaker := true
if obshow and oblast > 0
if barstate.isconfirmed
blob.mitigated()
brob.mitigated()
if overlap
overlap(blob, brob)
if blob.size() > 0
for in blob
metric.umt()
if brob.size() > 0
for in brob
metric.umt()
if barstate.islast
if blob.size() > 0
for i = 0 to math.min(oblast - 1, blob.size() - 1)
obs = blob.get(i)
display(obs, blob, i)
if brob.size() > 0
for i = 0 to math.min(oblast - 1, brob.size() - 1)
obs = brob.get(i)
display(obs, brob, i)
if barstate.islast and draw and bldw.size() > 0 and brdw.size() > 0
for i = 0 to bldw.size() - 1
obj = bldw.get(i)
if i <= limit
bin.ln.unshift(
line.new(
x1 = obj.x1
, x2 = obj.x2
, y1 = obj.y
, y2 = obj.y
, color = obj.css
, style = obj.style
, xloc = xloc.bar_time
)
)
bin.lb.unshift(
label.new(
x = int(math.avg(bin.ln.get(0).get_x1(), bin.ln.get(0).get_x2()))
, y = obj.y
, xloc = xloc.bar_time
, color = #ffffff00
, style = label.style_label_down
, textcolor = obj.css
, size = mstext.txSz()
, text = obj.txt
)
)
if msbubble
bin.lb.unshift(
label.new(
x = obj.x1
, y = obj.y
, xloc = xloc.bar_time
, color = color.new(obj.css, 80)
, style = label.style_circle
, size = size.tiny
)
)
for i = 0 to brdw.size() - 1
obj = brdw.get(i)
if i <= limit
bin.ln.unshift(
line.new(
x1 = obj.x1
, x2 = obj.x2
, y1 = obj.y
, y2 = obj.y
, color = obj.css
, style = obj.style
, xloc = xloc.bar_time
)
)
bin.lb.unshift(
label.new(
x = int(math.avg(bin.ln.get(0).get_x1(), bin.ln.get(0).get_x2()))
, y = obj.y
, xloc = xloc.bar_time
, color = #ffffff00
, style = label.style_label_up
, textcolor = obj.css
, size = mstext.txSz()
, text = obj.txt
)
)
if msbubble
bin.lb.unshift(
label.new(
x = obj.x1
, y = obj.y
, xloc = xloc.bar_time
, color = color.new(obj.css, 80)
, style = label.style_circle
, size = size.tiny
)
)
ms
//}
_ ='
------------
–––––––––––––––––––––––––– EXECUTION –––––––––––––––––––––––––––
------------ '//{
structure ms = na
if windowsis
if (bar_index > last_bar_index - mswindow)
ms := structure(swingcssup , swingcssdn , showSwing , false, swingLimit)
if windowsis == false
ms := structure(swingcssup , swingcssdn , showSwing , false, swingLimit)
// if showInternal and inZone
// structure ims = structure(interncssup, interncssdn, showInternal, true , swingLimit)
color css = na
method darkcss(color css, float factor) =>
blue = color.b(css) * (1 - factor)
red = color.r(css) * (1 - factor)
green = color.g(css) * (1 - factor)
color.rgb(red, green, blue, 0)
if windowsis ? (bar_index > last_bar_index - mswindow) : true
css := ms.trend == 1 ? swingcssup : swingcssdn
css := (ms.txt == "bos" ? css : css.darkcss(0.3))
barcolor(candlecss ? css : na)
if fvg_enable
dFVG()
if showMapping
mapping()
var phl = Zphl.new(
na
, na
, label.new(na , na , color = invcol , textcolor = swingcssdn , style = label.style_label_down , size = size.tiny , text = "")
, label.new(na , na , color = invcol , textcolor = swingcssup , style = label.style_label_up , size = size.tiny , text = "")
, true
, true
, true
, true
, ""
, ""
, 0
, 0
, 0
, 0
, high
, low
, 0
, 0
, 0
, 0
, 0
, 0
, na
, na
)