Honest Trade PlannerHonest Trade Planner
On-chart position sizer & risk/reward planner. Place entry, stop, target — it sizes the trade so a single loss can't exceed your risk budget. Decision-support, not signals.
Honest Trader Toolkit — decision-support, not prediction. No signals, no forecasts, no win-rate claims. Just a correct read of what's actually on your chart.
The Honest Trade Planner turns a trade idea into a correctly sized order. You place your **entry**, **stop**, and (optionally) **target** on the chart; it shows you exactly how big to trade and precisely what you're risking — with the cross-asset math done right.
**What it does**
• Sizes a single trade from your **account size × risk %** and your **entry-to-stop distance**.
• Correct across **stocks, crypto, index, futures, and forex** — futures use the contract point value; forex reports both units and standard lots.
• Shows the full picture: **Risk $, Reward $, R:R ratio, position notional, and % of account** both risked and deployed.
• Optional **ATR-assisted stop** with an explicit Long/Short bias, so the distance math is never ambiguous.
• Draws a **risk zone** and a **reward zone** on the chart, plus a clean dashboard table.
**Honest by design**
• Position size is always rounded **DOWN** to your instrument's step — so your planned loss never sneaks past your risk budget. It will never round up to make a number look nicer.
• Money figures are shown in the symbol's **quote currency** (Pine can't read your broker, so account size is a manual input — convert if your account currency differs).
• On unsupported instruments or missing contract data it says **"verify contract specs"** rather than display a confidently wrong number.
• Bad inputs (zero account, entry = stop, target on the wrong side) **suppress** the nonsense output and tell you why. A low R:R is shown as information, never as a command to act.
**This tool does not predict anything and gives no buy or sell signals.** Every number is yours to act on or ignore — it only informs the decision you're already making.
**How to use**
1. Add it to any chart. You'll be prompted to click **Entry**, then **Stop** (both are draggable afterward). Set a **Target** in settings, or drag it, to get R:R.
2. Open settings → enter your **account size** and pick a **risk %** (0.25 / 0.5 / 1 / 2% or custom).
3. For fractional instruments (crypto, fractional shares) set the **Quantity step** (e.g. 0.001).
4. Read the dashboard. Drag entry/stop/target to plan different scenarios live.
**Limitations (so you know exactly what you're getting)**
• Pine cannot connect to your broker — account size and levels are manual inputs.
• Figures are in the symbol's quote currency.
• This is a planning and sizing tool, not financial advice. Always verify contract specifications for your instrument and broker before trading.
Open-source — read every line of the math yourself. Feedback welcome in the comments.
Indicator

Auto Candlestick Patterns Targets Setup🔷 OVERVIEW
Auto Candlestick Pattern Targets automatically identifies supported candlestick reversal patterns and displays a complete trade setup directly on the chart. When a qualifying pattern is detected, the indicator plots an Entry level, Stop Loss, and up to three Take Profit levels based on its internal calculation logic.
The objective is to reduce the amount of manual chart work by presenting trade levels in a consistent visual format.
🔷 HOW IT WORKS
The indicator continuously evaluates completed candles for supported bullish and bearish candlestick formations.
When the pattern conditions are satisfied, it:
• Displays a Buy or Sell label
• Calculates an Entry level
• Places a Stop Loss based on the detected pattern
• Projects three Take Profit targets
Each setup remains visible on the chart, allowing users to review historical signals and monitor active trades.
🔷 VISUAL FEATURES
• Automatic Buy and Sell labels
• Entry level
• Stop Loss level
• Three Take Profit targets
• Risk and reward visualization
• Historical signal display
• Configurable colors and styles
🔷 INPUTS
The indicator includes options to customize:
• Signal sensitivity
• Display of Entry, Stop Loss, and Targets
• Label visibility
• Colors
• Historical setup display
🔷 USAGE
A common workflow is:
Wait for a Buy or Sell signal.
Allow the signal candle to close.
Review the plotted Entry, Stop Loss, and Take Profit levels.
Combine the setup with your own market analysis before making trading decisions.
🔷 MARKETS
The indicator can be applied to:
• Forex
• Stocks
• Cryptocurrency
• Indices
• Commodities
It is compatible with multiple timeframes, depending on the user's trading approach.
🔷 NOTES
This indicator is intended as a chart analysis tool and does not predict future price movements. Trade setups are generated according to the indicator's programmed rules and should be evaluated alongside other forms of technical analysis and appropriate risk management. Indicator

Motion Reversal System [BullByte]Motion Reversal System (MRS) - Trend-Failure Bar Detector with Adaptive Pressure Meter, Multi-Mode Signal Engine, and Complete Trade-Level Framework
---
Why This Indicator Exists
Most reversal indicators fall into one of two failure modes. Either they fire constantly in ranging markets because they have no directional filter, or they only confirm reversals long after price has already turned because they rely on lagging momentum oscillators. Motion Reversal System (MRS) was built to solve both problems in a single coherent engine.
MRS is one engine with one purpose: identify the precise bar at which a confirmed trend structurally fails - the moment commitment fades, the bar itself rejects further advance, and the move's energy reverses. From that bar, MRS automatically frames the trade with entry, two targets, and a stop loss, then manages the full trade lifecycle to closure.
---
What Makes This Not a Mashup
A mashup combines independent indicators that each output their own signal, then layers them visually. MRS is the opposite. Every component of MRS feeds into a single decision: "Is the current bar a trend-failure bar?" Remove any one component and the engine stops working correctly.
- The Directional Gate decides IF a trend is present (no trend = no exhaustion to detect)
- The Four Failure Conditions decide IF the current bar is structurally failing that trend
- The Signal Mode decides HOW STRICT the failure must be
- The Pressure Meter provides a live visual reading of building reversal pressure
- The Trade Level Engine decides WHERE to enter, stop, and target
- The HTF Filter decides WHETHER higher-timeframe context confirms the call
These are not independent indicators. They are stages of one detection pipeline. Each stage exists because the next stage cannot function without it.
---
The Engine - How It Actually Works
Stage 1 - Directional Gate (Kaufman Efficiency Ratio, Self-Adapting)
The script computes Kaufman's Efficiency Ratio (ER) over a rolling window. ER measures net price displacement divided by the total path price traveled. Values near 1.0 indicate pure trending motion; values near 0.0 indicate pure noise.
A fixed ER threshold would work well on one instrument and fail on another, so MRS adapts the gate dynamically. The threshold becomes the rolling mean of the ER series plus half a standard deviation, with a user-defined floor. This means the gate raises itself during volatile sessions and lowers during quiet sessions automatically. No re-tuning per instrument.
Only bars that occur inside a confirmed directional move (gate passed + minimum ATR displacement satisfied) are evaluated for failure. This single design choice eliminates the largest source of false signals: exhaustion calls in choppy ranges where there is no trend to exhaust.
Stage 2 - Four Failure Conditions (Evaluated at Bar Close)
For every bar inside a confirmed trend, MRS evaluates four orthogonal failure conditions:
C1 - Velocity Reversal: The bar closed against the direction of the confirmed trend. This is the most basic failure signal. A bull trend bar that closes red, or a bear trend bar that closes green.
C2 - Wick Rejection: The trend-side wick (upper wick in a bull trend, lower wick in a bear trend) is at least N times the size of the bar's body. This measures intra-bar rejection - buyers or sellers pushed price further in the trend direction and were defeated within the same bar.
C3 - Commitment Anomaly: The bar's commitment value (measured via volume-weighted body strength when volume is reliable, or wick-rejection ratio when it is not) is at least N standard deviations below the recent trend's commitment baseline. The current bar is statistically anomalous compared to what the trend has been producing.
C4 - Range Expansion: The bar's true range is at least N times ATR. Filters out small doji bars where wick rejection and velocity reversal become meaningless from microstructure noise.
These four conditions are orthogonal - they measure different physical properties of the bar. C1 measures direction. C2 measures intra-bar struggle. C3 measures volume/commitment. C4 measures magnitude. When multiple conditions align on the same bar, the signal reflects a greater degree of structural confluence - though no combination of conditions guarantees a reversal.
Stage 3 - Signal Mode (Strictness Selector - THE ACTUAL SIGNAL GATE)
This is the decisive gate that determines whether a signal fires. The user chooses how many of the four conditions must align:
Conservative - All 4 conditions required. Rarest signals, highest structural confluence. Best for swing traders, low-noise sessions, or those who prefer fewer signals with stronger multi-condition alignment.
Balanced (default) - Any 3 of 4 conditions required. Middle ground for most users and most timeframes. Allows one condition to be absent if the other three are strong.
Aggressive - Velocity Reversal (C1) is mandatory plus at least one other condition (minimum 2 of 4 total). Most signals, fewer conditions required per signal. Best for scalpers, active intraday traders, or those who prefer earlier detection at the cost of more false positives.
When the chosen condition count is satisfied at bar close, a signal fires. The Pressure Meter (Stage 5) is a separate visual reading and does not gate signals.
Stage 4 - Commitment Measurement (Volume-Aware with Auto Fallback)
Commitment measures how decisively the market voted on each bar. MRS supports three measurement modes:
Auto (recommended) - Uses volume-weighted commitment on instruments with real volume data (crypto, futures, stocks with traded volume). Automatically falls back to wick-rejection ratio on indices and synthetic feeds where reported volume is meaningless. The dashboard surfaces whichever method is actually active.
Volume - Forces volume-weighted measurement. Useful when you want to lock the method explicitly. Silently falls back to wick if data is missing, with a dashboard warning.
Wick - Forces wick-rejection ratio regardless of volume availability. Best for spot Gold (XAUUSD), forex, or any instrument where you don't trust the broker's volume feed.
Stage 5 - Adaptive Pressure Meter (Live Visual Reading)
The pressure meter is the dashboard's live reading of building reversal pressure. It is always populated whenever a trend is confirmed, regardless of whether the four-condition gate has been met. This gives the trader a continuous sense of how strong the reversal pressure has been building.
The meter is normalized against an adaptive baseline calculated from its own rolling history (mean + multiplier x stdev). The dashboard percentage shows where the current meter sits relative to that baseline.
Important: the baseline is a visual reference only. It does not gate signals. The signal authority is the Signal Mode condition count described in Stage 3. The meter and baseline simply help the trader monitor when conditions are increasingly aligned before they actually trigger.
Stage 6 - Higher Timeframe Confirmation (Optional Filter)
When enabled, the engine cross-checks every signal against the directional state of a higher timeframe. A reversal signal on the chart timeframe is marked "Strong" when the higher timeframe direction agrees with the chart trend being reversed against. For example: chart is in a confirmed bull move, HTF is also bullish, and a bear reversal signal fires - this is HTF-Strong, because the HTF confirms the bull trend that is being exhausted.
If the HTF direction disagrees with the chart trend (e.g., chart is in a bull move but HTF is already bearish), the signal is marked "Weak" - visually dimmed but not suppressed. The trader still sees the call but is warned that the HTF backdrop does not align with the underlying chart trend being detected.
The HTF uses request.security with lookahead = barmerge.lookahead_off, eliminating future-data leak across timeframes. The HTF series itself naturally evolves as each HTF candle forms (this is standard Pine behavior), so the script treats HTF as a confirmation filter rather than a guarantee of HTF-bar finalization. The signal trigger itself remains chart-bar-close only.
Stage 7 - Trade Level Engine (Complete Lifecycle)
When a signal fires, the engine automatically computes and draws:
- Entry: signal-bar close
- Stop Loss: fixed ATR distance from entry (not score-scaled - strong signals deserve tighter stops, not wider ones)
- Target 1: intermediate reference level, ATR distance scaled by signal strength (visual only, does not close trade)
- Target 2: decisive level, ATR distance scaled by signal strength (closes the trade on hit)
While the trade is active, four colored horizontal lines extend from the signal bar to the current bar, with monospace pill labels showing the price and R:R for each level. Two zone fills (green Entry to TP2 reward zone, red Entry to SL risk zone) make the risk/reward geometry visible at a glance.
The trade closes when either TP2 or SL is touched at bar close (intra-bar wicks that retreat before close do NOT close the trade). Same-bar TP2/SL tie is resolved as SL hit (conservative backtest assumption).
After closure, the trade-level lines freeze in place as historical record. Labels and fills vanish to keep the chart clean. The cooldown counter starts. By default, all four lines (Entry, SL, TP1, TP2) persist as historical traces for richest backtest visibility. The "Keep TP1/TP2 Historical Lines" input can be turned off to delete TP1/TP2 lines on closure and roughly double the number of historical trades the chart can hold before Pine's 500-line cap is reached.
---
Signal Timing - No Repaint
All signal generation and trade closure is gated to confirmed (closed) bars via barstate.isconfirmed.
- A reversal signal triangle and label appear only at the close of the signal bar
- Entry, SL, TP1, TP2 levels are computed from the signal bar's close
- Trade closure (TP2 / SL hit) is evaluated only after the candle finalizes - intra-bar wicks that retreat before close do not trigger closure
The trade-off is up to one bar of timing on closure for cases where price spikes through a level intra-bar and retraces. The gain is realistic backtest visuals and zero repaint at every stage of the trade lifecycle. This is an intentional architectural choice for honest behavior over flashy intra-bar firing.
---
How to Read the Chart
Signal Markers
Bull Reversal (detected inside a confirmed bear move, reversal up signaled): small cyan triangle below the bar.
Bear Reversal (detected inside a confirmed bull move, reversal down signaled): small red triangle above the bar.
Important: a bearish reversal signal fires inside a confirmed bull move. The signal detects exhaustion of the prevailing trend - not confirmation of a new one. The dashboard will show BULL MOVE while a short is active. This is correct behavior - you are trading the exhaustion of that bull move.
A monospace pill label sits beside each triangle showing the failure score (e.g., "Reversal Up | 2.45"). Higher numbers indicate stronger structural confluence across the four conditions.
When HTF Confirmation is enabled and HTF disagrees with the signal, the triangle and label appear in a dimmed color with "(HTF)" appended to the label text. The signal is still visible but is visually de-emphasized.
Trade Level Lines
Once a signal fires, four horizontal lines appear extending from the signal bar:
- Entry (yellow, solid): the price at which the signal was generated (signal-bar close)
- Target 1 (cyan, dashed): intermediate reference level, visual only
- Target 2 (green, solid): decisive level - trade closes when this is hit at bar close
- Stop Loss (red, solid): risk level - trade closes when this is hit at bar close
Pill labels at the right end of each line show the exact price and R:R distance.
Zone Fills
- Green soft fill between Entry and TP2: the reward zone
- Red soft fill between Entry and SL: the risk zone
At a glance, the green:red ratio visualizes the trade's risk-to-reward geometry.
Directional Background
- Subtle blue tint: a bull trend is confirmed
- Subtle red/orange tint: a bear trend is confirmed
- No tint: no confirmed direction (chop)
Bar Coloring (Exhaustion Gradient)
When the exhaustion meter rises above the trigger threshold (default 50% of baseline), bars are tinted on a gradient:
- Cool color (cyan/red): exhaustion is building but moderate
- Bright color (red on bull trend, cyan on bear trend): exhaustion has reached or exceeded the baseline - conditions for a signal are increasingly met, though no signal fires until the condition count gate is satisfied at bar close
Historical Trade Traces
After a trade closes, by default all four trade-level lines (Entry, SL, TP1, TP2) remain on the chart as a permanent historical record. This builds a visual log of every prior MRS detection directly on the chart. The "Keep TP1/TP2 Historical Lines" input can be turned off if you want to conserve Pine's line-object cap.
---
How to Read the Dashboard (Full Mode)
The dashboard is the live diagnostic panel. Every row tells you something specific about the current state of the engine. From top to bottom:
Row 0 - Title: "MOTION REVERSAL SYSTEM (MRS)" - confirms the indicator name.
Row 1 - Context: ticker symbol, chart timeframe, and active Signal Mode.
Row 2 - Directional State: BULL MOVE / BEAR MOVE / NEUTRAL - large text, colored. Tells you whether a confirmed trend is currently in effect. When a trade is active against the current trend (e.g., short open during a bull move), this row appends "SHORTING EXHAUSTION" or "LONGING EXHAUSTION" so the dashboard reads as a coherent statement rather than an apparent contradiction.
Row 3 - Exhaustion bar: a 10-segment text-based pressure bar with percentage. Shows how close the live meter is to the adaptive baseline. Color escalates from gray to teal to purple to bright red/cyan as pressure builds.
Row 4 - Pressure: numerical value of the live exhaustion meter.
Row 5 - Baseline: the adaptive baseline value (mean + k x stdev) the meter is compared against. Visual reference only - does not gate signals.
Row 6 - Conditions: which of the four failure conditions are currently satisfied. " VEL WICK ANOM RANGE" means C1, C2, C4 are firing; C3 is not.
Row 7 - Count: how many of 4 conditions are firing, with current Signal Mode in parentheses. This is the actual signal authority - when the count satisfies the Signal Mode rule, a signal fires.
Row 8 - Eff Ratio: the current Kaufman Efficiency Ratio value, with the adaptive gate level next to it. Shows whether the directional gate is passing.
Row 9 - ATR: current ATR value at the configured length. Reference for understanding trade-level distances.
Row 10 - HTF Dir: current higher-timeframe directional state, OR "INVALID HTF (set higher than chart)" warning if user has misconfigured the HTF input.
Row 11 - Commit: which commitment measurement method is currently active (Auto -> Volume, Auto -> Wick fallback, etc.), with warning indicator if forced mode silently fell back.
Row 12 - Active Trade Status: "NO ACTIVE TRADE" or "LONG ACTIVE E " / "SHORT ACTIVE E " - color-coded.
Row 13 - Status: "Ready for signal" / "Cooldown: N bars" / "Trade active" - tells you whether the engine can fire a new signal right now.
Row 14 - Session: count of signals fired in the current session (resets daily).
Rows 15 to 19 - Engine Parameters reference: live readouts of the directional window, lookback periods, threshold parameters, ER gate values, and current commitment status. Useful for verifying your settings are applied as expected.
Row 20 - Version and Author footer.
Mobile / Minimal Dashboard Mode
For phone and tablet users, switching "Dashboard Mode" to "Minimal (Mobile)" collapses the dashboard to a single-column 5-row compact layout with larger fonts: Title, State, Exhaustion, Conditions, and Trade Status. Diagnostics are hidden for screen-space efficiency.
---
Default Settings Explained
- Directional Window: 12 bars - measures Efficiency Ratio over a 12-bar lookback
- Directional Threshold (Base): 0.40 - minimum ER for trend confirmation, adapted upward dynamically
- Min Move Size: 1.5 ATR - net displacement must be at least 1.5 ATR for a trend to qualify
- Trend Statistics Lookback: 20 bars - sample size for computing commitment baseline statistics
- Wick Rejection Ratio: 1.5 - trend-side wick must be at least 1.5x the body to count as rejection
- Commitment Anomaly Sigma: 1.0 - current commitment must be at least 1.0 standard deviation below trend mean
- Min Range Expansion: 1.2 ATR - current bar range must be at least 1.2x ATR
- Signal Mode: Balanced - any 3 of 4 conditions required
- Baseline Lookback: 100 bars - rolling history for pressure meter statistics
- Baseline Multiplier: 2.0 - baseline = mean + 2.0 x stdev
- ATR Length: 14 - standard ATR period
- Commitment Mode: Auto - volume on real-volume instruments, wick on indices
- Post-Closure Cooldown: 10 bars - wait 10 bars after trade closure before new signal
- Stop Loss Distance: 1.5 ATR - base SL distance from entry
- Target 1 Distance: 1.5 ATR - T1 at 1:1 with SL
- Target 2 Distance: 3.0 ATR - T2 at 1:2 with SL
- Score-Weight Nudge: 0.3 - stronger signals widen targets by up to 30%
- Min Label Spacing: 0.35 ATR - minimum vertical gap between pill labels for readability
---
Recommended Usage by Trader Profile
Scalper (1m to 5m): Aggressive mode, Cooldown 5 to 8 bars, HTF Confirmation on 15m. Signal frequency will be higher in Aggressive mode; use the dashboard pressure meter to monitor building exhaustion between signals.
Intraday Trader (5m to 30m): Balanced mode (default), Cooldown 10 bars, HTF Confirmation on 1h to 4h. The default settings were designed with this profile in mind as a starting reference point.
Swing Trader (1h to 4h): Conservative mode, Cooldown 15 to 20 bars, HTF Confirmation on Daily. Few signals, maximum condition confluence required.
Position Trader (Daily and above): Conservative mode, HTF Confirmation on Weekly. Signals are rare; when they fire, all four structural failure conditions have aligned on a higher timeframe bar.
---
Recommended Markets
- Crypto (Spot and Perpetuals): well-suited - high volume data availability, clean microstructure, MRS auto-selects volume-weighted commitment
- Index Futures (NQ, ES, NIFTY futures): well-suited - real traded volume available, strong directional character
- FX Majors: usable with Wick commitment mode forced (broker volume is unreliable)
- Spot Gold (XAUUSD): use Wick mode explicitly - most brokers report tick count as volume which is meaningless
- Cash Indices (NIFTY, SPX index): MRS auto-detects index type and routes to Wick mode; verify Commit row on dashboard
---
A Real-World Example Walkthrough
This walkthrough is a constructed illustration of how the engine behaves. It does not represent a historical trade or a performance result.
Scenario: BTCUSDT 15m chart, Balanced mode, Auto commitment.
Bars 1 to 20: Price climbs in a steady bull move. Dashboard shows BULL MOVE, Efficiency Ratio 0.55, Pressure Meter 0.20 (low). No signals fire because exhaustion is not building.
Bar 21: A large green candle prints - Range Expansion (C4) fires but the bar closes strong (no Velocity Reversal C1), and commitment is normal (no C3). Only 1 of 4 conditions. No signal.
Bars 22 to 24: Three smaller green bars with shrinking bodies. The Pressure Meter ticks up to 0.55 (moderate). Bar coloring activates softly. Dashboard "Conditions" row shows - only Wick Rejection is firing intermittently. No signal yet.
Bar 25: A red bar prints with a long upper wick and large range. All four conditions fire:
- C1 Velocity Reversal: bar closed red (against bull trend)
- C2 Wick Rejection: upper wick is 1.8x the body
- C3 Commitment Anomaly: bar's commitment is 1.4 standard deviations below the trend baseline
- C4 Range Expansion: bar range is 1.6x ATR
Dashboard shows "Conditions: VEL WICK ANOM RANGE | Count: 4/4". Pressure Meter reads 1.15.
A red bear reversal triangle prints above the bar with the label "Reversal Down | 3.42". Trade-level lines automatically draw:
- Entry (yellow): 64,210.50 (signal-bar close)
- SL (red): 64,422.00 (1.5 ATR above entry, since this is a short)
- T1 (cyan dashed): 63,999.00 (1.5 ATR x score-scale below entry)
- T2 (green): 63,576.00 (3.0 ATR x score-scale below entry)
Green reward fill appears Entry to T2, red risk fill Entry to SL. Dashboard "Active Trade" row turns red: "SHORT ACTIVE E 64,210.50". Dashboard "Directional State" row reads: "BULL MOVE | SHORTING EXHAUSTION".
Over the next several bars, price drops. The trade-level lines extend bar-by-bar. Dashboard " Status " reads "Trade active". No new signals fire because one trade is already open.
Bar 32: In this example, price reaches T2 at 63,576.00 on this bar's close. The trade closes at the target level. Labels and zone fills vanish. The trade-level lines freeze at bar 32 as historical record. Dashboard "Status" switches to "Cooldown: 10 bars".
Bars 33 to 42: Cooldown period. No new signals possible.
Bar 43: Cooldown complete. Dashboard "Status" reads "Ready for signal". The engine will evaluate the next qualifying bar for failure conditions.
---
Chart Examples
These screenshots show the indicator in use at specific moments in time. They are provided for visual reference only and do not represent performance results or forward-looking outcomes.
1. MRS detected a trend-failure bar inside a confirmed bull move on BTCUSDT 5m. Range expansion (C4) fired as exhaustion pressure reached the adaptive baseline (1.28 vs 1.03). Balanced mode gated the short at bar close - entry 62,553.3, SL 62,681.9, T2 62,273.6 (T2 distance: 2.17R).
2. MRS detected a trend-failure bar at the low of a confirmed bear move on NQ1! 5m. As the engine tracked displacement against path length (ER), exhaustion pressure crossed the adaptive baseline - failure score 0.48. Balanced mode gated the long at bar close - entry 30,553.75, SL 30,489.00, T2 30,706.50 (T2 distance: 2.36R).
---
Parameter Adjustment Guide
If you get too few signals:
- Switch Signal Mode to Aggressive
- Lower Wick Rejection Ratio (1.0 to 1.2)
- Lower Commitment Anomaly Sigma (0.7 to 0.9)
- Lower Min Range Expansion (1.0 to 1.1)
- Reduce Cooldown to 5
If you get too many false signals:
- Switch Signal Mode to Conservative
- Raise Wick Rejection Ratio (2.0 to 2.5)
- Raise Commitment Anomaly Sigma (1.3 to 2.0)
- Raise Min Range Expansion (1.5 to 2.0)
- Enable HTF Confirmation
- Raise Cooldown to 15 to 20
If the T2 zone is reached but price reverses sharply before bar close triggers closure:
- Reduce T2 Distance to 2.0 to 2.5 ATR
- Reduce Score-Weight Nudge to 0.1 (less target widening on strong signals)
If SL is hit too often:
- Increase Stop Loss Distance to 2.0 ATR
- Increase T1 and T2 proportionally to maintain R:R geometry
---
What This Indicator Does Not Do
- It does not execute trades. It is an indicator (overlay), not a strategy. Order placement and trade management decisions remain with the user.
- It does not predict the future. It identifies bars where a confirmed trend has structurally failed based on objective criteria.
- It does not eliminate losses. False signals will occur, especially in news-driven price spikes. Always size positions according to your own risk management rules.
- It does not work on every instrument equally well. Choppy low-liquidity assets produce noisier signals. Test on your specific market before relying on it.
- It does not replace discretionary judgment. Use MRS as one input in your decision process, not the only input.
---
Alerts Available
MRS Bull Reversal (Strong) - bullish reversal signal; HTF confirms the preceding bear trend
MRS Bull Reversal (HTF Weak) - bullish reversal signal; HTF does not confirm the preceding bear trend
MRS Bear Reversal (Strong) - bearish reversal signal; HTF confirms the preceding bull trend
MRS Bear Reversal (HTF Weak) - bearish reversal signal; HTF does not confirm the preceding bull trend
MRS Target 2 Hit - trade closure at T2 level
MRS Stop Loss Hit - trade closure at SL level
---
Disclaimer
This script is provided for educational and analytical purposes only. It is not financial advice, an investment recommendation, or a solicitation to trade. Past performance of any indicator or strategy does not guarantee future results. Trading involves substantial risk of loss. The author and TradingView are not liable for any losses or damages arising from use of this script. Always validate signals against your own analysis, conduct your own due diligence, and apply prudent risk management. Use at your own risk.
---
Open source under Mozilla Public License 2.0. Code is fully readable in the Pine Editor for those who want to study the math. Thank you.
- BullByte Indicator

BreakoutBreakout is an overlay indicator for identifying pre-breakout trade context using supply/demand zones, higher-timeframe alignment, moving-average structure, and confluence scoring.
This script is for analysis and planning only. It does not place orders or guarantee results.
What it does
Breakout helps visualize potential long and short setups before price breaks out of a key zone. It combines:
- Key magnet supply/demand zones (strongest reaction levels only)
- HTF trade zones auto-anchored by chart timeframe
- Pre-trade setup boxes with entry, stop, and target
- Diamond markers for high-confluence turning points
- Liquidity levels for potential sweep/SFP context
- Optional info panel with bias, levels, and active setup details
How it works
Magnet zones: pivot highs/lows cluster into levels. Levels price revisits gain strength. Only the strongest are drawn.
HTF trade regime: each chart timeframe uses two higher anchor timeframes. Long ideas can be filtered to HTF demand zones; shorts to HTF supply zones. Zones use confirmed HTF swing highs/lows with ATR-based width and reach.
Setup engine: setups form when zone context, trend/MA structure, confidence score, and cooldown align. Stops use risk percent, MA support/resistance, swing levels, and a max distance cap. Targets use a configurable minimum risk/reward.
Diamond signals: require structure (SFP, reversal, or MA setup), zone context, and supporting momentum/trend. Optional volume spike and RSI divergence add confluence. Not every pivot prints a diamond.
Volume and divergence: abnormal volume spikes (relative volume and z-score) can combine with RSI divergence in diamonds and setup scoring.
MTF data uses request.security() with barmerge.lookahead_off to avoid lookahead on higher-timeframe context.
How to use
1. Add Breakout to your chart.
2. Choose your execution timeframe.
3. Keep HTF zone filter on for higher-timeframe alignment.
4. Wait for price at HTF zone plus key magnet zone, then diamond or setup box with confidence at or above Min Confidence.
5. Use entry, stop, and target from the active setup box for planning.
6. Manage risk with your own rules.
Main settings
- Risk: risk per trade, min R/R, max hold bars
- Filters: min confidence, approach distance, cooldown, volume, vol spike and divergence
- HTF zones: trade inside HTF S/D only, auto anchors, zone width and reach
- Display: zones, setups, liquidity, labels, info panel, EMAs, diamond spacing
Alerts
- Breakout Long Setup
- Breakout Short Setup
- Breakout Approaching Demand
- Breakout Approaching Supply
Alerts reflect script conditions at alert time. They are not trade recommendations.
Disclaimer
Educational and informational use only. Not financial advice. Trading involves risk, including loss of capital. Past results do not guarantee future performance. Use at your own discretion. Indicator

Squeeze Momentum IQ Trade Management SimplifiedSqueeze Momentum IQ Trade Management Simplified
A trade management and position conviction engine designed to help determine whether to continue holding, manage cautiously, take profits, or avoid new entries.
Most indicators focus on finding entries.
Squeeze Momentum Nexus Conviction focuses on a different question:
"Does the trade still deserve my conviction?"
Rather than generating simple buy and sell signals, Conviction continuously evaluates trend quality, momentum behavior, efficiency, and confirmation conditions to determine whether current market conditions still support remaining in a trade.
The objective is to help traders avoid two common mistakes:
• Exiting strong trends too early
• Holding weakening trades too long
Core Concept
Conviction transforms multiple market variables into a simplified trade management framework:
HOLD
Strong trend quality and confirmation
Momentum remains healthy
Higher timeframe and trend conditions supportive
HOLD CAUTIOUSLY
Trend remains intact, but signs of weakening or conflict begin to appear
Increased probability of pullback or slower continuation
TAKE PROFIT / DO NOT ENTER
Trade quality deteriorating
Momentum weakening significantly
Choppy or conflicting conditions increasing
Features
Trade Quality Engine
Evaluates market conditions through a weighted scoring model using:
• Momentum behavior
• Trend confirmation
• Higher timeframe agreement
• Efficiency ratio
• Volatility state
• Expansion quality
Conviction State Engine
Converts raw calculations into actionable states:
HOLD
Strong continuation conditions
Trend quality remains elevated
HOLD CAUTIOUSLY
Moderate quality conditions
Continuation possible but with increasing caution
TAKE PROFIT / DO NOT ENTER
Weak conditions
Elevated risk of deterioration, pullback, or lower probability continuation
Visual Hold Zones
Vertical highlighted chart regions visually display current conviction states:
Green
HOLD
Orange
HOLD CAUTIOUSLY
Red
TAKE PROFIT / DO NOT ENTER
Designed to allow immediate interpretation directly from price action without requiring constant dashboard monitoring.
Simple Decision Dashboard
Displays only the essential information:
Action
HOLD
HOLD CAUTIOUSLY
TAKE PROFIT / DO NOT ENTER
Trade Quality
Current trade-grade evaluation
Score
Weighted confidence reading
Suggested Uses
Can be used for:
• Managing existing positions
• Scaling out of trades
• Holding trend positions longer
• Filtering poor continuation conditions
• Preventing emotional exits
• Avoiding lower quality entries
Works well alongside:
• Market structure
• Trend systems
• Volume Profile / POC analysis
• Supply and demand zones
• Higher timeframe bias
• Risk management systems
About TrendGenY Indicators
TrendGenY indicators are built from market experience, creative concepts, and a constant pursuit of unique perspectives. Rather than following conventional ideas, the focus is on uncovering alternative insights and viewing market behavior through different angles to reveal information that traditional tools may overlook and help traders build a more meaningful edge in the market. Indicator

Dynamic Take Profit Stop LossDynamic Take Profit Stop Loss
Dynamic Take Profit Stop Loss is designed to move beyond static take profit levels by dynamically adapting profit projections to changing market conditions.
Instead of relying on fixed R:R targets or ATR values alone, this indicator uses an internal Efficiency Engine to measure how effectively price is moving and adjusts projected targets accordingly.
As market efficiency strengthens, targets can expand. As efficiency weakens or deteriorates, targets can tighten to help preserve gains and reduce exposure.
Key Features
• Adaptive TP projections based on market efficiency
• SL-based R:R projection mode
• ATR-based projection mode
• Dynamic TP expansion and contraction logic
• Automatic Optimal TP selection (TP1 / TP2 / TP3)
• Local High / Low stop-loss calculation with adjustable buffers
• Optional manual entry price input
• Multiple TP display combinations:
TP1 Only
TP2 Only
TP3 Only
Optimal Only
TP + Optimal combinations
Multi-TP combinations
Show All
• Long and Short trade projections
• Dynamic TP multiplier engine
• Efficiency state analysis:
Improving
Mixed
Worsening
• Live information table showing:
Efficiency Score
Market State
TP Multiplier
Optimal TP
Long SL Distance
Short SL Distance
• Adjustable colors, table placement, text sizing, labels, and projection length
How It Works
The internal Efficiency Engine analyzes recent price behavior by comparing:
• Net directional movement
• Total movement path traveled
• Historical improvement or deterioration in efficiency
A weighted score is generated and translated into a dynamic TP multiplier.
Typical behavior:
Strong efficiency + improving conditions
→ Expand targets
Neutral conditions
→ Hold targets
Weakening efficiency
→ Tighten targets
Weak and deteriorating conditions
→ Exit or reduce exposure
Example Use
A standard 2R target may become:
Strong conditions:
2R → 3R+
Weak conditions:
2R → 1.2R–1.5R
The goal is to align profit expectations with how price is actually behaving instead of assuming all trades deserve identical targets.
Best Used For
• Trend continuation trading
• Breakout strategies
• Intraday trading
• Swing trading
• Futures
• Forex
• Indices
• Crypto
• Stocks
About TrendGenY Indicators
TrendGenY indicators are built from market experience, creative concepts, and a constant pursuit of unique perspectives. Rather than following conventional ideas, the focus is on uncovering alternative insights and viewing market behavior through different angles to reveal information that traditional tools may overlook and help traders build a more meaningful edge in the market. Indicator

Indicator

Tension Flow Trend [BigBeluga] - Historical RRTension Flow Trend is a high-performance trend-following framework that treats price action like a reactive elastic system. By moving beyond static averages, this indicator introduces "Price Tension"—a sophisticated measurement of how overstretched a trend is relative to its baseline—now enhanced with a live Historical RR (Risk:Reward) backtesting engine.
By combining the ultra-low-lag properties of the Hull Moving Average (HMA) with real-time Z-Score volatility analysis, this indicator visualizes not just the direction of the market, but the mathematical "exhaustion" of every move.
🔵 THE ELASTICITY FRAMEWORK
The Ultra-Responsive HMA Baseline: At the heart of the system is a 50-period Hull Moving Average. Specifically engineered to eliminate the lag found in traditional SMAs, the HMA provides a "true north" that reacts instantly to structural shifts without the usual delay.
Price Tension (Z-Score Engine): The indicator measures the vertical distance between price and the HMA, normalizing it using standard deviation. This Z-Score represents the "Tension" of the trend—showing you exactly when the market has deviated too far from its mean.
Dynamic Transparency Feedback: As price enters an extreme Z-Score range, the trend ribbon’s transparency increases. A bright, solid ribbon indicates compressed, high-probability energy, while a fading ribbon warns that the "elastic band" is stretched to its limit.
🔵 PERFORMANCE & RISK INTELLIGENCE
Automated RR Projection: Upon every "START" signal, the script automatically plots dynamic Risk:Reward boxes. It calculates an ATR-based stop loss and projects a take-profit target based on your custom RR ratio, visualizing the trade's path in real-time.
Rolling Performance Tracker: The indicator features a built-in backtester that tracks the win/loss history of the most recent trades. It calculates your Win Rate based on a rolling sample size, allowing you to see how the strategy is performing under current market conditions.
Signal Cooldown Logic: To eliminate "whipsaw" noise, a configurable cooldown engine ensures that signals only trigger during significant structural shifts. This prevents signal clustering in sideways or choppy markets.
🔵 DUAL-DASHBOARD SYSTEM
Energy Monitor (Bottom-Right): Tracks the numerical Z-Score and categorizes the market status. "Strong" indicates healthy momentum, while "Overextended" warns of an imminent mean-reversion risk.
RR Performance Table (Top-Right): Provides an institutional-grade breakdown of your strategy performance, including total Wins, Losses, and the current Win Rate percentage for the specified trade window.
🔵 STRATEGIC APPLICATION
The Momentum Breakout: Look for "START" labels that appear when the HMA slope aligns with a price crossover. These represent the birth of a new trend cycle where tension is low and expansion is likely.
Managing Trend Exhaustion: When the ribbon begins to fade and the Energy Dashboard hits "Overextended," it is time to tighten stops or take partial profits. High tension usually precedes a sharp snap-back to the baseline.
Confirming with Win Rate: Use the Performance Dashboard to gauge market regime. If the rolling Win Rate is high, the market is respecting the trend envelopes; if it drops, the market may be entering a consolidation phase where you should wait for better alignment.
Mean Reversion Targets: For contrarian traders, the HMA baseline serves as a natural "magnet." When price is significantly overextended, look for price to be pulled back into the HMA "Neutral Zone."
Tension Flow Trend transforms your chart into a map of market stress and opportunity. By visualizing the tension behind every candle and providing real-time performance feedback, it ensures you stay on the right side of the trend while trading with professional-grade risk management. Indicator

Liquidity Vacuum Recovery Map [AGPro Series]Liquidity Vacuum Recovery Map
🧠 Core Idea
Did price leave a liquidity vacuum, and is the market repairing that vacuum or rejecting the repair attempt?
📌 Overview / What it does
Liquidity Vacuum Recovery Map is a price-action visualization tool built to study displacement, imbalance, liquidity void behavior, and repair progress after a strong directional candle.
The script identifies high-quality displacement candles, builds an active vacuum zone from the body of that move, tracks how deeply price revisits the zone, measures repair progress, highlights rejection risk, and summarizes the full recovery context inside a compact AG Pro panel.
It does not predict future price, automate trades, or claim that every vacuum must be filled. It is a structured map for reading whether a thin participation area is still open, partially repaired, fully repaired, or being rejected.
🎯 Purpose & Design Philosophy
Many traders can see a fast displacement move after it happens.
The harder question is what comes next:
Is the market repairing the move, respecting the void, or rejecting the return into that area?
This script was built to answer that question visually. It helps traders read imbalance recovery, repair quality, rejection pressure, and next-context conditions without turning the chart into a generic signal board.
⚡ Why This Script Is Different
Most liquidity void tools focus on drawing static gaps, imbalance boxes, or historical void areas.
This script does NOT treat a vacuum as a passive rectangle on the chart.
Instead, it tracks the life cycle of the vacuum after displacement: creation, first repair, half repair, full repair, and rejection risk. The focus is not only where the vacuum is. The focus is whether the market is actively repairing it or refusing to repair it.
⚙️ Methodology
1. Displacement Detection
The script reviews candle range expansion, candle body commitment, close drive, and volume participation to identify a meaningful displacement candle.
2. Vacuum Zone Mapping
When the displacement qualifies, the script builds a vacuum zone from the strongest portion of the candle body. Bullish displacement leaves a repair zone below price. Bearish displacement leaves a repair zone above price.
3. Repair Progress Tracking
The script tracks how far price penetrates back into the active vacuum zone and converts that movement into a repair progress percentage.
4. Rejection Evaluation
If price enters the zone but moves away before full repair, the script evaluates whether the repair attempt is being rejected.
5. Quality Scoring
Vacuum quality combines range expansion, body commitment, close drive, and volume participation into a 0-100 score.
6. Visual Output
The chart displays the active vacuum zone, repair progress fill, midpoint reference, right-side repair tags, event labels, alerts, and a compact AG Pro decision panel.
🗺️ How to Read the Chart
Liquidity Vacuum Zone = the thin participation area left behind by a strong displacement candle.
Repair Progress Fill = the portion of the vacuum that price has already revisited.
VAC HIGH / VAC LOW = the active upper and lower boundaries of the vacuum zone.
REPAIR tag = the current repair progress score on the right side of the chart.
VACUUM OPEN = a qualified vacuum exists, but repair has not meaningfully started.
REPAIRING = price has started revisiting the vacuum zone.
REPAIR COMPLETE = price has repaired most or all of the active vacuum.
REJECTION RISK = price entered the vacuum zone but moved away before full repair.
Panel = summarizes vacuum state, quality score, vacuum type, repair progress, rejection risk, target zone, and next context.
🚦 Signals & States
• BULL VACUUM LEFT → bullish displacement created a vacuum below price.
• BEAR VACUUM LEFT → bearish displacement created a vacuum above price.
• REPAIR START → price has started entering the active vacuum zone.
• REPAIR HALF → price has repaired at least half of the active vacuum zone.
• REPAIR COMPLETE → price has repaired most or all of the active vacuum zone.
• REPAIR REJECTION → price entered the vacuum zone but rejected away before full repair.
🔔 Alerts Logic
Alerts can trigger when a qualified vacuum is created, repair starts, half repair is reached, full repair is reached, or repair rejection appears.
These alerts are attention markers only.
They are not trade instructions, entry signals, exit signals, or guaranteed outcomes.
🧩 Confluence Logic
The context becomes stronger when a high-quality displacement candle creates a clear vacuum, price revisits the zone, repair progress reaches a meaningful threshold, and rejection risk remains low.
The context becomes weaker when the vacuum is old, repair progress is incomplete, and price repeatedly rejects away from the zone.
📊 When to Use
• After strong displacement candles
• During imbalance and liquidity void analysis
• Around fast breakout or breakdown moves
• When evaluating whether a move is being repaired
• When studying continuation versus retracement behavior
• On liquid markets where candles and volume are meaningful
⚠️ When NOT to Use
• In extremely low-liquidity markets
• During highly erratic news candles
• On symbols with unreliable volume data
• When price is moving in tiny noisy candles without displacement
• As a standalone buy or sell system
🎛️ Key Inputs
• Minimum Displacement Range → controls how large a candle must be relative to average range.
• Minimum Body / Range → controls how committed the displacement candle body must be.
• Minimum Close Drive → controls how strongly the candle must close toward its direction.
• Vacuum Zone Body Share → controls how deep the vacuum zone is drawn inside the displacement body.
• Repair Start / Half / Complete Percent → controls the repair progress thresholds.
• Rejection Buffer ATR → controls how far price must move away before rejection risk is detected.
• Projection Bars → controls how far the active zone extends to the right.
• Label and Panel Font Size → controls chart readability.
🖥️ Interface & Visual Design
The visual design is built around one active story:
Where is the vacuum, how much of it has been repaired, and what is the current repair state?
The zone creates the main map, the repair fill shows progress, right-side tags keep the structure readable, event labels mark important moments, and the AG Pro panel summarizes the decision context.
🧪 Practical Usage Workflow
1. Read the panel first.
2. Check whether the script shows an active vacuum.
3. Review the vacuum quality score.
4. Look at repair progress.
5. Check whether rejection risk is low, medium, or high.
6. Use the vacuum boundaries as context areas, not automatic trade levels.
7. Confirm the broader market structure independently.
🔍 Interpretation Guidelines
A vacuum left behind by strong displacement can remain open for a long time.
Repair progress means price has revisited part of the zone.
Full repair means the active vacuum has mostly been revisited.
Rejection risk means the market attempted to repair the zone but moved away before completing the repair.
None of these states guarantee what happens next.
🚫 What This Script Is NOT
This script is not a prediction engine.
It is not a financial advice tool.
It is not an automated trading system.
It does not guarantee that price will fill a vacuum.
It does not guarantee continuation after rejection.
It does not replace risk management or independent analysis.
⚠️ Limitations & Transparency
Vacuum detection depends on candle behavior, volatility, volume, and timeframe.
Different timeframes may show different vacuum structures.
Some markets repair quickly, while others leave open void areas for long periods.
Volume-based scoring may be less reliable on symbols with incomplete or synthetic volume.
High volatility can create visually large zones that should be interpreted with extra caution.
🧠 Market Context Notes
Liquidity vacuums are most useful when interpreted as participation gaps rather than guaranteed magnets.
A repaired vacuum can signal that the market revisited a prior thin area.
A rejected vacuum can signal that the market respected the displacement path and refused deeper repair.
The best interpretation comes from combining vacuum context with structure, volatility, liquidity, and higher-timeframe conditions.
🧾 Use Case Examples
When price leaves a strong bullish displacement candle and later returns into the vacuum zone, traders can monitor whether repair progress increases smoothly or gets rejected near the upper part of the zone.
When price leaves a strong bearish displacement candle and later returns into the vacuum zone, traders can monitor whether the market fully repairs the move or rejects back below the zone.
When repair progress reaches half repair but rejection risk rises, the active context may become more fragile.
🧱 System Philosophy
Liquidity Vacuum Recovery Map is part of the AGPro Series approach:
Build visual tools that explain market context clearly, avoid hype, avoid prediction claims, and support structured decision-making.
The goal is not to tell users what to do.
The goal is to help users see what the market is doing more clearly.
🔐 Non-Promise Statement
No script can remove uncertainty from trading.
This tool does not promise accuracy, certainty, profitability, or future performance.
📉 Risk Disclosure
Trading involves risk.
Market conditions can change quickly.
Users are responsible for their own decisions, position sizing, risk management, and interpretation.
This script is for educational and analytical purposes only and does not provide financial advice.
📚 Educational Note
Use this script as a structured way to study displacement, liquidity vacuum behavior, repair progress, and rejection context.
The most valuable output is not a single label.
The value is the full map: vacuum, repair, rejection, quality, and next context.
Indicator

ATR Step Trailing Stop Positioning ToolThis indicator is an ATR-based trailing stop positioning tool.
It is not designed to generate buy or sell signals. Its purpose is to help traders visualize possible trailing stop levels based on volatility.
How it works:
The indicator calculates a stepped trailing level using the ATR distance from the high or low of the last closed candle.
For long-position management, the stop level can be positioned below price using the candle low and an ATR-based distance.
For short-position management, the stop level can be positioned above price using the candle high and an ATR-based distance.
Because the calculation is based on the last closed candle, the level is designed to behave like a step-style trailing reference instead of constantly moving tick by tick.
How this is different from a standard ATR trailing stop:
Many ATR stop indicators use a continuous trailing line or a single shared configuration for both long and short conditions.
This version is focused specifically on stop placement structure. It allows the trader to visualize ATR-based stop levels as stepped references from the most recent completed candle.
Another practical difference is that traders can add two instances of the indicator to the same chart. For example, one instance can be adjusted for long trailing stop management and another for short trailing stop management. By changing the visibility or transparency settings, it is possible to show only the positive or negative side of each instance and compare different ATR lengths or ATR multipliers for long and short positioning.
This makes the tool useful when a trader wants different trailing stop behavior for long and short positions instead of using one universal setting.
Possible use cases:
* Visualizing ATR-based trailing stop zones
* Managing open trades with a volatility-adjusted stop reference
* Comparing different ATR lengths or multipliers
* Separating long-side and short-side stop logic
* Studying how price behaves around volatility-based stop levels
Important limitation:
This indicator does not predict direction. It does not provide entry signals, exit signals, buy signals, or sell signals. The plotted levels are only a technical reference for trailing stop positioning based on ATR and closed candle structure.
Traders should combine this tool with their own entry logic, market structure analysis, risk management rules, and broader trading plan.
Indicator

Retest Defense Planner [AGPro Series]Retest Defense Planner
🧠 Core Idea
Is a retested level still being defended strongly enough to keep the planning context alive?
📌 Overview / What it does
Retest Defense Planner is a chart-first decision tool built for traders who review how price behaves after returning to an active defense shelf.
Instead of treating every level touch as meaningful, the script evaluates whether the shelf is actually being protected. It measures retest depth, wick defense, close response, time at level, volume support, target room, and risk-edge distance, then converts that evidence into a 0-100 Retest Score and a clear next-action state.
The default view is tuned for clear 4H-style retest review, where shelf defense, reaction quality, and short-term follow-through are usually easier to read than on very compressed timeframes. The script still works across timeframes, but users should adjust shelf age, projection bars, and sensitivity when changing market rhythm.
The script produces a defense zone, active defense rail, risk edge, target-room guide, follow-through guide, compact chart labels, alerts, and a clean AGPro planning panel. It does not predict price movement, automate execution, or provide guaranteed outcomes.
🎯 Purpose & Design Philosophy
This script was built to fill the gap between simple level plotting and full structure scanners.
Many traders can identify that price has returned to a level, but the harder question is whether the level is still being defended cleanly enough to deserve attention. Retest Defense Planner focuses on that decision layer.
The design supports a planning mindset: read the defense state, check the score, locate the risk edge, compare target room, and decide what deserves review next.
⚡ Why This Script Is Different
Most retest tools focus on structure breaks, swing-leg pullbacks, support/resistance maps, or broad breakout retest signals.
This script does NOT clone Structure Retest Planner, Swing Retest Quality, Breakout Retest Readiness, Break-Retest Quality, Breaker Block Engine, or a generic S/R zone map.
Instead, it evaluates one active defense shelf and asks whether the shelf is surviving the retest. The main output is not a signal. It is a decision state: DEFENDED, WATCH, WEAK RETEST, APPROACH, DEFENSE LOST, WAIT, or SCAN.
⚙️ Methodology
1. Context Detection
The script identifies fresh support-side or resistance-side defense shelves using confirmed pivot behavior and optional automatic side selection.
2. Reference Mapping
It maps one active defense zone, a shelf rail, a risk edge, and a target-room guide. These are planning references, not trade instructions.
3. Reaction Evaluation
The 0-100 model scores retest depth, wick defense, close response, time at level, and volume support.
4. Visual Output
The chart shows the active defense zone with centered text, event labels, guide lines, and the AGPro decision panel.
🗺️ How to Read the Chart
Defense Zone = the active shelf area being evaluated after price returns to it.
Defense Rail = the exact reference shelf the model is monitoring.
Risk Edge = the planning line where the active defense context is considered lost.
Target-Room Guide = a forward context guide based on the current shelf-to-risk distance.
Labels = compact TEST, DEFENDED, WATCH, WEAK, LOST, and context labels.
Colors = teal marks bullish support-defense context, pink marks bearish resistance-defense context, amber marks caution/review, indigo marks watch/transition, and red marks lost defense.
Panel = the AGPro panel summarizes Defense State, Retest Score, Reaction Quality, Risk Edge, and Action.
🚦 Signals & States
• DEFENDED → the shelf has been retested and the defense score is strong enough for structured review.
• WATCH → the response is developing, but confirmation or room is still incomplete.
• WEAK RETEST → price touched the shelf, but response quality is not strong enough.
• APPROACH → price is near the active defense shelf and a retest review may be forming.
• DEFENSE LOST → price crossed the risk edge and the active shelf context should be rebuilt.
• WAIT → an active shelf exists, but price is not close enough for a useful review.
• SCAN → no fresh defense shelf is active yet.
🔔 Alerts Logic
Alerts trigger when price touches the active defense zone, when a defended retest appears, when watch context appears, when a weak retest is detected, and when the risk edge is crossed.
Alerts are attention markers only. They are not trade instructions, automated strategy commands, or outcome promises.
🧩 Confluence Logic
The strongest context appears when a controlled retest probe, visible wick defense, constructive close response, enough hold time, supportive relative volume, and usable target room align.
When those components conflict, the panel moves toward WATCH, WEAK RETEST, RISK REVIEW, or DEFENSE LOST.
📊 When to Use
• Pullbacks into a defended support shelf
• Retests of a resistance shelf after bearish pressure
• 4H retest reviews where shelf defense and reaction candles are visually readable
• Continuation planning where the level has already been identified by price action
• Risk planning where invalidation and target room matter
• Liquid markets where candles, pivots, and volume behavior are readable
⚠️ When NOT to Use
• Very low-liquidity symbols with irregular candles
• Extremely noisy micro-timeframes
• News-driven spikes where shelf behavior becomes distorted
• Markets where pivot structure is too compressed to form useful shelves
• Situations where the user expects a signal-only tool
🎛️ Key Inputs
• Defense Side → selects Auto, Bullish Defense, or Bearish Defense.
• Defense Pivot Length → controls how confirmed shelves are detected.
• Max Shelf Age → controls how long a shelf remains eligible.
• Sensitivity → adjusts activation distance and zone tolerance.
• Response Window Bars → controls how long the retest response remains active.
• Risk Edge ATR → controls the planning risk edge behind the shelf.
• DEFENDED Score → sets the score threshold for stronger review states.
• Label and Panel Font Size → controls chart-label and panel readability.
• Panel Location and Theme → adjusts the AGPro panel layout.
🖥️ Interface & Visual Design
The interface is designed to stay chart-first and decision-led.
The defense zone is the main visual object. The centered label keeps the zone readable without adding extra floating text. The risk edge and target guide explain where the planning context weakens and how much room remains.
The AGPro panel uses a merged blue title row and five compact rows so the user can read state, score, reaction quality, risk, and next action quickly.
🧪 Practical Usage Workflow
1. Read the panel state and Retest Score.
2. Check whether price is approaching or touching the defense zone.
3. Compare the shelf rail with the risk edge.
4. Review whether the label says TEST, DEFENDED, WATCH, WEAK, or LOST.
5. Confirm the broader market context before making any decision.
🔍 Interpretation Guidelines
Think in terms of defense quality, not prediction.
A higher score means multiple defense components align inside the script's rule set. A weaker score means the retest may be too shallow, too deep, too fast, too noisy, or missing a constructive close response.
The script helps organize the review process. It does not replace judgment.
🚫 What This Script Is NOT
• Not a prediction engine
• Not financial advice
• Not an auto-trading system
• Not a guaranteed signal tool
• Not a BOS / CHOCH scanner
• Not a breakout retest scanner
• Not a swing-leg retest tool
• Not an order block, FVG, or supply/demand map
• Not a generic support/resistance zone map
⚠️ Limitations & Transparency
• Pivot-based shelf references appear only after pivots are confirmed.
• Scores can vary across symbols, sessions, and timeframes.
• Volume scoring depends on exchange-provided volume data.
• Fast volatility can cross a shelf before a clean defense can be measured.
• In Live Updating mode, active-bar values can change before the bar closes.
🧠 Market Context Notes
Retest defense is easiest to interpret when liquidity, volatility, and trend context are readable.
A defended shelf is not enough by itself. The reaction, close location, hold time, risk edge, and target room all matter.
🧾 Use Case Examples
When price returns to a support shelf, probes the defense zone, forms a visible lower wick, and closes back above the shelf with enough target room, the planner may mark DEFENDED.
When price touches the shelf but closes weakly with poor reaction quality, the planner may show WEAK RETEST or WATCH.
When price crosses the risk edge, DEFENSE LOST indicates that the active context should be rebuilt.
🧱 System Philosophy
Retest Defense Planner follows the AGPro decision-engine approach: map the context, score the quality, show the risk reference, show the target room, and summarize the next action without issuing trade commands.
🔐 Non-Promise Statement
No indicator can provide certainty.
The script does not guarantee that a retest will hold, continue, reverse, or produce any specific outcome.
📉 Risk Disclosure
Trading involves risk.
Users are responsible for their own analysis, risk management, and trading decisions.
This script is provided for educational and analytical purposes only and does not constitute financial advice.
📚 Educational Note
Use the script as a structured retest-defense review framework. The best results come from combining the panel, zones, labels, and alerts with broader chart context and disciplined risk evaluation.
Indicator

Sovereign Trend Strategy [JOAT]Sovereign Trend Strategy
Introduction
The Sovereign Trend Strategy is a systematic, rules-based trend-following strategy built on the SMEMA (SMA of EMA) crossover engine — a double-smoothed moving average system that removes the erratic noise of raw EMA crossovers while remaining faster to respond than pure SMA systems. It enters long and short trades on SMEMA fast/slow crossovers, applies four optional confirmation filters (ADX, RSI, volatility ratio, and baseline), and manages each trade through a full exit framework: stop loss, two take-profit levels with partial close at TP1, a dynamic trailing stop, a trend-reversal exit, and a maximum bars cap that forces turnover.
This is a strategy designed to trade constantly — the default configuration is tuned for maximum trade frequency across all assets and timeframes, with all optional filters disabled so that every valid SMEMA crossover generates a signal. Traders seeking higher-quality entries can enable the ADX, RSI, baseline, or volatility filters individually to raise the bar.
Core Concepts
SMEMA — Double-Smoothed Moving Average Engine
The SMEMA construction applies a simple moving average on top of an exponential moving average, producing a line that is more responsive than a plain SMA but smoother than a raw EMA:
smema(float src, int len) =>
ta.sma(ta.ema(src, len), len)
float fast = smema(close, smFast)
float slow = smema(close, smSlow)
float baseline = smema(close, smBase)
Three SMEMA lines are computed: a fast line (default length 2), a slow line (default length 5), and a longer baseline (default length 15). Crossovers between fast and slow generate the entry signals. The baseline provides an optional directional filter when enabled.
Entry Conditions
Long entries fire when the fast SMEMA crosses above the slow SMEMA with all active filters passing:
bool xUp = ta.crossover(fast, slow)
bool longOk = xUp and adxOk and rsiLongOk and volOk and baseOk
and warmed and inDateRange and barstate.isconfirmed and doLong
Short entries mirror this on downward crossovers. Entries only fire when there are no open trades (pyramiding disabled), ensuring clean one-trade-at-a-time management.
Trade Management Framework
Each trade uses ATR-based levels calculated at entry:
| Level | Default Multiplier | Purpose |
|-------|-------------------|---------|
| Stop Loss | 1.8× ATR | Full position stop |
| TP1 | 2.5× ATR | 50% partial close, breakeven stop move |
| TP2 | 4.5× ATR | Full position close |
| Trailing Stop | 1.5× ATR | Activated after TP1 hit |
After TP1 triggers, the stop-loss is moved to the entry price (breakeven). The trailing stop then follows price by 1.5× ATR, locking in profit while letting the remaining position run toward TP2. This staged approach captures quick-reaction profits at TP1 and rides momentum toward TP2.
Six Exit Paths
// Priority order for long exits:
// 1. Stop Loss — low <= entrySL
// 2. TP1 — high >= entryTP1 (50% partial, breakeven stop set)
// 3. TP2 — high >= entryTP2 (full close after TP1 hit)
// 4. Trailing — low <= trlStop (after TP1 hit)
// 5. Reversal — fast SMEMA crosses below slow (xDn confirmed)
// 6. Max Bars — barsInTrd >= maxBars
The max bars exit (default 10) is particularly important for trade frequency — it guarantees no position is held longer than 10 bars regardless of whether any other exit triggers, creating rapid capital recycling and enabling 100+ trade sample sizes even on daily timeframes.
Optional Confirmation Filters
All four filters are disabled by default and can be enabled individually:
ADX Filter — requires ADX above a minimum threshold before entry. Prevents entries in ranging, low-momentum markets.
RSI Filter — requires RSI above the bull minimum for longs (default 52) or below the bear maximum for shorts (default 48). Confirms momentum alignment with direction.
Volatility Ratio Filter — requires current ATR to be at least a configurable fraction of its own SMA. Filters out squeeze conditions where ATR is compressed.
Baseline Filter — requires close to be above the baseline SMEMA for longs and below for shorts. Adds a medium-term trend confirmation layer.
Strategy Parameters (Backtesting Standards)
Initial capital: $10,000 (realistic for the average retail trader)
Position size: 100% of equity (maximizes trade count visibility in backtest)
Commission: 0.05% per side (appropriate for most spot and futures markets)
Slippage: 2 ticks (conservative estimate for liquid instruments)
Pyramiding: 0 (no compounding positions)
Features
SMEMA fast/slow crossover entry engine with three configurable period lengths
Full trade management: ATR-based SL, TP1 (50% partial), TP2 (full), trailing stop, reversal exit, max bars exit
Breakeven stop migration to entry price after TP1 hit
Four optional confirmation filters: ADX, RSI, volatility ratio, and SMEMA baseline
Long-only, short-only, or both directions configurable
Date range filter for restricted backtesting windows
Live SL, TP1, and TP2 dashed lines drawn on the chart while a trade is open
SMEMA ribbon fill between fast and slow lines, colored by crossover direction
▲ LONG / ▼ SHORT signal labels at every entry signal
Dashboard: position, SMEMA cross direction, ADX, RSI, vol ratio, trade count, win rate, net P&L, bars in trade, settings summary
Alerts for long entry and short entry signals
Webhook JSON alert format
Watermark
Input Parameters
SMEMA Engine
Fast SMEMA Length — period for the fast crossover line (default 2)
Slow SMEMA Length — period for the slow crossover line (default 5)
Baseline SMEMA — period for the optional trend baseline (default 15)
Trend Filter
ADX Length — period for ADX / DMI calculation (default 14)
Min ADX — minimum ADX value required before entry (default 18)
Enable ADX Filter — master toggle (default off)
RSI Filter
RSI Length — period for RSI calculation (default 14)
RSI Bull Min — minimum RSI for long entries (default 52)
RSI Bear Max — maximum RSI for short entries (default 48)
Enable RSI Filter — master toggle (default off)
Volatility Filter
ATR Length — lookback for ATR (default 14)
ATR Smooth — lookback for the ATR average used in ratio (default 20)
Min Vol Ratio — ATR/AvgATR minimum threshold (default 0.8)
Enable Vol Ratio Filter — master toggle (default off)
Baseline Filter
Enable Baseline Filter — when on, requires close above baseline for longs and below for shorts (default off)
Trade Management
Stop-Loss ATR Mult — distance of initial stop from entry in ATR units (default 1.8)
TP1 ATR Mult — distance of first take-profit from entry (default 2.5)
TP2 ATR Mult — distance of second take-profit from entry (default 4.5)
Use Trailing Stop — enables dynamic trailing after TP1 (default on)
Trailing Stop ATR Mult — trail distance in ATR units (default 1.5)
Max Bars in Trade — maximum bars before forced exit (default 10)
Trade Direction
Allow Long Trades — toggles long entry signals (default on)
Allow Short Trades — toggles short entry signals (default on)
Date Range
Enable Date Filter — restricts backtesting to a specific window
From Date / To Date — start and end of the active period
Visuals
Bull Color — cyan default for upside elements
Bear Color — red default for downside elements
Neutral Color — gray for baseline and neutral dashboard text
Show Dashboard — live performance and settings panel
Show Watermark
Show Signal Labels — ▲ LONG / ▼ SHORT markers on entry bars
Show SMEMA Bands — toggles the ribbon and three SMEMA line plots
How to Use
Add the strategy to any chart. The default settings are tuned for high trade frequency — no filters enabled, fast periods of 2/5, max bars 10.
Run the Strategy Tester to review backtest performance. Check that the trade count is above 100 on your chosen timeframe and symbol before drawing any performance conclusions.
To increase signal quality at the cost of trade frequency, enable filters one at a time: start with the ADX filter to eliminate ranging entries, then add RSI if you want additional momentum confirmation.
Use the SL/TP dashed lines drawn on-chart during live trades to monitor your risk levels visually in real time.
Set the Long Entry and Short Entry alerts to receive notifications. Use Webhook JSON format to route signals to automation platforms.
Adjust the ATR multipliers to fit the volatility profile of your market. Higher-volatility assets like altcoins benefit from wider stops (2.0–2.5×) and wider TP levels. Lower-volatility assets like indices may work better with tighter parameters.
The Max Bars in Trade parameter is the most powerful lever for trade frequency. Reducing it to 5–7 generates very high trade counts. Increasing it to 20–40 gives trades more room to develop but reduces total trade count.
Indicator Limitations
SMEMA crossovers are inherently lagging — by definition, the crossover confirms a direction change after it has already begun. In fast-moving markets this means entries will not be at the exact turning point.
The default configuration (all filters off, max bars 10) optimizes for trade count and sample size rather than highest possible win rate. Enabling filters will reduce trade count but may improve per-trade quality — test thoroughly on your symbol and timeframe before live use.
The 100% equity position sizing in the backtest is chosen to keep commission effects proportional and performance metrics visible at small capital sizes. This does not represent a recommendation to risk your entire account on any trade.
Backtested results are not a guarantee of future performance. Past performance under any parameters does not imply future results.
The strategy uses `calc_on_every_tick=false` — all orders execute at bar close, which is more realistic than tick-by-tick simulation but means intrabar SL/TP wicks may not be captured accurately in the backtest.
Originality Statement
The Sovereign Trend Strategy is an original Pine Script v6 strategy publication. The SMEMA (SMA of EMA) double-smoothing construction is an original baseline engineering choice that produces a distinct crossover behavior not replicated by standard EMA or SMA crossover systems. The six-path exit framework, the staged TP1/breakeven/trailing/TP2 management sequence, and the modular optional filter architecture are original design decisions. The strategy.position_size derivation of position state (avoiding the Pine Script v6 timing bug with strategy.opentrades and manual boolean flags) is an original technical solution developed for this publication.
Disclaimer
This is a backtested strategy provided for educational purposes only. It does not constitute financial advice or a recommendation to trade any specific instrument. All trading involves risk of capital loss. Backtested performance does not guarantee future results. Commission, slippage, and real-world execution conditions will differ from backtest simulations. Always perform your own analysis and consult a licensed financial professional before trading with real capital.
-Made with passion by jackofalltrades
Strategy

Indicator

Indicator

MechArt ATR Box 12 V1.4MechArt ATR Box — Trade Management Zones
This indicator visualizes structured trade management levels around a defined entry price using ATR (Average True Range) as the measurement unit. It's designed for options traders and swing traders who manage positions with clearly defined roll marks and stop levels.
What It Does
Once you set an entry price, entry date, and expiration date, the indicator draws a complete zone map across the life of your trade — from open to expiration. All levels are calculated from the Daily ATR(14) value at the time of entry, giving you volatility-adjusted roll marks rather than arbitrary fixed distances.
Levels Drawn
🟢 +2.5 ATR — Third Roll. Additional rolls every 1.0 ATR above.
🟢 +1.5 ATR — Second Roll
🟢 +0.5 ATR — First Roll
⬜ Entry — Your trade entry price baseline
🟡 -2.0 ATR — Stop loss level
🔴 -3.0 ATR — Emergency exit level
All multipliers are fully adjustable in the Settings panel.
Features
• ATR-based levels that automatically scale to each asset's volatility
• Stacked color-coded boxes for instant visual zone identification
• Horizontal lines with customizable style, width, and opacity
• Dynamic labels that reflect your actual multiplier settings
• DTE (Days to Expiration) + ATR value displayed on the chart
• Pre-loaded with 12 configurable tickers in the open Pine Script — simply update entry prices to your trades
• Smart default mode for any unlisted ticker: auto-sets entry to current price and expiration to the nearest Friday ~21 days out
• Full style customization: colors, opacity, line style, label size
How to Use
1. Find your ticker in the script's ticker block and update the entryPrice to your actual trade entry
2. Adjust entryDate and expirationDate to match your position
3. Load the indicator — zones and levels draw automatically
4. Use the Settings panel to fine-tune multipliers and visual styling to your preference
Best Used For
Long Calls, OVTLYR Plan M, use your creativity.
Indicator

Strategy

Supertrend by JKRSupertrend by JKR is a trend-following overlay that plots dynamic support/resistance bands around price and flips when the trend changes.
It builds a smoothed baseline using your selected moving average type (SMA, TMA, WMA, VWMA, TEMA, HMA, EMA, or VMA). Around this baseline, it computes a volatility/range offset (classic ATR mode or Dual-Thrust range mode) and creates two trailing bands:
UpTrend band (active during bullish conditions)
DownTrend band (active during bearish conditions)
When price closes beyond the active band, the indicator flips trend direction and switches to the opposite band. While the trend remains active, the band “trails” price and updates in a way that avoids stepping backwards, which helps keep the trend structure clean and stable.
Options
Trend-change arrows (optional)
Bar coloring or candle overlay (optional)
Designed to evaluate on bar close for stable signals
Tip: Increase the Multiplier to reduce flips and widen bands; reduce Period to make the trend more responsive. Indicator

Risk & Reward Position PlannerDescription
This script is a trade architecture tool designed to help traders calculate position sizes and visualize risk-reward ratios dynamically on the chart. It focuses on functional precision and clean aesthetics, offering two distinct visual styles: "Cyber" for modern high-tech charts and "Classic" for a traditional look.
Key Features
Interactive Setup: Upon adding the script or resetting, it prompts you to click directly on the chart to set your Entry and Stop Loss levels.
Dynamic Position Sizing: Calculates the total risk in currency (USD) based on your custom unit size.
Multi-Target Planning: Visualizes four customizable Take Profit targets based on specific RR ratios.
Cyber UI Aesthetics: Full control over colors, neon glow effects, and horizontal alignment to fit any chart layout.
Comprehensive Data: Displays price, percentage distance, currency risk, and RR ratios at a single glance.
User Guide (How to use)
To ensure the most efficient workflow, here are the essential steps for operating the tool:
Setting a New Trade (Resetting)
If you change your symbol or want to plan a completely new trade, you can clear the current setup and trigger the interactive selection again:
Right-click on the indicator in the chart OR click the three dots (...) next to the indicator name in the legend.
Select "Reset Points".
The indicator will prompt you to click two new points on the chart: first for the Entry, then for the Stop Loss.
Moving Entry and Stop Loss
Move the mouse over the line of the Entry or the StopLoss and grab the grip of the line to move it up or down. Drop it to the price you want to set. Indicator

Position Avg Line + P/L Table - SightLine LabsPosition Avg – SLL is a lightweight position-tracking indicator designed to display a persistent average price level on the chart along with a real-time position summary table.
This script is non-trading and does not generate signals, entries, or exits. It is intended strictly for position awareness and visual reference.
What this indicator does:
Plots a persistent horizontal average price line (dashed by default)
Displays a live position statistics table showing:
Shares owned
Average price
Current price
Unrealized profit/loss in dollars
Unrealized profit/loss in percent
Updates automatically as price changes
Works across all timeframes
Does not depend on broker integration or strategy logic
Key features:
Average Price Line:
User-defined average price input
Persistent across the entire chart
Adjustable color and width
Visibility toggle
Position Table:
Six selectable table positions:
Top Left, Top Center, Top Right, Bottom Left, Bottom Center, Bottom Right
Adjustable text size (Tiny through Huge)
Optional table background fill
Optional inner grid lines
Optional outer frame border
Independent color control for:
Header background
Header text
Value text
Positive and negative P/L values
Chart Overlay Options:
Optional chart background tint
Does not modify the global chart theme
Inputs overview:
Position Settings:
Shares Owned
Average Price
Visual Settings:
Show or hide average price line
Line color and width
Table Settings:
Table position
Table text size
Color Settings:
Header background and text colors
Value text color
Positive and negative P/L colors
Optional table background, grid, and frame colors
How to use:
Add the indicator to a chart
Open the settings panel
Enter the number of shares and the average price
Adjust table position, size, and colors as desired
Use the average price line and table as a visual reference for trade and risk management
Notes and limitations:
This indicator does not place trades
It does not connect to any broker
All values are manually entered
Unrealized P/L is calculated using the chart’s current price
Commissions, fees, and slippage are not included
Disclaimer:
This script is provided for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or trade signals. All trading decisions are the sole responsibility of the user.
Developed by SightLine Labs. Indicator

Auto Position CalculatorA position sizing tool that automatically detects the instrument you're trading and calculates the correct position size based on your risk parameters.
What It Does
This indicator calculates how many contracts, lots, or shares to trade based on your account size, risk percentage, and stop loss distance. It auto-detects the instrument type and adjusts the point/pip value accordingly.
Supported Instruments
Futures: NQ, MNQ, ES, MES, YM, MYM, RTY, M2K, CL, MCL, GC, MGC
Forex: All major pairs (USD, EUR, GBP, JPY, etc.)
Index CFDs: NAS100, US500, US30, GER40, UK100
Metals: XAU, XAG
Crypto and Stocks: Automatic detection
How to Use
Set your account size and risk % in settings
Click the settings icon and place Entry, Stop Loss, and Take Profit on the chart
The position size and risk calculations appear automatically
Levels auto-reset at your chosen session (Asia, London, or New York open)
Limitations
CFD and forex pip values assume standard lot sizing - your broker may differ
Auto-detection relies on ticker naming conventions, which vary by broker/data feed
Session reset times are based on ET (Eastern Time) Indicator

CNagda Anchor2EntryCNagda Anchor2Entry Pine Script v6 overlay indicator pulls higher-timeframe (HTF) signal events to define anchor high/low levels and then projects visual entry labels on the lower-timeframe (LTF). It also draws auto-oriented Fibonacci retracement/extension levels for context, but it does not execute orders, stops, or targets—only visual guidance.
Inputs
Key inputs include Lookback Length for HTF scanning and a Signal Timeframe used with request.security to import HTF events onto the active chart.
Entry behavior can be set to “Confirm only” or “Wait candle,” trade side can be restricted to Buy/Sell/Both, and individual strategies (Buy WAIT/S1; Sell REV/S1/S2/S3) can be toggled.
HTF logic
The script defines WAIT/BUY setup and confirmation, SELL reversal on breaking the WAIT BUY low, and several volume/candle-based patterns (Sell S1/S2/S3, Buy S1).
It captures the associated highs/lows at those events with ta.valuewhen and imports them via request.security to form anchors (anc_hi/anc_lo) and “new trigger” booleans that gate label creation on the LTF.
Flip entries
When enabled, “Flip entries” generate contrarian labels based on breaking or confirming HTF anchors: crossing above anc_hi can trigger a flip-to-sell label, and crossing below anc_lo can trigger a flip-to-buy label.
The flip mode supports Immediate (on cross) or Confirm (on sustained break) to control how strict the trigger is.
Fibonacci drawing
User-specified Fib levels are parsed from a string, safely converted to floats, and drawn as dotted horizontal lines only when they fall inside an approximate visible viewport. Orientation (up or down) is decided automatically from pending signal direction and a simple context score (candle bias, trend, and price vs. mid), with efficient redraw/clear guards to avoid clutter.
Dynamic anchors
If HTF anchors are missing or too far from current price (checked with an ATR-based threshold), the script falls back to local swing highs/lows to keep the reference range relevant. This dynamic switch helps Fib levels and labels remain close to current market structure without manual intervention.
Signal labels
Labels are created only on confirmed bars to avoid repainting noise, with one “latest” label kept by deleting the previous one. The script places BUY/SELL labels for WAIT/CONFIRM, direct HTF patterns (Buy S1, Sell S1/S2/S3), and contrarian flip events, offset slightly from highs/lows with clear coloring and configurable sizes.
Visual context
Bars are softly colored (lime tint for bullish, orange tint for bearish) for quick context, and everything renders as an overlay on the price chart. Fib labels include a Δ readout (distance from current close), and line extension length, label sizes, and viewport padding are adjustable.
How to use
Set the Signal Timeframe and Lookback Length to establish which HTF structures and ranges will drive the anchors and entry conditions. Choose entry flow (Wait vs Confirm), enable Flip if contrarian triggers are desired, select the trade side, toggle strategies, and customize Fibonacci levels plus dynamic-anchor fallback for practical on-chart guidance.
Notes
This is a visual decision-support tool; it does not place trades, stops, or targets and should be validated on charts before live use. It is written for Pine Script v6 and relies heavily on request.security for HTF-to-LTF transfer of signals and anchors. Indicator

Position Size CalculatorPosition Size Calculator
This open-source Pine Script® indicator helps traders manage risk by calculating position size, margin, and risk/reward based on account size, leverage, entry, stop-loss, and take-profit. It features a customizable table and optional chart lines/labels for clear trade planning across stocks, forex, crypto, and futures.
What It Does
- Position Size: Computes units to trade based on risk percentage and stop-loss distance, capped by leverage.
- Margin: Calculates initial margin in base currency and USD, with account size percentage.
- Risk/Reward: Shows risk-reward ratio, percentage price movements, and USD gains/losses.
- Visualization: Displays results in a table and optional chart lines/labels with customizable styles.
How It Works
- Precision: Adjusts price formatting using syminfo.mintick for accuracy across assets.
- Calculations: Position size = accountSize * (riskPercent / 100) / |entry - stoploss|, capped by accountSize * leverage / entry. Margin = positionSize / leverage. Risk-reward = |takeprofit - entry| / |stoploss - entry|.
- Display: Table shows metrics; optional lines/labels plot entry, stop-loss, and take-profit with percentage and USD details.
How to Use
- Set Inputs:
1- Account Size (USD): Your capital (e.g., 1000).
2- % Risk per Trade: Risk tolerance (e.g., 1%).
3- Leverage: Broker leverage (e.g., 1x, 10x).
4- Entry, Stop Loss, Take Profit: Trade prices.
5- Show Lines and Labels: Enable chart overlays.
- Customize: Adjust table position, colors, and line styles (Solid, Dashed, Dotted).
- View Results: Table shows position size, margin, and risk/reward. Chart lines/labels (if enabled) display prices, percentages, and USD outcomes.
- Apply: Use metrics for trade execution; modify code for custom features.
Notes
- Ensure valid inputs (entry ≠ stop-loss, both positive) to avoid “N/A”.
- Open-source: Inspect or extend the code for your needs.
- Contact the author via TradingView for feedback.
Indicator

Indicator
