Rob Hoffman's 50/80/90/Price Trailing Stop LossA trailing stop loss method by Rob Hoffman.
Set your entry, TP, and SL.
Once price is 50% of its way to the TP, set your stop loss at the  gray  line.
Once price is 80% of its way to the TP, set your stop loss at the  light gray  line.
Once price is 90% of its way to the TP set your stop loss at the  white   line.
"Trailing stop" için komut dosyalarını ara
MA Trailing StopA Trailing Stop indicator that uses a multiple of ATR below a SMA/EMA line. Support long positions only.
Configurables:
1. Use SMA or EMA
2. MA Period
3. ATR multiplier
4. ATR look back period
The bottom of the red area indicates the stop line. The top of the red area indicates the reference MA line.
Ideal use case is you find your a red area that covers most local lows.
The stop line moves up with MA, but does not move down if MA moves down.
If moves down (re-calculates itself) only when a low penetrates the stop line.
Long Term Breakout entry + 25% Trailing stopThis script enters on a long term breakout and exits using a 25% trailing stop
Three Bar Exit Trailing Stop - Naked Forex: Price ActionThree Bar Exit Trailing Stop - Naked Forex: Exit indicator based on price action. The naked trader locks in profit by trailing the stop loss behind the lowest low of the last three candlesticks (for buy trades) or above the highest high of the last three candlesticks (For sell trades) 
Simple Moving Average - ATR Trailing StopThe old adage goes "Cut losers fast and let the winners run"
With this in mind, this will plot a dynamic trailing stop by subtracting any multiplier of the Average True Range (ATR) from the SMA of your choice.
Linear Trailing StopBased on my latest script "Linear Channels"
This is a trailing stop version of the linear channels. Thanks to capissimo for helping me fix several issues with the linear extrapolation part.
In order to know how the indicator work i recommend reading the post on the Linear Channels indicator here 
Hope you like it and feel free to leave your suggestions :)
Linear Regression (Backtest / Trailing Stop)A Strategy with Backtest and Trailing Stop for Long/Short
Credits:  Study by RafaelZioni - Thanks buddy! 
Progressive Profit Taking with Trailing StopThis is version 2 of 
Special features:
 
 Added partial profit taking as price rises. Profit taking is triggered by price crossing an EMA. 
 After profit taking, price has to rise by a user-specified percent before taking profits again. 
 Also includes condition for fully closing position after meeting specified profit target.
 
To incorporate into your algo, turn the plotshape functions into alertcondition.
Grover Llorens Activator [alexgrover & Lucía Llorens] Trailing stops play a key role in technical analysis and are extremely popular trend following indicators. Their main strength lie in their ability to minimize whipsaws while conserving a decent reactivity, the most popular ones include the Supertrend, Parabolic SAR and Gann Hilo activator. However, and like many indicators, most trailing stops assume an infinitely long trend, which penalize their ability to provide early exit points, this isn't the case of the parabolic SAR who take this into account and thus converge toward the price at an increasing speed the longer a trend last.
Today a similar indicator is proposed.  From an original idea of alexgrover & Lucía Llorens who wanted to revisit the classic parabolic SAR indicator, the Llorens activator aim to converge toward the price the longer a trend persist, thus allowing for potential early and accurate exit points. The code make use of the idea behind the price curve channel that you can find here :
I tried to make the code as concise as possible.
 The Indicator 
The indicator posses 2 user settings,  length  and  mult , length control the rate of convergence of the indicator, with higher values of length making the indicator output converge more slowly toward the price. Mult is also related with the rate of convergence, basically once the price cross the trailing stop its value will become equal to the previous trailing stop value plus/minus  mult*atr  depending on the previous trailing stop value, therefore higher values of mult will require more time for the trailing stop to reach the closing price, use higher values of mult if you want to avoid potential whipsaws.
  
Above the indicator with slow convergence time (high length) and low mult.
  
Points with early exit points are highlighted.
 Usage For Oscillators 
The difference between the closing price and an overlay indicator can provide an oscillator with characteristics depending on the indicators used for differencing, Lucía Llorens stated that we should find indicators for differencing that highlight the cycles in the price, in other terms :  Price - Signal , where we want to find  Signal  such that we maximize the visibility of the cycles, it can be demonstrated that in the case where the closing price is an additive model :  Trend + Cycles + Noise , the zero lag estimation of the Trend component can allow for the conservation of the cycle and noise component, that is :  Price - Estimate(Trend) , for example the difference between the price and moving average isn't optimal because of the moving average lag, instead the use of zero lag moving averages is more suitable, however the proposed indicator allow for a surprisingly good representation of the cycles when using differencing.
  
The normalization of this oscillator (via the RSI) allow to make the peak amplitude of the cycles more constant. Note however that such method can return an output with a sign inverse to the one of the original cycle component.
 Conclusion 
We proposed an indicator which share the logic of the SAR indicator, that is using convergence toward the price in order to provide early exit points detection. We have seen that this indicator can be used to highlight cycles when used for differencing and i don't exclude publishing more indicators based on this method.
Lucía Llorens has been a great person to work with, and provided enormous feedback and support while i was coding the indicator, this is why i include her in the indicator name as well as copyright notice. I hope we can make more indicators togethers in the future. 
 (altho i was against using buy/sells labels xD !) 
Thanks for reading !
Trailing Stop Loss ATR + AlertI share this TSL indicator with alert (I use it only for Stocks), the configuration is very simple, you must select if it is a Short or Long operation, time at which the operation was opened,% of the daily ATR for TSL. It also contains:
- Alert
- Panel Info
  
 
Trailing Stop LossThis script demonstrate how to make a Training Stop Loss to "ride the wave". In comparison to classic Stop Loss this strategy follows the price upwards (for long positions) and when price drops by a fixed percentage then you exit your position.
atr_idemaTrailing stop indicator.
Trail when the top/bottom green line appears (with that line value as stop price).
Serenity Model VIPI — by yuu_iuHere’s a concise, practical English guide for Serenity Model VIPI (Author: yuu_iu). It covers what it is, how to set it up for daily trading, how to tune it, and how we guarantee non-repainting.
Serenity Model VIPI — User Guide (Daily Close, Non‑Repainting)
Credits
- Author: yuu_iu
- Producer: yuu_iu
- Platform: TradingView (Pine Script v5)
1) What it is
Serenity Model VIPI is a multi‑module, context‑aware trading model that fuses signals from:
- Entry modules: VCP, Flow, Momentum, Mean Reversion, Breakout
- Exit/risk modules: Contrarian, Breakout Sell, Volume Delta Sell, Peak Detector, Overbought Exit, Profit‑Take
- Context/memory: Learns per Ticker/Sector/Market Regime and adjusts weights/aggression
- Learning engine: Runs short “fake trades” to learn safely before scaling real trades
It produces a weighted, context‑adjusted score and a final decision: BUY, SELL, TAKE_PROFIT, or WAIT.
2) How it works (high level)
- Each module computes a score per bar.
- A fusion layer combines module scores using accuracy and base weights, then adjusts by:
  - Market regime (Bull/Bear/Sideways) and optional higher‑timeframe (HTF) bias
  - Risk control neuron
  - Context memory (ticker/sector/regime)
- Optional LLM mode can override marginal cases if context supports it.
- Final decision is taken at bar close only (no intrabar repaint).
3) Non‑repainting guarantee (Daily)
- Close‑only execution: All key actions use barstate.isconfirmed, so signals/entries/exits only finalize after the daily candle closes.
- No lookahead on HTF data: request.security() reads prior‑bar values (series ) for HTF close/EMA/RSI.
- Alerts at bar close: Alerts are fired once per bar close to prevent mid‑bar changes.
What this means: Once the daily bar closes, the decision and alert won’t be repainted.
4) Setup (TradingView)
- Paste the Pine v5 code into Pine Editor, click Add to chart.
- Timeframe: 1D (Daily).
- Optional: enable a date window for training/backtest
  - Enable Custom Date Filter: ON
  - Set Start Date / End Date
- Create alert (non‑repainting)
  - Condition: AI TRADE Signal
  - Options: Once Per Bar Close
  - Webhook (optional): Paste your URL into “System Webhook URL (for AI events)”
- Watch the UI
  - On‑chart markers: AI BUY / AI SELL / AI TAKE PROFIT
  - Right‑side table: Trades, Win Rate, Avg Profit, module accuracies, memory source, HTF trend, etc.
  - “AI Thoughts” label: brief reasoning and debug lines.
5) Daily trading workflow
- The model evaluates at daily close and may:
  - Enter long (BUY) when buy votes + total score exceed thresholds, after context/risk checks
  - Exit via trailing stop, hard stop, TAKE_PROFIT, or SELL decision
- Learning mode:
  - Triggers short “fake trades” every N bars (default 3) and measures outcome after 5 bars
  - Improves module accuracies and adjusts aggression once stable (min fake win% threshold)
- Memory application:
  - When you change tickers, the model tries to apply Ticker or Sector memory for the current market regime to pre‑bias module weights/aggression.
6) Tuning (what to adjust and why)
Core controls
- Base Aggression Level (default 1.0): Higher = more trades and stronger decisions; start conservative on Daily (1.0–1.2).
- Learning Speed Multiplier (default 3): Faster adaptation after fake/real trades; too high can overreact.
- Min Fake Win Rate to Exit Learning (%) (default 10–20%): Raises the bar before trusting more real trades.
- Fake Trade Every N Bars (default 3): Frequency of learning attempts.
- Learning Threshold Win Rate (default 0.4): Governs when the learner should keep learning.
- Hard Stop Loss (%) (default 5–8%): Global emergency stop.
Multi‑Timeframe (MTF)
- Enable Multi‑Timeframe Confirmation: ON (recommended for Daily)
- HTF Trend Source: HOSE:VNINDEX for VN equities (or CURRENT_SYMBOL if you prefer)
- HTF Timeframe: D or 240 (for a strong bias)
- MTF Weight Adjustment: 0.2–0.4 (0.3 default is balanced)
Module toggles and base weights
- In strong uptrends: increase VCP, Momentum, Breakout (0.2–0.3 typical)
- In sideways low‑vol regimes: raise MeanRev (0.2–0.3)
- For exits/defense: Contrarian, Peak, Overbought Exit, Profit‑Take (0.1–0.2 each)
- Keep Flow on as a volume‑quality filter (≈0.2)
Memory and control
- Enable Shared Memory Across Tickers: ON to share learning
- Enable Sector‑Based Knowledge Transfer: ON to inherit sector tendencies
- Manual Reset Learning: Use sparingly to reset module accuracies if regime changes drastically
Risk management
- Hard Stop Loss (%): 5–8% typical on Daily
- Trailing Stop: ATR‑ and volatility‑adaptive; tightens faster in Bear/High‑Vol regimes
- Max hold bars: Shorter in Bear or Sideways High‑Vol to cut risk
Alerts and webhook
- Use AI TRADE Signal with Once Per Bar Close
- Webhook payload is JSON, including event type, symbol, time, win rates, equity, aggression, etc.
7) Recommended Daily preset (VN equities)
- MTF: Enable, Source: HOSE:VNINDEX, TF: D, Weight Adj: 0.3
- Aggression: 1.1
- Learning Speed: 3
- Min Fake Win Rate to Exit Learning: 15%
- Hard SL: 6%
- Base Weights:
  - VCP 0.25, Momentum 0.25, Breakout 0.15, Flow 0.20
  - MeanRev 0.20 (raise in sideways)
  - Contrarian/Peak/Overbought/Profit‑Take: 0.10–0.20
- Leave other defaults as is, then fine‑tune by symbol/sector.
8) Reading the UI
- Table highlights: Real Trades, Win Rate, Avg Profit, Fake Actions/Win%, VCP Acc, Aggression, Equity, Score, Status (LEARNING/TRADING/REFLECTION), Last Real, Consec Loss, Best/Worst Trade, Pattern Score, Memory Source, Current Sector, AI Health, HTF Trend, Scheduler, Memory Loaded, Fake Active.
- Shapes: AI BUY (below bar), AI SELL/TAKE PROFIT (above bar)
- “AI Thoughts”: module contributions, context notes, debug lines
9) Troubleshooting
- No trades?
  - Ensure timeframe is 1D and the date filter covers the chart range
  - Check Scheduler Cooldown (3 bars default) and that barstate.isconfirmed (only at close)
  - If MTF is ON and HTF is bearish, buy bias is reduced; relax MTF Weight Adjustment or module weights
