Luxy UT God Mode - UT-Bot Forecast, Signals, Zones and RiskLuxy UT God Mode turns the classic UT Bot ATR trailing-stop into a complete, self-contained trading cockpit: momentum-adaptive buy/sell signals, a forward-looking Trend Duration Forecast, auto support/resistance zones, a 0-100 Confidence Score, a built-in multi-currency Risk Calculator, and automatic Stop Loss / Take Profit levels - all on one overlay, all non-repainting.
Note: Every forecast, probability, and statistic in this tool is a calculation based on the chart's own historical behavior. They describe past patterns, not guaranteed future results.
WHAT MAKES THIS DIFFERENT
A normal UT Bot only tells you the trend flipped. Luxy UT God Mode answers the three questions a trader actually asks at the moment of a signal:
1. Should I trust this flip? - a Confidence Score (0-100) blends seven engines into one number.
2. How long might this trend run? - a Trend Duration Forecast projects the expected remaining life of the current trend, drawn as a fading strip with survival-probability milestones.
3. What do I risk and how big do I trade? - automatic Stop Loss, R-based Take Profits, and a position-size calculator in your own account currency.
Everything is layered so you can run it bare-bones (just clean signals) or switch on the full "God Mode" stack.
METHODOLOGY AND CREDITS
This indicator implements proven concepts using entirely original code.
- UT Bot ATR trailing logic - original concept by @QuantNomad . This implementation is a significant rework: it adds volume weighting, momentum-adaptive sensitivity, a composite multi-method stop loss, a full multi-filter confirmation stack, multi-timeframe confluence, and the statistical trend-duration engine described below.
Important: this is an educational analysis tool. It does not guarantee any trading result. Always do your own analysis and manage risk.
THE SEVEN ENGINES (and the Confidence Score that fuses them)
Each bar, the script scores how well the current setup aligns and sums it into a single 0-100 Confidence Score with a visual progress bar:
UT Bot direction - is price above/below the momentum-adaptive trailing stop
SuperTrend - direction plus a distance-from-line strength bonus
Market Structure - position inside the recent swing range and structure breaks
ADX Regime - is the market trending (signals allowed) or choppy (blocked)
Multi-Timeframe - does a higher timeframe agree with the signal direction
Volume - is conviction backed by above-average volume
RSI Divergence - is a recent divergence supporting or opposing the signal
Read it at a glance: 80+ = strong, 60+ = good, 40+ = weak, under 40 = very weak. Hover the Confidence cell for the full per-engine breakdown.
1. TREND DURATION FORECAST - the headline feature
When the trend flips, the script projects how many more bars the new trend may last, based on the chart's own past trends.
How it works:
Every completed trend's duration is recorded, kept separately for bullish and bearish trends.
On each new flip the script estimates the expected duration using an exponentially-weighted average and standard deviation (recent trends weighted more heavily).
The estimate is drawn as a fading gradient strip that projects forward from the flip, with a "Trend Analysis" label and survival-probability milestones at 25% / 50% / 75% / 90% / 100% of the projection.
The percentages are empirical - they show the share of past same-direction trends on THIS chart that actually lasted at least that long. Not a fixed textbook curve.
Three forecast modes:
Simple - median duration only. Clean and fast.
Standard - exponentially-weighted average plus spread (recommended default).
Advanced - Standard plus five adaptive multipliers: Structure (proximity to S/R), Asset Type (volatility profile), Flip Strength (volume + filters passed), Error Learning (self-correction from its own past misses), and Regime (trending vs choppy).
When history is thin, the forecast honestly falls back to a combined estimate and flags it, rather than showing false precision.
2. MOMENTUM-ADAPTIVE UT BOT CORE
The trailing stop is not a fixed ATR multiple. The effective sensitivity adapts each bar to:
Momentum - faster momentum widens the trail to stay in strong moves
Relative volume - conviction adjusts the distance
Asset type - auto-detected (crypto, forex, futures, index, fund, CFD, bond, stock) with a per-class multiplier, or set it manually
Volatility mode - Fixed, Dynamic, or Aggressive auto-adjustment to the current volatility regime
The result is a trailing engine that behaves differently on a calm blue-chip than on a volatile small-cap or crypto pair - without you re-tuning it.
3. ANTI-WHIPSAW AND SIGNAL FILTER STACK
Signals only fire when they survive the filters you enable, so you control the trade-off between frequency and quality:
ADX Regime - block signals in choppy, non-trending conditions
Cooldown and Confirmation - minimum bars between signals and N-bar direction confirmation
Swing - only trade aligned with recent swing structure
Full Candle - require the whole candle beyond the trailing line (no straddles)
Volume, RSI, Hull MA, SuperTrend - optional confirmation layers
High-Volatility and % Change - only trade meaningful moves
2-Bar Confirm - extra confirmation for volatile markets
Every active filter appears as a row in the table with a live pass/fail state, so you always know why a flip did or did not become a signal.
4. SUPPORT / RESISTANCE ZONES
The script clusters significant swing pivots into persistent price zones and draws only the two that matter right now: the nearest resistance above price and the nearest support below price. Each zone shows its price and touch count (e.g. "S 4.19 (3x)" = a support tested three times). A level that price has broken through drops off automatically, and an optional Zone Filter can block buys into resistance and sells into support. Pivot strength is adjustable so you can show only major levels.
5. AUTOMATIC STOP LOSS, TAKE PROFIT AND RISK CALCULATOR
On every signal the script draws a complete trade plan:
Stop Loss - choose from seven methods: ATR, % based, tick based, swing, scaled ATR, Smart Adaptive (auto-scales to volatility), or Safer (widest of several).
Take Profit - TP1 / TP1.5 / TP2 / TP3 as R multiples of the stop distance, with optional price and % labels, and a freeze-on-touch check mark for journaling.
Entry line - marks the signal price; all lines can auto-limit to 10 bars for a clean chart.
Risk Calculator - enter account size and risk (% or fixed amount) and it returns the position size in shares/contracts, in your own currency, with live FX conversion (USD, EUR, GBP, JPY, CAD, AUD, CHF) or a manual rate.
6. MULTI-TIMEFRAME CONFLUENCE AND RSI DIVERGENCE
The table shows the trend of up to seven higher timeframes (5m, 15m, 30m, 1H, 4H, D, W) via an EMA 9/21 cross, so you can see whether the bigger picture agrees before you act. An optional MTF filter blocks counter-trend signals. Separately, RSI divergence (regular bullish and bearish) is detected, labeled on the chart, and fed into the Confidence Score.
7. LIVE STATUS TABLE
A configurable dashboard (position and size adjustable) summarizes everything: asset type, Confidence Score, adaptive mode, current signal, win-rate / average-bars statistics, multi-timeframe row, divergence, forecast, position size, and one row per active filter - each with a detailed tooltip.
HOW TO USE IT - QUICK START
Step 1 - Add it and pick your sensitivity. Defaults suit intraday (5-15m). For scalping lower the Sensitivity/ATR; for swing raise them (see the Sensitivity tooltip for presets).
Step 2 - Read a signal. A Buy (aqua, below bar) or Sell (orange, above bar) appears only after the bar closes and all enabled filters pass. Check the Confidence Score and the Multi-TF row for context.
Step 3 - Use the trade plan. The Entry, Stop Loss and Take Profit lines draw automatically. Read the Position row for size. Use the Trend Duration Forecast strip as a realistic hold-time expectation - scale out near the median, reassess if price runs past the projection.
Step 4 - Set alerts. Use "Any alert() function call" to receive BUY/SELL and trend-flip alerts on bar close, or pick the specific "Momentum Buy/Sell Signal" conditions. All alerts fire on confirmed bars only.
TUNING FOR MORE OR FEWER SIGNALS
Too few signals: turn off MTF, then Full Candle, then lower the ADX threshold or the Anti-Whipsaw filter. Too many / choppy: raise the ADX threshold, enable Volume and Full Candle, increase Cooldown, or add 2-Bar Confirm. Every filter is independent and shown live in the table.
TECHNICAL NOTES
Pine Script v6, overlay, max bars back 5000.
No repaint: signals, lines, forecast and alerts are committed on bar close (barstate.isconfirmed); all higher-timeframe data uses lookahead_off.
Works on stocks, crypto, forex, futures and indices, on any timeframe.
Higher timeframes and longer history produce more reliable forecasts; a new symbol needs a number of completed trends before the duration model is meaningful.
LIMITATIONS
Trend-following by nature: signals arrive after a trend establishes, not at exact tops/bottoms.
Best in trending conditions; use the ADX regime and filters to avoid chop.
The duration forecast needs history to become meaningful and is a statistical estimate, never a guarantee.
DISCLAIMER
This script is an educational analysis tool, not financial advice. Trading stocks, crypto, forex and futures involves substantial risk of loss - you can lose all invested capital. Forecasts, probabilities and win-rate statistics are calculated from historical chart data and do not guarantee future performance. Test on paper first, and you are solely responsible for your own trading decisions.
Feedback and suggestions are welcome in the comments. Happy trading.
Indicator

