Hareketli Ortalamalar
Heikinisi Candle (With MA + Smoothing + Buy/Sell with Cooldown)This custom Heikinisi Candle (With MA + Smoothing + Buy/Sell with Cooldown) indicator combines the advantages of Heikin-Ashi candles with the flexibility of multiple moving averages and smoothing options. The built-in buy/sell signals with cooldown functionality help traders avoid overtrading while capturing trend reversals and momentum shifts. Whether you're a day trader, swing trader, or long-term investor, this indicator offers powerful tools for analyzing price action and making informed trading decisions.
Note: Disable the regular candle to get better visualization.
Key Features:
Custom Heikin-Ashi Candles:
The core feature of this script is the Heikin-Ashi candles, which are known for smoothing price action and helping traders identify market trends more clearly.
Unlike traditional Heikin-Ashi, this version adjusts the Heikin-Ashi close based on specific price action patterns, including rejection signals and engulfing patterns.
The custom Heikin-Ashi open also incorporates momentum, adjusting dynamically based on recent price changes.
Price Action Measurements:
The indicator measures key price action components, including:
Body: The absolute difference between the open and close.
Candle Range: The total range from high to low.
Upper Wick: The distance from the highest price to the maximum of open or close.
Lower Wick: The distance from the lowest price to the minimum of open or close.
These measurements help detect bullish and bearish conditions, as well as price rejection signals.
Buy/Sell Signal Logic:
Buy Signal: Triggered when the Heikin-Ashi close is above the chosen moving average (MA1), with a cooldown period to avoid too frequent signals.
Sell Signal: Triggered when the Heikin-Ashi close falls below the MA1 after a buy signal has already been issued.
The cooldown period ensures that buy and sell signals are spaced apart by a specific number of bars, preventing excessive signal generation during periods of price consolidation.
Multiple Moving Averages (MA):
This script supports up to three customizable moving averages (MA1, MA2, MA3), each of which can be set to different types and lengths, including:
Simple Moving Average (SMA)
Exponential Moving Average (EMA)
Weighted Moving Average (WMA)
Volume Weighted Moving Average (VWMA)
Volume Weighted Moving Price (VWMP)
Least Squares Moving Average (LSMA)
Hull Moving Average (HMA)
Double Exponential Moving Average (DEMA)
Triple Exponential Moving Average (TEMA)
Users can adjust the length and type of each MA for tailored analysis.
Smoothing Options for MAs:
Users can smooth the output of MAs using various types of smoothing algorithms (SMA, EMA, LSMA, WMA, Gaussian) and a customizable length. This helps to reduce noise in the moving average lines and provides clearer signals.
Gaussian Filter (Advanced Smoothing):
A Gaussian Filter is available as a smoothing option for MAs. This filter reduces noise and makes the moving averages smoother, which can be particularly helpful in volatile or choppy markets.
Alerts and Visualization:
The script allows users to plot buy and sell signals on the chart with distinctive markers. A Buy Signal is shown below the bar with a lime green marker and text "Buy," while a Sell Signal is shown above the bar with a red marker and text "Sell."
Traders can also set up alerts based on the buy/sell signals to get notified in real time.
Indicator Configuration:
Heikin-Ashi Candle Configuration:
Automatically adjusts Heikin-Ashi candles based on rejection signals, engulfing patterns, and momentum. It uses custom formulas for the Heikin-Ashi open and close, making it more sensitive to price action than standard Heikin-Ashi candles.
Moving Averages (MA) Configuration:
You can select from multiple moving average types and lengths (MA1, MA2, MA3) for trend-following analysis.
Choose between SMA, EMA, WMA, VWMA, VWMP, LSMA, HMA, DEMA, and TEMA.
Smoothing Options:
Enable or disable smoothing for the moving averages.
Select from different smoothing types, including SMA, EMA, RMA, WMA, LSMA, and Gaussian.
Cooldown Period:
Control the number of bars that must pass before a new buy/sell signal is triggered. This cooldown period helps prevent excessive trading signals in quick succession.
How to Use:
Analyze Price Action with Heikin-Ashi Candles:
The custom Heikin-Ashi candles are ideal for spotting market trends, reversals, and price rejection. Use the candle patterns to gauge the market sentiment.
Use MAs for Trend Confirmation:
The moving averages (MA1, MA2, MA3) can help identify the prevailing trend. A price above a rising MA indicates an uptrend, while a price below a falling MA suggests a downtrend.
Trigger Buy and Sell Signals:
When the Heikin-Ashi close crosses above MA1, a buy signal is triggered.
When the Heikin-Ashi close crosses below MA1 after a buy signal, a sell signal is triggered.
The cooldown period ensures that signals are spaced out, preventing overtrading.
Use Smoothing for Clearer Signals:
If you are trading in a volatile market, you can use the smoothing options to make the MAs smoother and reduce noise.
DavSabs - Triple EMA 5>10 strategy + MACD and RSIThis is one of my favorite buy sell strategies and I'm holding on to this for now.
I have perfected buy sell signals with shorter EMA and made soft red and green if MACD and RSI is not supporting the buy.
Strong Green Buy signal = 5>10 EMA AND price over 30 EMA.
Soft Green if buy green signal = above and MACD < signal line or RSI < RSI-based EMA
Strong RED Sell signal = Price close below 10 EMA
Soft Red sell signal = above and MACD > signal line or RSI > RSI-based EMA
Always add your own analysis.
Best EMA FinderBASED ON BEST SMA FINDER BY Julien_Eche
Purpose
Identifies the single most robust exponential moving average (EMA) length on any chart by backtesting every EMA from 10 to 1000 periods and ranking them by a custom “robustness” score.
Core Logic
Backtest loop: For each EMA length, run either a “Long Only” or “Buy & Sell” backtest.
Metrics computed:
Total trades
Profit factor (gross profit / gross loss)
Win rate
Robustness score = Profit Factor × √(Win Rate) × log(Trades)
Filter: Discard any EMA with fewer trades than the user‐defined minimum.
Select: Choose the EMA length with the highest robustness score.
Visualization
Plots the optimal EMA in blue on your chart.
Optionally displays a table (top-right) showing the chosen EMA length, trade count, profit factor, win rate, and robustness score.
User Inputs
Strategy Type: “Long Only” or “Buy & Sell”
Minimum Trades: Exclude under-sampled EMAs
Show Stats Table: Toggle summary display
Use Case
Perfect for traders who want to automatically pick an EMA that’s historically balanced between profitability and consistency—no manual trial-and-error needed.
Limitations
No position sizing, stops, or profit targets
Only one open trade per direction
Intended as an exploratory optimization tool, not a full trading system.
US30 HMA Signal v2.8Indicator Description – US30 HMA Signal v2.8
Overview:
The US30 HMA Signal indicator is designed to generate Buy and Sell signals based on the crossover of three Hull Moving Averages (HMAs). The indicator focuses on identifying momentum shifts and directional bias using the 9, 21, and 50 HMA structures, optimised for the US30 (Dow Jones) index.
⸻
Indicator Components:
1. Hull Moving Averages (HMAs):
• 9 HMA (Green): Fastest HMA, responds quickly to price changes.
• 21 HMA (Amber): Medium-term HMA, acts as a transitional filter.
• 50 HMA (Red): Slowest HMA, defines the broader trend direction.
⸻
Logic and Signal Conditions:
1. Session Filter:
• Signals are only generated during the US session, defined as starting at 13:30 BST.
2. Directional Bias:
• Bullish Bias: Occurs when both the 9 HMA and 21 HMA are above the 50 HMA.
• Bearish Bias: Occurs when both the 9 HMA and 21 HMA are below the 50 HMA.
3. Crossover Logic:
• Buy Signal: Prints when the 9 HMA crosses above the 21 HMA while the directional bias is bullish.
• Sell Signal: Prints when the 9 HMA crosses below the 21 HMA while the directional bias is bearish.
4. Minimum Bar Spacing:
• To avoid signal clustering, a minimum bar spacing of 5 bars is implemented between consecutive signals.
⸻
Plotting:
• Buy Signal: Displays as a green label below the candle with the text “BUY.”
• Sell Signal: Displays as a red label above the candle with the text “SELL.”
⸻
Purpose and Usage:
• The indicator is designed for traders looking to capture momentum shifts in the US30 index using HMA crossovers.
• It is best applied on the 5-minute timeframe to balance signal frequency and reliability.
• The strict session filter ensures signals are only generated during the most volatile period, aligning with US market activity.
Support BandsSupport Bands – Discount Zones for Bitcoin
⚡Overview:
-The Support Bands indicator identifies one of the most tested and respected support zones for Bitcoin using moving averages from higher timeframes.
-These zones are visualized through colored bands (blue, white, and violet), simplifying the decision making process especially for less experienced traders who seek high-probability areas to accumulate Bitcoin during retracements.
-Band levels are based on manual backtesting and real-world price behavior throughout Bitcoin’s history.
-Each zone reflects a different degree of support strength, from temporary pullback zones to historical bottoms.
⚡️ Key Characteristics:
-Highlights discount zones where Bitcoin has historically shown strong reactions.
-Uses 3 different levels of supports based on EMA/SMA combinations.
-Offers a clean, non-intrusive overlay that reduces chart clutter.
⚡ How to Use:
-Open your chart on the 1W timeframe and select the BTC Bitstamp or BLX symbol, as they provide the most complete historical data, ensuring optimal performance of the indicator.
-Use the bands as reference zones for support and potential pullbacks.
- Level 3 (violet band) historically marks the bottom of Bitcoin bear markets and is ideal for long-term entries during deep corrections.
- Level 2 (white band) often signals macro reaccumulation zones but usually requires 1–3 months of consolidation before a breakout. If the price closes below and then retests this level as resistance for 1–2 weekly candles, it often marks the start of a macro downtrend.
-Level 1 (blue band) acts as short-term support during strong bullish moves, typically after a successful rebound from Level 2.
⚡ What Makes It Unique:
- This script merges moving averages per level into three simplified bands for clearer analysis.
-Reduces chart noise by avoiding multiple overlapping lines, helping you make faster and cleaner decisions.
- Built from manual market study based on recurring Bitcoin behavior, not just random code.
-Historically backtested:
-Level 3 (violet band) until today has always marked the bitcoin bearmarket bottom.
- Level 2 (white band) is the strongest support during bull markets; losing it often signals a macro trend reversal.
- Level 1 is frequently retested during impulsive rallies and can act as short-term support or resistance.
⚡ Disclaimer:
-This script is a visual tool to assist with market analysis.
-It does not generate buy or sell signals, nor does it predict future movements.
-Historical performance is not indicative of future results.
-Always use independent judgment and proper risk management.
⚡ Why Use Support Bands:
-Ideal for traders who want clarity without dozens of lines on their charts.
- Helps identify logical zones for entry or reaccumulation.
- Based on actual market behavior rather than hypothetical setups.
-If the blue band (Level 1) doesn't hold as support, the price often moves to the white band (Level 2), and if that fails too, the violet band (Level 3) is typically the last strong support. By dividing your capital into three planned entries, one at each level,you can manage risk more effectively compared to entering blindly without this structure.
SMA ExtensionsExplanation of the SMA Extensions Indicator
The SMA Extensions indicator, designed for TradingView, overlays a 200-period Simple Moving Average (SMA) and its extensions (1.5x, 2x, 2.5x, 3x) on the price chart to identify price zones. Users can customize the SMA source, length, and line colors (default: blue, green, yellow, orange, red). Each level is plotted as a line, with transparent colored fills between them and below the SMA to highlight zones. Labels ("Very Cheap," "Cheap," "Fair Value," "Expensive," "Very Expensive") appear only on the last bar, slightly right-shifted, matching line colors for clarity. This helps traders assess whether prices are undervalued or overvalued relative to the SMA.
The idea originated from a video from the YouTube channel Crypto Currently
HMA 200 + EMA 20 Crossover StrategyThis strategy combines a long-term trend filter using the Hull Moving Average (HMA 200) with a short-term entry trigger using the Exponential Moving Average (EMA 20).
📈 Entry Logic:
Buy Entry: When price is above the HMA 200 and crosses above the EMA 20.
Sell Entry: When price is below the HMA 200 and crosses below the EMA 20.
The strategy closes the current position and reverses on the opposite signal.
⚙️ Strategy Settings (Backtest Configuration):
Position size: 10% of equity per trade
Commission: 0.1% per trade (to simulate broker fees)
Slippage: 2 ticks (to reflect realistic fill conditions)
✅ Purpose:
This script is designed to identify high-probability trades in the direction of the overall trend, avoiding whipsaw conditions. It is useful for traders looking for a dynamic crossover-based system that filters trades based on longer-term momentum.
🔎 Make sure to test across multiple assets and timeframes. For best results, apply this strategy to liquid trending markets like major FX pairs, indices, or high-cap stocks.
Moving Average Channel Avancé# Moving Average Channel Avancé (MAC)
This versatile TradingView indicator provides a dynamic channel around a central moving average, offering a comprehensive tool for trend identification, volatility assessment, and potential entry/exit signals.
## Key Features:
* **Flexible Moving Average Core:** Choose from a variety of popular moving average types (SMA, EMA, WMA, VWMA, HMA, TEMA) to serve as the baseline for your channel. Customize the length and price source for tailored analysis.
* **Multiple Channel Calculation Methods:**
* **Standard Deviation:** Creates Bollinger Band-like channels based on price volatility.
* **ATR (Average True Range):** Generates Keltner Channel-style bands that adapt to market volatility.
* **Percentage:** Defines channel width as a fixed percentage of the moving average.
* **Donchian:** Uses highest highs and lowest lows over a specified period to form the channel.
* **Visual Customization:**
* Toggle visibility of the midline, channel fill, and breakout signals.
* Full color customization for upper/lower bands, midline, channel fill, and bullish/bearish breakout signals.
* **Breakout Signals:** Displays arrows when the price crosses above the lower band (potential buy) or below the upper band (potential sell).
* **Overbought/Oversold Visualization:** Bar coloring highlights potential overbought (price near upper band) and oversold (price near lower band) conditions.
* **Information Panel:** A convenient on-chart table displays the selected MA type and the current price position within the channel as a percentage.
* **Alert Conditions:** Set up alerts for:
* Price crossing above/below the upper band.
* Price crossing above/below the lower band.
* Overbought and oversold conditions.
## How to Use:
The Moving Average Channel Avancé can be used in various ways:
* **Trend Following:** Trade in the direction of the channel. When the price is consistently above the midline and respecting the lower band as support, it can indicate an uptrend. Conversely, price action below the midline, with the upper band acting as resistance, can suggest a downtrend.
* **Volatility Breakouts:** Look for price breakouts above the upper band or below the lower band as potential entry signals, especially when accompanied by increased volume.
* **Mean Reversion:** In ranging markets, prices may tend to revert towards the central moving average after touching the outer bands.
* **Support and Resistance:** The channel bands can act as dynamic levels of support and resistance.
This indicator is designed to be intuitive for novice traders while offering the depth of customization that experienced analysts require. Experiment with different settings and MA types to find what best suits your trading style and the specific market you are analyzing.
RSI-WMA + EMA Trend Filter | Signal OnlyThis is the specialized Indicator to create the internal Strategy for the class of Rio & Friend base on RSI-WMA with the EMA Trend Filter.
Enjoy and have fun with it!
RSI-WMA + EMA Trend Filter | Signal OnlyThis is the specialized indicator representing the internal strategy created by RIO for the Trading Career 2025 Class.
Enjoy and have fun by using it if you feel the option being suitable for your trading!
EMA Breakdown Strategytake sell position when price crosses below ema take a short position when price crosses below green candel low target size of green candle SL high of green candel RR 1:1
Grid + Trade Annotations & Liquidations## Introducing the “Grid + Trade Annotations & Liquidations” Pine Script Strategy
Imagine you could overlay a perfectly-spaced price grid on your favorite chart, backtest a simple moving-average crossover, see exactly where trades would have fired off in the past—and even know at what price you’d have been liquidated if you were running at 10× leverage. That’s exactly what this all-in-one TradingView **Pine Script® v6** strategy delivers.
### Why you’ll love it
* **Visual clarity:** A fixed-interval horizontal grid, centered on each bar’s close, helps you instantly spot round-number levels (e.g. every \$0.50).
* **Trade annotations:** Every historical entry/exit is automatically marked with arrows and labels—no more scrolling through Trade History.
* **Liquidation lines:** For each entry, the script computes your theoretical liquidation price, based on your chosen leverage, and draws it as a dashed line.
* **Performance metrics:** Total return, maximum drawdown, Sharpe ratio, and win rate are calculated and displayed on-chart, so you don’t have to wrestle with spreadsheets.
---
## How it’s structured
The code lives in a single **strategy**—add it via **Pine Editor → New Strategy** and click **Add to Chart**. Internally, it’s broken into four main sections:
1. **Grid setup:**
* **Inputs:** `gridStep`, `aboveLines`, `belowLines`, `gridColor`, `gridStyle`, `gridWidth`.
* **Persistent array:** stores `line` objects so they survive bar updates.
* **Draw/update logic:** on each confirmed historical bar, the script either recreates all lines (when you change the count) or simply repositions them around the new close.
2. **Entry/exit logic & annotations:**
* **Example system:** 20-period vs. 50-period simple moving-average crossover.
* **Labels & shapes:**
* Green triangles for long entries/exits, red for short.
* A “Long Liq:” or “Short Liq:” label at the point of entry.
3. **Liquidation calculations:**
* **Formula:**
* Long: `P_liq = P_entry × (1 − 1⁄L)`
* Short: `P_liq = P_entry × (1 + 1⁄L)`
* Let the script draw a dashed red (for longs) or dashed green (for shorts) line at each `P_liq`.
4. **Performance metrics:**
* **Built-ins:**
* `strategy.netprofit_percent` → total return %
* `strategy.max_drawdown_percent` → max drawdown %
* `strategy.wintrades` / `strategy.closedtrades` → win rate %
* **Sharpe ratio:** manually computed from per-bar returns, assuming a user-defined risk-free rate and bars-per-year count.
---
## Using & customizing the strategy
1. **Add to your chart.**
* Copy the full script into Pine Editor, select **Strategy**, and hit **Add to Chart**.
2. **Tune your grid.**
* **`Grid Interval ($)`**: e.g. `0.50` for \$0.50 steps.
* **`Lines Above`/`Below`**: how many lines to show on each side of the current price.
* **`Grid Style`**: choose Solid, Dashed, or Dotted; set line width and opacity via the color picker.
3. **Adjust your trading logic.**
* Out of the box, the script uses SMA(20) vs. SMA(50). Swap in any `ta.*` indicator calls you like.
4. **Set leverage & capital.**
* **`Leverage`**: affects the liquidation price.
* **`Initial Capital`** and **`Order Size`**: the strategy uses 100% of equity per trade by default—you can change that in the `strategy()` call.
5. **Review performance.**
* Metrics show up in the Strategy Tester and on-chart label.
* If you want data in the Data Window, expand the script’s name to see the hidden plots for return, drawdown, Sharpe, and win rate.
---
## Behind the code
Below is a high-level walkthrough of the key snippets:
```pinescript
//@version=6
strategy("Grid + Annotations & Liquidations", overlay=true,
initial_capital=100000, default_qty_type=strategy.percent_of_equity,
default_qty_value=100)
// ─ Grid inputs & style mapping ────────────────────────────────────────
gridStep = input.float(0.50, "Grid Interval ($)", minval=0)
aboveLines = input.int(5, "Lines Above", minval=0)
belowLines = input.int(5, "Lines Below", minval=0)
gridColor = input.color(color.new(color.gray, 80), "Grid Color")
gridStyle = input.string("Dashed", "Grid Style", options= )
gridWidth = input.int(1, "Grid Line Width", minval=1, maxval=5)
gridStyleConst = gridStyle == "Solid" ? line.style_solid :
gridStyle == "Dotted"? line.style_dotted :
line.style_dashed
```
* We map a simple string choice into Pine’s `line.style_*` constants.
* `gridStep` drives the spacing in dollars.
```pinescript
// Persist & update lines only when needed
var line gridLines = array.new_line()
if barstate.islastconfirmedhistory
total = aboveLines + belowLines + 1
if array.size(gridLines) != total
// delete & recreate
…
else
// only reposition
…
```
* Wrapping all drawing in `barstate.islastconfirmedhistory` avoids repaint issues.
* The script deletes and rebuilds lines only when you change `aboveLines`/`belowLines`, otherwise it simply moves them.
```pinescript
// MA crossover logic & liquidation labels
fast = ta.sma(close, 20)
slow = ta.sma(close, 50)
if ta.crossover(fast, slow)
strategy.entry("Long", strategy.long)
liq = close * (1 - 1.0 / leverage)
label.new(bar_index, low, text="Long Liq: " + str.tostring(liq))
line.new(…, y1=liq, y2=liq, color=color.red, style=line.style_dashed)
```
* Entries trigger both the `strategy.entry` call and a pair of visual cues: a label and a dashed line at the computed liquidation price.
```pinescript
// Performance metrics: draw from built-ins + manual Sharpe
totalRet = strategy.netprofit_percent
maxDD = strategy.max_drawdown_percent
winRate = strategy.closedtrades > 0 ?
(strategy.wintrades / strategy.closedtrades)*100 : 0
// Manual Sharpe calculation
… accumulate per-bar % returns … compute mean, stddev … apply formula …
```
* TradingView gives us return, drawdown, and trade counts out of the box.
* We calculate Sharpe ourselves so you can adjust the risk-free rate and periods per year.
---
## Wrapping up
This one-file strategy is designed to be both **educational** and **practical**:
* **Learn by reading:** every section is commented so you can see how Pine v6 handles arrays, loops, strategy functions, and labels.
* **Customize for your edge:** swap in your own indicators, change leverage, or hook up alerts.
* **Publish & share:** drop it into your public repo with this story as your README, and fellow traders will know exactly how to use it.
Feel free to fork, file issues, or submit pull requests. Happy charting—and may your grid lines always align!
RSIOMA IndicatorI trust the RSIOMA by itself when I am at work, on the road, at play, and using only my cell phone.
When I find the long, high plateau or the bottom river bed, my attention perks up.
I examine the nearby timeframes to see if there are any similar patterns.
Please don't use any of the middle crosses; they don't have the power out of the gate that the flat ones do.
I wait and wait for the smaller timeframe to make its cross and add one position.
At every pullback, I start adding positions. Each of you needs to become comfortable with this indicator and start trusting it first.
I am guilty of fading this flat top or bottom, but they can go forever, it seems.
But then that 200-point bar drops, and all the pain goes away with a considerable profit.
I reset and start scanning other charts for the same.
Davsabs 10-20-50 EMA strategyThis is a 10-20-50 day EMA strategy.
Buy signals are generated on price being over the 50 EMA, 10 EMA over the 20 EMA.
Sell signals are generated when price closed below the 10 ema
Moving Averages with ADR%/ATR/52W TableOption to select Moving Averages as per different time frames.
ADR%: It should be above 5% as it is a sign of strength and stop loss should be lower than the ADR%. It should be calculated for last 20 Days.
ATR%: It is calculated as per the previous 14 Candles.
Minervini’s 52-Week High and Low Principles:
52-Week High:
Key Principle: Minervini prefers stocks trading near or at their 52-week highs, as this indicates strong bullish momentum and institutional buying interest. A stock at or close to its 52-week high is often breaking out of consolidation or resistance, signaling potential for further upside.
Criteria:
The stock should ideally be within 25% of its 52-week high (i.e., no more than 25% below the high). This is considered the “pivot point” or “buy zone” where the stock is still in a strong uptrend.
A breakout above the 52-week high, especially on high volume, is a bullish signal, often marking the start of a new uptrend.
Rationale: Stocks near their 52-week highs are less likely to face overhead resistance (supply from previous buyers at higher prices) and are attractive to momentum traders and institutions.
52-Week Low:
Key Principle: Minervini advises avoiding stocks trading close to their 52-week lows, as they often indicate weakness, lack of demand, or bearish sentiment. Instead, he looks for stocks that are significantly above their 52-week lows, demonstrating strength and recovery.
Criteria:
The stock should be at least 30% above its 52-week low to confirm it has moved away from a downtrend and is showing relative strength.
Stocks too close to their 52-week lows are considered risky, as they may be in a prolonged downtrend or lack institutional support.
Rationale: A stock well above its 52-week low has likely absorbed selling pressure and is attracting buyers, indicating a healthier trend and potential for further gains.
Application in Trading:
Stock Selection: Minervini uses these criteria as part of his SEPA (Specific Entry Point Analysis) methodology to filter stocks. Stocks meeting the 52-week high/low criteria are more likely to be in a “Stage 2” uptrend (per his adaptation of Stan Weinstein’s stage analysis).
Breakout Strategy: He focuses on buying stocks breaking out from consolidation patterns (e.g., volatility contractions, cup-and-handle) near their 52-week highs, ideally with strong volume and tight price action.
Risk Management: Stocks too far from their 52-week highs or too close to their 52-week lows may have higher risk, either due to overextension or lack of momentum.
Dynamic Color Logic in Your Script:
Based on our previous discussions, your Pine Script incorporates Minervini’s criteria for dynamic coloring in the ADR%/ATR/52W Table:
Below 52-Week High: Text turns green if the stock is within -25% to 0% of the 52-week high (i.e., high_52w_dist >= -25 and high_52w_dist <= 0), highlighting stocks in the bullish “buy zone.”
Above 52-Week Low: Text turns green if the stock is ≥30% above the 52-week low (i.e., low_52w_dist >= 30), indicating strength and distance from weakness.
These thresholds align with Minervini’s principles to visually flag stocks meeting his momentum criteria.
Integration with Your Pine Script:
Your script already implements Minervini’s 52-week high/low principles in the table’s dynamic color logic. Here’s how it reflects his strategy:
Below 52-Week High (high_52w_dist): The condition high_52w_dist >= -25 and high_52w_dist <= 0 ensures the stock is within 25% of its 52-week high, marking it as a potential candidate for a breakout or continuation trade.
Above 52-Week Low (low_52w_dist): The condition low_52w_dist >= 30 confirms the stock is at least 30% above its 52-week low, filtering out weak stocks and highlighting those with bullish strength.
The table displays these metrics on intraday and daily charts, using daily data via request.security for accurate calculations, which supports Minervini’s focus on daily price action for entry points.
Moving Averages with ADR%/ATR/52W TableOption to select Moving Averages as per different time frames.
ADR%: It should be above 5% as it is a sign of strength and stop loss should be lower than the ADR%. It should be calculated for last 20 Days.
ATR%: It is calculated as per the previous 14 Candles.
Minervini’s 52-Week High and Low Principles:
52-Week High:
Key Principle: Minervini prefers stocks trading near or at their 52-week highs, as this indicates strong bullish momentum and institutional buying interest. A stock at or close to its 52-week high is often breaking out of consolidation or resistance, signaling potential for further upside.
Criteria:
The stock should ideally be within 25% of its 52-week high (i.e., no more than 25% below the high). This is considered the “pivot point” or “buy zone” where the stock is still in a strong uptrend.
A breakout above the 52-week high, especially on high volume, is a bullish signal, often marking the start of a new uptrend.
Rationale: Stocks near their 52-week highs are less likely to face overhead resistance (supply from previous buyers at higher prices) and are attractive to momentum traders and institutions.
52-Week Low:
Key Principle: Minervini advises avoiding stocks trading close to their 52-week lows, as they often indicate weakness, lack of demand, or bearish sentiment. Instead, he looks for stocks that are significantly above their 52-week lows, demonstrating strength and recovery.
Criteria:
The stock should be at least 30% above its 52-week low to confirm it has moved away from a downtrend and is showing relative strength.
Stocks too close to their 52-week lows are considered risky, as they may be in a prolonged downtrend or lack institutional support.
Rationale: A stock well above its 52-week low has likely absorbed selling pressure and is attracting buyers, indicating a healthier trend and potential for further gains.
Application in Trading:
Stock Selection: Minervini uses these criteria as part of his SEPA (Specific Entry Point Analysis) methodology to filter stocks. Stocks meeting the 52-week high/low criteria are more likely to be in a “Stage 2” uptrend (per his adaptation of Stan Weinstein’s stage analysis).
Breakout Strategy: He focuses on buying stocks breaking out from consolidation patterns (e.g., volatility contractions, cup-and-handle) near their 52-week highs, ideally with strong volume and tight price action.
Risk Management: Stocks too far from their 52-week highs or too close to their 52-week lows may have higher risk, either due to overextension or lack of momentum.
Dynamic Color Logic in Your Script:
Based on our previous discussions, your Pine Script incorporates Minervini’s criteria for dynamic coloring in the ADR%/ATR/52W Table:
Below 52-Week High: Text turns green if the stock is within -25% to 0% of the 52-week high (i.e., high_52w_dist >= -25 and high_52w_dist <= 0), highlighting stocks in the bullish “buy zone.”
Above 52-Week Low: Text turns green if the stock is ≥30% above the 52-week low (i.e., low_52w_dist >= 30), indicating strength and distance from weakness.
These thresholds align with Minervini’s principles to visually flag stocks meeting his momentum criteria.
Integration with Your Pine Script:
Your script already implements Minervini’s 52-week high/low principles in the table’s dynamic color logic. Here’s how it reflects his strategy:
Below 52-Week High (high_52w_dist): The condition high_52w_dist >= -25 and high_52w_dist <= 0 ensures the stock is within 25% of its 52-week high, marking it as a potential candidate for a breakout or continuation trade.
Above 52-Week Low (low_52w_dist): The condition low_52w_dist >= 30 confirms the stock is at least 30% above its 52-week low, filtering out weak stocks and highlighting those with bullish strength.
The table displays these metrics on intraday and daily charts, using daily data via request.security for accurate calculations, which supports Minervini’s focus on daily price action for entry points.
Moving Volume-Weighted Avg Price, % Channel, BBsThis script includes:
- Moving Volume-Weighted Average Price line.
- User-defined % band above and below, very useful for "breakout" signals, and mentally adjusting to the magnitude of price swings when viewing an automatic scale on the price axis.
- Volume-Weighted Bollinger Bands, which are more sensitive to volume.
More detail:
- This is like TV's basic VWAP in concept, except the major flaw in that is that it has reset periods that you can't override, and the volume is cumulative until the next hard reset. The 'reset' is OK for securities trading, that resets every day anyway. But not for crypto - and not if/when securities trading goes 24/7. Also, the denominator accumulating over the entire period is also *not* OK, because then what is shown means something different as the day progresses - which kind of makes it useless. In other words, it starts out very sensitive to volume, and gets progressively more numb to it as they day progresses, and starts flattening out.
- This fixes both problems, by using a user-definable moving window for the average. Essentially combining SMA with volume-weighting.
- You may also find an invaluable trading aid, in the % bands above and below.
- What can optionally be shown is standard deviation bands, aka Bollinger bands. The advantage over regular BB is that it's volume-weighted. Since it is already calculated on a moving average, the period for the standard deviation has been shortened by default, and the magnitude increased, to better approximate regular Bollinger Bands - but it's still more responsive to volume.
Granville's 8 Rules Visualizer 🧠 Granville’s 8 Rules Indicator
I’ve created a Pine Script indicator that visually implements **Granville’s Eight Rules**, one of the foundational theories for price movement relative to a moving average (MA). This tool helps traders better time entries and exits based on momentum shifts and MA behavior.
---
### 📈 What is Granville’s Law?
Joseph Granville’s theory suggests that **price and moving average (typically SMA)** interactions produce **8 recurring signals**:
* **4 Buy signals** (B1–B4)
* **4 Sell signals** (S1–S4)
These rules help identify the beginning or continuation of bullish and bearish trends.
---
### 🔍 Indicator Logic
This indicator uses a simple 20-period SMA (modifiable) and tracks price action in relation to it. Each signal is drawn as a triangle with a label (`B1` to `B4` or `S1` to `S4`), based on the following rules:
#### ✅ Buy Signals:
* **B1**: Price crosses above a rising MA (classic breakout)
* **B2**: Price pulls back below a rising MA, then begins rising again
* **B3**: Price bounces off a falling MA
* **B4**: Price is above a rising MA but temporarily drops
#### ❌ Sell Signals:
* **S1**: Price crosses below a falling MA
* **S2**: Price pulls back above a falling MA, then starts dropping again
* **S3**: Price bounces down off a rising MA
* **S4**: Price is below a falling MA but temporarily rises
---
### 🛠 How to Use It:
1. **Trend Confirmation**: Use the moving average slope (rising or falling) as your trend filter.
2. **Entry Timing**: Look for Buy signals (B1–B4) in uptrends and Sell signals (S1–S4) in downtrends.
3. **Avoid Noise**: Combine with volume or volatility filters (e.g. ATR or squeeze) to eliminate weak setups.
4. **Customize**: Adjust the MA type or length to fit your market (e.g. EMA for crypto, SMA for FX).
---
### 💡 Example Strategies:
* Pair **B1 + rising volume** for early trend entries
* Use **B2/B4** for retracement-based entries
* Exit on **S3/S4** for profit taking or stop logic
Happy trading!
Functionally Weighted Moving AverageOVERVIEW
An anchor-able moving average that weights historical prices with mathematical curves (shaping functions) such as Smoothstep , Ease In / Out , or even a Cubic Bézier . This level of configurability lends itself to more versatile price modeling, over conventional moving averages.
SESSION ANCHORS
Aside from VWAP, conventional moving averages do not allow you to use the first bar of each session as an anchor. This can make averages less useful near the open when price is sufficiently different from yesterdays close. For example, in this screenshot the EMA (blue) lags behind the sessionally anchored FWMA (yellow) at the open, making it slower to indicate a pivot higher.
An incrementing length is what makes a moving average anchor-able. VWAP is designed to do this, indefinitely growing until a new anchor resets the average (which is why it doesn't have a length parameter). But conventional MA's are designed to have a set length (they do not increment). Combining these features, the FWMA treats the length like a maximum rather than a set length, incrementing up to it from the anchor (when enabled).
Quick aside: If you code and want to anchor a conventional MA, the length() function in my UtilityLibrary will help you do this.
Incrementing an averages length introduces near-anchor volatility. For this reason, the FWMA also includes an option to saturate the anchor with the source , making values near the anchor more resistant to change. The following screenshot illustrates how saturation affects the average near the anchor when disabled (aqua) and enabled (fuchsia).
AVERAGING MATH
While there's nothing special about the math, it's worth documenting exactly how the average is affected by the anchor.
Average = Dot Product / Sum of Weights
Dot Product
This is the sum of element-wise multiplication between the Price and Weight arrays.
Dot Product = Price1 × Weight1 + Price2 × Weight2 + Price3 × Weight3 ...
When the Price and Weight arrays are equally sized (aka. the length is no longer incrementing from the anchor), there's a 1-1 mapping between Price and Weight indices. Anchoring, however, purges historical data from the Price array, making it temporarily smaller. When this happens, a dot product is synthesized by linearly interpolating for proportional indices (rather than a 1-1 mapping) to maintain the intended shape of weights.
Synthetic Dot Product = FirstPrice × FirstWeight + ... MidPrice × MidWeight ... + LastPrice × LastWeight
Sum of Weights
Exactly what it sounds like, the sum of weights used by the dot product operation. The sum of used weights may be less than the sum of all weights when the dot product is synthesized.
Sum of Weights = Weight1 + Weight2 + Weight3 ...
CALCULATING WEIGHTS
Shaping functions are mathematical curves used for interpolation. They are what give the Functionally Weighted Moving Average its name, and define how each historical price in the look back period is weighted.
The included shaping functions are:
Linear (conventional WMA)
Smoothstep (S curve)
Ease In Out (adjustable S curve)
Ease In (first half of Ease In Out)
Ease Out (second half of Ease In Out)
Ease Out In (eases out and then back in)
Cubic Bézier (aka. any curve you want)
In the following screenshot, the only difference between the three FWMA's is the shaping function (Ease In, Ease In Out, and Ease Out) illustrating how different curves can influence the responsiveness of an average.
And here is the same example, but with anchor saturation disabled .
ADJUSTING WEIGHTS
Each function outputs a range of values between 0 and 1. While you can't expand or shrink the range, you can nudge it higher or lower using the Scalar . For example, setting the scalar to -0.2 remaps to , and +0.2 remaps to . The following screenshot illustrates how -0.2 (lightest blue) and +0.2 (darkest blue) affect the average.
Easing functions can be further adjusted with the Degree (how much the shaping function curves). There's an interactive example of this here and the following illustrates how a degrees 0, 1, and 20 (dark orange, orange, and light orange) affect the average.
This level of configurability completely changes how a moving average models price for a given length, making the FWMA extremely versatile.
INPUTS
You can configure:
Length (how many historical bars to average)
Source (the bar value to average)
Offset (horizontal offset of the plot)
Weight (the shaping function)
Scalar (how much to adjust each weight)
Degree (how much to ease in / out)
Bézier Points (controls shape of Bézier)
Divisor & Anchor parameters
Style of the plot
BUT ... WHY?
We use moving averages to anticipate trend initialization, continuation, and termination. For a given look back period (length) we want the average to represent the data as accurately and smoothly as possible. The better it does this, the better it is at modeling price.
In this screenshot, both the FWMA (yellow) and EMA (blue) have a length of 9. They are both smooth, but one of them more accurately models price.
You wouldn't necessarily want to trade with these FWMA parameters, but knowing it does a better job of modeling price allows you to confidently expand the model to larger timeframes for bigger moves. Here, both the FWMA (yellow) and EMA (blue) have a length of 195 (aka. 50% of NYSE market hours).
INSPIRATION
I predominantly trade ETF derivatives and hold the position that markets are chaotic, not random . The salient difference being that randomness is entirely unpredictable, and chaotic systems can be modeled. The kind of analysis I value requires a very good pricing model.
The term "model" sounds more intimidating than it is. Math terms do that sometimes. It's just a mathematical estimation . That's it. For example, a regression is an "average regressing" model (aka. mean reversion ), and LOWESS (Locally Weighted Scatterplot Smoothing) is a statistically rigorous local regression .
LOWESS is excellent for modeling data. Also, it's not practical for trading. It's computationally expensive and uses data to the right of the point it's averaging, which is impossible in realtime (everything to the right is in the future). But many techniques used within LOWESS are still valuable.
My goal was to create an efficient real time emulation of LOWESS. Specifically I wanted something that was weighted non-linearly, was efficient, left-side only, and data faithful. Incorporate trading paradigms (like anchoring) and you get a Functionally Weighted Moving Average.
The formulas for determining the weights in LOWESS are typically chosen just because they seem to work well. Meaning ... they can be anything, and there's no justification other than "looks about right". So having a variety of functions (aka. kernels) for the FWMA, and being able to slide the weight range higher or lower, allows you to also make it "look about right".
William Cleveland, prominent figure in statistics known for his contributions to LOWESS, preferred using a tri-cube weighting function. Using Weight = Ease Out In with the Degrees = 3 is comparable to this. Enjoy!
CRT Finder (WanHakimFX)📈 Liquidity Grab Indicator with MTF Confluence & Alerts
🔍 Overview:
The Liquidity Grab Indicator is designed to detect precise moments when price sweeps liquidity — either by wicking below recent lows (bullish LQH) or above recent highs (bearish LQL) — followed by a clear rejection. It combines this logic with multi-timeframe confirmation and trend filters, making it a powerful tool for identifying high-probability reversal setups.
⚙️ How It Works:
✅ Liquidity Sweep Logic (LQH / LQL)
Bullish (LQH):
Current candle wicks below the previous low
Closes above the previous candle body
Confirms potential bullish reversal
Bearish (LQL):
Current candle wicks above the previous high
Closes below the previous candle body
Confirms potential bearish reversal
✅ Additional Conditions:
Must occur during London or New York sessions.
Requires trend confluence:
LQH = Price must be above SMMA 60/100/200
LQL = Price must be below SMMA 60/100/200
🧠 Multi-Timeframe Confluence:
The indicator scans for LQH/LQL sweeps across:
Daily
4H
1H
30M
15M
If a sweep occurs on any of these timeframes, an alert is triggered and a triangle marker appears on the chart for real-time visual confluence.
📊 Visual Features:
Green/Red labels for active timeframe sweeps.
Dotted wick lines to show liquidity zones from the previous candle.
Colored triangle markers for MTF sweep alerts.
🛠 Strategy Usage:
This indicator is best used as a trigger tool in a confluence-based strategy:
Use higher-timeframe MTF LQH/LQL markers for directional bias.
Wait for matching sweep on your entry timeframe (e.g., M1/M5).
Enter on confirmation candle or break of structure.
Target imbalances, FVGs, or previous highs/lows.
Risk-managed entries using sweep candle's high/low as stop.
📢 Alerts:
✅ Bullish Sweep (LQH) on any timeframe
✅ Bearish Sweep (LQL) on any timeframe
Custom MAs (Multi-Timeframe, 5x MA, EMA/SMA/WMA/RMA)Multi-Timeframe Moving Averages (Per-TF, Per-Type, Clean Labels)
This script allows you to plot up to five customizable moving averages, each with:
✅ Independent timeframe (chart or fixed)
✅ Independent MA type (EMA, SMA, WMA, RMA)
✅ Custom color, length, and visibility
✅ Optional visual smoothing using a second MA layer
✅ Clean, informative labels (e.g. EMA 50 @ 1D)
✅ Grouped settings for ease of use
Use this to track key MAs from higher or lower timeframes without switching charts, build trend overlays, or monitor cross-timeframe confluence zones.
Designed to be clean, accurate, and highly flexible — no clutter, no unnecessary features.
Money Flow Index with MAsMoney Flow Index (MFI) indicator with configurable Fast MA Length (default 2) and Slow MA Length (default 7). Both MAs are plotted on top of the MFI line, and you can change their lengths from the settings panel.
Crossovers can be used as 'BUY' & 'SELL' conditions with structural analysis.
Cheers..