- Too many/too few trades?
  - Lower/raise Base Aggression Level
  - Adjust base weights on key modules (raise entry modules to be more active; raise exit/defense modules to be more selective)
- Learning doesn’t end?
  - Increase Min Fake Win Rate to Exit Learning only after it’s consistently stable; otherwise lower it or reduce Fake Trade Every N Bars
10) Important notes
- The strategy is non‑repainting at bar close by design (confirmed bars + HTF series  + close‑only alerts).
- Backtest fills may differ from live fills due to slippage and broker rules; this is normal for all TradingView strategies.
- Always validate settings across multiple symbols and regimes before going live.
If you want, I can bundle this guide into a README section in your Pine code and add a small on‑chart signature (Author/Producer: yuu_iu) in the top‑right corner.
Option Buying Strategy By Raj PandyaThis strategy is designed for intraday trading on BankNifty using a powerful confluence of trend, structure and momentum. It combines the 9-period Exponential Moving Average (EMA) with Daily Traditional Pivot Points to identify high-probability breakout trades.
A Long (CALL) signal is generated when price crosses and closes above both the 9 EMA and the Daily Pivot Point (PP), confirming upward trend strength. A Short (PUT) signal triggers when price crosses and closes below the 9 EMA and PP, signaling downside momentum. To reduce false signals, the strategy uses RSI with a moving average filter to ensure momentum aligns with price action.
Risk management is built-in with previous candle high/low stop-loss, a fixed 50-point target, and an automatic trailing stop system to protect profits on trending days. This helps capitalize on strong momentum while managing risk effectively.
This strategy works best on the 5-minute timeframe and is optimized for BankNifty futures/options. It aims to capture clean directional moves around key intraday value levels used by institutional traders.
Great Expectations [LucF]Great Expectations helps traders answer the question: What is possible? It is a powerful question, yet exploration of the unknown always entails risk. A more complete set of questions better suited to traders could be:
 What opportunity exists from any given point on a chart? 
 What portion of this opportunity can be realistically captured? 
 What risk will be incurred in trying to do so, and how long will it take? 
Great Expectations is the result of an exploration of these questions. It is a trade simulator that generates visual and quantitative information to help strategy modelers visually identify and analyse areas of optimal expectation on charts, whether they are designing automated or discretionary strategies.
 WARNING: Great Expectations is NOT an indicator that helps determine the current state of a market.  It works by looking at points in the past from which the future is already known. It uses one definition of repainting extensively (i.e. it goes back in the past to print information that could not have been know at the time). Repainting understood that way is in fact almost all the indicator does! —albeit for what I hope is a noble cause. The indicator is of no use whatsoever in analyzing markets in real-time.  If you do not understand what it does, please stay away! 
This is an indicator—not a strategy that uses TradingView’s backtesting engine. It works by simulating trades, not unlike a backtest, but with the crucial difference that it assumes a trade (either long or short) is entered on all bars in the historic sample. It walks forward from each bar and determines possible outcomes, gathering individual trade statistics that in turn generate precious global statistics from all outcomes tested on the chart.
Great Expectations provides numbers summarizing trade results on all simulations run from the chart. Those numbers cannot be compared to backtest-produced numbers since all non-filtered bars are examined, even if an entry was taken on the bar immediately preceding the current one, which never happens in a backtest. This peculiarity does NOT invalidate Great Expectations calculations; it just entails that results be considered under a different light. Provided they are evaluated within the indicator’s context, they can be useful—sometimes even more than backtesting results, e.g. in evaluating the impact of parameter-fitting or variations in entry, exit or filtering strats.
Traders and strategy modelers are creatures of hope often suffering from blurred vision; my hope is that Great Expectations will help them appraise the validity of their setup and strat intuitions in a realistic fashion, preventing confirmation bias from obstructing perspective—and great expectations from turning into financial great deceptions.
 USE CASES 
You’ve identified what looks like a promising setup on other indicators. You load Great Expectations on the chart and evaluate if its high-expectation areas match locations where your setup’s conditions occur. Unless today is your lucky day, chances are the indicator will help you realize your setup is not as promising as you had hoped.
You want to get a rough estimate of the optimal trade duration for a chart and you don’t mind using the entry and exit strategies provided with the indicator. You use the trade length readouts of the indicator.
You’re experimenting with a new stop strategy and want to know how long it will keep you in trades, on average. You integrate your stop strategy in the indicator’s code and look at the average trade length it produces and the TST ratio to evaluate its performance.
You have put together your own entry and exit criteria and are looking for a filter that will help you improve backtesting results. You visually ascertain the suitability of your filter by looking at its results on the charts with great Expectations, to see if your filter is choosing its areas correctly.
You have a strategy that shows backtested trades on your chart. Great Expectations can help you evaluate how well your strategy is benefitting from high-opportunity areas while avoiding poor expectation spots.
You want more complete statistics on your set of strategies than what backtesting will provide. You use Great Expectations, knowing that it tests all bars in the sample that correspond to your criteria, as opposed to backtesting results which are limited to a subset of all possible entries.
You want to fool your friends into thinking you’ve designed the holy grail of indicators, something that identifies optimal opportunities on any chart; you show them the P&L cloud.
 FEATURES 
 For one trade 
At any given point on the chart, assuming a trade is entered there, Great Expectations shows you information specific to that trade simulation both on the chart and in the Data Window.
The chart can display:
 the P & L Cloud which shows whether the trade ended profitably or not, and by how much,
 the Opportunity & Risk Cloud which the maximum opportunity and risk the simulation encountered. When superimposed over the P & L cloud, you will see what I call the  managed  opportunity and risk, i.e the portion of maximum opportunity that was captured and the portion of the maximum risk that was incurred,
 the target and if it was reached, 
 a background that uses a gradient to show different levels of trade length, P&L or how frequently the target was reached during simulation. 
The Data Window displays more than 40 values on individual trades and global results. For any given trade you will know:
 Entry/Exit levels, including slippage impact,
 It’s outcome and duration,
 P/L achieved,
  The fraction of the maximum opportunity/risk managed by the trade. 
 For all trades 
After going through all the possible trades on the chart, the indicator will provide you with a rare view of all outcomes expressed with the P&L cloud, which allows us to instantly see the most/least profitable areas of a chart using trade data as support, while also showing its relationship with the opportunity/risk encountered during the simulation. The difference between the two clouds is the managed opportunity and risk.
The Data Window will present you with numbers which we will go through later. Some of them are: average stop size, P/L, win rate, % opportunity managed, trade lengths for different types of trade outcomes and the TST (Target:Stop Travel) ratio.
Let’s see Great Expectations in action… and remember to open your Data Window!
 INPUTS 
 Trade direction : You must first choose if you wish to look at long or short trades. Because of the way the indicator works and the amount of visual information on the chart, it is only practical to look at one type of trades at a time. The default is Longs.
 Maximum trade Length (MaxL) : This is the maximum walk forward distance the simulator will go in analyzing outcomes from any given point in the past. It also determines the size of the dead zone among the chart’s last bars. A red background line identifies the beginning of the dead zone for which not enough bars have elapsed to analyze outcomes for the maximum trade length defined. If an ATR-based entry stop is used, that length is added to the wait time before beginning simulations, so that the first entry starts with a clean ATR value. On a sample of around 16000 bars, my tests show that the indicator runs into server errors at lengths of around 290, i.e. having completed ~4,6M simulation loop iterations. That is way too high a length anyways; 100 will usually be amply enough to ring out all the possibilities out of a simulation, and on shorter time frames, 30 can be enough. While making it unduly small will prevent simulations of expressing the market’s potential, the less you use, the faster the indicator will run. The default is 40.
 Unrealized P&L base at End of Trade (EOT) : When a simulation ends and the trade is still open, we calculate unrealized P&L from an exit order executed from either the last in-trade stop on the previous bar, or the close of the last bar. You can readily see the impact of this selection on the chart, with the P&L cloud. The default is on the close.
 Display : The check box besides the title does nothing.
 Show target : Shows a green line displaying the trade’s target expressed as a multiple of X, i.e. the amplitude of the entry stop.  I call this value “X” and use it as a unit to express profit and loss on a trade  (some call it “R”). The line is highlighted for trades where the close reached the target during the trade, whether the trade ended in profit or loss. This is also where you specify the multiple of X you wish to use in calculating targets. The multiple is used even if targets are not displayed.
 Show P&L Cloud : The cloud allows traders to see right away the profitable areas of the chart. The only line printed with the cloud is the “end of trade line” (EOT). The EOT line is the only way one can see the level where a trade ended on the chart (in the Data Window you can see it as the “Exit Fill” value). The EOT level for the trade determines if the trade ended in a profit or a loss. Its value represents one of the following:
- fill from order executed at close of bar where stop is breached during trade (which produces “Realized P/L”),
- simulation of a fill pseudo-fill at the user-defined EOT level (last close or stop level) if the trade runs its course through MaxL bars without getting stopped (producing Unrealized P/L).
The EOT line and the cloud fill print in green when the trade’s outcome is profitable and in red when it is not. If the trade was closed after breaching the stop, the line appears brighter.
  Show Opportunity&Risk Cloud : Displays the maximum opportunity/risk that was present during the trade, i.e. the maximum and minimum prices reached.
 Background Color Scheme : Allows you to choose between 3 different color schemes for the background gradients, to accommodate different types of chart background/candles. Select “None” if you don’t want a background.
 Background source : Determines what value will be used to generate the different intensities of the gradient. You can choose trade length (brighter is shorter), Trade P&L (brighter is higher) or the number of times the target was reached during simulation (brighter is higher). The default is Trade Length.
 Entry strat : The check box besides the title does nothing. The default strat is All bars, meaning a trade will be simulated from all bars not excluded by the filters where a MaxL bars future exists. For fun, I’ve included a pseudo-random entry strat (an indirect way of changing the seed is to vary the starting date of the simulation). 
 Show Filter State : Displays areas where the combination of filters you have selected are allowing entries. Filtering occurs as per your selection(s), whether the state is displayed or not. The effect of multiple selections is additive. The filters are:
1. Bar direction: Longs will only be entered if close>open and vice versa.
2. Rising Volume: Applies to both long and shorts.
3. Rising/falling MA of the length you choose over the number of bars you choose.
4. Custom indicator: You can feed your own filtering signal through this from another indicator. It must produce a signal of 1 to allow long entries and 0 to allow shorts.
 Show Entry Stops :
1. Multiple of user-defined length ATR.
2. Fixed percentage.
3. Fixed value.
All entry stops are calculated using the entry fill price as a reference. The fill price is calculated from the current bar’s open, to which slippage is added if configured. This simulates the case where the strategy issued the entry signal on the previous bar for it to be executed at the next bar’s open.
The entry stop remains active until the in-trade stop becomes the more aggressive of the two stops. From then on, the entry stop will be ignored, unless a bar close breaches the in-trade stop, in which case the stop will be reset with a new entry stop and the process repeats.
 Show In-trade stops : Displays in bright red the selected in-trade stop (be sure to read the note in this section about them).
1. ATR multiple: added/subtracted from the average of the two previous bars minimum/maximum of open/close.
2. A trailing stop with a deviation expressed as a multiple of entry stop (X).
3. A fixed percentage trailing stop.
Trailing stops deviations are measured from the highest/lowest high/low reached during the trade.
Note: There is a twist with the in-trade stops. It’s that for any given bar, its in-trade stop can hold multiple values, as each successive pass of the advancing simulation loops goes over it from a different entry points. What is printed is the stop from the loop that ended on that bar, which may have nothing to do with other instances of the trade’s in-trade stop for the same bar when visited from other starting points in previous simulations. There is just no practical way to print all stop values that were used for any given bar. While the printed entry stops are the actual ones used on each bar, the in-trade stops shown are merely the last instance used among many.
 Include Slippage : if checked, slippage will be added/subtracted from order price to yield the fill price. Slippage is in percentage. If you choose to include slippage in the simulations, remember to adjust it by considering the liquidity of the markets and the time frame you’ll be analyzing.
 Include Fees : if checked, fees will be subtracted/added to both realized an unrealized trade profits/losses. Fees are in percentage. The default fees work well for crypto markets but will need adjusting for others—especially in Forex. Remember to modify them accordingly as they can have a major impact on results. Both fees and slippage are included to remind us of their importance, even if the global numbers produced by the indicator are not representative of a real trading scenario composed of sequential trades.
 Date Range filtering : the usual. Just note that the checkbox  has  to be selected for date filtering to activate.
 DATA WINDOW 
