Cumulative Volume Delta (MTF)Cumulative Volume Delta (CVD) Indicator 
The Cumulative Volume Delta (CVD) indicator is a powerful analytical tool used to understand the behavior and dynamics of market participants through volume analysis. It tracks the net difference between buying and selling pressure, providing insights into market trends and potential reversals. Here's a detailed description of this indicator and its components:
The Cumulative Volume Delta (CVD) indicator calculates the cumulative net difference between buying and selling volume over a specified period. By analyzing this net difference, traders can gain insights into the underlying strength or weakness of a price movement, helping to identify trends, reversals, and potential breakout points.
 Key Components: 
 
 Bull & Bear Power Calculation: 
 
 Bull Power: Represents the strength of buyers in the market. It is calculated based on the relationship between the current and previous price bars. A higher Bull Power indicates stronger buying pressure.
 Bear Power: Represents the strength of sellers in the market. It is also calculated based on the relationship between the current and previous price bars. A higher Bear Power indicates stronger selling pressure.
 
 Bull & Bear Volume Calculation: 
 
 Bull Volume: The volume attributed to buying pressure. It is calculated by taking the proportion of Bull Power relative to the total of Bull Power and Bear Power, multiplied by the total volume.
 Bear Volume: The volume attributed to selling pressure. It is calculated similarly to Bull Volume but using Bear Power.
 
 Delta Calculation: 
 
 Delta: The net difference between Bull Volume and Bear Volume for each bar. A positive Delta indicates more buying pressure, while a negative Delta indicates more selling pressure.
 
 Cumulative Volume Delta (CVD): 
 
 CVD: The running total of the Delta values over time. It accumulates the net buying and selling pressure to provide a visual representation of the market's cumulative sentiment.
 
 Moving Average of CVD (CVD MA): 
 
 CVD MA: A simple moving average of the CVD, used to smooth out fluctuations and help identify the overall trend. It provides a baseline to compare the current CVD value against, highlighting divergences or convergences.
 
 
 Multi-Timeframe Functionality: 
The enhanced version of the CVD indicator includes multi-timeframe (MTF) capabilities, allowing users to select and analyze data from different timeframes. This feature enhances the versatility of the indicator by providing a broader perspective on market dynamics across various time intervals.
 Practical Applications: 
 
 Trend Identification: By tracking the CVD and its moving average, traders can identify the prevailing trend. An upward-sloping CVD indicates sustained buying pressure, while a downward-sloping CVD indicates sustained selling pressure.
 Divergences: Divergences between the CVD and price can signal potential reversals. For example, if the price is making new highs but the CVD is not, it may indicate weakening buying pressure and a potential reversal.
 Breakout Confirmation: Significant changes in the CVD can confirm breakouts. A sharp increase in the CVD during a price breakout indicates strong buying support, adding confidence to the breakout.
 Support and Resistance Levels: The CVD can help identify significant support and resistance levels based on changes in volume dynamics. For instance, a notable increase in buying volume at a support level can reinforce its strength.
在腳本中搜尋"breakout"
Daily Close GAP Detector [Yosiet]User Manual for "Daily Close GAP Detector  " 
 Overview 
This script is designed to help traders identify and react to significant gaps in daily market prices. It plots daily open and close prices and highlights significant gaps with a cross. The script is particularly useful for identifying potential breakouts or reversals based on these gaps.
 Configuration 
 
 GAP Close Threshold: This input allows you to set a threshold for the gap size that you consider significant. The default value is 0.001.
 Timeframe Seeker: This input lets you choose the timeframe for the gap detection. The default is 'D' for daily.
 
 Features 
 
 Daily Open and Close Lines: The script plots daily open and close prices. If the close price is lower than the open price, the line is colored red; otherwise, it's green.
 Gap Detection: It calculates the difference between the current day's close and the previous day's close, both adjusted for the selected timeframe. If this difference exceeds the threshold, it's considered a significant gap.
 Significant Gap Indicator: A cross is plotted on the chart to indicate significant gaps. The color of the cross indicates whether the gap is a short or long gap: red for short gaps and green for long gaps.
 Alert Conditions: The script sets up alert conditions for short and long gap breakouts. You can customize the alert messages to include details like the ticker symbol, interval, price, and exchange.
 
 How to Use 
 
 
 Add the Script to Your Chart: Copy the script into the Pine Script editor on TradingView and add it to your chart.
 Configure Inputs: Adjust the "GAP Close Threshold" and "Timeframe Seeker" inputs as needed.
 Review the Chart: The script will overlay daily open and close prices on your chart, along with crosses indicating significant gaps.
 Set Alerts: Use the script's alert conditions to set up alerts for short and long gap breakouts. You can customize the alert messages to suit your trading strategy.
 
 Extending the Code 
To extend this script, you can modify the gap detection logic, add more indicators, or integrate it with other scripts for a more comprehensive trading strategy. Remember to test any changes thoroughly before using them in live trading.
Mean and Standard Deviation Lines Description:
Calculates the mean and standard deviation of close-to-close price differences over a specified period, providing insights into price volatility and potential breakouts.
Manually calculates mean and standard deviation for a deeper understanding of statistical concepts.
Plots the mean line, upper bound (mean + standard deviation), and lower bound (mean - standard deviation) to visualize price behavior relative to these levels.
Highlights bars that cross the upper or lower bounds with green (above) or red (below) triangles for easy identification of potential breakouts or breakdowns.
Customizable period input allows for analysis of short-term or long-term volatility patterns.
 
Probability Interpretations based on Standard Deviation:
50% probability: mean or expected value
68% probability: Values within 1 standard deviation of the mean (mean ± stdev) represent roughly 68% of the data in a normal distribution. This implies that around 68% of closing prices in the past period fell within this range.
95% probability: Expanding to 2 standard deviations (mean ± 2*stdev) captures approximately 95% of the data. So, in theory, there's a 95% chance that future closing prices will fall within this wider range.
99.7% probability: Going further to 3 standard deviations (mean ± 3*stdev) encompasses nearly 99.7% of the data. However, these extreme values become less likely as you move further away from the mean.
Key Features:
Uses manual calculations for mean and standard deviation, providing a hands-on approach.
Excludes the current bar's close price from calculations for more accurate analysis of past data.
Ensures valid index usage for robust calculation logic.
Employs unbiased standard deviation calculation for better statistical validity.
Offers clear visual representation of mean and volatility bands.
Considerations:
Manual calculations might have a slight performance impact compared to built-in functions.
Not a perfect normal distribution: Financial markets often deviate from a perfect normal distribution. This means probability interpretations based on standard deviation shouldn't be taken as absolute truths.
Non-stationarity: Market conditions and price behavior can change over time, impacting the validity of past data as a future predictor.
Other factors: Many other factors influence price movements beyond just the mean and standard deviation.
Always consider other technical and fundamental factors when making trading decisions.
 
Potential Use Cases:
Identifying periods of high or low volatility.
Discovering potential breakout or breakdown opportunities.
Comparing volatility across different timeframes.
Complementing other technical indicators for confirmation.
Understanding statistical concepts for financial analysis.
PercentX Trend Follower [Trendoscope]"Trendoscope" was born from our trading journey, where we first delved into the world of trend-following methods. Over time, we discovered the captivating allure of pattern analysis and the exciting challenges it presented, drawing us into exploring new horizons. However, our dedication to trend-following methodologies remains steadfast and continues to be an integral part of our core philosophy.
Here we are, introducing another effective trend-following methodology, employing straightforward yet powerful techniques.
 🎲 Concepts 
Introducing the innovative  PercentX Oscillator , a representation of Bollinger PercentB and Keltner Percent K. This powerful tool offers users the flexibility to customize their PercentK oscillator, including options for the type of moving average and length.
 The Oscillator Range  is derived dynamically, utilizing two lengths - inner and outer. The inner length initiates the calculation of the oscillator's highest and lowest range, while the outer length is used for further calculations, involving either a moving average or the opposite side of the highest/lowest range, to obtain the oscillator ranges.
Next, the  Oscillator Boundaries  are derived by applying another round of high/low or moving average calculations on the oscillator range values.
 Breakouts  occur when the close price crosses above the upper boundary or below the lower boundary, signaling potential trading opportunities.
 🎲 How to trade a breakout? 
To reduce false signals, we employ a simple yet effective approach. Instead of executing market trades, we use stop orders on both sides at a certain distance from the current close price.
In case of an upper side breakout, a long stop order is placed at 1XATR above the close, and a short stop order is placed at 2XATR below the close. Conversely, for a lower side breakout, a short stop order is placed at 1XATR below the close, and a long stop order is placed at 2XATR above the ATR. As a trend following method, our first inclination is to trade on the side of breakout and not to find the reversals. Hence, higher multiplier is used for the direction opposite to the breakout.
The script provides users with the option to specify ATR multipliers for both sides.
Once a trade is initiated, the opposite side of the trade is converted into a stop-loss order. In the event of a breakout, the script will either place new long and short stop orders (if no existing trade is present) or update the stop-loss orders if a trade is currently running.
As a trend-following strategy, this script does not rely on specific targets or target levels. The objective is to run the trade as long as possible to generate profits. The trade is only stopped when the stop-loss is triggered, which is updated with every breakout to secure potential gains and minimize risks.
 🎲 Default trade parameters 
Script uses 10% equity per trade and up to 4 pyramid orders. Hence, the maximum invested amount at a time is 40% of the equity. Due to this, the comparison between buy and hold does not show a clear picture for the trade.
Feel free to explore and optimize the parameters further for your favorite symbols.
 🎲 Visual representation  
The blue line represents the PercentX Oscillator, orange and lime colored lines represent oscillator ranges. And red/green lines represent oscillator boundaries. Oscillator spikes upon breakout are highlighted with color fills.
Band-Zigzag - TrendFollower Strategy [Trendoscope]Strategy Time!!!
Have built this on my earlier published indicator  Band-Zigzag-Trend-Follower . This is just one possible implementation of strategy on   Band-Based-Zigzag .
 🎲 Notes 
 
  Experimental prototype. Not financial advise and strategy not guaranteed to make money despite backtest results
  Not created or tested for any specific instrument or timeframe
  Test and adopt with own risk
 
 🎲 Strategy 
This is trend following strategy built based on Bands and Zigzag. Traits of trend following strategies are
 
  Lower win rate (Yes, thats right)
  High risk reward (Compensates low win rate)
  Higher drawdown
  If market is choppy, trend following methods suffer.
 
The script implements few points to overcome the negatives such as lower win rate and higher drawdown by actively assessing pivots on the direction of trend along. This helps us take regular profits and exit on time during the end of trend. Most of the other concepts are defined and explained in indicator -  Band-Zigzag-Trend-Follower  and  Band-Based-Zigzag 
Defining a trend following method is simple. Basic rule of trend following is Buy High and Sell Low (Yes, you heard it right). To explain further - methodology involve finding an established trend which is flying high and join the trend with proper risk and optimal stop. Once you get into the trade, you will not exit unless there is change in the trend. Or in other words, the parameters which you used to define trend has reversed and the trend is not valid anymore.
 🎯 Using bands 