Triple Barrier Exit with Meta LabelingOverview
Most tools tell you when to enter. This one frames how a trade would be managed — and then keeps an honest record of how that framing actually resolved. It takes a primary entry signal (its own built-in breakout, or any external signal series you point it at), draws a volatility-scaled profit barrier, stop barrier and time barrier around it, watches which is touched first, and feeds every resolved outcome into a live track record. On top sits a meta-label gate: a small online model that learns, from those resolved outcomes, whether to take or skip the next signal.
It is a research and trade-framing study — not a strategy, not a signal service, and not a validated edge.
Why these parts are ONE tool (mashup rationale)
Each layer exists because the one before it leaves a question open:
The triple barrier. A raw entry signal has no definition of success. Profit / stop / time barriers, scaled by current volatility (ATR or an EWMA of returns), turn a signal into a labelled outcome: profit-hit, stop-hit, or timed-out. Widths are regime-asymmetric — the profit barrier widens in trend and tightens in chop — because a fixed frame misprices the same signal in different conditions.
The trend-scanning vertical. A fixed holding time is arbitrary. The time barrier is instead chosen from candidate horizons by the strongest |t-value| of a linear fit — the horizon over which price is actually trending most decisively.
The meta-label gate. Knowing outcomes isn't the same as acting on them. A small online logistic model, trained only on resolved outcomes, scores each new signal and says TAKE or SKIP. It stays disabled until enough trades have resolved, so it never acts on an untrained model.
The honesty layer. Overlapping trades are not independent samples — so wins are recency-decayed and reported with a Wilson 95% lower bound per regime, alongside a reliability table and a Brier score for the meta-gate itself. If the gate isn't calibrated, the panel says so.
Remove any layer and the tool either mislabels the trade, mistimes it, acts on an untested model, or reports a win-rate it hasn't earned.
How it works
A primary signal fires. If the meta-gate passes, the trade is framed: profit = entry ± (PT × regime multiplier × σ), stop = entry ∓ (SL × regime multiplier × σ), and a vertical barrier holdH bars ahead. The frame is drawn as a forward box that recolours green / red / grey on first touch. Same-bar ties resolve stop-first (the conservative assumption). MFE and MAE are tracked live on the open trade. On resolution, the outcome trains the meta-model and updates the per-regime statistics.
How to use it
Read the panel before you trust the frame.
Meta gate — whether the model would take or skip the current signal (stays "warming" until it has enough resolved samples).
Wilson 95% lower — the honest floor of the win-rate in the current regime. If it isn't above 50%, this framing has not demonstrated an edge here.
Meta Brier — below ~0.25 means the gate's probabilities are reasonably calibrated; above it, ignore the gate.
The most useful thing you can do with it: point it at your own entry signal via the external-source input, and see how your signal resolves under a disciplined exit frame. The suggested size is advisory arithmetic (risk ÷ stop distance), not a recommendation. Only one trade is managed at a time — this is a study of the framing, not a portfolio simulator. The dashboard has a Compact layout (default) and a Pro layout (adds the scanned horizon, Brier, reliability tiers, PT/SL/timeout counts, live MFE/MAE and suggested size).
Universal across markets
Entry source, σ source, barrier widths and horizons are all inputs, so it runs on any symbol and timeframe. It needs no volume. Defaults target intraday index futures.
Non-repainting
Entries are taken and outcomes resolved only on confirmed bars, and the meta-model is trained only on resolved outcomes — so no statistic reads its own future and nothing inflates intrabar. The live "next-trade frame" preview is a forward projection at the current bar only, by design.
Originality
The triple barrier, meta-labelling and trend-scanning are published research concepts, credited below. What's assembled here is the specific synthesis: the triple barrier used as a live exit/management frame rather than an offline training pipeline, regime-asymmetric barrier widths, an online meta-gate that trains itself on the chart in front of you, and an honesty panel that reports the Wilson lower bound, the reliability tiers and the gate's own Brier score. Clean-room implementation; no third-party code reused.
Concept credits
Triple-barrier labelling, meta-labelling, trend-scanning, and sample uniqueness / time-decay for non-IID overlapping outcomes — Marcos López de Prado (Advances in Financial Machine Learning). Here the triple barrier is used as an exit/management frame and a labelling substrate, not as a training pipeline.
Wilson score confidence interval — Edwin B. Wilson · Brier score — Glenn W. Brier
Average True Range — J. Welles Wilder · Efficiency Ratio — Perry Kaufman
Inverse-volatility position sizing — standard risk-management practice
Honest limits
Overlapping trades are not independent, which is exactly why wins are decayed and reported with a Wilson lower bound rather than a raw percentage — treat the win-rate as descriptive, not a probability of future results. The meta-model is a small online logistic fit on three features; it can be miscalibrated, which is why its Brier score is shown. All figures are in-sample, with no costs, slippage or spread. Nothing here predicts price.
Disclaimer
Research and educational tool only. Not financial advice, not a recommendation, and no guarantee of results. The position-size output is arithmetic, not advice. Trading carries risk of loss. Test out-of-sample and make your own decisions. The author accepts no liability for any use. Indicator