Most of the information produced by this indicator is made available in the Data Window, which you bring up by using the icon below the Watchlist and Alerts buttons at the right of the TV UI. Here’s what’s there.
Some of the information presented in the Data Window is standard trade data; other values are not so standard; e. g. the notions of managed opportunity and risk and Target:Stop Travel ratio. The interplay between all the values provided by Great Expectations is inherently complex, even for a static set of entry/filter/exit strats. During the constant updating which the habitual process of progressive refinement in building strategies that is the lot of strategy modelers entails, another level of complexity is no doubt added to the analysis of this indicator’s values. While I don’t want to sound like Wolfram presenting  A New Kind of Science , I do believe that if you are a serious strategy modeler and spend the time required to get used to using all the information this indicator makes available, you may find it useful.
 Trade Information 
 Entry Order : This is the open of the bar where simulation starts. We suppose that an entry signal was generated at the previous bar.
 Entry Fill (including slip.) : The actual entry price, including slippage. This is the base price from which other values will be calculated.
 Exit Order : When a stop is breached, an exit order is executed from the close of the bar that breached the stop. While there is no “In-trade stop” value included in the Data Window (other than the End of trade Stop previously discussed), this “Exit Order” value is how we can know the level where the trade was stopped during the simulation. The “Trade Length” value will then show the bar where the stop was breached.
 Exit Fill (including slip.) : When the exit order is simulated, slippage is added to the order level to create the fill.
 Chart: Target : This is the target calculated at the beginning of the simulation. This value also appear on the chart in teal. It is controlled by the multiple of X defined under the “Show Target” checkbox in the Inputs.
 Chart: Entry Stop : This value also appears on the chart (the red dots under points where a trade was simulated). Its value is controlled by the Entry Strat chosen in the Inputs.
 X (% Fill, including Fees)  and  X (currency) : This is the stop’s amplitude (Entry Fill – Entry Stop) + Fees. It represents the risk incurred upon entry and will be used to express P&L. We will show R expressed in both a percentage of the Entry Fill level (this value), and currency (the next value). This value represents the risk in the risk:reward ratio and is considered to be a unit of 1 so that RR can be expressed as a single value (i.e. “2” actually meaning “1:2”).
 Trade Length : If trade was stopped, it’s the number of bars elapsed until then. The trade is then considered “Closed”. If the trade ends without being stopped (there is no profit-taking strat implemented, so the stop is the only exit strat), then the trade is “Open”, the length is MaxL and it will show in orange. Otherwise the value will print in green/red to reflect if the trade is winning/losing. 
 P&L (X) : The P&L of the trade, expressed as a multiple of X, which takes into account fees paid at entry and exit. Given our default target setting at 2 units of “X”, a trade that closes at its target will have produced a P&L of +2.0, i.e. twice the value of X (not counting fees paid at exit  ). A trade that gets stopped late 50% further that the entry stop’s level will produce a P&L of -1.5X.
 P&L (currency, including Fees) : same value as above, but expressed in currency.
 Target first reached at bar : If price closed above the target during the trade (even if it occurs after the trade was stopped), this will show when. This value will be used in calculating our TST ratio.
 Times Stop/Target reached in sim. : Includes all occurrences during the complete simulation loop.
 Opportunity (X) : The highest/lowest price reached during a simulation, i.e. the maximum opportunity encountered, whether the trade was previously stopped or not, expressed as a multiple of X.
 Risk (X) : The lowest/highest price reached during a simulation, i.e. the maximum risk encountered, whether the trade was previously stopped or not, expressed as a multiple of X.
 Risk:Opportunity : The greater this ratio, the greater Opportunity is, compared to Risk.
 Managed Opportunity (%) : The portion of Opportunity that was captured by the highest/low stop position, even if it occurred after a previous stop closed the trade.
  Managed Risk (%) : The portion of risk that was protected by the lowest/highest stop position, even if it occurred after a previous stop closed the trade. When this value is greater than 100%, it means the trade’s stop is protecting more than the maximum risk, which is frequent. You will, however, never see close to those values for the Managed Opportunity value, since the stop would have to be higher than the Maximum opportunity. It is much easier to alleviate the risk than it is to lock in profits.
 Managed Risk:Opportunity : The ratio of the two preceding values.
  Managed Opp. vs. Risk : The Managed Opportunity minus the Managed Risk. When it is negative, which is most often is, it means your strat is protecting a greater portion of the risk than it captures opportunity.
 Global Numbers 
 Win Rate(%) : Percentage of winning trades over all entries. Open trades are considered winning if their last stop/close (as per user selection) locks in profits.
 Avg X%, Avg X (currency) : Averages of previously described values:.
 Avg Profitability/Trade (APPT) : This measures expectation using:  Average Profitability Per Trade = (Probability of Win × Average Win) − (Probability of Loss × Average Loss) . It quantifies the average expectation/trade, which RR alone can’t do, as the probabilities of each outcome (win/lose) must also be used to calculate expectancy. The APPT combine the RR with the win rate to yield the true expectancy of a strategy. In my usual way of expressing risk with X, APPT is the equivalent of the average P&L per trade expressed in X. An APPT of -1.5 means that we lose on average 1.5X/trade.
 Equity (X), Equity (currency) : The cumulative result of all trade outcomes, expressed as a multiple of X. Multiplied by the Average X in currency, this yields the Equity in currency.
 Risk:Opportunity, Managed Risk:Opportunity, Managed Opp. vs. Risk : The global values of the ones previously described.
 Avg Trade Length (TL) : One of the most important values derived by going through all the simulations. Again, it is composed of either the length of stopped trades, or MaxL when the trade isn’t stopped (open). This value can help systems modelers shape the characteristics of the components they use to build their strategies.
 Avg Closed Win TL  and  Avg Closed Lose TL : The average lengths of winning/losing trades that were stopped.
 Target reached? Avg bars to Stop  and  Target reached? Avg bars to Target : For the trades where the target was reached at some point in the simulation, the number of bars to the first point where the stop was breached and where the target was reached, respectively. These two values are used to calculate the next value.
 TST (Target:Stop Travel Ratio) : This tracks the ratio between the two preceding values (Bars to first stop/Bars to first target), but only for trades where the target was reached somewhere in the loop. A ratio of 2 means targets are reached twice as fast as stops.
The next values of this section are counts or percentages and are self-explanatory.
 Chart Plots 
Contains chart plots of values already describes.
 NOTES 
Optimization/Overfitting: There is a fine line between optimizing and overfitting. Tools like this indicator can lead unsuspecting modelers down a path of overfitting that often turns strategies into over-specialized beasts that do not perform elegantly when confronted to the real-world. Proven testing strategies like walk forward analysis will go a long way in helping modelers alleviate this risk.
Input tuning: Because the results generated by the indicator will vary with the parameters used in the active entry, filtering and exit strats, it’s important to realize that although it may be fun at first, just slapping the default settings on a chart and time frame will not yield optimal nor reliable results. While using ATR as often as possible (as I do in this indicator) is a good way to make strat parametrization adaptable, it is not a foolproof solution.
There is no data for the last MaxL bars of the chart, since not enough trade future has elapsed to run a simulation from MaxL bars back.
Modifying the code: I have tried to structure the code modularly, even if that entails a larger code base, so that you can adapt it to your needs. I’ve included a few token components in each of the placeholders designed for entry strategies, filters, entry stops and in-trade stops. This will hopefully make it easier to add your own. In the same spirit, I have also commented liberally.
You will find in the code many instances of standard trade management tasks that can be lifted to code TV strategies where, as I do in mine, you manage everything yourself and don’t rely on built-in Pine strategy functions to act on your trades.
Enjoy!
 THANKS 
To @scarf who showed me how  plotchar()  could be used to plot values without ruining scale.
To @glaz for the suggestion to include a Chandelier stop strat; I will.
To @simpelyfe for the idea of using an indicator input for the filters (if some day TV lets us use more than one, it will be useful in other modules of the indicator).
To @RicardoSantos for the random generator used in the random entry strat.
To all scripters publishing open source on TradingView; their code is the best way to learn.
To my trading buddies Irving and Bruno; who showed me way back how pro traders get it done.
Luxy Momentum, Trend, Bias and Breakout Indicators  V7
TABLE OF CONTENTS
This is Version 7 (V7) - the latest and most optimized release. If you are using any older versions (V6, V5, V4, V3, etc.), it is highly recommended to replace them with V7. 
 
 Why This Indicator is Different
 Who Should Use This
 Core Components Overview
 The UT Bot Trading System
 Understanding the Market Bias Table
 Candlestick Pattern Recognition
 Visual Tools and Features
 How to Use the Indicator
 Performance and Optimization
 FAQ
 
---
 ### CREDITS & ATTRIBUTION 