When price breaks out of upper bands (example, Bollinger Band , Keltener Channel, or Donchian Channel), with a pre determined length and multiplier, we can consider the trend to be bullish and similarly when price breaks down the lower band, we can consider the trend to be bearish .
 🎯 Using Pivots 
Simple logic using zigzag or pivot points is that when price starts making higher highs and higher lows, we can consider this as uptrend. And when price starts making lower highs and lower lows, we can consider this as downtrend. There are few supertrend implementations I have published in the past based on zigzags and pivot points .
Drawbacks of both of these methods is that there will be too many fluctuations in both cases unless we increase the reference length. And if we increase the reference length, we will have higher drawdown.
 🎯 Band Based Zigzag Method  
 
  Here we use bands to define our pivot high and pivot low - this makes sure that we are identifying trend only on breakouts as pivots are only formed on breakouts
  Our method also includes pivot ratio to cross over 1.0 to be able to consider it as trend. This means, we are waiting for price also to make new high high or lower low before making the decision on trend. But, this helps us ignore smaller pivot movements due to the usage of bands.
  I have also implemented few tricks such as sticky bands (Bands will not contract unless there is breakout) and Adaptive Bands (Band will not expand unless price is moving in the direction of band). This makes the trend following method very robust.
  To avoid fakeouts, we also use percentB of high/low in comparison with price retracement to define breakout.
 
 🎲 Settings 
Settings are fairly simpler and are explained as below. You will find most of the required information in tooltips.
Trading BehnamI've read around here various definitions for engulfs along the lines of "an engulf consumes all orders at a level to allow price to easily pass through it." . That doesn't make much sense to me, if the guys with billions of dollars want to break a level, they will break it and price will run off very often. We've seen it time and time again, they don't need to engulf levels to give us a nice opportunity to get into the trade with them, if they want to blast through a level, they will do so and price will run off. If they want an opportunity to accumulate more orders before price runs away, then it doesn't make sense to engulf the level, better to let price bounce from that level and then fill more orders, if the level breaks then they have to deliberately stop the market running away and move it back to the pre-engulf area as the market momentum would naturally make it run off after an engulf. Other ideas about it being a secret signal between the institutions don't make sense to me either. To be honest, I think any secret signals between competing institutions come in the form of them in a heavily encrypted chatroom telling each other what to do. This collusion has been reported on previously as traders align their activities at important moments.
So I think we can all agree something along the lines of:
Fakeout:
Fakeout is an engulf of an obvious swing high/low in order to stop out traders and induce breakout traders to trade in the wrong direction, thus generating liquidity for the move in the opposite direction.
What's not so clear is the definition of the engulf, I'd like to try to give some ideas on the purpose of the engulf and it's definition and see what others think.
Engulf:
An engulf is the consumption of orders at an important level, not necessarily a swing/high low but an area where we expect to see supply or demand. Taking out of the orders tells us that the supply or demand which was or should have been present is now not present and tells us the intent direction of the market. If price runs off as is often the case, this is not tradeable and is effectively just a "breakout", although breakouts are usually considered to be breaks of swing high and lows which are obvious to the average trader. For an engulf to be tradeable there must be a retrace following the engulf back in the original direction. This adds confusion as it initially resembles a fakeout. So the question is, why does price retrace after the engulf? If an engulf to the short side is a genuine engulf and not a fakeout to generate long liquidity, why does it not travel immediately south if market momentum is ultimately south.
A small pocket of demand beneath the engulfed level may make it retrace north as price moves between areas of liquidity, this pocket of demand may give price enough momentum to make it back up to the supply which broke the demand level if key market participants do not favour an immediate market drop.
Alternatively key market participants may step in and drive the market back upwards.
Price moving north back to supply after the engulf may occur or be favourable for various reasons:
1) We often talk about FO generating liquidity because of breakout trading, but an engulf can also generate liquidity from breakout traders. Short breakout traders would place their stop losses a small distance above the engulf (breakout). If key players absorb this selling or allow a demand level to push price back up, they can run price back up to supply taking out the stops of the breakout short traders and make quick profit and/or generate more liquidity for their own shorts.
2) To confuse traders, the ITs don't want the puzzle that is Forex to be easy to solve, if price never retraced after an engulf then engulfs of all levels would be FOs. Price would either break and immediately runoff or it would turn and runoff in the other direction. In order to keep people confused about whether price is faking out or breaking out, sometimes price should whipsaw by breaking out, briefly faking out and then continuing in the direction of the breakout. This whipsaw pattern is to us a tradeable engulf.
3) Market momentum may be mixed, key players are indecisive or inactive or the market is behaving erratically.
4) As previously mentioned there may be a small pocket of supply/demand just past the engulf which is causing a reaction. This could also be viewed as a FO on a different timeframe. If the market engulfs an H1 demand level, then retraces for 30 mins upwards to supply, this engulf would be a valid and very profitable FO for an M1 trader looking to get long.
Volume ChartVolume data can be interpreted in many different ways. This is a very basic script and novel idea to display volume as a chart. The purpose of this script is to visually help identify volume breakouts and other common chart patterns. While this indicator could be useful for finding big moves and early reversals it not reliable for determining the direction of the move. 
Below is an example of a volume breakout:
  
Below is confirmation of the second ear in the batman pattern:
  
Lower highs and higher lows can give early signs of a reversal:
  
Below we can see retailers getting pumped and dumped on during the gaps while they sleep:
  
Smarter SNR (Support and Ressistance, Trendline, MTF OSC)Built with love "Smarter SNR (Support and Ressistance, Trendline, MTF OSC) "
This indiator will show you Support & Ressistance, Good Trendline, and Multi-timeframe analyzing of Oscillator (Stochastic and RSI)
You can combine with your own strategy, or use this purely
 DISCLAIMER :
Measure the risk first before use it in real market
Backtest The Strategy was very important, so you know the probability 
Fundamentally Logical :
SNR -> Last 3 Zigzag Pivot
Trendline -> Using two last pivot for calculating the slope
Features :
1. SNR
2. Trendline
3. MTF Oscillator Analyzing 
How to use it :
1. All Label, Table & Line can be turned on/off in settings
2. Pivot Period can be Adjusted in settings
3. All Label, Table & Line style can be adjusted in settings
Regards,
Hanabil
Donchian Screener█ OVERVIEW
This is a screener script for the  Donchian Channel indicator . It's an excellent indicator for trend following, a trading strategy which tries to take advantage of long, medium or short-term moves that seem to play out in various markets.
█ DESCRIPTION
The screener works by scanning through up to 10 symbols and list down symbols that are currently breaking through the upper or lower band as definied by the Donchian Channels, at which point the market signals the start of a bullish or bearish trend.
█ HOW TO USE
After adding the indicator, open the script settings and type the symbol name and length to be used on the Donchian Channels for each stock.
█ PARAMETERS
- Use High/Low Price Breakouts: check this box if you want to use price high/low instead of price close to identify breakouts
- Panel Position: choose whether you want to position the panel on the top, middle or bottom right side of the graph (default is top)
- Default Timeframe: what timeframe to use on the screener (default is daily)
- Ticker: the ticker name you want to monitor
- Length: length parameter used on Donchian Channel indicator
█ FEATURES
The screener can scan up to 10 symbols each time.
█ LIMITATIONS
The screener will scan the symbols breaking out bands on the current bar, and as such, there maybe some delays depending on the stock/ etf /crypto you choose. Some exchanges require an additional subscription to get realtime data.
Trend Following with Donchian Channels and MACDThis is a trend following system based on the Donchian Channels. Instead of using a simple moving average crossover, this system uses the MACD as the trendfilter:
Long positions:
* Price makes a new 50 day high,
* The MACD-line crosses above or is above the Signal-line.
* Both the MACD and the Signal-lines are above the zero-line. 
Short positions:
* Price makes a new 50 day low,
* The MACD-line crosses below or is below the Signal-line.
* Both the MACD and the Signal-lines are below the zero-line.
Stoploss:
The initial and the trailing stoploss are 4 ATRs away from the price. 
Hi-Lo TrendThis script uses the most recent low/high and candle size to determine trend breakouts.
The trend is determined buy whether the most recent price extreme within the Lookback period is a high or low.  If it is a most recent high, it is an uptrend, if it is a lwo, a downtrend.
Bands are created using the average absolute difference of current minus previous close over the MABandPeriod, multiplied by the MABandMultiplier.  
If the current close minus previous close is above/below the band, then a blue dot is painted and it is a breakout.
a buy alert fires when a downtrend becomes an uptrend and a breakout above the bands happens.
A sell alert fires when an uptrend becomes a downtrend and a breakout below the bands happns.
2 Candles Inside ATR2 agitated candles falling inside ATR range, awaiting possibly a big move.
Buy / Sell signals at combined high / low can be used as order with other as stop loss.
Counter trade, when this minimal stop loss is hit, is also as useful. However, wait till the SL candle closes, before opening position on the other side.
Works quite well on 15 mins chart, with settings of ATR duration 25 and multiplier 0.6. These settings are configurable, so feel free.
Smoothed CandlesHello Traders, 
This is " Smoothed Candles " script to get rid of noises and to get a smoothed chart to figure out breakouts and price movements easily.
There are three scaling methods:  User Defined, Dynamic (ATR) and Percentage 
Optionally you can add 2 Simple Moving Averages and 2 Exponential Moving Averages
Optionally you can hide the Wicks, example:
You can add moving averages:
Easily find breakouts:
Enjoy!
Hikkake PatternLifted description from web:
 Hikkake means to trap, trick, or ensnare. Primarily, this price pattern seeks to identify inside bar breakouts and profit from their failures.
An inside bar is a price bar that is entirely within the range of the preceding price bar. Inside bars are typical on price charts of most timeframes.
While you’ll often find inside bars in congested markets, they also offer a low-risk entry point for price action traders. The contracted range of an inside bar offers a natural tight stop-loss.
Hence, inside bar breakouts seem attractive. However, if you are patient and focus on identifying false breakouts, you might be able to find more reliable trading setups in the form of Hikkakes.
In a nutshell, the Hikkake pattern offers a systematic approach to trading false inside bar breakouts.
 
As a filter I incorporated VWAP into the code to only trigger Bullish / Bearish signals when price is Above/Below VWAP respectively. The ATR is used to create a Stop buffer (red cross) for the Entry signal ( green dot ). The R1 and R2 (orange squares) are two possible profit targets that are customizable to different Risk multiples based upon the difference between Entry and Stop.
RBLR - GSK Vizag AP IndiaThis indicator identifies the Opening Range High (ORH) and Low (ORL) based on the first 15 minutes of the Indian equity market session (9:15 AM to 9:30 AM IST). It draws horizontal lines extending these levels until market close (3:30 PM IST) and generates visual signals for price breakouts above ORH or below ORL, as well as reversals back into the range.
Key features:
- **Range Calculation**: Captures the high and low during the opening period using real-time bar data.
- **Line Extension**: Lines are dynamically extended bar-by-bar within the session for clear visualization.
- **Signals**: 
  - Green triangle up: Crossover above ORH (potential bullish breakout).
  - Red triangle down: Crossunder below ORL (potential bearish breakout).
  - Yellow labels: Reversals from breakout levels back into the range.