Indicator

Take Profit Planner [AGPro Series]Take Profit Planner
🎯 **Overview**
**Take Profit Planner ** is a precision exit-planning tool that transforms trade management from guesswork into a structured process. It builds a disciplined profit ladder around any trade idea — whether you are a scalper managing rapid exits or a swing trader stepping out of positions over days — and keeps the entire plan on one chart with live progress tracking.
Most traders agonize over entries and leave exits to improvisation. This tool flips that habit: define your anchor, choose your calculation style, and the script projects a complete multi-tier exit map with stop loss, position-sizing allocation, confluence scoring, and real-time hit tracking.
🪜 **What Makes It Different**
Unlike conventional take-profit indicators that plot a single ATR-based target or fixed R:R pair, this tool offers a **multi-layer exit architecture**:
▫️ **Three Calculation Modes** — Fibonacci Extensions, R-Multiples, or Hybrid Confluence in a single tool
▫️ **Three Anchor Sources** — Manual price inputs, auto pivot detection, or recent S/R zone anchoring
▫️ **Confluence Scoring** — In Hybrid mode, every target receives a ★ / ★★ / ★★★ rating based on how many independent level types (Fib, round number, pivot S/R) cluster at that price
▫️ **Position-Sizing Layer** — Allocate a custom percentage of your position to close at each tier, with automatic weighted P&L calculation
▫️ **Live Progress Tracking** — Visual hit confirmation (✓), realized vs expected profit, and a six-state status ladder: ACTIVE → PROGRESSING → IN PROFIT → NEAR COMPLETE → ALL TPs HIT → STOPPED OUT
🧠 **Methodology**
▫️ **Anchor Detection** — The script identifies a trade's origin (Swing) and entry point using one of three methods. Auto Pivot uses a confirmable `pivothigh`/`pivotlow` with configurable length. Auto S/R uses the most recent swing extremes as structural anchor points. Manual lets you input exact prices.
▫️ **Direction Inference** — LONG or SHORT is determined automatically from the geometry: Entry above Swing → LONG, Entry below Swing → SHORT. No manual flag needed.
▫️ **Stop-Loss Logic** — Three modes: ATR Multiple (volatility-adaptive), Swing Point (structural), or Fixed Percent (disciplined). In Manual anchor mode, you set the stop directly.
▫️ **Target Projection** — Fibonacci mode projects targets from the Anchor→Swing leg using standard extensions (1.272, 1.414, 1.618, 2.000, 2.618). R-Multiple mode multiplies the stop distance by risk factors (1R, 2R, 3R, 5R, 8R). Hybrid uses Fibonacci as base and scores confluence.
▫️ **Confluence Algorithm** — For each Fibonacci target, the script checks proximity to: (1) the nearest psychological round number within 0.15 ATR, (2) the most recent pivot high within 0.2 ATR, (3) the most recent pivot low within 0.2 ATR. Each alignment adds one point to the base Fibonacci score.
▫️ **Hit Detection** — On every confirmed bar, the script checks whether price crossed each un-hit target. Hits are persistent until the anchor changes by more than 1 ATR, at which point the plan resets.
🔔 **Signals & Alerts**
▫️ **TP Hit** — Fires once per bar when price touches a specific target. Alert message includes tier number, price, and direction.
▫️ **SL Hit** — Fires once when stop-loss is breached.
▫️ **All TPs Reached** — Fires once when the full ladder is completed.
All alerts are non-repainting and trigger only on confirmed bars.
🎛️ **Key Inputs**
▫️ **Calculation Mode** — Fibonacci Extensions, R-Multiples, or Hybrid Confluence
▫️ **Anchor Source** — Manual Price, Auto Pivot High/Low, or Auto Recent S/R
▫️ **Pivot Length** — Bars of confirmation for automatic pivot detection (default 10)
▫️ **Stop-Loss Mode** — ATR Multiple, Swing Point, or Fixed Percent
▫️ **Number of TP Tiers** — 2 to 7 (default 5)
▫️ **Fibonacci / R-Multiple Levels** — Fully customizable per tier
▫️ **Allocation %** — Position-sizing percentage per tier
▫️ **Zone Half-Width (ATR)** — Vertical thickness of target zones in ATR units
▫️ **Panel Location & Theme** — Six positions, Dark or Light theme
▫️ **Label & Panel Font Size** — Tiny, Small, Normal, Large
💡 **How to Use**
▫️ **Scalper Workflow (Fast Exits)** — Set Calculation Mode to R-Multiples, tier count to 3, allocations to 50 / 30 / 20. Use Auto Pivot with pivot length 5–8 on lower timeframes. Exit weighted-partials at each R-level.
▫️ **Swing Trader Workflow (Multi-Day Holds)** — Set Calculation Mode to Hybrid Confluence, tier count to 5, allocations to 20 / 20 / 25 / 20 / 15. Use Auto Pivot with length 10–15 on 4H or daily. Prioritize exits at ★★★ confluence targets.
▫️ **Discretionary Trader Workflow** — Set Anchor Source to Manual Price, enter your own Entry, Swing, and SL values. Choose Fibonacci mode for trend-based projections or Hybrid for confluence-weighted decisions.
▫️ **Position Management** — The Expected line in the panel shows total profit % if all active tiers are filled (weighted by allocation). The Realized line tracks booked profit as tiers fill. Use this to compare planned vs actual performance.
⚠️ **Limitations & Transparency**
▫️ This is a **planning and visualization tool**, not an entry signal generator. It assumes you already have a trade bias; it structures the exit.
▫️ **Auto-anchor modes** rely on confirmed pivots, which means the most recent plan updates a few bars after a fresh pivot forms. This is intentional to prevent repainting.
▫️ **Confluence scoring** is based on the current snapshot of pivot highs/lows and round numbers. As price moves and new pivots form, scores may change.
▫️ **Hit detection** uses bar highs/lows on confirmed candles only.
▫️ The tool does not know your actual fill prices, slippage, or spreads — expected and realized percentages assume exact execution at target prices.
🛡️ **Risk Disclosure**
Trading involves substantial risk of loss and is not suitable for every investor. The information provided by this indicator is for educational and informational purposes only and does not constitute financial advice, a trading recommendation, or a solicitation to buy or sell any asset. Past performance does not guarantee future results. Always perform your own analysis, define risk before entering any trade, and use proper position sizing. The author and AGProLabs accept no liability for trading decisions made using this tool.
🔓 **Open Source**
This script is published open-source under the Mozilla Public License 2.0. You are welcome to study the methodology, build on it, and contribute feedback. Indicator