This indicator implements proven trading concepts using entirely original code developed specifically for this project.
 ### CONCEPTUAL FOUNDATIONS 
 • UT Bot ATR Trailing System 
  - Original concept by @QuantNomad: (search "UT-Bot-Strategy"
  - Our version is a complete reimplementation with significant enhancements:
  - Volume-weighted momentum adjustment
  - Composite stop loss from multiple S/R layers
  - Multi-filter confirmation system (swing, %, 2-bar, ZLSMA)
  - Full integration with multi-timeframe bias table
  - Visual audit trail with freeze-on-touch
  - NOTE: No code was copied - this is a complete reimplementation with enhancements.
 • Standard Technical Indicators (Public Domain Formulas): 
   - Supertrend: ATR-based trend calculation with custom gradient fills
   - MACD: Gerald Appel's formula with separation filters
   - RSI: J. Welles Wilder's formula with pullback zone logic
   - ADX/DMI: Custom trend strength formula inspired by Wilder's directional movement concept, reimplemented with volume weighting and efficiency metrics
   - ZLSMA: Zero-lag formula enhanced with Hull MA and momentum prediction
  ### Custom Implementations 
- Trend Strength: Inspired by Wilder's ADX concept but using volume-weighted pressure calculation and efficiency metrics (not traditional +DI/-DI smoothing)
- All code implementations are original
 ### ORIGINAL FEATURES (70%+ of codebase) 
- Multi-Timeframe Bias Table with live updates
- Risk Management System (R-multiple TPs, freeze-on-touch)
- Opening Range Breakout tracker with session management
- Composite Stop Loss calculator using 6+ S/R layers
- Performance optimization system (caching, conditional calcs)
- VIX Fear Index integration
- Previous Day High/Low auto-detection
- Candlestick pattern recognition with interactive tooltips
- Smart label and visual management
- All UI/UX design and table architecture
 ### DEVELOPMENT PROCESS 
 **AI Assistance:**  This indicator was developed over 2+ months with AI assistance (ChatGPT/Claude) used for:
- Writing Pine Script code based on design specifications
- Optimizing performance and fixing bugs
- Ensuring Pine Script v6 compliance
- Generating documentation
 **Author's Role:**  All trading concepts, system design, feature selection, integration logic, and strategic decisions are original work by the author. The AI was a coding tool, not the system designer.
 **Transparency:**  We believe in full disclosure - this project demonstrates how AI can be used as a powerful development tool while maintaining creative and strategic ownership.
---
 1. WHY THIS INDICATOR IS DIFFERENT 
Most traders use multiple separate indicators on their charts, leading to cluttered screens, conflicting signals, and analysis paralysis. The Suite solves this by integrating proven technical tools into a single, cohesive system.
 Key Advantages: 
 
 All-in-One Design:  Instead of loading 5-10 separate indicators, you get everything in one optimized script. This reduces chart clutter and improves TradingView performance.
 Multi-Timeframe Bias Table:  Unlike standard indicators that only show the current timeframe, the Bias Table aggregates trend signals across multiple timeframes simultaneously. See at a glance whether 1m, 5m, 15m, 1h are aligned bullish or bearish - no more switching between charts.
 Smart Confirmations:  The indicator doesn't just give signals - it shows you WHY. Every entry has multiple layers of confirmation (MA cross, MACD momentum, ADX strength, RSI pullback, volume, etc.) that you can toggle on/off.
 Dynamic Stop Loss System:  Instead of static ATR stops, the SL is calculated from multiple support/resistance layers: UT trailing line, Supertrend, VWAP, swing structure, and MA levels. This creates more intelligent, price-action-aware stops.
 R-Multiple Take Profits:  Built-in TP system calculates targets based on your initial risk (1R, 1.5R, 2R, 3R). Lines freeze when touched with visual checkmarks, giving you a clean audit trail of partial exits.
 Educational Tooltips Everywhere:  Every single input has detailed tooltips explaining what it does, typical values, and how it impacts trading. You're not guessing - you're learning as you configure.
 Performance Optimized:  Smart caching, conditional calculations, and modular design mean the indicator runs fast despite having 15+ features. Turn off what you don't use for even better performance.
 No Repainting:  All signals respect bar close. Alerts fire correctly. What you see in history is what you would have gotten in real-time.
 
  
 What Makes It Unique: 
Integrated UT Bot + Bias Table: No other indicator combines UT Bot's ATR trailing system with a live multi-timeframe dashboard. You get precision entries with macro trend context.
Candlestick Pattern Recognition with Interactive Tooltips: Patterns aren't just marked - hover over any emoji for a full explanation of what the pattern means and how to trade it.
Opening Range Breakout Tracker: Built-in ORB system for intraday traders with customizable session times and real-time status updates in the Bias Table.
Previous Day High/Low Auto-Detection: Automatically plots PDH/PDL on intraday charts with theme-aware colors. Updates daily without manual input.
Dynamic Row Labels in Bias Table: The table shows your actual settings (e.g., "EMA 10 > SMA 20") not generic labels. You know exactly what's being evaluated.
Modular Filter System: Instead of forcing a fixed methodology, the indicator lets you build your own strategy. Start with just UT Bot, add filters one at a time, test what works for your style.
---
 2. WHO WHOULD USE THIS 
Designed For:
 
 Intermediate to Advanced Traders: You understand basic technical analysis (MAs, RSI, MACD) and want to combine multiple confirmations efficiently. This isn't a "one-click profit" system - it's a professional toolkit.
 Multi-Timeframe Traders: If you trade one asset but check multiple timeframes for confirmation (e.g., enter on 5m after checking 15m and 1h alignment), the Bias Table will save you hours every week.
 Trend Followers: The indicator excels at identifying and following trends using UT Bot, Supertrend, and MA systems. If you trade breakouts and pullbacks in trending markets, this is built for you.
 Intraday and Swing Traders: Works equally well on 5m-1h charts (day trading) and 4h-D charts (swing trading). Scalpers can use it too with appropriate settings adjustments.
 Discretionary Traders: This isn't a black-box system. You see all the components, understand the logic, and make final decisions. Perfect for traders who want tools, not automation.
 
 Works Across All Markets: 
Stocks (US, international)
Cryptocurrency (24/7 markets supported)
Forex pairs
Indices (SPY, QQQ, etc.)
Commodities
 NOT Ideal For :
 
 Complete Beginners: If you don't know what a moving average or RSI is, start with basics first. This indicator assumes foundational knowledge.
 Algo Traders Seeking Black Box: This is discretionary. Signals require context and confirmation. Not suitable for blind automated execution.
 Mean-Reversion Only Traders: The indicator is trend-following at its core. While VWAP bands support mean-reversion, the primary methodology is trend continuation.
 
---
 3. CORE COMPONENTS OVERVIEW 
 The indicator combines these proven systems: 
 
 Trend Analysis: 
 Moving Averages:  Four customizable MAs (Fast, Medium, Medium-Long, Long) with six types to choose from (EMA, SMA, WMA, VWMA, RMA, HMA). Mix and match for your style.
 Supertrend:  ATR-based trend indicator with unique gradient fill showing trend strength. One-sided ribbon visualization makes it easier to see momentum building or fading.
 ZLSMA : Zero-lag linear-regression smoothed moving average. Reduces lag compared to traditional MAs while maintaining smooth curves.
 Momentum & Filters: 
 MACD:  Standard MACD with separation filter to avoid weak crossovers.
 RSI:  Pullback zone detection - only enter longs when RSI is in your defined "buy zone" and shorts in "sell zone".
 ADX/DMI:  Trend strength measurement with directional filter. Ensures you only trade when there's actual momentum.
 Volume Filter:  Relative volume confirmation - require above-average volume for entries.
 Donchian Breakout:  Optional channel breakout requirement.
 
 Signal Systems: 
 
 UT Bot:  The primary signal generator. ATR trailing stop that adapts to volatility and gives clear entry/exit points.
 Base Signals:  MA cross system with all the above filters applied. More conservative than UT Bot alone.
 Market Bias Table:  Multi-timeframe dashboard showing trend alignment across 7 timeframes plus macro bias (3-day, weekly, monthly, quarterly, VIX).
 Candlestick Patterns:  Six major reversal patterns auto-detected with interactive tooltips.
 ORB Tracker:  Opening range high/low with breakout status (intraday only).
 PDH/PDL:  Previous day levels plotted automatically on intraday charts.
 VWAP + Bands : Session-anchored VWAP with up to three standard deviation band pairs.
 
  
---
 4. THE UT BOT TRADING SYSTEM 
The UT Bot is the heart of the indicator's signal generation. It's an advanced ATR trailing stop that adapts to market volatility.
Why UT Bot is Superior to Fixed Stops:
Traditional ATR stops use a fixed multiplier (e.g., "stop = entry - 2×ATR"). UT Bot is smarter:
It TRAILS the stop as price moves in your favor
It WIDENS during high volatility to avoid premature stops
It TIGHTENS during consolidation to lock in profits
It FLIPS when price breaks the trailing line, signaling reversals
 Visual Elements You'll See: 
Orange Trailing Line: The actual UT stop level that adapts bar-by-bar
Buy/Sell Labels: Aqua triangle (long) or orange triangle (short) when the line flips
ENTRY Line: Horizontal line at your entry price (optional, can be turned off)
Suggested Stop Loss: A composite SL calculated from multiple support/resistance layers:
- UT trailing line
- Supertrend level
- VWAP
- Swing structure (recent lows/highs)
- Long-term MA (200)
- ATR-based floor
Take Profit Lines: TP1, TP1.5, TP2, TP3 based on R-multiples. When price touches a TP, it's marked with a checkmark and the line freezes for audit trail purposes.
Status Messages: "SL Touched ❌" or "SL Frozen" when the trade leg completes.
 How UT Bot Differs from Other ATR Systems: 
Multiple Filters Available: You can require 2-bar confirmation, minimum % price change, swing structure alignment, or ZLSMA directional filter. Most UT implementations have none of these.
Smart SL Calculation: Instead of just using the UT line as your stop, the indicator suggests a better SL based on actual support/resistance. This prevents getting stopped out by wicks while keeping risk controlled.
Visual Audit Trail: All SL/TP lines freeze when touched with clear markers. You can review your trades weeks later and see exactly where entries, stops, and targets were.
Performance Options: "Draw UT visuals only on bar close" lets you reduce rendering load without affecting logic or alerts - critical for slower machines or 1m charts.
 Trading Logic: 
UT Bot flips direction (Buy or Sell signal appears)
Check Bias Table for multi-timeframe confirmation
Optional: Wait for Base signal or candlestick pattern
Enter at signal bar close or next bar open
Place stop at "Suggested Stop Loss" line
Scale out at TP levels (TP1, TP2, TP3)
Exit remaining position on opposite UT signal or stop hit
  
---
 5. UNDERSTANDING THE MARKET BIAS TABLE 
This is the indicator's unique multi-timeframe intelligence layer. Instead of looking at one chart at a time, the table aggregates signals across seven timeframes plus macro trend bias.
 Why Multi-Timeframe Analysis Matters: 
 
 Professional traders check higher and lower timeframes for context:
 Is the 1h uptrend aligning with my 5m entry?
 Are all short-term timeframes bullish or just one?
 Is the daily trend supportive or fighting me?
 
Doing this manually means opening multiple charts, checking each indicator, and making mental notes. The Bias Table does it automatically in one glance.
 Table Structure: 
 Header Row: 
On intraday charts: 1m, 5m, 15m, 30m, 1h, 2h, 4h (toggle which ones you want)
On daily+ charts: D, W, M (automatic)
Green dot next to title = live updating
 Headline Rows - Macro Bias: 
These show broad market direction over longer periods:
3 Day Bias: Trend over last 3 trading sessions (uses 1h data)
Weekly Bias: Trend over last 5 trading sessions (uses 4h data)
Monthly Bias: Trend over last 30 daily bars
Quarterly Bias: Trend over last 13 weekly bars
VIX Fear Index: Market regime based on VIX level - bullish when low, bearish when high
Opening Range Breakout: Status of price vs. session open range (intraday only)
These rows show text: "BULLISH", "BEARISH", or "NEUTRAL"
Indicator Rows - Technical Signals:
These evaluate your configured indicators across all active timeframes:
Fast MA > Medium MA (shows your actual MA settings, e.g., "EMA 10 > SMA 20")
Price > Long MA (e.g., "Price > SMA 200")
Price > VWAP
MACD > Signal
Supertrend (up/down/neutral)
ZLSMA Rising
RSI In Zone
ADX ≥ Minimum
These rows show emojis: GREEB (bullish), RED (bearish), GRAY/YELLOW (neutral/NA)
 AVG Column: 
Shows percentage of active timeframes that are bullish for that row. This is the KEY metric:
AVG > 70% = strong multi-timeframe bullish alignment
AVG 40-60% = mixed/choppy, no clear trend
AVG < 30% = strong multi-timeframe bearish alignment
 How to Use the Table: 
 For a long trade: 
Check AVG column - want to see > 60% ideally
Check headline bias rows - want to see BULLISH, not BEARISH
Check VIX row - bullish market regime preferred
Check ORB row (intraday) - want ABOVE for longs
Scan indicator rows - more green = better confirmation
 For a short trade: 
Check AVG column - want to see < 40% ideally
Check headline bias rows - want to see BEARISH, not BULLISH
Check VIX row - bearish market regime preferred
Check ORB row (intraday) - want BELOW for shorts
Scan indicator rows - more red = better confirmation
 When AVG is 40-60%: 
Market is choppy, mixed signals. Either stay out or reduce position size significantly. These are low-probability environments.
 Unique Features: 
 
 Dynamic Labels: Row names show your actual settings (e.g., "EMA 10 > SMA 20" not generic "Fast > Slow"). You know exactly what's being evaluated.
 Customizable Rows: Turn off rows you don't care about. Only show what matters to your strategy.
 Customizable Timeframes: On intraday charts, disable 1m or 4h if you don't trade them. Reduces calculation load by 20-40%.
 Automatic HTF Handling: On Daily/Weekly/Monthly charts, the table automatically switches to D/W/M columns. No configuration needed.
 Performance Smart: "Hide BIAS table on 1D or above" option completely skips all table calculations on higher timeframes if you only trade intraday.
 
 
  
---
 6. CANDLESTICK PATTERN RECOGNITION 
The indicator automatically detects six major reversal patterns and marks them with emojis at the relevant bars.
 Why These Six Patterns: 
These are the most statistically significant reversal patterns according to trading literature:
High win rate when appearing at support/resistance
Clear visual structure (not subjective)
Work across all timeframes and assets
Studied extensively by institutions
 The Patterns: 
 
 Bullish Patterns (appear at bottoms):
 Bullish Engulfing: Green candle completely engulfs prior red candle's body. Strong reversal signal.
 Hammer: Small body with long lower wick (at least 2× body size). Shows rejection of lower prices by buyers.
 Morning Star: Three-candle pattern (large red → small indecision → large green). Very strong bottom reversal.
 Bearish Patterns (appear at tops):
 Bearish Engulfing: Red candle completely engulfs prior green candle's body. Strong reversal signal.
 Shooting Star: Small body with long upper wick (at least 2× body size). Shows rejection of higher prices by sellers.
 Evening Star: Three-candle pattern (large green → small indecision → large red). Very strong top reversal.
 
 Interactive Tooltips: 
Unlike most pattern indicators that just draw shapes, this one is educational:
Hover your mouse over any pattern emoji
A tooltip appears explaining: what the pattern is, what it means, when it's most reliable, and how to trade it
No need to memorize - learn as you trade
 Noise Filter: 
"Min candle body % to filter noise" setting prevents false signals:
Patterns require minimum body size relative to price
Filters out tiny candles that don't represent real buying/selling pressure
Adjust based on asset volatility (higher % for crypto, lower for low-volatility stocks)
  
 How to Trade Patterns: 
Patterns are NOT standalone entry signals. Use them as:
 
 Confirmation: UT Bot gives signal + pattern appears = stronger entry
 Reversal Warning: In a trade, opposite pattern appears = consider tightening stop or taking profit
 Support/Resistance Validation: Pattern at key level (PDH, VWAP, MA 200) = level is being respected
 
 Best combined with: 
 
 UT Bot or Base signal in same direction
 Bias Table alignment (AVG > 60% or < 40%)
 Appearance at obvious support/resistance
 
---
 7. VISUAL TOOLS AND FEATURES 
 VWAP (Volume Weighted Average Price): 
Session-anchored VWAP with standard deviation bands. Shows institutional "fair value" for the trading session.
Anchor Options: Session, Day, Week, Month, Quarter, Year. Choose based on your trading timeframe.
Bands: Up to three pairs (X1, X2, X3) showing statistical deviation. Price at outer bands often reverses.
Auto-Hide on HTF: VWAP hides on Daily/Weekly/Monthly charts automatically unless you enable anchored mode.
 Use VWAP as: 
 
 Directional bias (above = bullish, below = bearish)
 Mean reversion levels (outer bands)
 Support/resistance (the VWAP line itself)
 
 Previous Day High/Low: 
Automatically plots yesterday's high and low on intraday charts:
Updates at start of each new trading day
Theme-aware colors (dark text for light charts, light text for dark charts)
Hidden automatically on Daily/Weekly/Monthly charts
These levels are critical for intraday traders - institutions watch them closely as support/resistance.
 Opening Range Breakout (ORB): 
Tracks the high/low of the first 5, 15, 30, or 60 minutes of the trading session:
Customizable session times (preset for NYSE, LSE, TSE, or custom)
Shows current breakout status in Bias Table row (ABOVE, BELOW, INSIDE, BUILDING)
Intraday only - auto-disabled on Daily+ charts
ORB is a classic day trading strategy - breakout above opening range often leads to continuation.
 Extra Labels: 
Change from Open %: Shows how far price has moved from session open (intraday) or daily open (HTF). Green if positive, red if negative.
ADX Badge: Small label at bottom of last bar showing current ADX value. Green when above your minimum threshold, red when below.
RSI Badge: Small label at top of last bar showing current RSI value with zone status (buy zone, sell zone, or neutral).
These labels provide quick at-a-glance confirmation without needing separate indicator windows.
---
 8. HOW TO USE THE INDICATOR 
 Step 1: Add to Chart 
Load the indicator on your chosen asset and timeframe
First time: Everything is enabled by default - the chart will look busy
Don't panic - you'll turn off what you don't need
 Step 2: Start Simple 
Turn OFF everything except:
UT Bot labels (keep these ON)
Bias Table (keep this ON)
Moving Averages (Fast and Medium only)
Suggested Stop Loss and Take Profits
Hide everything else initially. Get comfortable with the basic UT Bot + Bias Table workflow first.
 Step 3: Learn the Core Workflow 
UT Bot gives a Buy or Sell signal
Check Bias Table AVG column - do you have multi-timeframe alignment?
If yes, enter the trade
Place stop at Suggested Stop Loss line
Scale out at TP levels
Exit on opposite UT signal
Trade this simple system for a week. Get a feel for signal frequency and win rate with your settings.
 Step 4: Add Filters Gradually 
If you're getting too many losing signals (whipsaws in choppy markets), add filters one at a time:
Try: "Require 2-Bar Trend Confirmation" - wait for 2 bars to confirm direction
Try: ADX filter with minimum threshold - only trade when trend strength is sufficient
Try: RSI pullback filter - only enter on pullbacks, not chasing
Try: Volume filter - require above-average volume
Add one filter, test for a week, evaluate. Repeat.
 Step 5: Enable Advanced Features (Optional) 
Once you're profitable with the core system, add:
Supertrend for additional trend confirmation
Candlestick patterns for reversal warnings
VWAP for institutional anchor reference
ORB for intraday breakout context
ZLSMA for low-lag trend following
 Step 6: Optimize Settings 
Every setting has a detailed tooltip explaining what it does and typical values. Hover over any input to read:
What the parameter controls
How it impacts trading
Suggested ranges for scalping, day trading, and swing trading
Start with defaults, then adjust based on your results and style.
 Step 7: Set Up Alerts 
Right-click chart → Add Alert → Condition: "Luxy Momentum v6" → Choose:
"UT Bot — Buy" for long entries
"UT Bot — Sell" for short entries
"Base Long/Short" for filtered MA cross signals
Optionally enable "Send real-time alert() on UT flip" in settings for immediate notifications.
 Common Workflow Variations: 
Conservative Trader:
UT signal + Base signal + Candlestick pattern + Bias AVG > 70%
Enter only at major support/resistance
Wider UT sensitivity, multiple filters
 Aggressive Trader: 
UT signal + Bias AVG > 60%
Enter immediately, no waiting
Tighter UT sensitivity, minimal filters
 Swing Trader: 
Focus on Daily/Weekly Bias alignment
Ignore intraday noise
Use ORB and PDH/PDL less (or not at all)
Wider stops, patient approach
---
 9. PERFORMANCE AND OPTIMIZATION 
The indicator is optimized for speed, but with 15+ features running simultaneously, chart load time can add up. Here's how to keep it fast:
 Biggest Performance Gains: 
Disable Unused Timeframes: In "Time Frames" settings, turn OFF any timeframe you don't actively trade. Each disabled TF saves 10-15% calculation time. If you only day trade 5m, 15m, 1h, disable 1m, 2h, 4h.
Hide Bias Table on Daily+: If you only trade intraday, enable "Hide BIAS table on 1D or above". This skips ALL table calculations on higher timeframes.
Draw UT Visuals Only on Bar Close: Reduces intrabar rendering of SL/TP/Entry lines. Has ZERO impact on logic or alerts - purely visual optimization.
 Additional Optimizations: 
Turn off VWAP bands if you don't use them
Disable candlestick patterns if you don't trade them
Turn off Supertrend fill if you find it distracting (keep the line)
Reduce "Limit to 10 bars" for SL/TP lines to minimize line objects
 Performance Features Built-In: 
Smart Caching: Higher timeframe data (3-day bias, weekly bias, etc.) updates once per day, not every bar
Conditional Calculations: Volume filter only calculates when enabled. Swing filter only runs when enabled. Nothing computes if turned off.
Modular Design: Every component is independent. Turn off what you don't need without breaking other features.
 Typical Load Times: 
5m chart, all features ON, 7 timeframes: ~2-3 seconds
5m chart, core features only, 3 timeframes: ~1 second
1m chart, all features: ~4-5 seconds (many bars to calculate)
If loading takes longer, you likely have too many indicators on the chart total (not just this one).
---
 10. FAQ 
Q: How is this different from standard UT Bot indicators?
A: Standard UT Bot (originally by @QuantNomad) is just the ATR trailing line and flip signals. This implementation adds:
- Volume weighting and momentum adjustment to the trailing calculation
- Multiple confirmation filters (swing, %, 2-bar, ZLSMA)
- Smart composite stop loss system from multiple S/R layers
- R-multiple take profit system with freeze-on-touch
- Integration with multi-timeframe Bias Table
- Visual audit trail with checkmarks
Q: Can I use this for automated trading?
A: The indicator is designed for discretionary trading. While it has clear signals and alerts, it's not a mechanical system. Context and judgment are required.
Q: Does it repaint?
A: No. All signals respect bar close. UT Bot logic runs intrabar but signals only trigger on confirmed bars. Alerts fire correctly with no lookahead.
Q: Do I need to use all the features?
A: Absolutely not. The indicator is modular. Many profitable traders use just UT Bot + Bias Table + Moving Averages. Start simple, add complexity only if needed.
Q: How do I know which settings to use?
A: Every single input has a detailed tooltip. Hover over any setting to see:
What it does
How it affects trading
Typical values for scalping, day trading, swing trading
Start with defaults, adjust gradually based on results.
Q: Can I use this on crypto 24/7 markets?
A: Yes. ORB will not work (no defined session), but everything else functions normally. Use "Day" anchor for VWAP instead of "Session".
Q: The Bias Table is blank or not showing.
A: Check:
"Show Table" is ON
Table position isn't overlapping another indicator's table (change position)
At least one row is enabled
"Hide BIAS table on 1D or above" is OFF (if on Daily+ chart)
Q: Why are candlestick patterns not appearing?
A: Patterns are relatively rare by design - they only appear at genuine reversal points. Check:
Pattern toggles are ON
"Min candle body %" isn't too high (try 0.05-0.10)
You're looking at a chart with actual reversals (not strong trending market)
Q: UT Bot is too sensitive/not sensitive enough.
A: Adjust "Sensitivity (Key×ATR)". Lower number = tighter stop, more signals. Higher number = wider stop, fewer signals. Read the tooltip for guidance.
Q: Can I get alerts for the Bias Table?
A: The Bias Table is a dashboard for visual analysis, not a signal generator. Set alerts on UT Bot or Base signals, then manually check Bias Table for confirmation.
Q: Does this work on stocks with low volume?
A: Yes, but turn OFF the volume filter. Low volume stocks will never meet relative volume requirements.
Q: How often should I check the Bias Table?
A: Before every entry. It takes 2 seconds to glance at the AVG column and headline rows. This one check can save you from fighting the trend.
Q: What if UT signal and Base signal disagree?
A: UT Bot is more aggressive (ATR trailing). Base signals are more conservative (MA cross + filters). If they disagree, either:
Wait for both to align (safest)
Take the UT signal but with smaller size (aggressive)
Skip the trade (conservative)
There's no "right" answer - depends on your risk tolerance.
---
 FINAL NOTES 
The indicator gives you an edge. How you use that edge determines results.
For questions, feedback, or support, comment on the indicator page or message the author.
 Happy Trading! 
CoffeeShopCrypto Supertrend Liquidity EngineMost SuperTrend indicators use fixed ATR multipliers that ignore context—forcing traders to constantly tweak settings that rarely adapt well across timeframes or assets. 
This Supertrend is a nodd to and a more completion of the work 
done by Olivier Seban ( @olivierseban )
This version replaces guesswork with an adaptive factor based on prior session volatility, dynamically adjusting stops to match current conditions. It also introduces liquidity-aware zones, real-time strength histograms, and a visual control panel—making your stoploss smarter, more responsive, and aligned with how the market actually moves.
📏  The Multiplier Problem & Adaptive Factor Solution 
  
Traditional SuperTrend indicators rely on fixed ATR multipliers—often arbitrary numbers like 1.5, 2, or 3. The issue? No logical basis ties these values to actual market conditions. What works on a 5-minute Nasdaq chart fails on a daily EUR/USD chart. Traders spend hours tweaking multipliers per asset, timeframe, or volatility phase—and still end up with stoplosses that are either too tight or too loose. Worse, the market doesn’t care about your setting—it behaves according to underlying volatility, not your parameter.
This version fixes that by automating the multiplier selection entirely. It uses a 4-zone model based on the current ATR relative to the previous session’s ATR, dynamically adjusting the SuperTrend factor to match current volatility. It eliminates guesswork, adapts to the asset and timeframe, and ensures you’re always using a context-aware stoploss—one that evolves with the market instead of fighting it.
 ATR EXAMPLE 
Let’s say prior session ATR = 2.00
Now suppose current ATR = 0.32
This places us in Zone 1 (Very Low Volatility)
It doesn’t imply "overbought" or "oversold" — it tells you the market is moving very little, which often means:
Lower risk | Smaller stops | Smaller opportunities (and losses)
🔁  Liquidity Zones vs. Arbitrary Pullbacks 
  
The standard SuperTrend stop loss line often looks like price “barely misses it” before continuing its trend. Traders call this "stop hunting," but what’s really happening is liquidity collection—price pulls back into a zone rich in orders before continuing. The problem? The old SuperTrend doesn’t show this zone. It only draws the outer limit, leaving no visual cue for where entries or continuation moves might realistically originate.
This script introduces 2 levels in the Liquidity Zone. One for Support and one for Stophunts, which draw dynamically between the current price and the SuperTrend line. These levels reflect where the market is most likely to revisit before resuming the trend. By visualizing the area just above the Supertrend stop loss, you can anticipate pullbacks, spot ideal re-entries, and avoid premature exits. This bridges the gap between mechanical stoploss logic and real-world liquidity behavior.
⏳  Prior Session ATR vs. Live ATR 
  
Using real-time ATR to determine movement potential is like driving by looking in your rearview mirror. It’s reactive, not predictive. Traders often base decisions on live ATR, unaware that  today’s range is still unfolding —creating volatility mismatches between what’s calculated and what actually matters. Since ATR reflects range, calculating it mid-session gives an incomplete and misleading picture of true volatility.
Instead, this system uses the  ATR from the previous session , anchoring your volatility assumptions in a  fully-formed price structure . It tells you how far price moved in the last full market phase—be it London, New York, or Tokyo—giving you a more reliable gauge of expected range today. This is a smarter way to estimate how far price could move rather than how far it has moved.
The Smoothing function will take the ATR, Support, Resistance, Stophunt Levels, and the Moving Avearage and smooth them by the calculation you choose.
It will also plot a moving average on your chart against closing prices by the smoothing function you choose.
🧭  Scalping vs. Trending Modes 
 The market moves in at least 4 phases. Trending, Ranging, Consolidation, Distribution. 
Every trader has a  different style —some scalp low-volatility moves during off-hours, while others ride macro trends across days. The problem with classic SuperTrend? It treats every market condition the same. A fixed system can’t possibly provide proper stoploss spacing for both a fast scalp and a long-term swing. Traders are forced to rebuild their system every time the market changes character or the session shifts.
 This version solves that with a simple toggle: 
  
 Scalping or Trend Mode . With one switch, it inverts the logic of the adaptive factor to either tighten or loosen your trailing stops. During low-liquidity hours or consolidation phases, Scalping Mode offers snug stoplosses. During expansion or clear directional bias.
  
 Trend Mode  lets the trade breathe. This is flexibility built directly into the logic—not something you have to recalibrate manually.
📉  Histogram Oscillator for Move Strength 
In legacy indicators, there’s no built-in way to  gauge when the move is losing power . Traders rely on price action or momentum indicators to guess if a trend is fading. But this adds clutter, lag, and often contradiction. The classic SuperTrend doesn’t offer insight into  how strong or weak  the current trend leg is—only whether price has crossed a line.
This version includes a  Trending Liquidity Histogram  —a histogram that shows whether the liquidity in the SuperTrend zone is expanding or compressing. When the bars weaken or cross toward zero, it signals  liquidity exhaustion . This early warning gives you time to prep for reversals or anticipate pullbacks. It even adapts visually depending on your trading mode, showing color-coded signals for scalping vs. trending behavior. It's both a strength gauge and a trade timing tool—built into your stoploss logic.
 Histogram in Scalping Mode 
  
 Histogram in Trending Mode 
  
📊  Visual Table for Real-Time Clarity 
A major issue with custom indicators is  opacity —you don’t always know what settings or values are currently being used. Even worse, if your dynamic logic changes mid-trade, you may not notice unless you go digging into the code or logs. This can create confusion, especially for discretionary traders.
This SuperTrend solves it with a clean  visual summary table  right on your chart. It shows your current ATR value, adaptive multiplier, trailing stop level, and whether a new zone size is active. That means no surprises and no second-guessing—everything important is visible and updated in real-time.
MACD with Holt–Winters Smoothing [AIBitcoinTrend]👽  MACD with Holt–Winters Smoothing (AIBitcoinTrend) 
The MACD with Holt–Winters Smoothing is an momentum indicator that enhances traditional MACD analysis by incorporating Holt–Winters exponential smoothing. This adaptation reduces lag while maintaining trend sensitivity, making it more effective for detecting trend reversals and sustained momentum shifts. Additionally, the indicator includes real-time divergence detection and an ATR-based trailing stop system, helping traders manage risk dynamically.
  
👽  What Makes the MACD with Holt–Winters Smoothing Unique? 
Unlike the standard MACD, which relies on simple exponential moving averages, this version applies Holt–Winters smoothing to better capture trends while filtering out market noise. Combined with real-time divergence detection and a trailing stop system, this indicator allows traders to:
 ✅ Identify trend strength with a dynamically smoothed MACD signal.
✅ Detect bullish and bearish divergences in real time.
✅Implement Crossover/Crossunder signals tied to ATR-based trailing stops for risk management 
  
👽  The Math Behind the Indicator 
👾  Holt–Winters Smoothing for MACD 
Traditional MACD calculations use exponential moving averages (EMA) to identify momentum. This indicator improves upon it by applying Holt’s linear trend equations, which enhance signal accuracy by reducing lag and smoothing out fluctuations.
 Key Features: 
 
 Alpha (α) - Controls the weight of the new data in smoothing.
 Beta (β) - Determines how fast the trend component adapts to new changes.
 The Holt–Winters Signal Line provides a refined MACD crossover system for better trade execution.
 
👾  Real-Time Divergence Detection 
The indicator identifies bullish and bearish divergences between MACD and price action.
 
   Bullish Divergence:  Occurs when price makes a lower low, but MACD makes a higher low – signaling potential upward momentum.
 Bearish Divergence:  Occurs when price makes a higher high, but MACD makes a lower high – signaling potential downward momentum.
 
👾  Dynamic ATR-Based Trailing Stop 
The indicator includes a trailing stop system based on ATR (Average True Range). This allows traders to manage positions dynamically based on volatility.
 
 Bullish Trailing Stop:  Triggers when MACD crosses above the Holt–Winters signal, with a stop placed at low - (ATR × Multiplier).
 Bearish Trailing Stop:  Triggers when MACD crosses below the Holt–Winters signal, with a stop placed at high + (ATR × Multiplier).
 Trailing Stop Adjustments:  Expands or contracts dynamically with market conditions, reducing premature exits while securing profits.
 
👽  How Traders Can Use This Indicator 
👾  Divergence Trading 
Traders can use real-time divergence detection to anticipate trend reversals before they occur.
 Bullish Divergence Setup: 
 
 Look for MACD making a higher low, while price makes a lower low.
 Enter long when MACD confirms upward momentum.
 
 Bearish Divergence Setup: 
 
 Look for MACD making a lower high, while price makes a higher high.
 Enter short when MACD confirms downward momentum.
 
  
👾  Trailing Stop & Signal-Based Trading 
 Bullish Setup: 
 ✅ MACD crosses above the Holt–Winters signal.
✅ A bullish trailing stop is placed using low - ATR × Multiplier.
✅ Exit if the price crosses below the stop. 
 Bearish Setup: 
 ✅ MACD crosses below the Holt–Winters signal.
✅ A bearish trailing stop is placed using high + ATR × Multiplier.
✅ Exit if the price crosses above the stop. 
This systematic trade management approach helps traders lock in profits while reducing drawdowns.
  
👽  Why It’s Useful for Traders 
 
 Lag Reduction:  Holt–Winters smoothing ensures faster and more reliable trend detection.
 Real-Time Divergence Alerts:  Identify potential reversals before they happen.
 Adaptive Risk Management:  ATR-based trailing stops adjust to volatility dynamically.
 Works Across Markets & Timeframes:  Effective for stocks, forex, crypto, and futures trading.
 
👽  Indicator Settings 
 
 MACD Fast & Slow Lengths:  Adjust the MACD short- and long-term EMA periods.
 Holt–Winters Alpha & Beta:  Fine-tune the smoothing sensitivity.
 Enable Divergence Detection:  Toggle real-time divergence analysis.
 Lookback Period for Divergences:  Configure how far back pivot points are detected.
 ATR Multiplier for Trailing Stops:  Adjust stop-loss sensitivity to market volatility.
 Trend Filtering:  Enable signal filtering based on trend direction.
 
 Disclaimer: This indicator is designed for educational purposes and does not constitute financial advice. Please consult a qualified financial advisor before making investment decisions. 
Dskyz (DAFE) Adaptive Regime - Quant Machine ProDskyz (DAFE) Adaptive Regime - Quant Machine Pro:
Buckle up for the Dskyz (DAFE) Adaptive Regime - Quant Machine Pro, is a strategy that’s your ultimate edge for conquering futures markets like ES, MES, NQ, and MNQ. This isn’t just another script—it’s a quant-grade powerhouse, crafted with precision to adapt to market regimes, deliver multi-factor signals, and protect your capital with futures-tuned risk management. With its shimmering DAFE visuals, dual dashboards, and glowing watermark, it turns your charts into a cyberpunk command center, making trading as thrilling as it is profitable.
Unlike generic scripts clogging up the space, the Adaptive Regime is a DAFE original, built from the ground up to tackle the chaos of futures trading. It identifies market regimes (Trending, Range, Volatile, Quiet) using ADX, Bollinger Bands, and HTF indicators, then fires trades based on a weighted scoring system that blends candlestick patterns, RSI, MACD, and more. Add in dynamic stops, trailing exits, and a 5% drawdown circuit breaker, and you’ve got a system that’s as safe as it is aggressive. Whether you’re a newbie or a prop desk pro, this strat’s your ticket to outsmarting the markets. Let’s break down every detail and see why it’s a must-have.
Why Traders Need This Strategy
Futures markets are a gauntlet—fast moves, volatility spikes (like the April 28, 2025 NQ 1k-point drop), and institutional traps that punish the unprepared. Meanwhile, platforms are flooded with low-effort scripts that recycle old ideas with zero innovation. The Adaptive Regime stands tall, offering:
Adaptive Intelligence: Detects market regimes (Trending, Range, Volatile, Quiet) to optimize signals, unlike one-size-fits-all scripts.
Multi-Factor Precision: Combines candlestick patterns, MA trends, RSI, MACD, volume, and HTF confirmation for high-probability trades.
Futures-Optimized Risk: Calculates position sizes based on $ risk (default: $300), with ATR or fixed stops/TPs tailored for ES/MES.
Bulletproof Safety: 5% daily drawdown circuit breaker and trailing stops keep your account intact, even in chaos.
DAFE Visual Mastery: Pulsing Bollinger Band fills, dynamic SL/TP lines, and dual dashboards (metrics + position) make signals crystal-clear and charts a work of art.
Original Craftsmanship: A DAFE creation, built with community passion, not a rehashed clone of generic code.
Traders need this because it’s a complete, adaptive system that blends quant smarts, user-friendly design, and DAFE flair. It’s your edge to trade with confidence, cut through market noise, and leave the copycats in the dust.
Strategy Components
1. Market Regime Detection
The strategy’s brain is its ability to classify market conditions into five regimes, ensuring signals match the environment.
How It Works:
Trending (Regime 1): ADX > 20, fast/slow EMA spread > 0.3x ATR, HTF RSI > 50 or MACD bullish (htf_trend_bull/bear).
Range (Regime 2): ADX < 25, price range < 3% of close, no HTF trend.
Volatile (Regime 3): BB width > 1.5x avg, ATR > 1.2x avg, HTF RSI overbought/oversold.
Quiet (Regime 4): BB width < 0.8x avg, ATR < 0.9x avg.
Other (Regime 5): Default for unclear conditions.
Indicators: ADX (14), BB width (20), ATR (14, 50-bar SMA), HTF RSI (14, daily default), HTF MACD (12,26,9).
Why It’s Brilliant:
Regime detection adapts signals to market context, boosting win rates in trending or volatile conditions.
HTF RSI/MACD add a big-picture filter, rare in basic scripts.
Visualized via gradient background (green for Trending, orange for Range, red for Volatile, gray for Quiet, navy for Other).
2. Multi-Factor Signal Scoring
Entries are driven by a weighted scoring system that combines candlestick patterns, trend, momentum, and volume for robust signals.
Candlestick Patterns:
Bullish: Engulfing (0.5), hammer (0.4 in Range, 0.2 else), morning star (0.2), piercing (0.2), double bottom (0.3 in Volatile, 0.15 else). Must be near support (low ≤ 1.01x 20-bar low) with volume spike (>1.5x 20-bar avg).
Bearish: Engulfing (0.5), shooting star (0.4 in Range, 0.2 else), evening star (0.2), dark cloud (0.2), double top (0.3 in Volatile, 0.15 else). Must be near resistance (high ≥ 0.99x 20-bar high) with volume spike.
Logic: Patterns are weighted higher in specific regimes (e.g., hammer in Range, double bottom in Volatile).
Additional Factors:
Trend: Fast EMA (20) > slow EMA (50) + 0.5x ATR (trend_bull, +0.2); opposite for trend_bear.
RSI: RSI (14) < 30 (rsi_bull, +0.15); > 70 (rsi_bear, +0.15).
MACD: MACD line > signal (12,26,9, macd_bull, +0.15); opposite for macd_bear.
Volume: ATR > 1.2x 50-bar avg (vol_expansion, +0.1).
HTF Confirmation: HTF RSI < 70 and MACD bullish (htf_bull_confirm, +0.2); RSI > 30 and MACD bearish (htf_bear_confirm, +0.2).
Scoring:
bull_score = sum of bullish factors; bear_score = sum of bearish. Entry requires score ≥ 1.0.
Example: Bullish engulfing (0.5) + trend_bull (0.2) + rsi_bull (0.15) + htf_bull_confirm (0.2) = 1.05, triggers long.
Why It’s Brilliant:
Multi-factor scoring ensures signals are confirmed by multiple market dynamics, reducing false positives.
Regime-specific weights make patterns more relevant (e.g., hammers shine in Range markets).
HTF confirmation aligns with the big picture, a quant edge over simplistic scripts.
3. Futures-Tuned Risk Management
The risk system is built for futures, calculating position sizes based on $ risk and offering flexible stops/TPs.
Position Sizing:
Logic: Risk per trade (default: $300) ÷ (stop distance in points * point value) = contracts, capped at max_contracts (default: 5). Point value = tick value (e.g., $12.5 for ES) * ticks per point (4) * contract multiplier (1 for ES, 0.1 for MES).
Example: $300 risk, 8-point stop, ES ($50/point) → 0.75 contracts, rounded to 1.
Impact: Precise sizing prevents over-leverage, critical for micro contracts like MES.
Stops and Take-Profits:
Fixed: Default stop = 8 points, TP = 16 points (2:1 reward/risk).
ATR-Based: Stop = 1.5x ATR (default), TP = 3x ATR, enabled via use_atr_for_stops.
Logic: Stops set at swing low/high ± stop distance; TPs at 2x stop distance from entry.
Impact: ATR stops adapt to volatility, while fixed stops suit stable markets.
Trailing Stops:
Logic: Activates at 50% of TP distance. Trails at close ± 1.5x ATR (atr_multiplier). Longs: max(trail_stop_long, close - ATR * 1.5); shorts: min(trail_stop_short, close + ATR * 1.5).
Impact: Locks in profits during trends, a game-changer in volatile sessions.
Circuit Breaker:
Logic: Pauses trading if daily drawdown > 5% (daily_drawdown = (max_equity - equity) / max_equity).
Impact: Protects capital during black swan events (e.g., April 27, 2025 ES slippage).
Why It’s Brilliant:
Futures-specific inputs (tick value, multiplier) make it plug-and-play for ES/MES.
Trailing stops and circuit breaker add pro-level safety, rare in off-the-shelf scripts.
Flexible stops (ATR or fixed) suit different trading styles.
4. Trade Entry and Exit Logic
Entries and exits are precise, driven by bull_score/bear_score and protected by drawdown checks.
Entry Conditions:
Long: bull_score ≥ 1.0, no position (position_size <= 0), drawdown < 5% (not pause_trading). Calculates contracts, sets stop at swing low - stop points, TP at 2x stop distance.
Short: bear_score ≥ 1.0, position_size >= 0, drawdown < 5%. Stop at swing high + stop points, TP at 2x stop distance.
Logic: Tracks entry_regime for PNL arrays. Closes opposite positions before entering.
Exit Conditions:
Stop-Loss/Take-Profit: Hits stop or TP (strategy.exit).
Trailing Stop: Activates at 50% TP, trails by ATR * 1.5.
Emergency Exit: Closes if price breaches stop (close < long_stop_price or close > short_stop_price).
Reset: Clears stop/TP prices when flat (position_size = 0).
Why It’s Brilliant:
Score-based entries ensure multi-factor confirmation, filtering out weak signals.
Trailing stops maximize profits in trends, unlike static exits in basic scripts.
Emergency exits add an extra safety layer, critical for futures volatility.
5. DAFE Visuals
The visuals are pure DAFE magic, blending function with cyberpunk flair to make signals intuitive and charts stunning.
Shimmering Bollinger Band Fill:
Display: BB basis (20, white), upper/lower (green/red, 45% transparent). Fill pulses (30–50 alpha) by regime, with glow (60–95 alpha) near bands (close ≥ 0.995x upper or ≤ 1.005x lower).
Purpose: Highlights volatility and key levels with a futuristic glow.
Visuals make complex regimes and signals instantly clear, even for newbies.
Pulsing effects and regime-specific colors add a DAFE signature, setting it apart from generic scripts.
BB glow emphasizes tradeable levels, enhancing decision-making.
Chart Background (Regime Heatmap):
Green — Trending Market: Strong, sustained price movement in one direction. The market is in a trend phase—momentum follows through.
Orange — Range-Bound: Market is consolidating or moving sideways, with no clear up/down trend. Great for mean reversion setups.
Red — Volatile Regime: High volatility, heightened risk, and larger/faster price swings—trade with caution.
Gray — Quiet/Low Volatility: Market is calm and inactive, with small moves—often poor conditions for most strategies.
Navy — Other/Neutral: Regime is uncertain or mixed; signals may be less reliable.
Bollinger Bands Glow (Dynamic Fill):
Neon Red Glow — Warning!: Price is near or breaking above the upper band; momentum is overstretched, watch for overbought conditions or reversals.
Bright Green Glow — Opportunity!: Price is near or breaking below the lower band; market could be oversold, prime for bounce or reversal.
Trend Green Fill — Trending Regime: Fills between bands with green when the market is trending, showing clear momentum.
Gold/Yellow Fill — Range Regime: Fills with gold/aqua in range conditions, showing the market is sideways/oscillating.
Magenta/Red Fill — Volatility Spike: Fills with vivid magenta/red during highly volatile regimes.
Blue Fill — Neutral/Quiet: A soft blue glow for other or uncertain market states.
Moving Averages:
Display: Blue fast EMA (20), red slow EMA (50), 2px.
Purpose: Shows trend direction, with trend_dir requiring ATR-scaled spread.
Dynamic SL/TP Lines:
Display: Pulsing colors (red SL, green TP for Trending; yellow/orange for Range, etc.), 3px, with pulse_alpha for shimmer.
Purpose: Tracks stops/TPs in real-time, color-coded by regime.
6. Dual Dashboards
Two dashboards deliver real-time insights, making the strat a quant command center.
Bottom-Left Metrics Dashboard (2x13):
Metrics: Mode (Active/Paused), trend (Bullish/Bearish/Neutral), ATR, ATR avg, volume spike (YES/NO), RSI (value + Oversold/Overbought/Neutral), HTF RSI, HTF trend, last signal (Buy/Sell/None), regime, bull score.
Display: Black (29% transparent), purple title, color-coded (green for bullish, red for bearish).
Purpose: Consolidates market context and signal strength.
Top-Right Position Dashboard (2x7):
Metrics: Regime, position side (Long/Short/None), position PNL ($), SL, TP, daily PNL ($).
Display: Black (29% transparent), purple title, color-coded (lime for Long, red for Short).
Purpose: Tracks live trades and profitability.
Why It’s Brilliant:
Dual dashboards cover market context and trade status, a rare feature.
Color-coding and concise metrics guide beginners (e.g., green “Buy” = go).
Real-time PNL and SL/TP visibility empower disciplined trading.
7. Performance Tracking
Logic: Arrays (regime_pnl_long/short, regime_win/loss_long/short) track PNL and win/loss by regime (1–5). Updated on trade close (barstate.isconfirmed).
Purpose: Prepares for future adaptive thresholds (e.g., adjust bull_score min based on regime performance).
Why It’s Brilliant: Lays the groundwork for self-optimizing logic, a quant edge over static scripts.
Key Features
Regime-Adaptive: Optimizes signals for Trending, Range, Volatile, Quiet markets.
Futures-Optimized: Precise sizing for ES/MES with tick-based risk inputs.
Multi-Factor Signals: Candlestick patterns, RSI, MACD, and HTF confirmation for robust entries.
Dynamic Exits: ATR/fixed stops, 2:1 TPs, and trailing stops maximize profits.
Safe and Smart: 5% drawdown breaker and emergency exits protect capital.
DAFE Visuals: Shimmering BB fill, pulsing SL/TP, and dual dashboards.
Backtest-Ready: Fixed qty and tick calc for accurate historical testing.
How to Use
Add to Chart: Load on a 5min ES/MES chart in TradingView.
Configure Inputs: Set instrument (ES/MES), tick value ($12.5/$1.25), multiplier (1/0.1), risk ($300 default). Enable ATR stops for volatility.
Monitor Dashboards: Bottom-left for regime/signals, top-right for position/PNL.
Backtest: Run in strategy tester to compare regimes.
Live Trade: Connect to Tradovate or similar. Watch for slippage (e.g., April 27, 2025 ES issues).
Replay Test: Try April 28, 2025 NQ drop to see regime shifts and stops.
Disclaimer
Trading futures involves significant risk of loss and is not suitable for all investors. Past performance does not guarantee future results. Backtest results may differ from live trading due to slippage, fees, or market conditions. Use this strategy at your own risk, and consult a financial advisor before trading. Dskyz (DAFE) Trading Systems is not responsible for any losses incurred.
Backtesting:
Frame: 2023-09-20 - 2025-04-29
Slippage: 3
Fee Typical Range (per side, per contract)
CME Exchange $1.14 – $1.20
Clearing $0.10 – $0.30
NFA Regulatory $0.02
Firm/Broker Commis. $0.25 – $0.80 (retail prop)
TOTAL $1.60 – $2.30 per side
Round Turn: (enter+exit) = $3.20 – $4.60 per contract
Final Notes
The Dskyz (DAFE) Adaptive Regime - Quant Machine Pro is more than a strategy—it’s a revolution. Crafted with DAFE’s signature precision, it rises above generic scripts with adaptive regimes, quant-grade signals, and visuals that make trading a thrill. Whether you’re scalping MES or swinging ES, this system empowers you to navigate markets with confidence and style. Join the DAFE crew, light up your charts, and let’s dominate the futures game!
(This publishing will most likely be taken down do to some miscellaneous rule about properly displaying charting symbols, or whatever. Once I've identified what part of the publishing they want to pick on, I'll adjust and repost.)
Use it with discipline. Use it with clarity. Trade smarter.
**I will continue to release incredible strategies and indicators until I turn this into a brand or until someone offers me a contract.
Created by Dskyz, powered by DAFE Trading Systems. Trade smart, trade bold.
High/Low stopFirst of all let me quote some important points :
• You need stops; a trade without a stop is a gamble.
• You need to know where you’ll put your stop before you enter
a trade.
• Everybody needs hard stops.
• Whenever you change a stop, you may move it only in the direc-
tion of the trade.
There is a variety of techniques available to traders who like to use
trailing stops:
 • You can use a multibar low as a trailing stop; for example, you
can keep moving your stop to the lowest low of the last three
bars (but never against your trade). 
• You can trail prices with a very short moving average and use its
level for a trailing stop.
• You can use a Chandelier stop—every time the market makes a
new high, move the stop within a certain distance from the top—
either a specific price range or a number based on an ATR (aver-
age true range). Any time your stock makes a new high, you place
your stop within that distance from the top, like hanging a chan-
delier (this method is described in Come into My Trading Room).
• You can use a Parabolic stop .
• You can use a SafeZone stop .
• You can use a Volatility-Drop stop (described below, for the first
time in trading literature).
• You can use a Time Stop to get out of your trade if it does not
move within a certain time. For example, if you enter a day-trade
and the stock does not move within 10 or 15 minutes, it is clearly
not doing what you expected and it is best to scratch that trade.
If you put on a swing trade which you expect to last several
days, but then a week goes by and the stock is still flat, it is
clearly not confirming your analysis and the safest action would
be to get out.
 This is a summary taken from Dr Elder book and this indicator i coded from one of his book where he briefly mention this trailing stop technique but don't dive a lot into it, but still i found to be very effective.
You can use even the short stop (the green dots) as an entry point.
Zero Lag Trend Signals (MTF) [Quant Trading] V7Overview 
The Zero Lag Trend Signals (MTF) V7 is a comprehensive trend-following strategy that combines Zero Lag Exponential Moving Average (ZLEMA) with volatility-based bands to identify high-probability trade entries and exits. This strategy is designed to reduce lag inherent in traditional moving averages while incorporating dynamic risk management through ATR-based stops and multiple exit mechanisms.
This is a longer term horizon strategy that takes limited trades. It is not a high frequency trading and therefore will also have limited data and not > 100 trades.
 How It Works 
 Core Signal Generation: 
The strategy uses a Zero Lag EMA (ZLEMA) calculated by applying an EMA to price data that has been adjusted for lag:
 
 Calculate lag period: floor((length - 1) / 2)
 Apply lag correction: src + (src - src )
 Calculate ZLEMA: EMA of lag-corrected price
 
Volatility bands are created using the highest ATR over a lookback period multiplied by a band multiplier. These bands are added to and subtracted from the ZLEMA line to create upper and lower boundaries.
 Trend Detection: 
The strategy maintains a trend variable that switches between bullish (1) and bearish (-1):
 
 Long Signal:  Triggers when price crosses above ZLEMA + volatility band
 Short Signal:  Triggers when price crosses below ZLEMA - volatility band
 
 Optional ZLEMA Trend Confirmation: 
When enabled, this filter requires ZLEMA to show directional momentum before entry:
 
 Bullish Confirmation:  ZLEMA must increase for 4 consecutive bars
 Bearish Confirmation:  ZLEMA must decrease for 4 consecutive bars
 
This additional filter helps avoid false signals in choppy or ranging markets.
 Risk Management Features: 
The strategy includes multiple stop-loss and take-profit mechanisms:
 
 Volatility-Based Stops:  Default stop-loss is placed at ZLEMA ± volatility band
 ATR-Based Stops:  Dynamic stop-loss calculated as entry price ± (ATR × multiplier)
 ATR Trailing Stop:  Ratcheting stop-loss that follows price but never moves against position
 Risk-Reward Profit Target:  Take-profit level set as a multiple of stop distance
 Break-Even Stop:  Moves stop to entry price after reaching specified R:R ratio
 Trend-Based Exit:  Closes position when price crosses EMA in opposite direction
 
 Performance Tracking: 
The strategy includes optional features for monitoring and analyzing trades:
 
 Floating Statistics Table:  Displays key metrics including win rate, GOA (Gain on Account), net P&L, and max drawdown
 Trade Log Labels:  Shows entry/exit prices, P&L, bars held, and exit reason for each closed trade
 CSV Export Fields:  Outputs trade data for external analysis
 
 Default Strategy Settings 
 Commission & Slippage: 
 
 Commission: 0.1% per trade
 Slippage: 3 ticks
 Initial Capital: $1,000
 Position Size: 100% of equity per trade
 
 Main Calculation Parameters: 
 
 Length: 70 (range: 70-7000) - Controls ZLEMA calculation period
 Band Multiplier: 1.2 - Adjusts width of volatility bands
 
 Entry Conditions (All Disabled by Default): 
 
 Use ZLEMA Trend Confirmation: OFF - Requires ZLEMA directional momentum
 Re-Enter on Long Trend: OFF - Allows multiple entries during sustained trends
 
 Short Trades: 
 
 Allow Short Trades: OFF - Strategy is long-only by default
 
 Performance Settings (All Disabled by Default): 
 
 Use Profit Target: OFF
 Profit Target Risk-Reward Ratio: 2.0 (when enabled)
 
 Dynamic TP/SL (All Disabled by Default): 
 
 Use ATR-Based Stop-Loss & Take-Profit: OFF
 ATR Length: 14
 Stop-Loss ATR Multiplier: 1.5
 Profit Target ATR Multiplier: 2.5
 Use ATR Trailing Stop: OFF
 Trailing Stop ATR Multiplier: 1.5
 Use Break-Even Stop-Loss: OFF
 Move SL to Break-Even After RR: 1.5
 Use Trend-Based Take Profit: OFF
 EMA Exit Length: 9
 
 Trade Data Display (All Disabled by Default): 
 
 Show Floating Stats Table: OFF
 Show Trade Log Labels: OFF
 Enable CSV Export: OFF
 Trade Label Vertical Offset: 0.5
 
 Backtesting Date Range: 
 
 Start Date: January 1, 2018
 End Date: December 31, 2069
 
 Important Usage Notes 
 
 Default Configuration:  The strategy operates in its most basic form with default settings - using only ZLEMA crossovers with volatility bands and volatility-based stop-losses. All advanced features must be manually enabled.
 Stop-Loss Priority:  If multiple stop-loss methods are enabled simultaneously, the strategy will use whichever condition is hit first. ATR-based stops override volatility-based stops when enabled.
 Long-Only by Default:  Short trading is disabled by default. Enable "Allow Short Trades" to trade both directions.
 Performance Monitoring:  Enable the floating stats table and trade log labels to visualize strategy performance during backtesting.
 Exit Mechanisms:  The strategy can exit trades through multiple methods: stop-loss hit, take-profit reached, trend reversal, or trailing stop activation. The trade log identifies which exit method was used.
 Re-Entry Logic:  When "Re-Enter on Long Trend" is enabled with ZLEMA trend confirmation, the strategy can take multiple long positions during extended uptrends as long as all entry conditions remain valid.
 Capital Efficiency:  Default setting uses 100% of equity per trade. Adjust "default_qty_value" to manage position sizing based on risk tolerance.
 Realistic Backtesting:  Strategy includes commission (0.1%) and slippage (3 ticks) to provide realistic performance expectations. These values should be adjusted based on your broker and market conditions.
 
 Recommended Use Cases 
 
 Trending Markets:  Best suited for markets with clear directional moves where trend-following strategies excel
 Medium to Long-Term Trading:  The default length of 70 makes this strategy more appropriate for swing trading rather than scalping
 Risk-Conscious Traders:  Multiple stop-loss options allow traders to customize risk management to their comfort level
 Backtesting & Optimization:  Comprehensive performance tracking features make this strategy ideal for testing different parameter combinations
 
 Limitations & Considerations 
 
 Like all trend-following strategies, performance may suffer in choppy or ranging markets
 Default 100% position sizing means full capital exposure per trade - consider reducing for conservative risk management
 Higher length values (70+) reduce signal frequency but may improve signal quality
 Multiple simultaneous risk management features may create conflicting exit signals
 Past performance shown in backtests does not guarantee future results
 
 Customization Tips 
For more aggressive trading:
 
 Reduce length parameter (minimum 70)
 Decrease band multiplier for tighter bands
 Enable short trades
 Use lower profit target R:R ratios
 
For more conservative trading:
 
 Increase length parameter
 Enable ZLEMA trend confirmation
 Use wider ATR stop-loss multipliers
 Enable break-even stop-loss
 Reduce position size from 100% default
 
For optimal choppy market performance:
 
 Enable ZLEMA trend confirmation
 Increase band multiplier
 Use tighter profit targets
 Avoid re-entry on trend continuation
 
 Visual Elements 
The strategy plots several elements on the chart:
 
 ZLEMA line (color-coded by trend direction)
 Upper and lower volatility bands
 Long entry markers (green triangles)
 Short entry markers (red triangles, when enabled)
 Stop-loss levels (when positions are open)
 Take-profit levels (when enabled and positions are open)
 Trailing stop lines (when enabled and positions are open)
 Optional ZLEMA trend markers (triangles at highs/lows)
 Optional trade log labels showing complete trade information
 
 Exit Reason Codes (for CSV Export) 
When CSV export is enabled, exit reasons are coded as:
 
 0 = Manual/Other
 1 = Trailing Stop-Loss
 2 = Profit Target
 3 = ATR Stop-Loss
 4 = Trend Change
 
 Conclusion 
Zero Lag Trend Signals V7 provides a robust framework for trend-following with extensive customization options. The strategy balances simplicity in its core logic with sophisticated risk management features, making it suitable for both beginner and advanced traders. By reducing moving average lag while incorporating volatility-based signals, it aims to capture trends earlier while managing risk through multiple configurable exit mechanisms.
The modular design allows traders to start with basic trend-following and progressively add complexity through ZLEMA confirmation, multiple stop-loss methods, and advanced exit strategies. Comprehensive performance tracking and export capabilities make this strategy an excellent tool for systematic testing and optimization.
 Note: This strategy is provided for educational and backtesting purposes. All trading involves risk. Past performance does not guarantee future results. Always test thoroughly with paper trading before risking real capital, and adjust position sizing and risk parameters according to your risk tolerance and account size. 
================================================================================
 TAGS: 
================================================================================
trend following, ZLEMA, zero lag, volatility bands, ATR stops, risk management, swing trading, momentum, trend confirmation, backtesting
================================================================================
 CATEGORY: 
================================================================================
Strategies
================================================================================
 CHART SETUP RECOMMENDATIONS: 
================================================================================
For optimal visualization when publishing:
 
 Use a clean chart with no other indicators overlaid
 Select a timeframe that shows multiple trade signals (4H or Daily recommended)
 Choose a trending asset (crypto, forex major pairs, or trending stocks work well)
 Show at least 6-12 months of data to demonstrate strategy across different market conditions
 Enable the floating stats table to display key performance metrics
 Ensure all indicator lines (ZLEMA, bands, stops) are clearly visible
 Use the default chart type (candlesticks) - avoid Heikin Ashi, Renko, etc.
 Make sure symbol information and timeframe are clearly visible
 
================================================================================
 COMPLIANCE NOTES: 
================================================================================
✅ Open-source publication with complete code visibility
✅ English-only title and description
✅ Detailed explanation of methodology and calculations
✅ Realistic commission (0.1%) and slippage (3 ticks) included
✅ All default parameters clearly documented
✅ Performance limitations and risks disclosed
✅ No unrealistic claims about performance
✅ No guaranteed results promised
✅ Appropriate for public library (original trend-following implementation with ZLEMA)
✅ Educational disclaimers included
✅ All features explained in detail
================================================================================
Fractal Trail [UAlgo]The Fractal Trail   is designed to identify and utilize Williams fractals as dynamic trailing stops. This tool serves traders by marking key fractal points on the chart and leveraging them to create adaptive stop-loss trails, enhancing risk management and trade decision-making.
Williams fractals are pivotal in identifying potential reversals and critical support/resistance levels. By plotting fractals dynamically and providing configurable options, this indicator allows for personalized adjustments based on the trader's strategy.
This script integrates both visual fractal markers and adjustable trailing stops, offering insights into market trends while catering to a wide variety of trading styles and timeframes.
  
 🔶 Key Features 
 Williams Fractals Identification:  The indicator marks Williams Fractals on the chart, which are significant highs and lows within a specified range. These fractals are crucial for identifying potential reversal points in the market.
 Dynamic Trailing Stops:  The indicator generates dynamic trailing stops based on the identified fractals. These stops adjust automatically as new fractals are formed, providing a responsive and adaptive approach to risk management.
 Fractal Range:  Users can specify the number of bars to the left and right for analyzing fractals, allowing for flexibility in identifying significant price points.
 Trail Buffer Percentage:  A percentage-based safety margin can be added between the fractal price and the trailing stop, providing additional control over risk management.
 Trail Invalidation Source:  Users can choose whether the trailing stop flips based on candle closing prices or the extreme points (high/low) of the candles.
 Alerts and Notifications:  The indicator provides alerts for when the price crosses the trailing stops, as well as when new Williams Fractals are confirmed. These alerts can be customized to fit the trader's notification preferences.
 🔶 Interpreting the Indicator 
 Fractal Markers:  The triangles above and below the bars indicate Williams Fractals. These markers help traders identify potential reversal points in the market.
  
 Trailing Stops:  The dynamic trailing stops are plotted as lines on the chart. These lines adjust based on the latest identified fractals, providing a visual representation of potential support and resistance levels.
 Fill Colors:  The optional fill colors between the trailing stops and the price action help traders quickly identify the current trend and potential pullback zones.
  
 🔶 Disclaimer 
Use with Caution: This indicator is provided for educational and informational purposes only and should not be considered as financial advice. Users should exercise caution and perform their own analysis before making trading decisions based on the indicator's signals.
Not Financial Advice: The information provided by this indicator does not constitute financial advice, and the creator (UAlgo) shall not be held responsible for any trading losses incurred as a result of using this indicator.
Backtesting Recommended: Traders are encouraged to backtest the indicator thoroughly on historical data before using it in live trading to assess its performance and suitability for their trading strategies.
Risk Management: Trading involves inherent risks, and users should implement proper risk management strategies, including but not limited to stop-loss orders and position sizing, to mitigate potential losses.
No Guarantees: The accuracy and reliability of the indicator's signals cannot be guaranteed, as they are based on historical price data and past performance may not be indicative of future results.






