- **Labels**: "RAM BAAN" marks the ORH (inspired by a precise arrow from the Ramayana), and "LAKSHMAN REKHA" marks the ORL (inspired by a protective boundary line from the same epic).
- **Customization**: Toggle signals on/off and select line styles (Dotted, Dashed, Solid, or Smoothed, with transparency for Smoothed).
The state-tracking logic prevents redundant signals by monitoring if price remains outside the range after a breakout. This helps users observe range-bound behavior or directional moves without built-in alerts. This indicator is particularly useful for day trading on longer intraday timeframes (e.g., 15-minute charts) to identify session-wide trends and avoid noise in shorter frames. For best results, apply on intraday timeframes on NSE/BSE symbols. Note that lines and labels are limited to the script's max counts to avoid performance issues on long histories.
**Disclaimer**: This indicator is for educational and informational purposes only and does not constitute financial, investment, or trading advice. Trading in financial markets involves significant risk of loss and is not suitable for all investors. Past performance is not indicative of future results. Users should conduct their own research, consider their financial situation, and consult with qualified professionals before making any investment decisions. The author and TradingView assume no liability for any losses incurred from its use.
PM Range Breaker [CHE]  PM Range Breaker   — Premarket bias with first-five range breaks, optional SWDEMA regime latch, and simple two-times-range targets
  Summary 
This indicator sets a once-per-day directional bias during New York premarket and then tracks a strict first-five-minutes range from the session open. After the first five complete, it marks clean breakouts and can project targets at two times the measured range. A second mode latches an EMA-based regime to inform the bias and optional background tinting. A compact panel reports live state, first-five levels, and rolling hit rates of both bias modes using a user-defined midday close for statistics.
  Motivation: Why this design? 
Intraday traders often get whipsawed by early noise or by fast flips in trend filters. This script commits to a bias at a single premarket minute and then waits for the market to present an objective structure: the first-five range. Breaks after that window are clearer and easier to manage. The alternative SWDEMA regime gives a slower, latched context for users who prefer a trend scaffold rather than a midpoint reference.
  What’s different vs. standard approaches? 
 Baseline: Typical open-range-breakout lines or a single moving-average filter without daily commitment.
 Architecture differences:
   Bias decision at a fixed New York time using either a midpoint lookback (“Classic”) or a two-EMA regime latch (“SWDEMA”).
   Strict five-minute window from session open; breakout shapes print only after that window.
   Single-shot breakout direction per session (debounce) and optional two-times-range targets.
   On-chart panel with hit rates using a configurable midday close for statistics.
 Practical effect: Cleaner visuals, fewer repeated signals, and a traceable daily decision that can be evaluated over time.
  How it works (technical) 
 Time handling uses New York session times for premarket decision, open, first-five end, and a midday statistics checkpoint.
 Classic bias: A midpoint is computed from the highest and lowest over a user period; at the premarket minute, the bias is set long when the close is above the midpoint, short otherwise.
 SWDEMA bias: Two EMAs define a regime score that requires price and trend agreement; when both agree on a confirmed bar, the regime latches. At the premarket minute, the daily bias is set from the current regime.
 The first-five range captures high and low from open until the end minute, then freezes. Breakouts are detected after that window using close-based cross logic.
 The script draws range lines and optional targets at two times the frozen range. A session break direction latch prevents duplicate break markers.
 Statistics compare daily open and a configurable midday close to record if the chosen bias aligned with the move.
 Optional elements include EMA lines, midpoint line, latched-regime background, and regime switch markers.
 Data aggregation for day logic and the first-five window is sampled on one-minute data with explicit lookahead off. On charts above one minute, values update intra-bar until the underlying minute closes.
  Parameter Guide 
Premarket Start (NY) — Minute when the bias is decided — Default: 08:30 — Move earlier for more stability; later for recency.
Market Open (NY) — Session start used for the first-five window — Default: 09:30 — Align to instrument’s RTH if different.
First-5 End (NY) — End of the first-five window — Default: 09:35 — Extend slightly to capture wider opening ranges.
Day End (NY) for Stats — Midday checkpoint for hit rate — Default: 12:00 — Use a later time for a longer evaluation window.
Show First-5 Lines — Draw the frozen range lines — Default: On — Turn off if your chart is crowded.
Show Bias Background (Session) — Tint by daily bias during session — Default: On — Useful for directional context.
Show Break Shapes — Print breakout triangles — Default: On — Disable if you only want lines and alerts.
Show 2R Targets (Optional) — Plot targets at two times the range — Default: On — Switch off if you manage exits differently.
Line Length Right — Extension length of drawn lines — Default: 20 (bars) — Increase for slower timeframes.
High/Low Line Colors — Visual colors for range levels — Defaults: Green/Red — Adjust to your theme.
Long/Short Bias Colors — Background tints — Defaults: Green/Red with high transparency — Lower transparency for stronger emphasis.
Show Corner Panel — Enable the info panel — Default: On — Centralizes status and numbers.
Show Hit Rates in Panel — Include success rates — Default: On — Turn off to reduce panel rows.
Panel Position — Anchor on chart — Default: Top right — Move to avoid overlap.
Panel Size — Text size in panel — Default: Small — Increase on high-resolution displays.
Dark Panel — Dark theme for the panel — Default: On — Match your chart background.
Show EMA Lines — Plot blue and red EMAs — Default: Off — Enable for SWDEMA context.
Show Midpoint Line — Plot the midpoint — Default: Off — Useful for Classic mode visualization.
Midpoint Lookback Period — Bars for high-low midpoint — Default: 300 — Larger values stabilize; smaller values respond faster.
Midpoint Line Color — Color for midpoint — Default: Gray — A neutral line works best.
SWDEMA Lengths (Blue/Red) — Periods for the two EMAs — Defaults: 144 and 312 — Longer values reduce flips.
Sources (Blue/Red) — Price sources — Defaults: Close and HLC3 — Adjust if you prefer consistency.
Offsets (Blue/Red) — Pixel offsets for EMA plots — Defaults: zero — Use only for visual shift.
Show Latched Regime Background — Background by SWDEMA regime — Default: Off — Separate from session bias.
Latched Background Transparency — Opacity of regime background — Default: eighty-eight — Lower value for stronger tint.
Show Latch Switch Markers — Plot regime change markers — Default: Off — For auditing regime changes.
Bias Mode — Classic midpoint or SWDEMA latch — Default: Classic — Choose per your style.
Background Mode — Session bias or SWDEMA regime — Default: Session — Decide which background narrative you want.
  Reading & Interpretation 
 Panel: Shows the active bias, first-five high and low, and a state that reads Building during the window, Ready once frozen, and Break arrows when a breakout occurs. Hit rates show the percentage of days where each bias mode aligned with the midday move.
 Colors and shapes: Green background implies long bias; red implies short bias. Triangle markers denote the first valid breakout after the first-five window. Optional regime markers flag regime changes.
 Lines: First-five high and low form the core structure. Optional targets mark a level at two times the frozen range from the breakout side.
  Practical Workflows & Combinations 
 Trend following: Choose a bias mode. Wait for the first clean breakout after the first-five window in the direction of the bias. Confirm with structure such as higher highs and higher lows or lower highs and lower lows.
 Exits and risk: Conservative users can trail behind the opposite side of the first-five range. Aggressive users can scale near the two-times-range target.
 Multi-asset and multi-TF: Works well on intraday timeframes from one minute upward. For non-US sessions, adjust the time inputs to the instrument’s regular trading hours.
  Behavior, Constraints & Performance 
 Repaint and confirmation: Bias and regime decisions use confirmed bars. Breakout signals evaluate on bar close at the chart timeframe. On higher timeframes, minute-based sources update within the live bar until the minute closes.
 security and HTF: The script samples one-minute data. Lookahead is off. Values stabilize once the source minute closes.
 Resources: `max_bars_back` is five thousand. Drawing objects and the panel update efficiently, with position extensions handled on the last bar.
 Known limits: Midday statistics use the configured time, not the official daily close. Session logic assumes New York session timing. Targets are simple multiples of the first-five range and do not adapt to volatility beyond that structure.
  Sensible Defaults & Quick Tuning 
Start with Classic bias, midpoint lookback at three hundred, and all visuals on.
 Too many flips in context → switch to SWDEMA mode or increase EMA lengths.
 Breakouts feel noisy → extend the first-five end by a minute or two, or wait for a retest by your own rules.
 Too sluggish → reduce midpoint lookback or shorten EMA lengths.
 Chart cluttered → hide EMA or midpoint lines and keep only range levels and breakout shapes.
  What this indicator is—and isn’t 
This is a visualization and signal layer for session bias and first-five structure. It does not manage orders, position sizing, or risk. It is not predictive. Use it alongside market structure, execution rules, and independent risk controls.
 Disclaimer 
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Do not use this indicator on Heikin-Ashi, Renko, Kagi, Point-and-Figure, or Range charts, as these chart types can produce unrealistic results for signal markers and alerts.
 Best regards and happy trading
Chervolino 
Many thanks to LonesomeTheBlue
 for the original work. I adapted the midpoint calculation for this script. www.tradingview.com 