Risk Reward Visualizer [AGPro Series]Risk Reward Visualizer
🔹 Overview
Risk Reward Visualizer is a professional trade-planning indicator that transforms every setup into a clean visual framework: entry, stop-loss, and up to three take-profit targets displayed as long rectangular R-multiple zones. Beyond basic visualization, it adds three features rarely found together in one tool — a breakeven probability calculator, live MFE/MAE excursion tracking, and an automatic trail-to-breakeven workflow.
The indicator is built for traders who think in R-multiples: swing traders, prop-firm candidates, day traders, and anyone who wants to answer the question "does this setup actually make mathematical sense?" before committing capital.
🔹 What Makes It Different
Most risk/reward scripts stop at drawing levels and a position-size table. This one goes further:
• Breakeven Probability Math — For every R target, the panel displays the minimum win rate required to break even, adjusted for round-trip fees. A 3R target needs only 25% wins; a 1R target needs 50%. Seeing this side-by-side reframes how you evaluate setups.
• Live MFE / MAE Tracking — Maximum Favorable Excursion and Maximum Adverse Excursion are tracked in real time from the moment the setup becomes valid. Labels mark the exact bar of each peak in R-multiples, with leader lines connecting the label to the wick, so you can grade trade quality after the fact.
• Trail-to-Breakeven Visualization — When TP1 is hit, the original stop fades and a new breakeven line is drawn at entry, making the risk management discipline visible on the chart.
• Hybrid Auto-Detect — Leave Entry and Stop at zero and the script fills them using the current close and the most recent swing pivot plus an ATR buffer. Provide one manually and the other auto-completes. Everything can be overridden.
🔹 Methodology
Levels are calculated from the standard R-multiple framework:
• Risk per unit = |Entry − Stop|
• Take-profit N = Entry ± (N × Risk per unit), signed by trade direction
• Breakeven win rate = (1 + fees_R) / (1 + R target)
Direction is auto-inferred from the relationship between Entry and Stop (Long when Stop is below Entry, Short otherwise), and can be forced. Auto-detect uses a pivot lookback to locate the most recent swing high or low, then offsets the stop by a user-defined ATR multiple to reduce wick-out risk.
MFE and MAE reset whenever Entry or Stop changes, so editing inputs restarts tracking cleanly. Hit detection uses bar high or low against each level and fires alerts only on the rising edge of each event.
🔹 Visuals & Signals
• Risk zone rendered as a pink rectangle between Entry and Stop
• TP1, TP2 and TP3 zones rendered as stacked teal rectangles with graded opacity
• Entry line in indigo, stop in pink, take-profits in teal
• Labels anchor to the right edge of the zone so they never hide candles
• MFE label on the favorable excursion peak, MAE on the adverse peak, each offset 1.5 ATR with a dotted leader line
• Alerts: TP1 hit, TP2 hit, TP3 hit, Stop Loss hit, Breakeven reached
🔹 Key Inputs
• Setup Mode — Manual, Auto-Detect, or Hybrid
• Trade Side — Auto, Long, or Short
• Entry and Stop — leave at zero to auto-detect
• Swing Lookback and ATR Buffer — for auto-detected stops
• TP1, TP2, TP3 multipliers with individual show/hide toggles
• Trail Stop to Breakeven After TP1 — toggle
• Round-Trip Fees (%) — folded into breakeven math
• Enable Position Size Calculator — optional; account size and risk percentage
• Panel location, panel font size, label font size, zone length, zone transparency
🔹 How To Use
Step 1 — Add the script to any symbol and timeframe. By default, Hybrid mode uses the current close as entry and the most recent swing plus an ATR buffer as stop.
Step 2 — Override Entry or Stop with your planned levels if you have a specific setup in mind.
Step 3 — Check the Breakeven Analysis section of the panel. Confirm the minimum win rate required for your chosen R target is realistic for your strategy.
Step 4 — Set alerts for the targets you want to be notified on. If Trail-to-Breakeven is enabled, you will also receive a notification when TP1 hits so you can move your stop in your broker.
Step 5 — After the trade, review MFE and MAE to grade execution. Did price reach favorable excursion that you missed? Did it dip deep into risk before resolving?
🔹 Limitations & Transparency
• This is a planning and visualization tool. It does not place orders and does not produce buy or sell signals.
• The breakeven calculation treats fees as a percentage of entry price converted into R-units. It is a useful approximation, not a tax or slippage model.
• Auto-detected stops depend on recent swing structure. On very low-liquidity symbols or during strong trends without pullbacks, recent swings may be stale. Verify visually before using.
• MFE and MAE tracking uses bar high or low and resets when inputs change.
• Position sizing assumes a linear contract value and does not account for margin, leverage, or instrument-specific tick rules. Always cross-check with your broker.
🔹 Risk Disclosure
Trading carries risk of loss. This indicator is provided for educational and analytical purposes only and is not financial advice. Past behavior of any tool does not guarantee future performance. Use proper position sizing and never risk more than you can afford to lose. Indicator

