Consolidation Zones - Working (v5)Updated from v4 to v5
need to write and entry strategy for breakouts
Indicatori e strategie
Briese CoT Movement IndexThis Briese CoT (Commitments of Traders) Movement Index histogram indicator was built based on the formula by Stephen Briese in his book "The Commitments of Traders Bible":
"...difference between the COT Index and its reading of one or several weeks prior. I use six." —Chapter 7, page 75.
The code is a bit of a remix of the "ICT Commitment of Traders°" indicator by toodegrees and is meant for use in a new pane below a Weekly Chart .
The upper and lower thresholds are +40/-40. Some context: "A ± 40 point surge in the COT Index within a six-week period frequently marks the end of a counter-trend price reaction"
40 Point CoT Surge Rules (Commercials) from page 76
"During a correction from a prevailing uptrend, a +40 point movement in the CoT Index within a six-week period often marks the end of a corrective pullback, and the resumption of the major uptrend."
"During a reaction in a prevailing downtrend, a -40 point movement in the CoT Index within a six-week period frequently marks the end of a price reaction, and the resumption of the established downtrend."
"The failure of a ± point CoT Movement Index signal to restart the prevailing trend is a tip-off to a major trend change"
I'd recommend reading Briese's book for examples on how to properly interpret this indictor.
This indicator can be used in conjunction with another one I've published called the "Williams x Briese Hybrid CoT Index" which can be found on my scripts page.
Average Dollar VolumeSimply displays the average daily dollar volume in the top right corner of the chart.
Chiaroscuro Scalp Model A [Signal + Visuals]This indicator is based on the Chiaroscuro Scalp Model A — a precision-based scalping system that identifies high-probability trade setups during the London and New York sessions. It combines daily range expansion, order blocks, fair value gaps, and W/M reversal patterns to generate 20-pip scalping opportunities with clearly plotted stop loss and take profit levels. Ideal for intraday traders seeking structured, rule-based entries.
Crowding model ║ BullVision🔬 Overview
The Crypto Crowding Model Pro is a sophisticated analytical tool designed to visualize and quantify market conditions across multiple cryptocurrencies. By leveraging Relative Strength Index (RSI) and Z-score calculations, this indicator provides traders with an intuitive and detailed snapshot of current crypto market dynamics, highlighting areas of extreme momentum, crowded trades, and potential reversal points.
⚙️ Key Concepts
📊 RSI and Z-Score Analysis
RSI (Relative Strength Index) evaluates the momentum and strength of each cryptocurrency, identifying overbought or oversold conditions.
Z-Score Normalization measures each asset's current price deviation relative to its historical average, identifying statistically significant extremes.
🎯 Crowding Analytics
An integrated analytics panel provides real-time crowding metrics, quantifying market sentiment into four distinct categories:
🔥 FOMO (Fear of Missing Out): High momentum, potential exhaustion.
❄️ Fear: Low momentum, potential reversal or consolidation.
📈 Recovery: Moderate upward momentum after a downward trend.
💪 Strength: Stable bullish conditions with sustained momentum.
🖥️ Visual Scatter Plot
Assets are plotted on a dynamic scatter plot, positioning each cryptocurrency according to its RSI and Z-score.
Color coding, symbol shapes, and sizes help quickly identify main market segments (BTC, ETH, TOTAL, OTHERS) and individual asset conditions.
🧩 Quadrant Classification
Assets are categorized into four quadrants based on their momentum and deviation:
Overbought Extended: High RSI and positive Z-score.
Recovery Phase: Low RSI but positive Z-score.
Oversold Compressed: Low RSI and negative Z-score.
Strong Consolidation: High RSI but negative Z-score.
🔧 User Customization
🎨 Visual Settings
Bar Scale: Adjust the scatter plot visual scale.
Asset Visibility: Optionally display key market benchmarks (TOTAL, BTC, ETH, OTHERS).
Gradient Background: Enhances visual interpretation of asset clusters.
Crowding Analytics Panel: Toggle the analytics panel on/off.
📊 Indicator Parameters
RSI Length: Defines the calculation period for RSI.
Z-score Lookback: Historical lookback period for normalization.
Crowding Alert Threshold: Sets alert sensitivity for crowded market conditions.
🎯 Zone Settings
Quadrant Labels: Displays descriptive labels for each quadrant.
Danger Zones: Highlights extreme RSI levels indicative of heightened market risk.
📈 Visual Output
Dynamic Scatter Plot: Visualizes asset positioning clearly and intuitively.
Gradient and Grid: Professional gridlines and subtle gradient backgrounds assist visual assessment.
Danger Zone Highlights: Visually indicates RSI extremes to warn of potential market turning points.
Crowding Analytics Panel: Real-time summary of market sentiment and asset distribution.
🔍 Use Cases
This indicator is particularly beneficial for traders and analysts looking to:
Identify crowded trades and potential reversal points.
Quickly assess overall market sentiment and individual asset strength.
Integrate a robust momentum analysis into broader technical or fundamental strategies.
Enhance market timing and improve risk management decisions.
⚠️ Important Notes
This indicator does not provide explicit buy or sell signals.
It is intended solely for informational, analytical, and educational purposes.
Past performance and signals are not indicative of future market results.
Always combine with additional tools and analysis as part of comprehensive decision-making.
GG ADRGG ADR Indicator
A compact volatility and price position table displaying key daily metrics:
• ADR% – Average Daily Range Percentage over a custom period
• ATR – Average True Range (daily), measuring market volatility
• LoD Dist – Distance from the current close to the Daily Low, expressed as a % of the ATR
• 8 EMA Distance – % distance from the current price to the 8-day EMA (based on daily timeframe only)
Customize visibility of each metric using the built-in input toggles. Ideal for tracking intraday positioning relative to historical ranges and key dynamic levels.
Based on ADR Indicator by © ArmerSchlucker
TrendZonesTrendZones
This is an indicator which I use, have tested, tweaked and added features to for use in my trend following investing system. I got the idea for it when for some reason I was looking for a dynamic reference to measure the height of a channel or something. In search of this I made MA’s of the high and low borders of a Donchian channel which turned out to be two near parallel and stunningly smooth curves. This visual was so appealing that I immediately tried to turn it into a replacement for the KeltCOG which I previously used in my system. First I created a curve in the middle of the upper and lower curves, which I called COG (Center Of Gravity). Then I decided to enter only one lookback and let the script create a Donchian channel with half the lookback and use this to create the curves with an MA of whole lookback. For this reason the minimum lookback is set to 14, enough room for the Donchian Channel of 7 periods. This Donchian ChanneI has a special way of calculating the borders, involving a 5 period Median value. Thanks to this these borders are really a resistance and support level, which won’t change at a whim, e.g. when a ‘dead cat bounce’ occurs. I prevented the Donchian channel to show itself between the curves and only pop out from behind these. These pop outs now function as “strong trend zones”. I gave it colors (blue:-strong up, green: moderate up, orange: moderate down, red: strong down, near COG: gray, curves horizontal: gray) and it looked very appealing. I tested it in different time frames. In some weekend, when I was bored, I observed for a few hours the minute chart of bitcoin. It turned out that you can reliably tell that an uptrend ends when the candles go under the COG beginning a downtrend. Uptrend starts again once the candles go above COG. As Trends on minute charts only last around half an hour, this entertainment made the potential of this indicator very clear to me in just one afternoon.
Risk Management, Safe Level and Logical Stops.
In the inputs are settings for “Risk Tolerance”, and to activate “Show Logical Stop Level” (activated in example chart) and “Show Safe Level”. As a rule of thump a trade should not expose the invested capital to a risk of losing more than 2 percent. I divided my investment capital in ten equal parts which are allocated to ten different stocks or other instruments or kept liquid. This means that when a position is closed by triggering a Stop with a loss of 20 percent, the invested capital suffers only 2 percent (20% x 10% = 2%). This is why the value for “Risk Tolerance” has a default of 20. Because I put my Stops on the lower curve, a “Safe Level” can be calculated such that when you buy for a price below or at this level, the stop will protect the position sufficiently. Because I only buy when the instrument is in uptrend, the buying price should be between COG and Safe Level. Although I never do that, putting the stop at other curves is feasible and when you want to widen the stop (I never lower my stops btw) in a downtrend situation, even 1 ATR below the “Low Border”. I call these “Logical Stop Levels”, marked with dark green circles on the lower curve when safe buying by placing the Stoploss on this curve is possible, gray circles on the other curves, on the Upper Curve navy when price enters very profitable level. In a downtrend situation maroon circles appear.
Target lines
When I open a position I always set a Stoploss and a Target, for this purpose two types of Target values can be set and corresponding Target lines activated. These lines are drawn above the “High Border” at the set distance. If one expects some price to be used, differences will occur.
Other Features
Support Zone, this is 1 ATR below the “Low Border”, the maroon circles of the “Logal Stops” are placed on this “Support level”.
Stop distance and Channel Width. (activated in example chart) These are reported in a two cell table in the right lower corner of the main panel. I created this because I want to be able to check the volatility, whether the channel shows a situation in which safe buying in most levels of the channel is possible or what risk you take when you buy now and set the Stop at the nearest logical level (which is not always the “Lower curve”). This feature comes in handy for creating a setup I propose in the “Day Trading Fantasy” below.
Some General and User Settings. I never activate this, perhaps you will.
Use Of TrendZones In My System.
Create a list of stocks in uptrend. I define ‘stock in uptrend’ as in uptrend zone in all three monthly, weekly and daily charts, all three should at the same time be in uptrend. The advantage of TrendZones is that you can immediately see in which zone the candle moves.
Opening a position in a stock from the above list. I do this only when in both the daily and weekly the green dot on the lower curve indicates a buying opportunity. This is usually not the case in most of the items of the list, this feature thus provides a good timing for opening a position. Sometimes you need to wait a few weeks for this to happen.
Setting a target over a position. For this I use the Target percent line of the weekly chart with the default value of 10.
Updating the Stoploss and Target values. Every week or two weeks I set these to the new values of the “Lower Curve” and the Target line of the weekly. Attention: never shift down Stops, only up or let them stay the same when the curve moves down. I never use Stop levels on other curves.
I Check the charts whenever I like to do this. Close the position when the uptrend obviously shifts down. Otherwise I let the profits run until the Target triggers which closes the position with some profit.
For selecting stocks an checking charts for volume events, I also use a subpanel indicator called “TZanalyser”, which borrows the visual of my “Fibonacci Zone Oscillator”, is based on TrendZones and includes code from my REVE indicators. I intend to publish that as well.
Day Trading Fantasy.
Day trading is an attempt to earn a dime by opening a position in the morning and close it during the day again with a profit (or a loss). Before the market closes, you close all day trading positions.
In my fantasy the “Logical Stop Level” is repurposed for use as entry point and the ATR-based Target line is used to provide a target setting in an intraday chart, like e.g. 15 minute. To do this the “Safe Level” should be limited to between Channel width and COG. This can be done by showing “Safe Level” and “Channel Width” and then set “Risk Tolerance” to around the shown Channel Width. In this setting you can then wait for the green circle to show up for entering your trade and protect it with the stop.
I don’t know if this works fine or if it’s better than other day trade systems, because I don’t do day trading.
Take care and have fun.
Bitcoin Cycle Log-Curve (JDK-Analysis)Important: The standard parameters provided in the script are specifically tuned for the TradingView Bitcoin Index chart on a monthly timeframe on logarithmic scale, and will yield the most accurate visual alignment when applied to that dataset. (more below)
This very simple script visualizes Bitcoin’s long-term price behavior using a logarithmic regression model designed to reflect the cyclical nature of Bitcoin’s historical market trends. Unlike typical technical indicators that react to recent price movements, this tool is built on the assumption that Bitcoin follows an exponential growth path over time, shaped by its fixed supply structure and four-year halving cycles.
The calculation behind the curved bands:
An upper boundary, a lower boundary, and a central midline, are calculated based on logarithmic functions applied to the bar index (which serves as a proxy for time). The upper and lower bounds are defined using exponential formulas of the type y = exp(constant + coefficient * log(bar_index)), allowing the curves to evolve dynamically over time. These bands serve as a macro-level guide for identifying periods of historical overvaluation (upper red curve) and undervaluation (lower green curve), with a central black curve representing the geometric average of the two.
How to customize the parameters:
The lower1_const and upper1_const values vertically shift the respective lower and upper curves—more negative values push the curve downward, while higher values lift it.
The lower1_coef and upper1_coef control the steepness of the curves over time, with higher values resulting in faster growth relative to time.
The shift_factor allows for uniform vertical adjustment of all curves simultaneously.
Additionally, the channel_width setting determines how far the mirrored bands extend from the original curves, creating a visual “channel” that can highlight more conservative or aggressive valuation zones depending on preference.
How to use this indicator:
This indicator is not intended for short-term trading or intraday signals. Rather, it serves as a contextual framework for long-term investors to identify high-risk zones near the upper curve and potential long-term value opportunities near the lower curve. These areas historically align with cycle tops and bottoms, and the model helps to place current price action within that broader cyclical narrative. While the concept draws inspiration from Bitcoin’s halving-driven market cycles and exponential adoption curve, the implementation is original in its use of time-based logarithmic regression to define dynamic trend boundaries.
It is best used as a strategic tool for cycle analysis, macro positioning, and trend anchoring—rather than as a short-term signal provider.
JWs EMA CrossoversJWs EMA Crossovers - A clean Pine Script v6 indicator that displays 8 and 21 period exponential moving averages with arrow signals when they cross. Shows bullish arrows when the faster EMA crosses above the slower EMA and bearish arrows when it crosses below. Includes customizable EMA periods and built-in alert conditions for trend change notifications. Perfect for identifying trend reversals without chart clutter.
Bollingr+supertrend
📘 Bollinger Bands + Supertrend (Buy/Sell Area Notes)
1. Bollinger Bands consist of a moving average (Basis) and upper/lower bands based on standard deviation.
2. Price near lower band may indicate a potential buy area (oversold).
3. Price near upper band may indicate a potential sell area (overbought).
4. Band squeeze shows low volatility — often followed by a breakout (good for entries).
5. Supertrend uses ATR and price to determine trend direction with green (up) and red (down) lines.
6. Supertrend flips from red to green → indicates a possible Buy signal.
7. Supertrend flips from green to red → indicates a possible Sell signal.
8. Best Buy Area: When Supertrend turns green and price is near or below the lower Bollinger Band.
9. Best Sell Area: When Supertrend turns red and price is near or above the upper Bollinger Band.
10. Use both indicators together to confirm trend direction and time entries more reliably.
Would you like a chart example or image to visualize these Buy/Sell zones?
Gil Stocks Custom WatermarkBased on Micha Stock
Adding Sell Based on ATR
stock price
i have noting to say so i write rowa
Intraday vs Overnight OBV🔍 Purpose
This indicator provides a volume-weighted cumulative flow model that mimics On-Balance Volume (OBV) logic but splits the volume impact into intraday vs. overnight sessions. It allows traders to track how volume contributes to price movement in each session and identify whether buying/selling pressure is stronger during or outside of regular trading hours.
This indicator attempts to alleviate some of the downfalls of the standard OBV indicator, which only looks at total volume and total direction. The price of stocks generally behaves extremely differently during market hours and outside market hours, and many of the large moves happen outside of regular market hours on low volume.
⚙️ Core Features
1) OBV-style calculation:
If price increases → volume is added to the OBV stream.
If price decreases → volume is subtracted.
If price is flat → OBV remains unchanged.
2) Session splitting:
Intraday session: movement from today's open to close.
Overnight session: movement from yesterday’s close to today’s open.
Volume is split proportionally between these two periods based on user input.
3) Four visualization modes:
"Intraday" — plots only OBV from intraday price movement.
"Overnight" — plots only OBV from overnight price movement.
"Aggregate" — plots the sum of intraday and overnight OBV for a holistic view.
"Both Intraday and Overnight" — plots intraday and overnight OBV separately on the same chart.
📐 Inputs
1) Synthetic OBV Type:
"Intraday" — Show OBV from open to close only.
"Overnight" — Show OBV from prior close to today's open only.
"Aggregate" — Show a single line combining both.
"Both Intraday and Overnight" — Show both lines on the same chart.
2) Estimated Overnight Volume %:
Percentage of total daily volume assumed to occur during extended hours.
The rest is allocated to regular session (intraday).
Default: 20% overnight, 80% intraday.
🧮 How It Works
Volume Splitting:
Total bar volume is split into overnight Volume and intraday Volume:
Intraday change is the difference between today’s close and open.
Overnight change is the difference between today’s open and yesterday’s close.
Session OBV Calculations:
OBV is incremented/decremented by the session's allocated volume, depending on whether the session’s price change was positive or negative.
Aggregate OBV:
Combines both session deltas for a holistic volume flow view.
📊 Interpretation
Rising OBV (any stream) suggests accumulation; falling OBV suggests distribution.
Divergences between price and OBV lines (especially overnight vs. intraday) can reveal where hidden buying/selling is occurring.
Comparing intraday vs overnight OBV can help:
Spot whether institutional demand is building off-hours.
Detect retail vs. institutional behavior (retail trades often dominate intraday; institutional may prefer after-hours).
💡 Use Cases
Identify whether overnight gaps are supported by overnight volume momentum.
Detect accumulation in low-volume overnight sessions.
Compare intraday and overnight strength during earnings season or news events.
Complement traditional OBV by seeing session-based breakdowns.
CHoCH with Order Block Entry//@version=5
indicator("CHoCH with Order Block Entry", overlay=true)
// User Inputs
lookback = input.int(20, "Lookback for Highs/Lows", minval=1)
ob_zone_size = input.float(0.2, "Order Block Zone %", minval=0.1)
show_zones = input.bool(true, "Show Order Block Zones")
// Function to find recent swing high/low
var float lastHH = na
var float lastLL = na
var bool isBullChoch = false
var bool isBearChoch = false
hh = ta.highest(high, lookback)
ll = ta.lowest(low, lookback)
// Detect CHoCH
if high > lastHH and low < lastLL
isBullChoch := true
isBearChoch := false
lastHH := high
lastLL := low
else if low < lastLL and high < lastHH
isBullChoch := false
isBearChoch := true
lastHH := high
lastLL := low
// Order Block Logic
var float obHigh = na
var float obLow = na
var line obLineTop = na
var line obLineBottom = na
if isBullChoch
obHigh := high
obLow := low
if show_zones
obLineTop := line.new(bar_index, obHigh, bar_index + 10, obHigh, color=color.green, style=line.style_dashed)
obLineBottom := line.new(bar_index, obLow, bar_index + 10, obLow, color=color.green, style=line.style_dashed)
else if isBearChoch
obHigh := high
obLow := low
if show_zones
obLineTop := line.new(bar_index, obHigh, bar_index + 10, obHigh, color=color.red, style=line.style_dashed)
obLineBottom := line.new(bar_index, obLow, bar_index + 10, obLow, color=color.red, style=line.style_dashed)
// Entry Signal
buySignal = isBullChoch and close <= obHigh and close >= obLow
sellSignal = isBearChoch and close <= obHigh and close >= obLow
plotshape(buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
ORB Norman (2 Sessions, Auto Timezone)ORB Norman (2 Sessions, Auto Timezone)
This script plots Opening Range Breakout (ORB) levels for two configurable sessions. It’s designed for intraday traders—especially in futures markets like Gold (GC), Nasdaq (NQ), and S&P (ES)—who trade based on early session breakouts or range rejections. Unlike standard indicators, this tool auto-adjusts for timezones based on the instrument, ensuring precise session alignment.
Features:
Automatically adjusts for NQ/ES (Chicago time) and GC (New York time) based on the symbol.
Plots high, low, and optional midpoint lines for each session.
Clean, minimal settings with visual separation for better usability.
Ray extension length is fully customizable.
Works on any intraday chart (recommended: 5–15 minute timeframes).
Includes customizable session times, colors, ray length, and an optional midpoint line.
Default Sessions:
Session 1:
‣ 07:00–08:00 EST for GC
‣ 06:00–07:00 CT for NQ/ES
Session 2:
‣ 09:30–09:45 EST for GC
‣ 08:30–08:45 CT for NQ/ES
This tool is ideal for traders who scalp the early morning breakout or look for range rejections based on the opening auction.
This script was developed from scratch based on the author's own intraday trading needs.
JWs Algo — 8/21 EMA Crossover📊 JWs Algo — 8/21 EMA Crossover (Visual Study)
JWs Algo is a clean, momentum-based visual tool that highlights key trend reversal points using a classic 8/21 EMA crossover strategy.
This study does not place trades but instead helps traders visually spot potential buy/sell moments using:
📈 Green emoji label below candles when the 8 EMA crosses above the 21 EMA (bullish signal)
📉 Red emoji label above candles when the 8 EMA crosses below the 21 EMA (bearish signal)
🔍 Features:
Smooth and responsive EMA trend lines
Clear visual cues without clutter
Emoji signal bubbles with custom-colored backgrounds for enhanced readability
Works on any asset and timeframe
Ideal for trend-following traders and EMA-based setups
🧠 Use Cases:
Confirm momentum shifts visually
Use alongside other indicators (RSI, MACD, etc.)
Build discretionary or rules-based entries around clean signals
JWs Algo📈 JWs Algo — 8/21 EMA Crossover Strategy with Take Profit and Stop Loss
JWs Algo is a momentum-based trading strategy that uses a classic 8/21 Exponential Moving Average (EMA) crossover to identify trend reversals and generate long and short trade signals. It includes built-in take profit and stop loss parameters to manage risk and lock in profits automatically.
🔍 Core Logic
Long Entry: When the 8 EMA crosses above the 21 EMA (bullish signal)
Short Entry: When the 8 EMA crosses below the 21 EMA (bearish signal)
Exit: Each position is exited automatically upon hitting either:
A take profit, defined as a percentage gain from entry
A stop loss, defined as a percentage loss from entry
✅ Key Features
Supports both long and short trades
Configurable take profit (%) and stop loss (%)
Prevents overlapping trades — the strategy waits for one trade to fully close before opening another
Clean visualization with:
Buy and sell signal markers
Plotted 8 EMA and 21 EMA for trend context
Compatible with any symbol and timeframe
⚙️ Recommended Use
This strategy works best on trending markets and can be adapted for:
Crypto
Forex
Stocks
Indices
Tune the TP/SL values and timeframe based on asset volatility for best results. Backtest thoroughly.
ATR Trailing + Alerts + Price LabelsATR Trend is a clean and intelligent trend-following overlay built for traders who want clarity during both trending and ranging markets.
This indicator dynamically detects bullish and bearish market trends using the Average True Range (ATR), applying a confirmation-based approach to filter out false signals and minor pullbacks.
The trend line is:
Blue 🔵 during uptrends.
Black ⚫ during downtrends.
Continuous, recalculating only when the market truly shifts — not just when price temporarily crosses the line.
When a confirmed trend reversal occurs:
A 🔼 or 🔽 label shows the exact price of the flip.
An alert can be triggered to notify the user immediately.
💡 Features:
✅ Single-line trend direction
✅ Filters out short-term noise
✅ Exact price labeling on trend change
✅ Built-in alerts for up/down trend shifts
⚙️ Inputs:
ATR Period – Length of ATR calculation (default: 14)
ATR Multiplier – Offset for trend line placement (default: 2.0)
Flip Sensitivity – Number of bars required to confirm a trend reversal (default: 3)
This tool is suitable for:
Swing traders avoid false breakouts
Scalpers looking for high-probability trend entries
Algorithmic setups requiring structured trend logic
My strategyThe Combination 1 strategy is a precision-based breakout and retest setup designed for the EUR/USD 2-minute chart, operating during the Asia and London sessions (UTC-4). It identifies a unique consolidation zone where price, the 20-period SMA, and the 200-period SMA all align within a tight 2-pip range, signaling potential buildup. Once price breaks 10 to 15 pips above this consolidation area, the strategy waits for a retest—specifically, a wick that touches the zone, followed by a bullish close. This confirms buyer strength and triggers a BUY alert, with the take profit set at the breakout high and the stop loss at the recent swing low. This strategy filters for clean trends and disciplined breakouts, minimizing noise and maximizing precision.
Trading CalculatorTrading Calculator Indicator
VIBE CODED WITH GROK 3
The Trading Calculator is a Pine Script indicator designed to perform quick and useful trading-related calculations directly on your chart. It allows traders to execute basic arithmetic operations—such as addition, subtraction, multiplication, and division—as well as calculate percent change and average using either numerical values or trading variables (e.g., close, open, high, low, volume). The indicator displays its results in a table that resembles a calculator interface, making it both functional and visually intuitive. Unlike typical indicators, it does not overlay on the price chart but instead appears in a separate pane.
Inputs
Formula (new | old): First value or variable (e.g., 100, close, close ). Example: close uses the current closing price.
Operator: Mathematical operation (e.g., Plus, Minus, Multiply). Example: Plus adds the two inputs.
Second Input: Second value or variable (e.g., 50, open, close ). Example: open uses the current opening price.
Golden Ratio Trend Persistence [EWT]Golden Ratio Trend Persistence
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Overview
The Golden Ratio Trend Persistence is a dynamic tool designed to identify the strength and persistence of market trends. It operates on a simple yet powerful premise: a trend is likely to continue as long as it doesn't retrace beyond the key Fibonacci golden ratio of 61.8%.
This indicator automatically identifies the most significant swing high or low and plots a single, dynamic line representing the 61.8% retracement level of the current move. This line acts as a "line in the sand" for the prevailing trend. The background color also changes to provide an immediate visual cue of the current market direction.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Power of the Golden Ratio (61.8%)
The golden ratio (ϕ≈1.618) and its inverse (0.618, or 61.8%) are fundamental mathematical constants that appear throughout nature, art, and science, often representing harmony and structure. In financial markets, this ratio is a cornerstone of Fibonacci analysis and is considered one of the most critical levels for price retracements.
Market movements are not linear; they progress in waves of impulse and correction. The 61.8% level often acts as the ultimate point of support or resistance. A trend that can hold this level demonstrates underlying strength and is likely to persist. A breach of this level, however, suggests a fundamental shift in market sentiment and a potential reversal.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
How to Use This Indicator
This indicator is designed for clarity and ease of use.
Identifying the Trend : The visual cues make the current trend instantly recognizable.
A teal line with a teal background signifies a bullish trend. The line acts as dynamic support.
A maroon line with a maroon background signifies a bearish trend. The line acts as dynamic resistance.
Confirming Trend Persistence : As long as the price respects the plotted level, the trend is considered intact.
In an uptrend, prices should remain above the teal line. The indicator will automatically adjust its anchor to new, higher lows, causing the support line to trail the price.
In a downtrend, prices should remain below the maroon line.
Spotting Trend Reversals : The primary signal is a trend reversal, which occurs when the price closes decisively beyond the plotted level.
Potential Sell Signal : When the price closes below the teal support line, it indicates that buying pressure has failed, and the uptrend is likely over.
Potential Buy Signal : When the price closes above the maroon resistance line, it indicates that selling pressure has subsided, and a new uptrend may be starting.
Think of this tool as an intelligent, adaptive trailing stop that is based on market structure and the time-tested principles of Fibonacci analysis.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Input Parameters
You can customize the indicator's sensitivity through the following inputs in the settings menu:
Pivot Lookback Left : This number defines how many bars to the left of a candle must be lower (for a pivot high) or higher (for a pivot low) to identify a potential swing point. A higher value will result in fewer, but more significant, pivots being detected.
Pivot Lookback Right : This defines the number of bars that must close to the right before a swing point is confirmed. This parameter prevents the indicator from repainting. A higher value increases confirmation strength but also adds a slight lag.
Fibonacci Ratio : While the default is the golden ratio (0.618), you can adjust this to other key Fibonacci levels, such as 0.5 (50%) or 0.382 (38.2%), to test for different levels of trend persistence.
Adjusting these parameters allows you to fine-tune the indicator for different assets, timeframes, and trading styles, from short-term scalping to long-term trend following.
Smart Harmonic Pattern Detector//@version=6
indicator("Smart Harmonic Pattern Detector", overlay=true, max_lines_count=500, max_labels_count=500)
// === User Input ===
zigzagDepth = input.int(12, title="ZigZag Depth")
bullColor = input.color(color.green, title="Bullish Signal Color")
bearColor = input.color(color.red, title="Bearish Signal Color")
textSize = input.string(size.small, title="Label Size")
// === Signal Detection Variables ===
var bool showBuySignal = false
var bool showSellSignal = false
var string signalDir = na
var int signalBar = na
// === ZigZag Pivot Logic ===
var float zz_prices = array.new_float()
var int zz_indexes = array.new_int()
var bool zz_types = array.new_bool() // true for high, false for low
ph = ta.pivothigh(high, zigzagDepth, zigzagDepth)
pl = ta.pivotlow(low, zigzagDepth, zigzagDepth)
if not na(ph)
array.push(zz_prices, ph)
array.push(zz_indexes, bar_index - zigzagDepth)
array.push(zz_types, true)
if not na(pl)
array.push(zz_prices, pl)
array.push(zz_indexes, bar_index - zigzagDepth)
array.push(zz_types, false)
// Reset signals
showBuySignal := false
showSellSignal := false
// === Pattern Detection ===
if array.size(zz_prices) >= 5
// Get last 5 points
float x = array.get(zz_prices, array.size(zz_prices)-5)
float a = array.get(zz_prices, array.size(zz_prices)-4)
float b = array.get(zz_prices, array.size(zz_prices)-3)
float c = array.get(zz_prices, array.size(zz_prices)-2)
float d = array.get(zz_prices, array.size(zz_prices)-1)
int x_i = array.get(zz_indexes, array.size(zz_indexes)-5)
int a_i = array.get(zz_indexes, array.size(zz_indexes)-4)
int b_i = array.get(zz_indexes, array.size(zz_indexes)-3)
int c_i = array.get(zz_indexes, array.size(zz_indexes)-2)
int d_i = array.get(zz_indexes, array.size(zz_indexes)-1)
bool x_type = array.get(zz_types, array.size(zz_types)-5)
bool a_type = array.get(zz_types, array.size(zz_types)-4)
bool b_type = array.get(zz_types, array.size(zz_types)-3)
bool c_type = array.get(zz_types, array.size(zz_types)-2)
bool d_type = array.get(zz_types, array.size(zz_types)-1)
// Validate swing structure
validStructure = (x_type != a_type) and (a_type != b_type) and (b_type != c_type) and (c_type != d_type)
if validStructure
// Calculate Fibonacci ratios
ab = math.abs(b - a)
bc = math.abs(c - b)
xa = math.abs(a - x)
cd = math.abs(d - c)
ab_pct = ab / xa
bc_pct = bc / ab
cd_pct = cd / bc
// Pattern detection
isBullish = false
isBearish = false
// Gartley Pattern
if (ab_pct >= 0.55 and ab_pct <= 0.65) and
(bc_pct >= 0.35 and bc_pct <= 0.45) and
(cd_pct >= 1.2 and cd_pct <= 1.35)
isBullish := not d_type
isBearish := d_type
// Bat Pattern
if (ab_pct >= 0.35 and ab_pct <= 0.45) and
(bc_pct >= 0.85 and bc_pct <= 0.9) and
(cd_pct >= 1.5 and cd_pct <= 1.7)
isBullish := not d_type
isBearish := d_type
// Current bar check
isCurrentBar = bar_index == d_i
// Set signal flags
if isCurrentBar and isBullish
showBuySignal := true
signalDir := "buy"
signalBar := bar_index
alert("Harmonic Buy signal detected", alert.freq_once_per_bar_close)
if isCurrentBar and isBearish
showSellSignal := true
signalDir := "sell"
signalBar := bar_index
alert("Harmonic Sell signal detected", alert.freq_once_per_bar_close)
// Draw labels
if isCurrentBar and (isBullish or isBearish)
label.new(
x = d_i,
y = d,
text = "→ " + (isBullish ? "buy" : "sell"),
style = d_type ? label.style_label_down : label.style_label_up,
color = (isBullish ? bullColor : bearColor),
textcolor = color.white
)
// === Plot Signals at Global Scope ===
plotshape(showBuySignal, title="Buy Signal", location=location.belowbar,
color=bullColor, style=shape.triangleup, size=size.normal)
plotshape(showSellSignal, title="Sell Signal", location=location.abovebar,
color=bearColor, style=shape.triangledown, size=size.normal)
Kanal MA 5 GarisTentu! Berikut ini adalah **deskripsi indikator dalam bahasa Inggris** yang bisa langsung kamu pakai untuk dipublikasikan di TradingView:
---
### 📌 **Indicator Title (Name):**
**Engulfing + RSI OB/OS Filter (1-Bar Confirmation)**
---
### 📝 **Description for TradingView:**
This custom indicator combines classic **Engulfing Candlestick Patterns** with **RSI-based overbought/oversold filters** for smarter signal confirmation.
### 🔍 Key Features:
✅ Detects 4 engulfing types:
* **BE1 (Bullish Engulfing 1):** Current close > previous high
* **BE2 (Bullish Engulfing 2):** Current high > previous high AND current close > previous open
* **SE1 (Bearish Engulfing 1):** Current close < previous low
* **SE2 (Bearish Engulfing 2):** Current low < previous low AND current close < previous open
✅ Detects RSI Overbought (OB) and Oversold (OS) conditions:
* **OB** (Overbought): RSI > 70
* **OS** (Oversold): RSI < 30
✅ **Smart confirmation rule:**
* **BE1/BE2** signals only appear **if the previous candle was OS (RSI < 30)**
* **SE1/SE2** signals only appear **if the previous candle was OB (RSI > 70)**
### 🎯 Usage:
This indicator helps traders avoid false engulfing signals by confirming momentum exhaustion using RSI. It is ideal for identifying **potential reversals** from overbought or oversold zones.
You can customize the RSI period and OB/OS threshold from the settings.
---
Let me know if you’d like a shorter version or want me to add strategy tips for the description!