Adaptive Trend Breaks Adaptive Trend Breaks 
## WHAT IT DOES
This script is a modified and enhanced version of "Trendline Breakouts With Targets" concept by ChartPrime. 
Adaptive Trend Breaks (ATB) is a trendline breakout system optimized for scalping liquid futures contracts. The indicator automatically draws dynamic support and resistance trendlines based on pivot points, then generates trade signals when price breaks through these levels with confirmation filters. It includes automated target and stop-loss placement with real-time P&L tracking in dollars.
## HOW IT WORKS
**Trendline Detection Method:**
The indicator uses pivot high/low detection to identify significant price turning points. When a new pivot forms, it calculates the slope between consecutive pivots to draw dynamic trendlines. These lines extend forward based on the established trend angle, creating actionable support and resistance zones.
**Band System:**
Around each trendline, the script creates a "band" using a volatility-adjusted calculation: `ATR(14) * 0.2 * bandwidth multiplier / 2`. This adaptive band accounts for current market conditions - wider during volatile periods, tighter during quiet markets.
**Breakout Logic:**
A breakout signal triggers when:
1. Price closes beyond the trendline + band zone
2. Volume exceeds the 20-period moving average by your set multiplier (default 1.2x)
3. Price is within Regular Trading Hours (9:30-16:00 EST) if session filter enabled
4. Current ATR meets minimum volatility threshold (prevents trading dead markets)
**Target & Stop Calculation:**
Upon breakout confirmation:
- **Entry**: Trendline breach point
- **Target**: Entry ± (bandwidth × target multiplier) - default 8x for quick scalps
- **Stop**: Entry ± (bandwidth × stop multiplier) - default 8x for 1:1 risk/reward
- Multipliers adjust automatically to market volatility through the ATR-based band
**P&L Conversion:**
The script converts point movements to dollars using:
```
Dollar P&L = (Price Points × Contract Point Value × Quantity)
```
For example, a 10-point NQ move with 2 contracts = 10 × $20 × 2 = $400
## HOW TO USE IT
**Setup:**
1. Select your instrument (NQ/ES/YM/RTY) - point values auto-configure
2. Set contract quantity for accurate dollar P&L
3. Choose pivot period (lower = more signals but more noise, default 5 for scalping)
4. Adjust bandwidth multiplier if trendlines are too tight/loose (1-5 range)
**Filters Configuration:**
- **Volume Filter**: Requires breakout volume > moving average × multiplier. Increase multiplier (1.5-2.0) for higher conviction trades
- **Session Filter**: Enable to trade only RTH. Disable for 24-hour trading
- **ATR Filter**: Prevents signals during low volatility. Increase minimum % for more active markets only
**Risk Management:**
- Set target/stop multipliers based on your risk tolerance
- 8x bandwidth = approximately 1:1 risk/reward for most liquid futures
- Enable trailing stops for trend-following approach (moves stop to protect profits)
- Adjust line length to see targets further into the future
**Statistics Table:**
- Choose timeframe to analyze: all-time, today, this week, custom days
- Monitor win rate, profit factor, and net P&L in dollars
- Track long vs short performance separately
- See real-time unrealized P&L on active trades
**Reading Signals:**
- **Green triangle below bar** = Long breakout (resistance broken)
- **Red triangle above bar** = Short breakout (support broken)
- **White dashed line** = Entry price
- **Orange line** = Take profit target with dollar value
- **Red line** = Stop loss with dollar value
- **Green checkmark (✓)** = Target hit, winning trade
- **Red X (✗)** = Stop hit, losing trade
## WHAT IT DOES NOT DO
**Limitations to Understand:**
- Does not predict future trendline formations - it reacts to breakouts after they occur
- Historical trendlines disappear after breakout (not kept on chart for clarity)
- Requires sufficient volatility - may not signal in extremely quiet markets
- Volume filter requires exchange volume data (not available on all symbols)
- Statistics are indicator-based simulations, not actual trading results
- Does not account for slippage, commissions, or order fills
## BEST PRACTICES
**Recommended Settings by Market:**
- **NQ (Nasdaq)**: Default settings work well, consider volume multiplier 1.3-1.5
- **ES (S&P 500)**: Slightly slower, try period 7-8, volume 1.2
- **YM (Dow)**: Lower volatility, reduce bandwidth to 1.5-2
- **RTY (Russell)**: Higher volatility, increase bandwidth to 3-4
**Risk Management:**
- Never risk more than 2-3% of account per trade
- Use contract quantity calculator: Max Risk $ ÷ (Stop Distance × Point Value)
- Start with 1 contract while learning the system
- Backtest your specific timeframe and instrument before live trading
**Optimization Tips:**
- Increase pivot period (7-10) for fewer but higher-quality signals
- Raise volume multiplier (1.5-2.0) in choppy markets
- Lower target/stop multipliers (5-6x) for tighter profit taking
- Use trailing stops in strong trending conditions
- Disable session filter for overnight gaps and Asia session moves
## TECHNICAL DETAILS
**Key Calculations:**
- Pivot Detection: `ta.pivothigh(high, period, period/2)` and `ta.pivotlow(low, period, period/2)`
- Slope Calculation: `(newPivot - oldPivot) / (newTime - oldTime)`
- Adaptive Band: `min(ATR(14) * 0.2, close * 0.002) * multiplier / 2`
- Breakout Confirmation: Price crosses trendline + 10% of band threshold
**Data Requirements:**
- Minimum bars in view: 500 for proper pivot calculation
- Volume data required for volume filter accuracy
- Intraday timeframes recommended (1min - 15min) for scalping
- Works on any timeframe but optimized for fast execution
**Performance Metrics:**
All statistics calculate based on indicator signals:
- Tracks every signal as a trade from entry to TP/SL
- P&L in actual contract dollar values
- Win rate = (Winning trades / Total trades) × 100
- Profit factor = Gross profit / Gross loss
- Separates long/short performance for bias analysis
## IDEAL FOR
- Futures scalpers and day traders
- Traders who prefer visual trendline breakouts
- Those wanting automated TP/SL placement
- Traders tracking performance in dollar terms
- Multiple timeframe analysis (compare 1min vs 5min signals)
## NOT SUITABLE FOR
- Swing trading (targets too close)
- Stocks/forex without modifying point values
- Extremely low timeframes (<30 seconds) - too much noise
- Markets without volume data if using volume filter
- Illiquid contracts (signals may not execute at shown prices)
---
**Settings Summary:**
- Core: Period, bandwidth, extension, trendline style
- Filters: Volume, RTH session, ATR volatility
- Risk: R:R ratio, target/stop multipliers, trailing stop
- Display: Stats table position, size, colors
- Stats: Timeframe selection (all-time to custom days)
**License:** This indicator is published open-source under Mozilla Public License 2.0. You may use and modify the code with proper attribution.
**Disclaimer:** This indicator is for educational purposes. Past performance does not guarantee future results. Always practice proper risk management and test thoroughly before live trading.
---
## CREDITS & ATTRIBUTION
This script builds upon the "Trendline Breakouts With Targets" concept by ChartPrime with significant enhancements:
**Major Improvements Added:**
- **Futures-Specific Calculations**: Automated dollar P&L conversion using actual contract point values (NQ=$20, ES=$50, YM=$5, RTY=$50)
- **Advanced Statistics Engine**: Comprehensive performance tracking with customizable timeframe analysis (today, week, month, custom ranges)
- **Multi-Layer Filtering System**: Volume confirmation, RTH session filter, and ATR volatility filter to reduce false signals
- **Professional Trade Management**: Enhanced visual trade tracking with separate TP/SL lines, dollar value labels, and optional trailing stops
- **Optimized for Scalping**: Faster pivot periods (5 vs 10), tighter bands, and reduced extension bars for quick entries
Original trendline detection methodology by ChartPrime - used with modification under Mozilla Public License 2.0.
Keltner Channel Enhanced [DCAUT]█ Keltner Channel Enhanced  
 📊 ORIGINALITY & INNOVATION 