Indicator

Live Position Sizer (LPS)Description (EN)
(Magyar leíráshoz görgess lejjebb!)
Live Position Sizer (LPS) is a discretionary trading utility designed to visualize risk, reward, and position size directly on the chart in real time.
The indicator draws a TradingView-style long or short position box and calculates the required position size based on your defined capital, maximum risk, stop-loss distance, and a user-defined lot conversion factor.
LPS is intended strictly as a decision-support and risk management tool. It does not place trades or generate automated signals.
Core features:
Automatic Long / Short position visualization
Dynamic Entry, Stop Loss, and Take Profit levels
Real-time position size calculation
Configurable Risk/Reward ratio
Fully customizable colors, transparency, and line styles
Clean, minimal on-chart labels showing direction, RR, and lot size
Only one active position box at a time for a clutter-free chart
Position sizing logic:
TradingView internally calculates position size in units, not broker-specific lots.
To bridge this difference, LPS uses a user-defined “Units per 1 Lot” multiplier.
Examples:
Forex (standard lot): 100000
Gold (XAUUSD): 1 or 100 (broker dependent)
Indices (e.g. NAS100): 1
The indicator first calculates the position size in TradingView units and then converts it to lots using this multiplier.
The displayed lot size is rounded to 0.01 lots.
Stop Loss logic:
The Stop Loss level is derived from the High or Low of a selectable previous candle.
Increasing the bar-back value places the Stop Loss further away, which:
increases stop distance
reduces position size for the same risk
Intended use:
Manual / discretionary trading
Risk management and position sizing
Trade planning and visualization
Educational purposes
Important notes:
This indicator does not execute trades
No alerts or automation by default
Lot size and contract specifications vary by broker
Always verify the exact lot or contract size with your broker before trading
------------------------------------
Description (HU)
A Live Position Sizer (LPS) egy diszkrecionális kereskedést támogató segédindikátor, amely valós időben jeleníti meg a kockázatot, a célárat és a pozícióméretet közvetlenül a charton.
Az indikátor TradingView-stílusú long vagy short pozíció boxot rajzol, és kiszámolja a szükséges pozícióméretet a megadott tőke, maximális kockázat, stop-loss távolság és egy felhasználó által definiált LOT szorzó alapján.
Az LPS nem stratégia, kizárólag döntéstámogató és kockázatkezelési eszköz.
Fő funkciók:
Automatikus Long / Short pozíció megjelenítés
Entry, Stop Loss és Take Profit szintek vizuális ábrázolása
Valós idejű pozícióméret számítás
Állítható Risk/Reward arány
Teljesen testreszabható színek, átlátszóság és vonalstílus
Letisztult chart label (irány, RR, lot méret)
Egyszerre csak egy aktív pozíció box
Pozícióméretezési logika:
A TradingView belsőleg egységekben (units) számol, nem bróker-specifikus LOT-okban.
Ennek kezelésére az LPS egy „Units per 1 Lot” beállítást használ.
Példák:
Forex standard lot: 100000
Arany (XAUUSD): 1 vagy 100 (brókertől függ)
Indexek (pl. NAS100): 1
Az indikátor először TradingView egységekben számol, majd ezt átváltja LOT-ra a megadott szorzó segítségével.
A kijelzett LOT méret 0.01-re van kerekítve.
Stop Loss logika:
A Stop Loss szint a kiválasztott korábbi gyertya high vagy low értékéből kerül meghatározásra.
Nagyobb bar-back érték:
távolabb helyezi a stopot
azonos kockázat mellett kisebb pozícióméretet eredményez
Ajánlott felhasználás:
Manuális, diszkrecionális kereskedés
Kockázatkezelés és pozícióméretezés
Trade tervezés
Oktatási célok
Fontos megjegyzések:
Az indikátor nem köt automatikusan
Alapértelmezetten nincs alert vagy automatizmus
A LOT és contract méret brókerenként eltérhet
Kereskedés előtt mindig ellenőrizd a pontos LOT / contract specifikációt a brókerednél
Indicator