The Keltner Channel Enhanced represents an important advancement over standard Keltner Channel implementations by introducing dual flexibility in moving average selection for both the middle band and ATR calculation. While traditional Keltner Channels typically use EMA for the middle band and RMA (Wilder's smoothing) for ATR, this enhanced version provides access to 25+ moving average algorithms for both components, enabling traders to fine-tune the indicator's behavior to match specific market characteristics and trading approaches.
 Key Advancements: 
 
 Dual MA Algorithm Flexibility: Independent selection of moving average types for middle band (25+ options) and ATR smoothing (25+ options), allowing optimization of both trend identification and volatility measurement separately
 Enhanced Trend Sensitivity: Ability to use faster algorithms (HMA, T3) for middle band while maintaining stable volatility measurement with traditional ATR smoothing, or vice versa for different trading strategies
 Adaptive Volatility Measurement: Choice of ATR smoothing algorithm affects channel responsiveness to volatility changes, from highly reactive (SMA, EMA) to smoothly adaptive (RMA, TEMA)
 Comprehensive Alert System: Five distinct alert conditions covering breakouts, trend changes, and volatility expansion, enabling automated monitoring without constant chart observation
 Multi-Timeframe Compatibility: Works effectively across all timeframes from intraday scalping to long-term position trading, with independent optimization of trend and volatility components
 
This implementation addresses key limitations of standard Keltner Channels: fixed EMA/RMA combination may not suit all market conditions or trading styles. By decoupling the trend component from volatility measurement and allowing independent algorithm selection, traders can create highly customized configurations for specific instruments and market phases.
 📐 MATHEMATICAL FOUNDATION 
Keltner Channel Enhanced uses a three-component calculation system that combines a flexible moving average middle band with ATR-based (Average True Range) upper and lower channels, creating volatility-adjusted trend-following bands.
 Core Calculation Process: 
 1. Middle Band (Basis) Calculation: 
The basis line is calculated using the selected moving average algorithm applied to the price source over the specified period:
 
basis = ma(source, length, maType)
 
Supported algorithms include EMA (standard choice, trend-biased), SMA (balanced and symmetric), HMA (reduced lag), WMA, VWMA, TEMA, T3, KAMA, and 17+ others.
 2. Average True Range (ATR) Calculation: 
ATR measures market volatility by calculating the average of true ranges over the specified period:
 
trueRange = max(high - low, abs(high - close ), abs(low - close ))
atrValue = ma(trueRange, atrLength, atrMaType)
 
ATR smoothing algorithm significantly affects channel behavior, with options including RMA (standard, very smooth), SMA (moderate smoothness), EMA (fast adaptation), TEMA (smooth yet responsive), and others.
 3. Channel Calculation: 
Upper and lower channels are positioned at specified multiples of ATR from the basis:
 
upperChannel = basis + (multiplier × atrValue)
lowerChannel = basis - (multiplier × atrValue)
 
Standard multiplier is 2.0, providing channels that dynamically adjust width based on market volatility.
 Keltner Channel vs. Bollinger Bands - Key Differences: 
While both indicators create volatility-based channels, they use fundamentally different volatility measures:
 Keltner Channel (ATR-based): 
 
 Uses Average True Range to measure actual price movement volatility
 Incorporates gaps and limit moves through true range calculation
 More stable in trending markets, less prone to extreme compression
 Better reflects intraday volatility and trading range
 Typically fewer band touches, making touches more significant
 More suitable for trend-following strategies
 
 Bollinger Bands (Standard Deviation-based): 
 
 Uses statistical standard deviation to measure price dispersion
 Based on closing prices only, doesn't account for intraday range
 Can compress significantly during consolidation (squeeze patterns)
 More touches in ranging markets
 Better suited for mean-reversion strategies
 Provides statistical probability framework (95% within 2 standard deviations)
 
 Algorithm Combination Effects: 
The interaction between middle band MA type and ATR MA type creates different indicator characteristics:
 
 Trend-Focused Configuration (Fast MA + Slow ATR): Middle band uses HMA/EMA/T3, ATR uses RMA/TEMA, quick trend changes with stable channel width, suitable for trend-following
 Volatility-Focused Configuration (Slow MA + Fast ATR): Middle band uses SMA/WMA, ATR uses EMA/SMA, stable trend with dynamic channel width, suitable for volatility trading
 Balanced Configuration (Standard EMA/RMA): Classic Keltner Channel behavior, time-tested combination, suitable for general-purpose trend following
 Adaptive Configuration (KAMA + KAMA): Self-adjusting indicator responding to efficiency ratio, suitable for markets with varying trend strength and volatility regimes
 
 📊 COMPREHENSIVE SIGNAL ANALYSIS 
Keltner Channel Enhanced provides multiple signal categories optimized for trend-following and breakout strategies.
 Channel Position Signals: 
 Upper Channel Interaction: 
 
 Price Touching Upper Channel: Strong bullish momentum, price moving more than typical volatility range suggests, potential continuation signal in established uptrends
 Price Breaking Above Upper Channel: Exceptional strength, price exceeding normal volatility expectations, consider adding to long positions or tightening trailing stops
 Price Riding Upper Channel: Sustained strong uptrend, characteristic of powerful bull moves, stay with trend and avoid premature profit-taking
 Price Rejection at Upper Channel: Momentum exhaustion signal, consider profit-taking on longs or waiting for pullback to middle band for reentry
 
 Lower Channel Interaction: 
 
 Price Touching Lower Channel: Strong bearish momentum, price moving more than typical volatility range suggests, potential continuation signal in established downtrends
 Price Breaking Below Lower Channel: Exceptional weakness, price exceeding normal volatility expectations, consider adding to short positions or protecting against further downside
 Price Riding Lower Channel: Sustained strong downtrend, characteristic of powerful bear moves, stay with trend and avoid premature covering
 Price Rejection at Lower Channel: Momentum exhaustion signal, consider covering shorts or waiting for bounce to middle band for reentry
 
 Middle Band (Basis) Signals: 
 Trend Direction Confirmation: 
 
 Price Above Basis: Bullish trend bias, middle band acts as dynamic support in uptrends, consider long positions or holding existing longs
 Price Below Basis: Bearish trend bias, middle band acts as dynamic resistance in downtrends, consider short positions or avoiding longs
 Price Crossing Above Basis: Potential trend change from bearish to bullish, early signal to establish long positions
 Price Crossing Below Basis: Potential trend change from bullish to bearish, early signal to establish short positions or exit longs
 
 Pullback Trading Strategy: 
 
 Uptrend Pullback: Price pulls back from upper channel to middle band, finds support, and resumes upward, ideal long entry point
 Downtrend Bounce: Price bounces from lower channel to middle band, meets resistance, and resumes downward, ideal short entry point
 Basis Test: Strong trends often show price respecting the middle band as support/resistance on pullbacks
 Failed Test: Price breaking through middle band against trend direction signals potential reversal
 
 Volatility-Based Signals: 
 Narrow Channels (Low Volatility): 
 
 Consolidation Phase: Channels contract during periods of reduced volatility and directionless price action
 Breakout Preparation: Narrow channels often precede significant directional moves as volatility cycles
 Trading Approach: Reduce position sizes, wait for breakout confirmation, avoid range-bound strategies within channels
 Breakout Direction: Monitor for price breaking decisively outside channel range with expanding width
 
 Wide Channels (High Volatility): 
 
 Trending Phase: Channels expand during strong directional moves and increased volatility
 Momentum Confirmation: Wide channels confirm genuine trend with substantial volatility backing
 Trading Approach: Trend-following strategies excel, wider stops necessary, mean-reversion strategies risky
 Exhaustion Signs: Extreme channel width (historical highs) may signal approaching consolidation or reversal
 
 Advanced Pattern Recognition: 
 Channel Walking Pattern: 
 
 Upper Channel Walk: Price consistently touches or exceeds upper channel while staying above basis, very strong uptrend signal, hold longs aggressively
 Lower Channel Walk: Price consistently touches or exceeds lower channel while staying below basis, very strong downtrend signal, hold shorts aggressively
 Basis Support/Resistance: During channel walks, price typically uses middle band as support/resistance on minor pullbacks
 Pattern Break: Price crossing basis during channel walk signals potential trend exhaustion
 
 Squeeze and Release Pattern: 
 
 Squeeze Phase: Channels narrow significantly, price consolidates near middle band, volatility contracts
 Direction Clues: Watch for price positioning relative to basis during squeeze (above = bullish bias, below = bearish bias)
 Release Trigger: Price breaking outside narrow channel range with expanding width confirms breakout
 Follow-Through: Measure squeeze height and project from breakout point for initial profit targets
 
 Channel Expansion Pattern: 
 
 Breakout Confirmation: Rapid channel widening confirms volatility increase and genuine trend establishment
 Entry Timing: Enter positions early in expansion phase before trend becomes overextended
 Risk Management: Use channel width to size stops appropriately, wider channels require wider stops
 
 Basis Bounce Pattern: 
 
 Clean Bounce: Price touches middle band and immediately reverses, confirms trend strength and entry opportunity
 Multiple Bounces: Repeated basis bounces indicate strong, sustainable trend
 Bounce Failure: Price penetrating basis signals weakening trend and potential reversal
 
 Divergence Analysis: 
 
 Price/Channel Divergence: Price makes new high/low while staying within channel (not reaching outer band), suggests momentum weakening
 Width/Price Divergence: Price breaks to new extremes but channel width contracts, suggests move lacks conviction
 Reversal Signal: Divergences often precede trend reversals or significant consolidation periods
 
 Multi-Timeframe Analysis: 
Keltner Channels work particularly well in multi-timeframe trend-following approaches:
 Three-Timeframe Alignment: 
 
 Higher Timeframe (Weekly/Daily): Identify major trend direction, note price position relative to basis and channels
 Intermediate Timeframe (Daily/4H): Identify pullback opportunities within higher timeframe trend
 Lower Timeframe (4H/1H): Time precise entries when price touches middle band or lower channel (in uptrends) with rejection
 
 Optimal Entry Conditions: 
 
 Best Long Entries: Higher timeframe in uptrend (price above basis), intermediate timeframe pulls back to basis, lower timeframe shows rejection at middle band or lower channel
 Best Short Entries: Higher timeframe in downtrend (price below basis), intermediate timeframe bounces to basis, lower timeframe shows rejection at middle band or upper channel
 Risk Management: Use higher timeframe channel width to set position sizing, stops below/above higher timeframe channels
 
 🎯 STRATEGIC APPLICATIONS 
Keltner Channel Enhanced excels in trend-following and breakout strategies across different market conditions.
 Trend Following Strategy: 
 Setup Requirements: 
 
 Identify established trend with price consistently on one side of basis line
 Wait for pullback to middle band (basis) or brief penetration through it
 Confirm trend resumption with price rejection at basis and move back toward outer channel
 Enter in trend direction with stop beyond basis line
 
 Entry Rules: 
 Uptrend Entry: 
 
 Price pulls back from upper channel to middle band, shows support at basis (bullish candlestick, momentum divergence)
 Enter long on rejection/bounce from basis with stop 1-2 ATR below basis
 Aggressive: Enter on first touch; Conservative: Wait for confirmation candle
 
 Downtrend Entry: 
 
 Price bounces from lower channel to middle band, shows resistance at basis (bearish candlestick, momentum divergence)
 Enter short on rejection/reversal from basis with stop 1-2 ATR above basis
 Aggressive: Enter on first touch; Conservative: Wait for confirmation candle
 
 Trend Management: 
 
 Trailing Stop: Use basis line as dynamic trailing stop, exit if price closes beyond basis against position
 Profit Taking: Take partial profits at opposite channel, move stops to basis
 Position Additions: Add to winners on subsequent basis bounces if trend intact
 
 Breakout Strategy: 
 Setup Requirements: 
 
 Identify consolidation period with contracting channel width
 Monitor price action near middle band with reduced volatility
 Wait for decisive breakout beyond channel range with expanding width
 Enter in breakout direction after confirmation
 
 Breakout Confirmation: 
 
 Price breaks clearly outside channel (upper for longs, lower for shorts), channel width begins expanding from contracted state
 Volume increases significantly on breakout (if using volume analysis)
 Price sustains outside channel for multiple bars without immediate reversal
 
 Entry Approaches: 
 
 Aggressive: Enter on initial break with stop at opposite channel or basis, use smaller position size
 Conservative: Wait for pullback to broken channel level, enter on rejection and resumption, tighter stop
 
 Volatility-Based Position Sizing: 
Adjust position sizing based on channel width (ATR-based volatility):
 
 Wide Channels (High ATR): Reduce position size as stops must be wider, calculate position size using ATR-based risk calculation: Risk / (Stop Distance in ATR × ATR Value)
 Narrow Channels (Low ATR): Increase position size as stops can be tighter, be cautious of impending volatility expansion
 ATR-Based Risk Management: Use ATR-based risk calculations, position size = 0.01 × Capital / (2 × ATR), use multiples of ATR (1-2 ATR) for adaptive stops
 
 Algorithm Selection Guidelines: 
Different market conditions benefit from different algorithm combinations:
 
 Strong Trending Markets: Middle band use EMA or HMA, ATR use RMA, capture trends quickly while maintaining stable channel width
 Choppy/Ranging Markets: Middle band use SMA or WMA, ATR use SMA or WMA, avoid false trend signals while identifying genuine reversals
 Volatile Markets: Middle band and ATR both use KAMA or FRAMA, self-adjusting to changing market conditions reduces manual optimization
 Breakout Trading: Middle band use SMA, ATR use EMA or SMA, stable trend with dynamic channels highlights volatility expansion early
 Scalping/Day Trading: Middle band use HMA or T3, ATR use EMA or TEMA, both components respond quickly
 Position Trading: Middle band use EMA/TEMA/T3, ATR use RMA or TEMA, filter out noise for long-term trend-following
 
 📋 DETAILED PARAMETER CONFIGURATION 
Understanding and optimizing parameters is essential for adapting Keltner Channel Enhanced to specific trading approaches.
 Source Parameter: 
 
 Close (Most Common): Uses closing price, reflects daily settlement, best for end-of-day analysis and position trading, standard choice
 HL2 (Median Price): Smooths out closing bias, better represents full daily range in volatile markets, good for swing trading
 HLC3 (Typical Price): Gives more weight to close while including full range, popular for intraday applications, slightly more responsive than HL2
 OHLC4 (Average Price): Most comprehensive price representation, smoothest option, good for gap-prone markets or highly volatile instruments
 
 Length Parameter: 
Controls the lookback period for middle band (basis) calculation:
 
 Short Periods (10-15): Very responsive to price changes, suitable for day trading and scalping, higher false signal rate
 Standard Period (20 - Default): Represents approximately one month of trading, good balance between responsiveness and stability, suitable for swing and position trading
 Medium Periods (30-50): Smoother trend identification, fewer false signals, better for position trading and longer holding periods
 Long Periods (50+): Very smooth, identifies major trends only, minimal false signals but significant lag, suitable for long-term investment
 
 Optimization by Timeframe:  1-15 minute charts use 10-20 period, 30-60 minute charts use 20-30 period, 4-hour to daily charts use 20-40 period, weekly charts use 20-30 weeks.
 ATR Length Parameter: 
Controls the lookback period for Average True Range calculation, affecting channel width:
 
 Short ATR Periods (5-10): Very responsive to recent volatility changes, standard is 10 (Keltner's original specification), may be too reactive in whipsaw conditions
 Standard ATR Period (10 - Default): Chester Keltner's original specification, good balance between responsiveness and stability, most widely used
 Medium ATR Periods (14-20): Smoother channel width, ATR 14 aligns with Wilder's original ATR specification, good for position trading
 Long ATR Periods (20+): Very smooth channel width, suitable for long-term trend-following
 
 Length vs. ATR Length Relationship:  Equal values (20/20) provide balanced responsiveness, longer ATR (20/14) gives more stable channel width, shorter ATR (20/10) is standard configuration, much shorter ATR (20/5) creates very dynamic channels.
 Multiplier Parameter: 
Controls channel width by setting ATR multiples:
 
 Lower Values (1.0-1.5): Tighter channels with frequent price touches, more trading signals, higher false signal rate, better for range-bound and mean-reversion strategies
 Standard Value (2.0 - Default): Chester Keltner's recommended setting, good balance between signal frequency and reliability, suitable for both trending and ranging strategies
 Higher Values (2.5-3.0): Wider channels with less frequent touches, fewer but potentially higher-quality signals, better for strong trending markets
 
 Market-Specific Optimization:  High volatility markets (crypto, small-caps) use 2.5-3.0 multiplier, medium volatility markets (major forex, large-caps) use 2.0 multiplier, low volatility markets (bonds, utilities) use 1.5-2.0 multiplier.
 MA Type Parameter (Middle Band): 
Critical selection that determines trend identification characteristics:
 
 EMA (Exponential Moving Average - Default): Standard Keltner Channel choice, Chester Keltner's original specification, emphasizes recent prices, faster response to trend changes, suitable for all timeframes
 SMA (Simple Moving Average): Equal weighting of all data points, no directional bias, slower than EMA, better for ranging markets and mean-reversion
 HMA (Hull Moving Average): Minimal lag with smooth output, excellent for fast trend identification, best for day trading and scalping
 TEMA (Triple Exponential Moving Average): Advanced smoothing with reduced lag, responsive to trends while filtering noise, suitable for volatile markets
 T3 (Tillson T3): Very smooth with minimal lag, excellent for established trend identification, suitable for position trading
 KAMA (Kaufman Adaptive Moving Average): Automatically adjusts speed based on market efficiency, slow in ranging markets, fast in trends, suitable for markets with varying conditions
 
 ATR MA Type Parameter: 
Determines how Average True Range is smoothed, affecting channel width stability:
 
 RMA (Wilder's Smoothing - Default): J. Welles Wilder's original ATR smoothing method, very smooth, slow to adapt to volatility changes, provides stable channel width
 SMA (Simple Moving Average): Equal weighting, moderate smoothness, faster response to volatility changes than RMA, more dynamic channel width
 EMA (Exponential Moving Average): Emphasizes recent volatility, quick adaptation to new volatility regimes, very responsive channel width changes
 TEMA (Triple Exponential Moving Average): Smooth yet responsive, good balance for varying volatility, suitable for most trading styles
 
 Parameter Combination Strategies: 
 
 Conservative Trend-Following: Length 30/ATR Length 20/Multiplier 2.5, MA Type EMA or TEMA/ATR MA Type RMA, smooth trend with stable wide channels, suitable for position trading
 Standard Balanced Approach: Length 20/ATR Length 10/Multiplier 2.0, MA Type EMA/ATR MA Type RMA, classic Keltner Channel configuration, suitable for general purpose swing trading
 Aggressive Day Trading: Length 10-15/ATR Length 5-7/Multiplier 1.5-2.0, MA Type HMA or EMA/ATR MA Type EMA or SMA, fast trend with dynamic channels, suitable for scalping and day trading
 Breakout Specialist: Length 20-30/ATR Length 5-10/Multiplier 2.0, MA Type SMA or WMA/ATR MA Type EMA or SMA, stable trend with responsive channel width
 Adaptive All-Conditions: Length 20/ATR Length 10/Multiplier 2.0, MA Type KAMA or FRAMA/ATR MA Type KAMA or TEMA, self-adjusting to market conditions
 
 Offset Parameter: 
Controls horizontal positioning of channels on chart. Positive values shift channels to the right (future) for visual projection, negative values shift left (past) for historical analysis, zero (default) aligns with current price bars for real-time signal analysis. Offset affects only visual display, not alert conditions or actual calculations.
 📈 PERFORMANCE ANALYSIS & COMPETITIVE ADVANTAGES 
Keltner Channel Enhanced provides improvements over standard implementations while maintaining proven effectiveness.
 Response Characteristics: 
 
 Standard EMA/RMA Configuration: Moderate trend lag (approximately 0.4 × length periods), smooth and stable channel width from RMA smoothing, good balance for most market conditions
 Fast HMA/EMA Configuration: Approximately 60% reduction in trend lag compared to EMA, responsive channel width from EMA ATR smoothing, suitable for quick trend changes and breakouts
 Adaptive KAMA/KAMA Configuration: Variable lag based on market efficiency, automatic adjustment to trending vs. ranging conditions, self-optimizing behavior reduces manual intervention
 
 Comparison with Traditional Keltner Channels: 
 Enhanced Version Advantages: 
 
 Dual Algorithm Flexibility: Independent MA selection for trend and volatility vs. fixed EMA/RMA, separate tuning of trend responsiveness and channel stability
 Market Adaptation: Choose configurations optimized for specific instruments and conditions, customize for scalping, swing, or position trading preferences
 Comprehensive Alerts: Enhanced alert system including channel expansion detection
 
 Traditional Version Advantages: 
 
 Simplicity: Fewer parameters, easier to understand and implement
 Standardization: Fixed EMA/RMA combination ensures consistency across users
 Research Base: Decades of backtesting and research on standard configuration
 
 When to Use Enhanced Version:  Trading multiple instruments with different characteristics, switching between trending and ranging markets, employing different strategies, algorithm-based trading systems requiring customization, seeking optimization for specific trading style and timeframe.
 When to Use Standard Version:  Beginning traders learning Keltner Channel concepts, following published research or trading systems, preferring simplicity and standardization, wanting to avoid optimization and curve-fitting risks.
 Performance Across Market Conditions: 
 
 Strong Trending Markets: EMA or HMA basis with RMA or TEMA ATR smoothing provides quicker trend identification, pullbacks to basis offer excellent entry opportunities
 Choppy/Ranging Markets: SMA or WMA basis with RMA ATR smoothing and lower multipliers, channel bounce strategies work well, avoid false breakouts
 Volatile Markets: KAMA or FRAMA with EMA or TEMA, adaptive algorithms excel by automatic adjustment, wider multipliers (2.5-3.0) accommodate large price swings
 Low Volatility/Consolidation: Channels narrow significantly indicating consolidation, algorithm choice less impactful, focus on detecting channel width contraction for breakout preparation
 
 Keltner Channel vs. Bollinger Bands - Usage Comparison: 
 Favor Keltner Channels When:  Trend-following is primary strategy, trading volatile instruments with gaps, want ATR-based volatility measurement, prefer fewer higher-quality channel touches, seeking stable channel width during trends.
 Favor Bollinger Bands When:  Mean-reversion is primary strategy, trading instruments with limited gaps, want statistical framework based on standard deviation, need squeeze patterns for breakout identification, prefer more frequent trading opportunities.
 Use Both Together:  Bollinger Band squeeze + Keltner Channel breakout is powerful combination, price outside Bollinger Bands but inside Keltner Channels indicates moderate signal, price outside both indicates very strong signal, Bollinger Bands for entries and Keltner Channels for trend confirmation.
 Limitations and Considerations: 
 General Limitations: 
 
 Lagging Indicator: All moving averages lag price, even with reduced-lag algorithms
 Trend-Dependent: Works best in trending markets, less effective in choppy conditions
 No Direction Prediction: Indicates volatility and deviation, not future direction, requires confirmation
 
 Enhanced Version Specific Considerations: 
 
 Optimization Risk: More parameters increase risk of curve-fitting historical data
 Complexity: Additional choices may overwhelm beginning traders
 Backtesting Challenges: Different algorithms produce different historical results
 
 Mitigation Strategies: 
 
 Use Confirmation: Combine with momentum indicators (RSI, MACD), volume, or price action
 Test Parameter Robustness: Ensure parameters work across range of values, not just optimized ones
 Multi-Timeframe Analysis: Confirm signals across different timeframes
 Proper Risk Management: Use appropriate position sizing and stops
 Start Simple: Begin with standard EMA/RMA before exploring alternatives
 
 Optimal Usage Recommendations: 
 For Maximum Effectiveness: 
 
 Start with standard EMA/RMA configuration to understand classic behavior
 Experiment with alternatives on demo account or paper trading
 Match algorithm combination to market condition and trading style
 Use channel width analysis to identify market phases
 Combine with complementary indicators for confirmation
 Implement strict risk management using ATR-based position sizing
 Focus on high-quality setups rather than trading every signal
 Respect the trend: trade with basis direction for higher probability
 
 Complementary Indicators: 
 
 RSI or Stochastic: Confirm momentum at channel extremes
 MACD: Confirm trend direction and momentum shifts
 Volume: Validate breakouts and trend strength
 ADX: Measure trend strength, avoid Keltner signals in weak trends
 Support/Resistance: Combine with traditional levels for high-probability setups
 Bollinger Bands: Use together for enhanced breakout and volatility analysis
 
 USAGE NOTES 
This indicator is designed for technical analysis and educational purposes. Keltner Channel Enhanced has limitations and should not be used as the sole basis for trading decisions. While the flexible moving average selection for both trend and volatility components provides valuable adaptability across different market conditions, algorithm performance varies with market conditions, and past characteristics do not guarantee future results.
Key considerations:
 
 Always use multiple forms of analysis and confirmation before entering trades
 Backtest any parameter combination thoroughly before live trading
 Be aware that optimization can lead to curve-fitting if not done carefully
 Start with standard EMA/RMA settings and adjust only when specific conditions warrant
 Understand that no moving average algorithm can eliminate lag entirely
 Consider market regime (trending, ranging, volatile) when selecting parameters
 Use ATR-based position sizing and risk management on every trade
 Keltner Channels work best in trending markets, less effective in choppy conditions
 Respect the trend direction indicated by price position relative to basis line
 
The enhanced flexibility of dual algorithm selection provides powerful tools for adaptation but requires responsible use, thorough understanding of how different algorithms behave under various market conditions, and disciplined risk management.
GRG/RGR Signal, MA, Ranges and PivotsThis indicator is a combination of several indicators. 
It is a combination of two of my indicators which I solely use for trading
 1. EMA 10-20-50-200, Pivots and Previous Day/Week/Month range 
 2. 3/4-Bar GRG / RGR Pattern (Conditional 4th Candle) 
You can use them individually if you already have some of them or just use this one. Belive me when I say, this is all you need, along with market structure knowlege and even if you don’t have that, this indicator has been doing wonders for me. This is all I use. I do not use anything else.
 **Note  - Do checkout the indicators individually as I have added valuable information in the comment section.
It contains the following,
 1. 10 EMA/SMA - configurable
2. 20 EMA/SMA - configurable
3. 50 EMA/SMA - configurable
4. 200 EMA/SMA - configurable
5. Previous Day's Range - configurable
6. Previous Week's Range - configurable 
7. Previous Month's Range - configurable 
8. Pivots - configurable 
9. Buy Sell Signal - configurable  
 The Moving Averages 
It is a very important combination and using it correctly with price action will strengthen your entries and exits.
The ema's or sma's added are the most powerful ones and they do definitely act as support and resistance.
 The Daily/Weekly/Monthly Ranges 
The Daily/Weekly/Monthly ranges are extremely important for any trader and should be used for targets and reversals.
 Pivots 
Pivots can provide support and resistance level. R5 and S5 can be used to check for over stretched conditions. You can customise them however you like. It is a full pivot indicator. 
It is defaulted to show R5 and S5 only to reduce noise in the chart but it can be customised. 
 The 3/4 RGR or GRG Signal Generator  
Combined with a 3/4 RGR or GRG setup can be all a trader needs.
You don't need complex strategies and SMC concepts to trade. Simple EMAs, ranges and RGR/GRG setup is the most winning combination.
This indicator can be used to identify the Green-Red-Green or Red-Green-Red pattern.
It is a price action indicator where a price action which identifies the defeat of buyers and sellers.
If the buyers comprehensively defeat the sellers then the price moves up and if the sellers defeat the buyers then the price moves down.
In my trading experience this is what defines the price movement.
It is a 3 or 4 candle pattern, beyond that i.e, 5 or more candles could mean a very sideways market and unnecessary signal generation.
 How does it work? 
 Upside/Green signal 
1. Say candle 1 is Green, which means buyers stepped in, then candle 2 is Red or a Doji, that means sellers brought the price down. Then if candle 3 is forming to be Green and breaks the closing of the 1st candle and opening of the 2nd candle, then a green arrow will appear and that is the place where you want to take your trade.
2. Here the buyers defeated the sellers.
3. Sometimes candle 3 falls short but candle 4 breaks candle 1's closing and candle 2's opening price. We can enter on candle 4.
4. Important - We need to enter the trade as soon as the price moves above the candle 1 and 2's body and should not wait for the 3rd or 4th candle to close. Ignore wicks.
5. But for a more optimised entry I have added an option to use candle’s highs and lows instead of open and close. This reduces lot of noise and provides us with more precise entry. This setting is turned on by default.
6. I have restricted it to 4 candles and that is all that is needed. More than that is a longer sideways market.
7. I call it the +-+ or GRG pattern or Green-Red-Green or Buyer-Seller-Buyer or Seller defeated or just Buyer pattern.
8. Stop loss can be candle 2's mid for safe traders (that includes me) or candle 2's body low for risky traders.
9. Back testing suggests that body low will be useless and result in more points in loss because for the bigger move this point will not be touched, so why not get out faster.
 Downside/Red signal 
1. Say candle 1 is Red, which means sellers stepped in, then candle 2 is Green or a Doji, that means buyers took the price up. Then if candle 3 is forming to be Red and breaks the closing of the 1st candle and opening of the 2nd candle then a Red arrow will appear and that is the place where you want to take your trade.
2. Sometimes candle 3 falls short but candle 4 breaks candle 1's closing and candle 2's opening price. We can enter on candle 4.
3. We need to enter the trade as soon as the price moves below the candle 1 and 2's body and should not wait for the 3rd or 4th candle to close.
4. But for a more optimised entry I have added an option to use candle’s highs and lows instead of open and close. This reduces lot of noise and provides us with more precise entry. This setting is turned on by default.
5. I have restricted it to 4 candles and that is all that is needed. More than that is a longer sideways market.
6. I call it the -+- or RGR pattern or Red-Green-Red or Seller-Buyer-Seller or Buyer defeated or just Seller pattern.
7. Stop loss can be candle 2's mid for safe traders ( that includes me) or candle 2's body high for risky traders.
8. Back testing suggests that body high will be useless and result in more points in loss because for the bigger move this point will not be touched, so why not get out faster.
 Combining Indicators and Signal 
Combining these indicators with GRG/RGR signal can be very powerful and can provide big moves.
1.  MA crossover and Signal -  This is very powerful and provides a very big move. Trades can be held for longer. If after taking the trade we notice that the MA crossover has happened then trades can be held for higher targets.
2.  Pivots and Signal -  Pivots and add a support or resistance point. Take profits on these points. R5/S5 are over streched conditions so we can start looking for reversal signals and ignore other signals
3.  Intraday Range -  first 1, 5, 15 min of the day - Sideways days is when price will stay in these ranges. You can take profits at these ranges or if the range is broken and we get a signal, then it can mean that the direction will be sustained.
4.   Previous Day/Week/Month Ranges -  These can be used as Take Profit points if the price is moving towards them after getting the signal. If the range is broken and we get a signal then it can be a strong signal. They can also be used as reversal points if a strong signal is generated.
 Important Settings 
1. Include 4th Candle Confirmation - You can enable or disable the 4th candle signal to avoid the noise, but at times I have noticed that the 4th candle gives a very strong signal or I can say that the strong signal falls on the 4th candle. This is mostly a coincidence.
2. Bars to check (default 10) - You can also configure how many previous bars should the signal be generated for. 10 to 30 is good enough. To backtest increase it to 2000 or 5000 for example.
3. Use Candle High/Low for confirmation instead of Candle Open/Close - More optimized entry and noise reduction. This option is now defaulted to false.
4. Show Green-Red-Green (bull) signals - Show only bull entries. Useful when I have a predefined view i.e, I know market is going to go up today.
5. Show Red-Green-Red (bear) signals - Show only bear entries. Useful when I have a predefined view i.e, I know market is going to go down today.
6. 3rd candle should be a Strong candle before considering 4th candle - This will enforce additional logic in 4 candle setup that the 3rd candle is the candle in our direction of breakout. This means something like GRGG is mandatory, which is still the default behaviour. If disabled, the 3rd candle can be any candle and 4th candle will act as our breakout candle. This behaviour has led to breakouts and breakdowns as times, hence I added this as a separate feature. Vice-versa for a RGGR.
	For a 4 candle setup till now we were expecting GRGG or RGRR but we can let the system ignore the 3rd candle completely if needed.
	This will result in additional signals.
7. Three intraday ranges added for index and stock traders - 1 min, 5 min and 15 min ranges will be displayed. These are disabled by default except 15 min. These are very important ranges and in sideways days the price will usually move within the 15 min. A breakout of this range and a positive signal can be a very powerful setup.
	Safe traders can avoid taking a trade in this range as it can lead to fakeouts.
	The line style, width, color and opacity are configurable.
 Pointers/Golden Rules 
1. If after taking the trade, the next candle moves in your direction and closes strong bullish or bearish, then move SL to break even and after that you can trail it.
2. If a upside trade hits SL and immediately a down side trade signal is generated on the next candle then take it. Vice versa is true.
3. Trades need to be taken on previous 2 candle's body high or low combined and not the wicks.
4. The most losses a trader takes is on a sideways day and because in our strategy the stop loss is so small that even on a sideways day we'll get out with a little profit or worst break even.
5. Hold trades for longer targets and don't panic.
6. If last 3-4 days have been sideways then there is a good probability that today will be trending so we can hold our trade for longer targets. Inverse is true when the market has been trending for 2-3 days then volatility followed by sideways is coming (DOW theory). Target to hold the trade for whole day and not exit till the day closes.
7. In general avoid trading in the middle of the day for index and stocks. Divide the day into 3 parts and avoid the middle.
8. Use Support/Resistance, 10, 20, 50, 200 EMA/SMA, Gaps, Whole/Round numbers(very imp) for identifying targets.
9. Trail your SL.
10. For indexes I would use 5 min and 15 min timeframe and at times 10 mins.
11. For commodities and crypto we can use higher timeframe as well. Look for signals during volatile time durations and avoid trading the whole day. Signal usually gives good targets on those times.
12. If a GRG or RGR pattern appears on a daily timeframe then this is our time to go big.
13. Minimum Risk to Reward should be 1:2 and for longer targets can be 1:4 to 1:10.
14. Trade with small lot size. Money management will happen automatically.
15. With small lot size and correct Risk-Reward we can be very profitable. Don't trade with big lot size.
16. Stay in the market for longer and collect points not money.
17. Very imp - Watch market and learn to generate a market view.
18. Very imp - Only 3 type of candles are needed in trading - 
Strong Bullish (Big Green candle), Strong Bearish (Big Red candle), 
Hammer (it is Strong Bullish), Inverse Hammer (it is Strong Bearish) 
and Doji (indecision or confusion). 
If on daily timeframe I see Strong Bullish candle previous day then I am biased to the upside the next day, if I see Strong Bearish candle the previous day then I am biased to the downside the next day, if I see Doji on the previous day then I am cautious the next day, if there are back to back Dojis forming in daily or weekly then I am preparing for big move so time to go big once I get the signal.
19. Most Important Candlestick pattern - Bullish and Bearish Engulfing
20. The only Chart patterns I need - 
a) Falling Wedge/Channel Bullish Pattern Uptrend or Bull Flag - Buying - Forming over a couple days for intraday and forming over a couple of weeks for swing 
b) Falling Wedge/Channel  Bullish Pattern Downtrend or Falling Channel - Buying
c) Rising Wedge Bearish Pattern Uptrend or Rising Channel - Selling
d) Rising Wedge Bearish Pattern Downtrend or Bear flag - Selling
e) Head and Shoulder - Over a longer period not for intraday. In 15 min takes few days and for swing 1hr or 4h or daily can take few days
f) M and W pattern - Reversal Patterns - They form within the above 4 patterns, usually resulting in the break of trend line
21. How Gaps work - 
a) Small Gap up in Uptrend - Market can fill the gap and reverse. The perception is that people are buying. If previous day candle was Strong Bullish then market view is up.
b) Big Gap up in Uptrend - Not news driven - Profit booking will come but may not fill the entire gap
c) Big Gap up in Uptrend - News driven, war related, tax, interest rate - Market can keep going up without stopping.
c) Flat opening in Uptrend - Big chance of market going up. If previous day candle was Strong Bullish then view is upwards, if it was Doji then still upwards.
d) Gap down in Uptrend - Market is surprised. After going down initially it can go up
e) Small Gap down in Downtrend - Market can fill the gap and keep moving down. If previous day candle was Strong Bearish then view is still down.
f) Flat opening in Downtrend - View is down, short today.
g) Big Gap down in Downtrend - Profit booking and foolish buying will come but market view is still down.
h) Gap down with News - Volatility, sideways then down. 
i) Gap Up in Downtrend - Can move up - Price can move up during 2/3rd of the day and End of the day revert and close in red.
22. Go big on bearish days for option traders. Puts are better bought and Calls are better sold.
23. Cluster of green signals can lead to bigger move on the upside and vice versa for red signals.
24. Most of this is what I learned from successful traders (from the top 2%) only the indicator is mine.
Camarilla Pivots + 20 EMA StrategyThis is an intraday volatility and trend-following system for commodities like Natural Gas, combining dynamic pivot levels (Camarilla) with a trend filter (20-period EMA) to improve risk-reward and reduce false breakouts.
Core Components
1. Camarilla Pivots:
These are special support and resistance levels (H3, H4, L3, L4) calculated each day based on the previous day's high, low, and close.
The pivots adapt to daily volatility, giving more relevant breakout and bounce zones than static lines.
H4: Aggressive resistance (used for breakout LONG entry)
H3: Moderate resistance/support (used for bounce or stoploss)
L4: Aggressive support (used for breakout SHORT entry)
L3: Moderate support/resistance (used for bounce or stoploss)
2. 20 EMA (Exponential Moving Average):
Plotted on the 30-minute chart, this acts as a trend filter.
If the price is above 20 EMA: Only look for long trades (bullish bias).
If below 20 EMA: Only look for short trades (bearish bias).
How the Strategy Works
Setup (30-Min Chart):
Camarilla pivots for the day are drawn on the chart.
20 EMA is also plotted.
Trade Filter:
Bullish: Trade ONLY if price is above 20 EMA.
Bearish: Trade ONLY if price is below 20 EMA.
Entry:
LONG: Enter when price breaks and closes above the H4 pivot AND is above 20 EMA.
SHORT: Enter when price breaks and closes below the L4 pivot AND is below 20 EMA.
Stop Loss:
LONG: Place stoploss at H3 (the next lower Camarilla resistance).
SHORT: Place stoploss at L3 (the next higher Camarilla support).
Target:
Always set a profit target at 2x the distance (risk) between entry and stoploss (strict R:R 2).
For example, if your entry is at H4 and stoploss at H3, your target is entry + 2*(entry - stoploss).
Alerts & Visuals:
The strategy plots entry arrows, stoploss and target lines for immediate visual reference.
Alerts trigger on breakout signals so you never miss a trade.
Why This Works Well for Natural Gas
Adapts to volatility: The pivots change daily, handling wide-ranging and choppy price moves better than fixed breakouts.
Trend filter: EMA prevents counter-trend whipsaws, only trades with market momentum.
Risk control: Every trade must meet strict risk-reward criteria, so losses are contained and winners can outweigh losers.
Trend/Range Composite (Single-Line) v1.4🔹 Step 1: Add it to your chart
Copy the whole script.
In TradingView → Pine Editor → paste it.
Click Add to chart.
It will show a white line in a subwindow, plus thresholds at 40 and 60, and a colored background.
Optional: You’ll see a status box (top-right of chart) with details like ADX, ATR, slope, etc.
🔹 Step 2: Understand the Score
The indicator compresses all signals into a 0–100 “Trend Strength Score”:
≥ 60 = TREND (teal background)
→ Market is trending, consider trend strategies like vertical spreads, runners, breakouts.
≤ 40 = RANGE (orange background)
→ Market is choppy/sideways, consider range strategies like butterflies, condors, mean-reversion fades.
40–60 = MIXED (gray background)
→ Indecision / chop. Best to reduce size or wait for clarity.
🔹 Step 3: Use with Your Trading Plan
Intraday (5m, 15m, 30m)
Score < 40 → play support/resistance bounces, fade extremes.
Score > 60 → play momentum breakouts or pullback continuations.
Daily chart
Good for swing context (is this month trending or just chopping?).
🔹 Step 4: Alerts
You can set TradingView alerts:
Cross above 60 → market entering trend mode.
Cross below 40 → market entering range mode.
Useful if you don’t want to watch constantly.
🔹 Step 5: Confirm with Price Levels
The score tells you “trend vs range”, but you still need levels:
If score < 40 → mark PDH / PDL (previous day high/low), VAH/VAL, VWAP. Expect rejections/fades.
If score > 60 → watch for breakouts beyond PDH/PDL or supply/demand zones.
RVol+ Enhanced Relative Volume Indicator📊 RVol+ Enhanced Relative Volume Indicator
Overview
RVol+ (Relative Volume Plus) is an advanced time-based relative volume indicator designed specifically for swing traders and breakout detection. Unlike simple volume comparisons, RVol+ analyzes volume at the same time of day across multiple sessions, providing statistically significant insights into institutional activity and breakout potential.
🎯 Key Features
Core Volume Analysis
Time-Based RVol Calculation - Compares current cumulative volume to the average volume at this exact time over the past N days
Statistical Z-Score - Measures volume in standard deviations from the mean for true anomaly detection
Volume Percentile - Shows where current volume ranks historically (0-100%)
Sustained Volume Filter - 3-bar moving average prevents false signals from single-bar spikes
Breakout Detection
🚀 Confirmed Breakouts - Identifies price breakouts validated by high volume (RVol > 1.5x)
⚠️ False Breakout Warnings - Alerts when price breaks key levels on low volume (high failure risk)
Multi-Timeframe Context - Weekly volume overlay prevents chasing daily noise
Advanced Metrics
OBV Divergence Detection - Spots bullish/bearish accumulation/distribution patterns
Volume Profile Integration - Identifies institutional positioning
Money Flow Analysis - Tracks smart money vs retail activity
Extreme Volume Alerts - 🔥 Labels mark unusual spikes beyond the display cap
Visual Intelligence
Smart Color Coding:
🟢 Bright Teal = High activity (RVol ≥ 1.5x)
🟡 Medium Teal = Caution zone (RVol ≥ 1.2x)
⚪ Light Teal = Normal activity
🟠 Orange = Breakout confirmed
🔴 Red = False breakout risk
Comprehensive Stats Table:
Current Volume (formatted as M/K/B)
RVol ratio
Z-Score with significance
Volume percentile
Historical average and standard deviation
Sustained volume confirmation
📈 How to Use
For Swing Trading (1D - 3W Holds)
Perfect Setup:
✓ RVol > 1.5x (bright teal)
✓ Z-Score > 2.0 (⚡ alert)
✓ Percentile > 90%
✓ Sustained = ✓
✓ 🚀 Breakout label appears
Avoid:
✗ Red "Low Vol" warning during breakouts
✗ RVol < 1.0 at key levels
✗ Sustained volume not confirmed
Signal Interpretation
⚡ Z>2 Labels - Statistically significant volume (95th+ percentile) - highest probability moves
↗️ OBV+ Labels - Bullish accumulation (OBV rising while price consolidates)
↘️ OBV- Labels - Bearish distribution (OBV falling while price rises)
🔵 Blue Background - Weekly volume elevated (confirms daily strength)
⚙️ Customization
Basic Settings
N Day Average - Number of historical days for comparison (default: 5)
RVol Thresholds - Customize highlight levels (default: 1.2x, 1.5x)
Visual Display Cap - Prevent extreme spikes from compressing view (default: 4.0x)
Advanced Metrics (Toggle On/Off)
Z-Score analysis
Weekly RVol context
OBV divergence detection
Volume percentile ranking
Breakout signal generation
Table Customization
Position - 9 placement options to avoid chart overlap
Size - Tiny to Huge
Colors - Full customization of positive/negative/neutral values
Transparency - Adjustable background
Debug Mode
Enable Pine Logs for calculation transparency
Adjustable log frequency
Real-time calculation breakdown
🔬 Technical Details
Algorithm:
Binary search for historical lookups (O(log n) performance)
Time-zone aware session detection
DST-safe timestamp calculations
Exponentially weighted standard deviation
Anti-repainting architecture
Performance:
Optimized for max_bars_back = 5000
Efficient array management
Built-in function optimization
Memory-conscious data structures
📊 What Makes RVol+ Different?
vs. Standard Volume:
Context-aware (time-of-day matters)
Statistical significance testing
False breakout filtering
vs. Basic RVol:
Z-Score normalization (2-3 sigma detection)
Multi-timeframe confirmation
OBV divergence integration
Sustained volume filtering
Smart visual scaling
vs. Professional Tools:
Free and open-source
Fully customizable
No black-box algorithms
Educational debug logs
💡 Best Practices
Wait for Confirmation - Don't enter on first bar; wait for sustained volume ✓
Combine with Price Action - RVol validates, price structure determines entry
Weekly Context Matters - Blue background = institutional interest
Z-Score is King - Focus on ⚡ alerts for highest probability
Avoid Low Volume Breakouts - Red ⚠️ labels = high failure risk
🎓 Trading Psychology
Volume precedes price. When RVol+ shows:
High RVol + Rising OBV = Accumulation before breakout
High RVol at Resistance = Test of conviction
Low RVol on Breakout = Retail-driven (fade candidate)
Z-Score > 3 = Potential "whale" positioning
📝 Credits
Based on the time-based RVol concept from /u/HurlTeaInTheSea, enhanced with:
Statistical analysis (z-scores, percentiles)
Multi-timeframe integration
OBV divergence detection
Professional-grade visualization
Swing trading optimization
🔧 Version History
v2.0 - Enhanced Edition
Added Z-Score analysis
Multi-timeframe volume context
OBV divergence detection
Breakout confirmation system
Smart color coding
Customizable stats table
Debug logging mode
Performance optimizations
📚 Learn More
For optimal use with swing trading:
Combine with support/resistance levels
Watch for volume clusters in consolidation
Use weekly timeframe for trend confirmation
Monitor OBV divergence for early warnings
⚠️ Disclaimer
This indicator is for educational purposes. Volume analysis is one component of trading decisions. Always use proper risk management, consider multiple timeframes, and validate signals with price structure. Past performance does not guarantee future results.
🚀 Getting Started
Add indicator to chart
Adjust "N Day Average" to your preference (5-10 days typical)
Position stats table to avoid overlap
Enable features you want to monitor
Watch for 🚀 breakout confirmations!
Happy Trading! 📈
Intraday Momentum for Volatile Stocks 29.09The strategy targets intraday momentum breakouts in volatile stocks when the broader market (Nifty) is in an uptrend. It enters long positions when stocks move significantly above their daily opening price with sufficient volume confirmation, then manages the trade using dynamic ATR-based stops and profit targets.
Entry Conditions
Price Momentum Filter: The stock must move at least 2.5% above its daily opening price, indicating strong bullish momentum. This percentage threshold is customizable and targets gap-up scenarios or strong intraday breakouts.
Volume Confirmation: Daily cumulative volume must exceed the 20-day average volume, ensuring institutional participation and genuine momentum. This prevents false breakouts on low volume.
Market Regime Filter: The Nifty index must be trading above its 50-day SMA, indicating a favorable market environment for momentum trades. This macro filter helps avoid trades during bearish market conditions.
Money Flow Index: MFI must be above 50, confirming buying pressure and positive money flow into the stock. This adds another layer of momentum confirmation.
Time Restriction: Trades are only initiated before 3:00 PM to ensure sufficient time for position management and avoid end-of-day volatility.
Exit Management
ATR Trailing Stop Loss: Uses a 3x ATR multiplier for dynamic stop-loss placement that trails higher highs, protecting profits while giving trades room to breathe. The trailing mechanism locks in gains as the stock moves favorably.
Profit Target: Set at 4x ATR above the entry price, providing a favorable risk-reward ratio based on the stock's volatility characteristics. This adaptive approach adjusts targets based on individual stock behavior.
Position Reset: Both stops and targets reset when not in a position, ensuring fresh calculations for each new trade.
Key Strengths
Volatility Adaptation: The ATR-based approach automatically adjusts risk parameters to match current market volatility levels. Higher volatility stocks get wider stops, while calmer stocks get tighter management.
Multi-Timeframe Filtering: Combines intraday price action with daily volume patterns and market regime analysis for robust signal generation.
Risk Management Focus: The strategy prioritizes capital preservation through systematic stop-loss placement and position sizing considerations.
Considerations for NSE Trading
This strategy appears well-suited for NSE intraday momentum trading, particularly for mid-cap and small-cap stocks that exhibit high volatility. The Nifty filter helps align trades with broader market sentiment, which is crucial in the Indian market context where sectoral and index movements strongly influence individual stocks.
The 2.5% threshold above open price is appropriate for volatile NSE stocks, though traders might consider adjusting this parameter based on the specific stocks being traded. The strategy's emphasis on volume confirmation is particularly valuable in the NSE environment where retail participation can create misleading price movements without institutional backin






