Indicator

Indicator

Strategy

Scripting Tutorial A - TManyMA - StopsThis script is for a triple moving average strategy where the user can select from different types of moving averages, price sources, lookback periods and resolutions.
Features:
- 3 Moving Averages with variable MA types, periods, price sources, resolutions and the ability to disable each individually.
- Crossovers are plotted on the chart with detailed information regarding the crossover (Ex: 50 SMA crossed over 200 SMA )
- Forecasting available for all three MAs. MA values are forecasted 5 values out and plotted as if a continuation to the MA.
- Forecast bias also applies to all forecasting. Bias means we can forecast based on an anticipated bullish, bearish or neutral direction in the market.
- To understand bias, please read the source code, or if you can't read the code just send me a message on here or Twitter. Twitter should be linked to my profile.
- Ribbons added and on by default. Optional setting to disable the ribbons. 5 ribbons between MA1 and MA2 and another 5 between MA2 and MA3.
- Ribbons are alpha-color coded based on their relation to their default MAs.
- Ribbons are only visible between MAs if the MAs being compared share the same Type, Resolution, and Source because there is no way to consolidate those three in a simple manner.
- Ribbon values are calculated based on calculated MA Periods between the MAs.
- Converted the existing study into a strategy.
- Strategy only enters long positions with a market order when MA crossovers occur.
- Strategy exits positions when crossunders occur.
- Trades 100% of the equity with one order/position by default.
- Ability to disable trading certain crosses with input checks.
- Ability to exit trades with a take profit or stop loss.
- User input to allow quick changes to the take profit or stop loss percentages.
This script is meant as an educational script with well-formatted styling, and references for specific functions.
*** PLEASE NOTE - THIS STRATEGY IS MEANT FOR LEARNING PURPOSES. DEPENDING ON IT'S CONFIGURATION IT MAY OR MAY NOT BE USEFUL FOR ACTUAL TRADING. THE STRATEGY IS NOT FINANCIAL ADVICE *** Strategy
