Initial Balance Breakout Signals [LuxAlgo]The Initial Balance Breakout Signals help traders identify breakouts of the Initial Balance (IB) range.
The indicator includes automatic detection of IB or can use custom sessions, highlights top and bottom IB extensions, custom Fibonacci levels, and goes further with an IB forecast with two different modes.
🔶 USAGE
The initial balance is the price range made within the first hour of the trading session. It is an intraday concept based on the idea that high volume and volatility enter the market through institutional trading at the start of the session, setting the tone for the rest of the day.
The initial balance is useful for gauging market sentiment, or, in other words, the relationship between buyers and sellers.
Bullish sentiment: Price trades above the IB range.
Mixed sentiment: Price trades within the IB range.
Bearish sentiment: Price trades below the IB range.
The initial balance high and low are important levels that many traders use to gauge sentiment. There are two main ideas behind trading around the IB range.
IB Extreme Breakout: When the price breaks and holds the IB high or low, there is a high probability that the price will continue in that direction.
IB Extreme Rejection: When the price tries to break those levels but fails, there is a high probability that it will reach the opposite IB extreme.
This indicator is a complete Initial Balance toolset with custom sessions, breakout signals, IB extensions, Fibonacci retracements, and an IB forecast. All of these features will be explained in the following sections.
🔹 Custom Sessions and Signals
By default, sessions for Initial Balance and breakout signals are in Auto mode. This means that Initial Balance takes the first hour of the trading session and shows breakout signals for the rest of the session.
With this option, traders can use the tool for open range trading, making it highly versatile. The concept behind open range (OR) is the same as that of initial balance (IB), but in OR, the range is determined by the first minute, three or five minutes, or up to the first 30 minutes of the trading session.
As shown in the image above, the top chart uses the Auto feature for the IB and Breakouts sessions. The bottom chart has the Auto feature disabled to use custom sessions for both parameters. In this case, the first three minutes of the trading session are used, turning the tool into an Open Range trading indicator.
This chart shows another example of using custom sessions to display overnight NASDAQ futures sessions.
The left chart shows a custom session from the Tokyo open to the London open, and the right chart shows a custom session from the London open to the New York open.
The chart shows both the Asian and European sessions, their top and bottom extremes, and the breakout signals from those extremes.
🔹 Initial Balance Extensions
Traders can easily extend both extremes of the Initial Balance to display their preferred targets for breakouts. Enable or disable any of them and set the IB percentage to use for the extension.
As the chart shows, the percentage selected on the settings panel directly affects the displayed levels.
Setting 25 means the tool will use a quarter of the detected initial balance range for extensions beyond the IB extremes. Setting 100 means the full IB range will be used.
Traders can use these extensions as targets for breakout signals.
🔹 Fibonacci Levels
Traders can display default or custom Fibonacci levels on the IB range to trade retracements and assess the strength of market movements. Each level can be enabled or disabled and customized by level, color, and line style.
As we can see on the chart, after the IB was completed, prices were unable to fall below the 0.236 Fibonacci level. This indicates significant bullish pressure, so it is expected that prices will rise.
Traders can use these levels as guidelines to assess the strength of the side trying to penetrate the IB. In this case, the sellers were unable to move the market beyond the first level.
🔹 Initial Balance Forecast
The tool features two different forecasting methods for the current IB. By default, it takes the average of the last ten values and applies a multiplier of one.
IB Against Previous Open: averages the difference between IB extremes and the open of the previous session.
Filter by current day of the week: averages the difference between IB extremes and the open of the current session for the same day of the week.
This feature allows traders to see the difference between the current IB and the average of the last IBs. It makes it very easy to interpret: if the current IB is higher than the average, buyers are in control; if it is lower than the average, sellers are in control.
For example, on the left side of the chart, we can see that the last day was very bullish because the IB was completely above the forecasted value. This is the IB mean of the last ten trading days.
On the right, we can see that on Monday, September 15, the IB traded slightly higher but within the forecasted value of the IB mean of the last ten Mondays. In this case, it is within expectations.
🔶 SETTINGS
Display Last X IBs: Select how many IBs to display.
Initial Balance: Choose a custom session or enable the Auto feature.
Breakouts: Enable or disable breakouts. Choose custom session or enable the Auto feature.
🔹 Extensions
Top Extension: Enable or disable the top extension and choose the percentage of IB to use.
Bottom extension: Enable or disable the bottom extension and choose the percentage of IB to use.
🔹 Fibonacci Levels
Display Fibonacci: Enable or disable Fibonacci levels.
Reverse: Reverse Fibonacci levels.
Levels, Colors & Style
Display Labels: Enable or disable labels and choose text size.
🔹 Forecast
Display Forecast: Select the forecast method.
- IB Against Previous Open: Calculates the average difference between the IB high and low and the previous day's IB open price.
- Filter by Current Day of Week: Calculates the average difference between the IB high and low and the IB open price for the same day of the week.
Forecast Memory: The number of data points used to calculate the average.
Forecast Multiplier: This multiplier will be applied to the average. Bigger numbers will result in wider predicted ranges.
Forecast Colors: Choose from a variety of colors.
Forecast Style: Choose a line style.
🔹 Style
Initial Balance Colors
Extension Transparency: Choose the extension's transparency. 0 is solid, and 100 is fully transparent.
Indicatori e strategie
INFLECTION NEXUS - SPAINFLECTION NEXUS - SPA (Shadow Portfolio Adaptive)
Foreword: The Living Algorithm
For decades, technical analysis has been a conversation between a trader and a static chart. We apply our indicators with their fixed-length inputs, and we hope that our rigid tools can somehow capture the essence of a market that is fluid, chaotic, and perpetually evolving. When our tools fail, we are told to "adapt." But what if the tools themselves could learn that lesson? What if our indicators could adapt not just for us, but with us?
This script, INFLECTION NEXUS - SPA, is the realization of that vision. It is an advanced analytical framework built around a revolutionary core: the Shadow Portfolio Adaptive (SPA) Engine . The buy and sell signals you see on the chart are an evolution of the logic from my previous work, "Turning Point." However, this is not a simple combination of two scripts. The SPA engine so fundamentally transforms the nature of the analysis that it creates an entirely new class of indicator. This publication is a showcase of that groundbreaking, self-learning engine.
This system is undeniably complex. When you first load it, the sheer volume of information may feel overwhelming. That is a testament to the depth of its analysis. This guide is designed to be your comprehensive manual, to break down every single component, every color, every number, into simple, understandable concepts. By the end of this document, you will not only master its functions but will also possess a deeper understanding of the market dynamics it is designed to reveal.
Chapter 1: The Paradigm Shift - Why the SPA Engine is a Leap Forward
To grasp the innovation here, we must first deconstruct the severe limitations of traditional "adaptive" indicators.
Part A: The Traditional Model - Driving by the Rear-View Mirror
Conventional "adaptive" systems are fundamentally reactive. They operate on a slow, inefficient loop: they wait for their own specific, biased signal to fire, wait for that trade to close, and only after a long and statistically significant "warm-up" period of 50-100 trades do they finally make a small, retrospective adjustment. They are always adapting to a market that no longer exists.
Part B: The SPA Model - The Proactive Co-Pilot
The Shadow Portfolio Adaptive (SPA) engine is a complete re-imagining of this process. It is not reactive; it is proactive, data-saturated, and instantly aware.
Continuous, Unbiased Learning: The SPA engine does not wait for a signal to learn. Its Shadow Portfolio is constantly running 5-bar long and short trades in the background. It learns from every single 5-bar slice of market action , giving it a continuous, unbiased stream of performance data. It is the difference between reading a textbook chapter and having a live sparring partner in the ring 24/7.
Instantaneous Market Awareness - The End of the "Warm-Up": This is the critical innovation. The SPA engine does not require a 100-trade warm-up period. The learning does not start after 50 trades; it begins on the 6th bar of the chart when the first shadow trade closes. From that moment on, the system is market-aware, analyzing data, and capable of making intelligent adjustments. The SPA engine is not adapting to old wins and losses. It is adapting, in near real-time, to the market's ever-shifting character, volatility, and personality.
Chapter 2: The Anatomy of the SPA Engine - A Granular Deep Dive
The engine is composed of three primary systems that work in a sophisticated, interconnected symphony.
Section 1: The Shadow Portfolio (The Information Harvester)
What it is, Simply: Think of this as the script's eyes and ears. It's a team of 10 virtual traders (5 long, 5 short) who are constantly taking small, quick trades to feel out the market.
How it Works, Simply: On every new bar, a new "long" trader and a new "short" trader enter the market. Exactly 5 bars later, they close their positions. This cycle is perpetual and relentless.
The Critical 'Why': Because these virtual traders enter and exit based on a fixed time (5 bars), not on a "good" or "bad" signal, their results are completely unbiased . They are simply measuring: "What happened to price over the last 5 bars?" This provides the raw, untainted truth about the market's behavior that the rest of the system needs to learn effectively.
The Golden Metric (ATR Normalization): The engine doesn't just look at dollar P&L. It's smarter than that. It asks a more intelligent question: "How much did this trade make relative to the current volatility?"
Analogy: Imagine a flea and an elephant. If they both jump 1 inch, who is more impressive? The flea. The SPA engine understands this. A $10 profit when the market is dead quiet is far more significant than a $10 profit during a wild, volatile swing.
The Formula: realized_atr = (close - trade.entry) / trade.atr_entry. It takes the raw profit and divides it by the Average True Range (a measure of volatility) at the moment of entry. This gives a pure, "apples-to-apples" score for every single trade, which is the foundational data point for all learning.
Section 2: The Cognitive Map (The Long-Term Brain)
What it is, Simply: This is the engine's deep memory, its library of experiences. Imagine a giant, 64-square chessboard (8x8 grid). Each square on the board represents a very specific type of market environment.
The Two Dimensions of Thought (The 'How'): How does it know which square we are on? It looks at two things:
The Market's Personality (X-Axis): Is the market behaving like a disciplined soldier, marching in a clear trend? Or is it like a chaotic, unpredictable child, running all over the place? The engine calculates a "Regime" score to figure this out.
The Market's Energy Level (Y-Axis): Is the market sleepy and quiet, or is it wide-awake and hyperactive? The engine measures "Normalized Volatility" to determine this.
The Power of Generalization (The 'Why'): When a Shadow Portfolio trade closes, its result is recorded in the corresponding square on the chessboard. But here's the clever part: it also shares a little bit of that lesson with the squares immediately next to it (using a Gaussian Kernel).
Analogy: If you touch a hot stove and learn "don't touch," your brain is smart enough to know you probably shouldn't touch the hot oven door next to it either, even if you haven't touched it directly. The Cognitive Map does the same thing, allowing it to make intelligent inferences even in market conditions it has seen less frequently. Each square remembers what indicator settings worked best in that specific environment.
Section 3: The Adaptive Engine (The Central Nervous System)
What it is, Simply: This is the conductor of the orchestra. It takes information from all other parts of the system and decides exactly what to do.
The Symphony of Inputs: It listens to three distinct sources of information before making a decision:
The Short-Term Memory (Rolling Stats): It looks at the performance of the last rollN shadow trades. This is its immediate, recent experience.
The Long-Term Wisdom (Cognitive Map): It consults the grand library of the Cognitive Map to see what has worked best in the current market type over the long haul.
The Gut Instinct (Bin Learning): It keeps a small "mini-batch" of the most recent trades. If this batch shows a very strong, sudden pattern, it can trigger a rapid, reflexive adjustment, like pulling your hand away from a flame.
The Fusion Process: It then blends these three opinions together in a sophisticated way. It gives more weight to the opinions it's more confident in (e.g., a Cognitive Map square with hundreds of trades of experience) and uses your Adaptation Intensity (dialK) input to decide how much to listen to its "gut instinct." The final decision is then smoothed to ensure the indicator's parameters change in a stable, intelligent way.
Chapter 3: The Control Panel - A Novice's Guide to Every Input
This is the most important chapter. Let's break down what these confusing settings actually do in the simplest terms possible.
--- SECTION 1: THE DRIVER'S SEAT (SIGNAL ENGINE & BASE SETTINGS) ---
🧾 Signal Engine (Turning Point):
What it is: These are the rules for the final BUY and SELL signs.
Think of it like this: The SPA engine is the smart robot that tunes your race car. These settings are you, the driver, telling the robot what kind of race you're in.
Enable Reversal Mode: You tell the robot, "I want to race on a curvy track with lots of turns." The robot will tune the car to be agile for catching tops and bottoms.
Enable Breakout Mode: You tell the robot, "I want to race on a long, straight track." The robot will tune the car for pure speed to follow the trend.
Require New Extreme: This is a quality filter. It tells the driver, "Don't look for a turn unless we've just hit a new top speed on the straightaway." It makes sure the reversal is from a real extreme.
Min Bars Between Signals: This is the "pit stop" rule. You're telling the robot, "After you show me a sign, wait at least 10 bars before showing another one, so I don't get confused."
⚡ ATR Bands (Base Inputs):
What they are: These are the starting settings for your car before the robot starts tuning it. These are your factory defaults.
Sensitivity: This is the "Bump Detector." A low number means the car feels every tiny pebble on the road. A high number means it only notices the big speed bumps. You want to set it so it notices the important bumps (real market structure) but ignores the pebbles (noise).
ATR Period & Multiplier: These set the starting size of the "safety lane" (the green and blue bands) around your car. The robot's main job is to constantly adjust the size of this safety lane to perfectly fit the current road conditions.
📊 & 📈 Filter Settings (RSI & Volume):
What they are: These are your co-pilot's confirmation checks.
Enable RSI Filter: Your co-pilot will check the "Engine Temperature" (RSI). He won't let you hit the gas (BUY) if the engine is already overheating (overbought).
RSI Length & Lookbacks: These tune how your co-pilot's temperature gauge works. The defaults are standard.
Require Volume Spike: Your co-pilot will check the "Crowd Noise" (Volume). He won't give you a signal unless he hears the crowd roar, confirming that a lot of people are interested in this move.
🎯 Signal Quality Control:
Enable Major Levels Only: This tells your co-pilot to be extra picky. He will only confirm signals that happen after a huge, powerful move, ignoring all the small stuff.
--- SECTION 2: THE ROBOT'S BRAIN (ENGINE & LEARNING CONTROLS) ---
🎛️ Master Control:
Adaptation Intensity (dialK): THIS IS THE ROBOT'S PERSONALITY DIAL.
Turn it DOWN (1-5): The robot becomes a "Wise Old Professor." It thinks very slowly and carefully, gathers lots of data, and only makes a change when it is 100% sure. Its advice is very reliable but might come a little late.
Turn it UP (15-20): The robot becomes a "Hyper-Reactive Teenager." It has a short attention span, reacts instantly to everything it sees, and changes its mind constantly. It's super-fast to new information but might get faked out a lot.
The Default (10): A "Skilled Professional." The perfect balance of thoughtful and responsive. Start here.
🧠 Adaptive Engine:
Enable Adaptive System: This is the main power button for your robot. Turn it off, and you're driving a normal, non-smart car. Turn it on, and the robot takes over the tuning.
Use Shadow Cycle: This turns on the robot's "practice laps." The robot can't learn without practicing. This must be on for the robot to work.
Lock ATR Bands: This is a visual choice. "Locked" means the safety lanes on your screen stay where your factory defaults put them (the robot still makes changes to the signals in the background). "Unlocked" means you see the safety lanes moving and changing shape in real-time as the robot tunes them.
🎯 Learning (Global + Risk):
What they are: These are the deep-level settings for how your robot's brain processes information.
Rolling Window Size: This is the robot's "Short-Term Memory." How many of the last few practice laps should it remember? A small number means it only cares about what just happened. A big number means it remembers the last hour of practice.
Learn Rate & Smooth Alpha: This is "How big of a change should the robot make?" and "How smoothly should it make the change?" Think of it as turning the steering wheel. A high learn rate is like yanking the wheel; a low one is like a gentle turn. The smoothing makes sure the turn is graceful.
WinRate Thresholds & PnL Cap: These are rules for the robot's learning. They tell it what a "good" or "bad" outcome looks like and tell it to ignore crazy, once-in-a-lifetime events so its memory doesn't get corrupted.
--- SECTION 3: THE GARAGE (RISK, MEMORY & VISUALS) ---
⚠️ Risk Management:
What they are: These are safety rules you can give to your co-pilot for your own awareness. They appear on the dashboard.
The settings: You can set a max number of trades, a max loss for the day, and a "time out" period after a few losses.
Apply Risk to Shadow: This is an important switch. If you turn this ON, your safety rules also apply to the robot's practice laps. If you hit your max loss, the robot stops practicing and learning. It's recommended to leave this OFF so the robot can learn 24/7, even if you have stopped trading.
🗺️ Cognitive Map, STM & Checkpoints:
What it is: The robot's "Long-Term Memory" or its entire library of racing experience.
Use Cognitive Map & STM: These switches turn on the long-term and short-term memory banks. You want these on for the smartest robot.
Map Settings (Grid, Sigma, Half-Life): These are very advanced settings for neuroscientists. They control how the robot's brain is structured and how it forgets old information. The defaults are expertly tuned.
The Checkpoint System: This is the "Save Your Game" button for the robot.
To Save: Check Emit Checkpoint Now. Go to your alert log, and you will see a very long password. Copy this password.
To Load: Paste that password into the Memory Checkpoint box. Then, check Apply Checkpoint On Next Bar. The robot will instantly download all of its saved memories and experience.
🎨 Visuals & 🧩 Display Params:
What they are: These are all about how your screen looks.
You can control everything: The size and shape of the little diamonds (Entry Orbs), whether you see the purple Adapt Pulse, and where the Dashboards appear on your screen. You can change the Theme to Dark, Light, or Neon. These settings don't change how the robot thinks, only how it presents its information to you.
Chapter 4: The Command Center - Decoding the Dashboard
PANEL A (INFLECTION NEXUS): Your high-level mission control, showing the engine's classification of the current Market Context and the performance summary of the Shadow Portfolio.
PANEL B (SHADOW PORTFOLIO ADAPTIVE): Your deep diagnostic screen.
Performance Metrics: View advanced risk-adjusted stats like the Sharpe Ratio to understand the quality of the market movements the engine is learning from.
Adaptive Parameters (Live vs Base): THIS IS THE MOST CRITICAL SECTION. It shows the engine's Live parameters right next to your (Base) inputs. When the Live values deviate, the engine is communicating its learned wisdom to you. For example, a Live ATR Multiplier of 2.5 versus your Base of 1.4 is the engine telling you: "Caution. The market is currently experiencing high fake-outs and requires giving positions more room to breathe." This section is a direct translation of the engine's learning into actionable insight.
Chapter 5: Reading the Canvas - On-Chart Visuals
The Bands (Green/Blue Lines): These are not static Supertrend lines. They are the physical manifestation of the engine's current thinking. As the engine learns and adapts its ATR Period and Multiplier, you will see these bands widen, tighten, and adjust their distance from price. They are alive.
The Labels (BUY/SELL): These are the final output of the "Turning Point" logic, now supercharged and informed by the fully adaptive SPA engine.
The Purple Pulse (Dot and Background Glow): This is your visual cue that the engine is "thinking." Every time you see this pulse, it means the SPA has just completed a learning cycle and updated its parameters. It is actively recalibrating itself to the market.
Chapter 6: A Manifesto on Innovation and Community
I want to conclude with a personal note on why I dedicate countless hours to building systems like this and sharing them openly.
My purpose is to drive innovation, period. I am not in this space to follow the crowd or to re-package old ideas. The world does not need a 100th version of a slightly modified MACD. Real progress, real breakthroughs, come from venturing into the wilderness, from asking "what if?" and from pursuing concepts that lie at the very edge of possibility.
I am not afraid of being wrong. I am not afraid of being bested by my peers. In fact, I welcome it. If another developer takes an idea from this engine, improves it, and builds something even more magnificent, that is a profound win for our entire community. The only failure I recognize is the failure to try. The only trap I fear is the creative complacency of producing sterile, recycled work just to appease the status quo.
I love this community, and I believe with every fiber of my being that we have barely scratched the surface of what can be discovered and created. This script is my contribution to that shared journey. It is a tool, an idea, and a challenge to all of us: let's keep pushing.
DISCLAIMER: This script is an advanced analytical tool provided for educational and research purposes ONLY. It does not constitute financial advice. All trading involves substantial risk of loss. Past performance is not indicative of future results. Please use this tool responsibly and as part of a comprehensive trading plan.
As the great computer scientist Herbert A. Simon, a pioneer of artificial intelligence, famously said:
"Learning is any process by which a system improves performance from experience."
*Tooltips were updated with a comprehensive guide
May this engine enhance your experience.
— Dskyz, for DAFE Trading Systems
AlgoPilotX - Breakout & Breakdown Meter (v1)Version Note:
This is a revised and improved version of the AlgoPilotX – Breakout & Breakdown Meter. It includes expanded explanations of the underlying logic, variable usage, and originality to comply with TradingView guidelines.
AlgoPilotX – Breakout & Breakdown Meter is a structured trading tool that combines Fair Value Gap (FVG) detection, session-based support/resistance breakouts, and a clean market condition info panel. It’s designed to help traders spot potential setups early and confirm stronger breakouts or breakdowns with context from momentum, volatility, and trend indicators.
How It Works
Session Levels → The first candle high/low of the session defines dynamic support/resistance. Unlike static pivots, these levels update with each new trading session and reflect real intraday sentiment.
Fair Value Gaps (FVGs) → A three-candle imbalance highlights inefficiencies. When detected, the script marks the open of the third candle as a potential entry (light green/red arrow).
Pullback Confirmations → If price pulls back into session support/resistance and then breaks away strongly, a stronger entry signal (dark green/red arrow) is plotted.
Breakouts & Breakdowns → Additional arrows appear when price crosses decisively above resistance or below support.
Signal Hierarchy → Arrows vary by color/size:
Light = early/potential setups.
Dark/Large = stronger confirmations.
Info Panel Dashboard → RSI, MACD, Bollinger Bands, and EMAs are displayed in a compact table with both numeric values and Bullish/Bearish/Neutral states, color-coded for quick interpretation.
How the Functions and Variables Work Together
Session Levels (Support & Resistance)
The script uses time() and session inputs to identify the first candle of the chosen trading session.
Variables sessionHigh and sessionLow are stored with var so they persist until the next session.
These levels are then plotted as dynamic support/resistance lines. This approach is different from static pivots or daily highs/lows, because it adapts in real-time to the market open.
Fair Value Gap (FVG) Detection
Conditions check for three-candle imbalances ( low > high for bullish, high < low for bearish).
When detected, a potential entry is marked at the open of the third candle.
Variables fvgBull and fvgBear define this logic , making FVGs a core entry condition rather than a side overlay.
Entry Hierarchy (Light vs. Dark Arrows)
longPotentialEntry and shortPotentialEntry mark light green/red arrows as early signals.
pullbackToSupport and pullbackToResistance build on these by requiring price to return to session levels and then break away again.
This creates the dark green/red arrows for stronger entries, introducing a two-step filtering process.
Breakout & Breakdown Detection
breakAbove = ta.crossover(close, sessionHigh)
breakBelow = ta.crossunder(close, sessionLow)
These conditions confirm true breakouts or breakdowns beyond support/resistance, reducing noise.
Info Panel Construction
A table is created and updated each bar.
Functions like ta.rsi(), ta.ema(), ta.sma(), and ta.stdev() calculate RSI, MACD, EMAs, and Bollinger Bands.
Each indicator’s state is summarized into human-readable text (e.g., “Bullish,” “Bearish,” “Above,” “Oversold”) and displayed with color coding using the helper function f_stateColor().
Values are also displayed numerically (RSI, MACD histogram, EMA levels, BB width), making this a dashboard rather than just arrows on a chart.
Helper Function for States
f_stateColor(state) translates qualitative states into consistent colors (green for bullish/above, red for bearish/below, orange for neutral, purple for overbought/oversold).
This ensures that every signal in the info panel has a visual identity that traders can read instantly.
Alerts Integration
alertcondition() is tied to each major event: FVG potential entries, strong pullback confirmations, and breakout/breakdown signals.
This allows the script to be used for alerts, notifications and automation , not just visual charting.
How to Use
1. Default timeframe = 15m (adjustable).
2. The first session candle defines support & resistance.
3. Watch for arrows:
Light green (▲) below candle → Potential breakout long (FVG detected).
Dark green (▲) below candle → Strong breakout confirmation after pullback.
Light red (▼) above candle → Potential breakdown short (FVG detected).
Dark red (▼) above candle → Strong breakdown confirmation after pullback.
Larger arrows = higher confidence signals.
4. Check the Info Panel for context:
RSI → momentum
MACD → trend confirmation
Bollinger Bands → overbought/oversold
EMA20 & EMA50 → short- and medium-term trend bias
5. Always confirm with your own price action, volume, and risk management rules.
6. Easily move the Info Panel to any corner of the chart via settings to keep your view clear.
Why This Structure Is Original
Not a mashup : Instead of simply overlaying RSI, MACD, or EMAs, the script integrates them into a signal-filtering framework.
Dynamic anchoring: Session-based high/low variables make levels adaptive to intraday structure, unlike fixed pivots.
Dual entry tiering: Light vs. dark arrows are built by combining FVGs + pullback conditions, offering nuance most breakout scripts lack.
Dashboard-style panel: Variables are summarized into a real-time info box with both numbers and state labels, replacing multiple chart overlays with one compact tool.
Modular functions: Breakout, pullback, FVG detection, and indicator states are modularized with separate variables — making the script flexible, extendable, and unique in design.
Disclaimer
This script is for educational purposes only. It does not constitute financial advice and does not guarantee profitable outcomes. Always backtest thoroughly, paper trade, and use proper risk management before trading live.
🗽 {Wong FoohKin System©} | BrokeHomie_Kwam™️🚝Built by BrokeHomie_Kwam™, this system is a modular, high-precision trading framework designed for tactical execution across volatile market conditions. It reflects Kwamein’s elite engineering style—vault-synced logic, multi-phase overlays, and cheat-sheet clarity.
Core Identity:
• Name Origin: “Wong FoohKin” is a coded nod to trap logic and misdirection—mirroring how price action often fakes out retail sentiment before reversing.
• Style: Aggressive yet calculated. The system thrives on layered logic, HTF bias alignment, and real-time adaptability.
Key Features:
• 🔁 Multi-phase logic: Bias detection, trap zones, POI freshness, and vault toggles
• 🧩 Modular overlays: HTF structure, EQH/EQL sweeps, FVG sync, and NYO trap logic
• 🎯 Execution-ready clarity: Half-line formatting, toggle logic, and instantly actionable flows
Use Case:
Perfect for traders who want to compress prep time and execute with precision during NYSE open or high-volatility sessions. It’s especially tuned for GOAT Funded Trader accounts and Empire Auto-Runner workflows.
Buying, selling and setting goalsBuying, selling and setting goals
Buying, selling and setting goals
Tristan's Star: 15m Shooting Star DetectorThis script is designed to be used on the 1-minute chart , but it analyzes the market as if you were watching the 15-minute candles.
Every cluster of 15 one-minute candles is grouped together and treated as a single 15-minute candle.
When that 15-minute “synthetic” candle looks like a shooting star pattern (small body near the low, long upper wick, short lower wick, bearish bias), the script triggers a signal.
At the close of that 15-minute cluster, the script will:
Plot a single “Sell” label on the last 1-minute bar of the group.
Draw a horizontal line across the 15 bars at the high, showing the level that created the shooting star.
Optionally display a table cell in the corner with the word “SELL.”
This lets you stay on the 1-minute timeframe for precision entries and exits, while still being alerted when the higher-timeframe (15-minute) shows a bearish reversal pattern.
Options Max Pain Calculator [BackQuant]Options Max Pain Calculator
A visualization tool that models option expiry dynamics by calculating "max pain" levels, displaying synthetic open interest curves, gamma exposure profiles, and pin-risk zones to help identify where market makers have the least payout exposure.
What is Max Pain?
Max Pain is the theoretical expiration price where the total dollar value of outstanding options would be minimized. At this price level, option holders collectively experience maximum losses while option writers (typically market makers) have minimal payout obligations. This creates a natural gravitational pull as expiration approaches.
Core Features
Visual Analysis Components:
Max Pain Line: Horizontal line showing the calculated minimum pain level
Strike Level Grid: Major support and resistance levels at key option strikes
Pin Zone: Highlighted area around max pain where price may gravitate
Pain Heatmap: Color-coded visualization showing pain distribution across prices
Gamma Exposure Profile: Bar chart displaying net gamma at each strike level
Real-time Dashboard: Summary statistics and risk metrics
Synthetic Market Modeling**
Since Pine Script cannot access live options data, the indicator creates realistic synthetic open interest distributions based on configurable market parameters including volume patterns, put/call ratios, and market maker positioning.
How It Works
Strike Generation:
The tool creates a grid of option strikes centered around the current price. You can control the range, density, and whether strikes snap to realistic market increments.
Open Interest Modeling:
Using your inputs for average volume, put/call ratios, and market maker behavior, the indicator generates synthetic open interest that mirrors real market dynamics:
Higher volume at-the-money with decay as strikes move further out
Adjustable put/call bias to reflect current market sentiment
Market maker inventory effects and typical short-gamma positioning
Weekly options boost for near-term expirations
Pain Calculation:
For each potential expiry price, the tool calculates total option payouts:
Call options contribute pain when finishing in-the-money
Put options contribute pain when finishing in-the-money
The strike with minimum total pain becomes the Max Pain level
Gamma Analysis:
Net gamma exposure is calculated at each strike using standard option pricing models, showing where hedging flows may be most intense. Positive gamma creates price support while negative gamma can amplify moves.
Key Settings
Basic Configuration:
Number of Strikes: Controls grid density (recommended: 15-25)
Days to Expiration: Time until option expiry
Strike Range: Price range around current level (recommended: 8-15%)
Strike Increment: Spacing between strikes
Market Parameters:
Average Daily Volume: Baseline for synthetic open interest
Put/Call Volume Ratio: Market sentiment bias (>1.0 = bearish, <1.0 = bullish) It does not work if set to 1.0
Implied Volatility: Current option volatility estimate
Market Maker Factors: Dealer positioning and hedging intensity
Display Options:
Model Complexity: Simple (line only), Standard (+ zones), Advanced (+ heatmap/gamma)
Visual Elements: Toggle individual components on/off
Theme: Dark/Light mode
Update Frequency: Real-time or daily calculation
Reading the Display
Dashboard Table (Top Right):
Current Price vs Max Pain Level
Distance to Pain: Percentage gap (smaller = higher pin risk)
Pin Risk Assessment: HIGH/MEDIUM/LOW based on proximity and time
Days to Expiry and Strike Count
Model complexity level
Visual Elements:
Red Line: Max Pain level where payout is minimized
Colored Zone: Pin risk area around max pain
Dotted Lines: Major strike levels (green = support, orange = resistance)
Color Bar: Pain heatmap (blue = high pain, red = low pain/max pain zones)
Horizontal Bars: Gamma exposure (green = positive, red = negative)
Yellow Dotted Line: Gamma flip level where hedging behavior changes
Trading Applications
Expiration Pinning:
When price is near max pain with limited time remaining, there's increased probability of gravitating toward that level as market makers hedge their positions.
Support and Resistance:
High open interest strikes often act as magnets, with max pain representing the strongest gravitational pull.
Volatility Expectations:
Above gamma flip: Expect dampened volatility (long gamma environment)
Below gamma flip: Expect amplified moves (short gamma environment)
Risk Assessment:
The pin risk indicator helps gauge likelihood of price manipulation near expiry, with HIGH risk suggesting potential range-bound action.
Best Practices
Setup Recommendations
Start with Model Complexity set to "Standard"
Use realistic strike ranges (8-12% for most assets)
Set put/call ratio based on current market sentiment
Adjust implied volatility to match current levels
Interpretation Guidelines:
Small distance to pain + short time = high pin probability
Large gamma bars indicate key hedging levels to monitor
Heatmap intensity shows strength of pain concentration
Multiple nearby strikes can create wider pin zones
Update Strategy:
Use "Daily" updates for cleaner visuals during trading hours
Switch to "Every Bar" for real-time analysis near expiration
Monitor changes in max pain level as new options activity emerges
Important Disclaimers
This is a modeling tool using synthetic data, not live market information. While the calculations are mathematically sound and the modeling realistic, actual market dynamics involve numerous factors not captured in any single indicator.
Max pain represents theoretical minimum payout levels and suggests where natural market forces may create gravitational pull, but it does not guarantee price movement or predict exact expiration levels. Market gaps, news events, and changing volatility can override these dynamics.
Use this tool as additional context for your analysis, not as a standalone trading signal. The synthetic nature of the data makes it most valuable for understanding market structure and potential zones of interest rather than precise price prediction.
Technical Notes
The indicator uses established option pricing principles with simplified implementations optimized for Pine Script performance. Gamma calculations use standard financial models while pain calculations follow the industry-standard definition of minimized option payouts.
All visual elements use fixed positioning to prevent movement when scrolling charts, and the tool includes performance optimizations to handle real-time calculation without timeout errors.
Estimated Manipulation Movement Signal [AlgoPoint]Follow the Footprints of Whale Movements That Drive the Market
Overview
The market is not always driven by natural supply and demand. Large players—often called "whales" or institutions—can create artificial price movements to trigger stop-losses, induce panic or FOMO, and build their large positions at favorable prices. These events are known as "stop hunts" or "liquidity grabs."
The EMMS indicator is a specialized tool designed to detect these specific moments of potential market manipulation. It does not follow trends in a traditional sense; instead, it identifies high-probability reversal points created by the calculated actions of Smart Money trapping other market participants.
How It Works: The 3-Module Logic
The indicator uses a multi-stage confirmation process to identify a potential stop hunt:
1. Anomaly Detection: The engine first scans the chart for "Anomaly Candles." These are candles with unusually high volume and a very long wick relative to their body. This combination signals a sudden, forceful, and potentially unnatural price push.
2. Liquidity Zone Detection: The indicator automatically identifies and tracks recent significant swing highs and lows. These levels are considered "Liquidity Zones" because they are areas where a large number of stop-loss orders are likely clustered. These are the "hunting grounds" for whales.
3. The Stop Hunt Signal: A final signal is generated only when these two events align in a specific sequence:
An Anomaly Candle (high volume, long wick) spikes through a previously identified Liquidity Zone.
The same candle then reverses, closing back inside the previous price range.
This sequence confirms that the move was likely a "trap" designed to engineer liquidity, and a reversal in the opposite direction is now highly probable.
How to Interpret & Use This Indicator
BUY Signal: A BUY signal appears after a sharp price drop that pierces a recent swing low (taking out the stops of long positions) and then aggressively reverses to close higher. This suggests that Smart Money has absorbed the panic selling they just induced. The signal indicates a potential move UP.
SELL Signal: A SELL signal appears after a sharp price spike that pierces a recent swing high (taking out the stops of short positions) and then aggressively reverses to close lower. This suggests that Smart Money has sold into the FOMO buying they just created. The signal indicates a potential move DOWN.
This indicator is best used as a high-probability confirmation tool, ideally in conjunction with your understanding of the overall market trend and structure.
Volume-Weighted RSI & Multi-Normalized MACD### Description for Publishing: Volume-Weighted RSI & Multi-Normalized MACD
**Overview**
The "Volume-Weighted RSI & Multi-Normalized MACD" indicator is a powerful and versatile tool designed for traders seeking enhanced momentum and trend analysis. Combining a volume-weighted Relative Strength Index (VW-RSI) with a customizable Moving Average Convergence Divergence (MACD) featuring multiple normalization methods, this indicator provides deep insights into market dynamics. It supports multi-timeframe (MTF) analysis and includes an optional stepped plotting mode for discrete signal visualization, making it ideal for both trend-following and mean-reversion strategies across various markets (stocks, forex, crypto, etc.).
**Key Features**
1. **Volume-Weighted RSI (VW-RSI)**:
- A modified RSI that incorporates trading volume for greater sensitivity to market activity.
- Normalized to a user-defined range (default: -50 to +50) for consistent analysis.
- Optional smoothing with multiple moving average types (SMA, EMA, WMA, VWMA, SMMA, or SMA with Bollinger Bands) to reduce noise and highlight trends.
- Overbought (+20) and oversold (-20) levels for quick reference.
2. **Multi-Normalized MACD**:
- Offers six normalization methods for MACD, allowing traders to tailor the output to their strategy:
- Normalized Volume Weighted MACD (unbounded).
- Min-Max Normalization (bounded).
- Volatility Normalization (unbounded, volatility-adjusted).
- Volatility Normalization with Min-Max (bounded).
- Hyperbolic Tangent Normalization (bounded).
- Arctangent Normalization (bounded).
- Min-Max with Smoothing (bounded).
- All bounded methods scale to the user-defined range (default: -50 to +50), ensuring comparability with VW-RSI.
- Dynamic color changes for MACD line (lime/red) and histogram (aqua/blue/red/maroon) based on momentum and signal line crosses.
3. **Stepped Plotting Mode**:
- Optional mode to plot RSI and MACD as discrete, stepped lines, reducing noise by only updating when values change significantly (configurable thresholds).
- Ideal for traders focusing on clear, actionable signal changes.
4. **Multi-Timeframe Support**:
- Configurable timeframe input (default: chart timeframe) for analyzing RSI and MACD on higher or lower timeframes, enhancing cross-timeframe strategies.
5. **Customizable Display**:
- Toggle options to show/hide MACD line, signal line, histogram, and cross dots.
- Bollinger Bands for RSI smoothing (optional) with adjustable standard deviation multiplier.
- Clear visual cues with horizontal lines for overbought/oversold levels, midline, and MACD bounds.
**Usage Instructions**
1. **Add to Chart**: Apply the indicator to any symbol (e.g., BTCUSD, SPY) on any timeframe (1H, 1D, etc.).
2. **Configure Settings**:
- **General**: Adjust `Lower Bound` (-50 default) and `Upper Bound` (+50 default) for the output range. Set `Timeframe` for MTF analysis. Enable `Stepped?` for discrete plotting.
- **RSI**: Choose `Price Source` (default: ohlc4), `RSI Length` (default: 9), and smoothing options (e.g., EMA, Bollinger Bands). Adjust `RSI Diff Threshold` for stepped mode.
- **MACD**: Select `Price Source`, `Fast Length` (9), `Slow Length` (21), `Signal Length` (9), and a normalization method (default: Volatility Min-Max). Adjust `MACD Diff Threshold` for stepped mode.
- **Display Options**: Toggle MACD components and histogram colors for clarity.
3. **Interpretation**:
- **VW-RSI**: Watch for crosses above +20 (overbought) or below -20 (oversold) for potential reversals. Use smoothed RSI or Bollinger Bands for trend confirmation.
- **MACD**: Look for MACD/Signal line crosses (dots indicate crossings) and histogram changes for momentum shifts. Bounded normalizations align with RSI for unified analysis.
- **Stepped Mode**: Focus on significant changes in RSI/MACD for clearer signals.
4. **Companion Overlay**: For visualization on the main price chart, use the companion script "VW-RSI & MACD Price Overlay" (available separately, requires this script to be published). It plots RSI and MACD as price-scaled echo lines, with toggles to show/hide and customizable scaling (high/low or ATR).
**Who Is This For?**
- **Trend Traders**: Use MACD normalizations and MTF to identify momentum shifts across timeframes.
- **Mean-Reversion Traders**: Leverage VW-RSI’s overbought/oversold signals for entry/exit points.
- **Technical Analysts**: Customize normalization and smoothing to match specific market conditions.
- **All Markets**: Works on stocks, forex, cryptocurrencies, and more, with any timeframe.
**Notes**
- Unbounded MACD normalizations (`enable_nvw`, `enable_vol`) may produce values outside -50/+50, suitable for volatility-focused strategies.
- For price chart overlay, publish this script and use its ID in the companion script’s `request.security` call.
- Adjust scaling inputs in the companion script for optimal visualization on volatile or stable assets.
**Author’s Note**
Developed by NEPOLIX, this indicator combines volume-weighted precision with flexible normalization for robust technical analysis. Feedback and suggestions are welcome to enhance future versions!
Initial Balance SMC-V3
Initial Balance SMC-V3 – An Advanced Mean Reversion Indicator for Index Markets
The Initial Balance SMC-V3 indicator is the result of continuous refinement in mean reversion trading, with a specific focus on index markets (such as DAX, NASDAQ, S&P 500, etc.). Designed for high-liquidity environments with controlled volatility, it excels at precisely identifying value zones and statistical reversal points within market structure.
🔁 Mean Reversion at Its Core
At the heart of this indicator lies a robust mean reversion logic: rather than chasing extreme breakouts, it seeks returns toward equilibrium levels after impulsive moves. This makes it especially effective in ranging markets or corrective phases within broader trends—situations where many traders get caught in false breakouts.
🎯 Signals Require Breakout + Confirmation
Signals are never generated impulsively. Instead, they require a clear sequence of confirmations:
Break of a key level (e.g., Initial Balance high/low or an SMC zone);
Price re-entry into the range accompanied by a crossover of customizable moving averages (SMA, EMA, HULL, TEMA, etc.);
RSI filter to avoid entries in overbought/oversold extremes;
Volatility filter (ATR) to skip low-volatility, choppy conditions.
This multi-layered approach drastically reduces false signals and significantly improves trade quality.
📊 Built-in Multi-Timeframe Analysis
The indicator features native multi-timeframe logic:
H1 / 15-minute charts: for structural analysis and identification of Supply & Demand zones (SMC);
M1 / M5 charts: for precise trade execution, with targeted entries and dynamic risk management.
SMC zones are calculated on higher timeframes (e.g., 4H) to ensure structural reliability, while actual trade signals trigger on lower timeframes for maximum precision.
⚙️ Advanced Customization
Full choice of moving average type (SMA, EMA, WMA, RMA, VWMA, HULL, TEMA, ZLEMA, etc.);
Revenge Trading logic: after a stop loss is hit without reaching the 1:1 breakeven level, the indicator automatically prepares for a counter-trade;
Dynamic ATR-based stop loss with customizable multiplier;
Session filters to trade only during optimal liquidity windows (e.g., European session).
🧠 Who Is It For?
This indicator is ideal for traders who:
Primarily trade indices;
Prefer mean reversion strategies over pure trend-following;
Seek a disciplined, rule-based system with multiple confluence filters;
Use a multi-timeframe approach to separate analysis from execution.
In short: Initial Balance SMC-V3 is more than just an indicator—it’s a complete trading framework for mean reversion on index markets, where every signal emerges from a confluence of statistical, structural, and temporal factors.
Happy trading! 📈
Goldbach Time – algopathingThe Goldbach Time indicator highlights intra-day timestamps that align with curated “Goldbach” time transforms. It is a time-only study intended for timing research and session-rhythm confluence: it flags minutes where one or more simple transforms of the clock (e.g. hour + minute, hour − minute, minute ± 1) hit values from a predefined integer set. Traders use those flagged minutes as a time-based confluence input alongside price structure (PO3 / Goldbach price levels, order blocks, liquidity, etc.).
CNagda Anchor2EntryCNagda Anchor2Entry Pine Script v6 overlay indicator pulls higher-timeframe (HTF) signal events to define anchor high/low levels and then projects visual entry labels on the lower-timeframe (LTF). It also draws auto-oriented Fibonacci retracement/extension levels for context, but it does not execute orders, stops, or targets—only visual guidance.
Inputs
Key inputs include Lookback Length for HTF scanning and a Signal Timeframe used with request.security to import HTF events onto the active chart.
Entry behavior can be set to “Confirm only” or “Wait candle,” trade side can be restricted to Buy/Sell/Both, and individual strategies (Buy WAIT/S1; Sell REV/S1/S2/S3) can be toggled.
HTF logic
The script defines WAIT/BUY setup and confirmation, SELL reversal on breaking the WAIT BUY low, and several volume/candle-based patterns (Sell S1/S2/S3, Buy S1).
It captures the associated highs/lows at those events with ta.valuewhen and imports them via request.security to form anchors (anc_hi/anc_lo) and “new trigger” booleans that gate label creation on the LTF.
Flip entries
When enabled, “Flip entries” generate contrarian labels based on breaking or confirming HTF anchors: crossing above anc_hi can trigger a flip-to-sell label, and crossing below anc_lo can trigger a flip-to-buy label.
The flip mode supports Immediate (on cross) or Confirm (on sustained break) to control how strict the trigger is.
Fibonacci drawing
User-specified Fib levels are parsed from a string, safely converted to floats, and drawn as dotted horizontal lines only when they fall inside an approximate visible viewport. Orientation (up or down) is decided automatically from pending signal direction and a simple context score (candle bias, trend, and price vs. mid), with efficient redraw/clear guards to avoid clutter.
Dynamic anchors
If HTF anchors are missing or too far from current price (checked with an ATR-based threshold), the script falls back to local swing highs/lows to keep the reference range relevant. This dynamic switch helps Fib levels and labels remain close to current market structure without manual intervention.
Signal labels
Labels are created only on confirmed bars to avoid repainting noise, with one “latest” label kept by deleting the previous one. The script places BUY/SELL labels for WAIT/CONFIRM, direct HTF patterns (Buy S1, Sell S1/S2/S3), and contrarian flip events, offset slightly from highs/lows with clear coloring and configurable sizes.
Visual context
Bars are softly colored (lime tint for bullish, orange tint for bearish) for quick context, and everything renders as an overlay on the price chart. Fib labels include a Δ readout (distance from current close), and line extension length, label sizes, and viewport padding are adjustable.
How to use
Set the Signal Timeframe and Lookback Length to establish which HTF structures and ranges will drive the anchors and entry conditions. Choose entry flow (Wait vs Confirm), enable Flip if contrarian triggers are desired, select the trade side, toggle strategies, and customize Fibonacci levels plus dynamic-anchor fallback for practical on-chart guidance.
Notes
This is a visual decision-support tool; it does not place trades, stops, or targets and should be validated on charts before live use. It is written for Pine Script v6 and relies heavily on request.security for HTF-to-LTF transfer of signals and anchors.
Larry Williams Donchian Breakout StrategyThis strategy is based on a breakout of the Donchian Channel with customizable risk-reward parameters and optional entry filters. It combines visual elements from the Donchian Channel indicator with a fully executable trading logic.
How entries are generated
A long trade is opened when the chosen signal price (either bar’s High or Close) closes above the upper Donchian Channel on each of the three previous bars.
A short trade is opened when the chosen signal price (either bar’s Low or Close) closes below the lower Donchian Channel on each of the three previous bars.
Both long and short signals can be configured to use either High/Low or Close values for confirmation.
Stop Loss and Take Profit
The Stop Loss is automatically placed relative to the Donchian middle line with a user-defined offset.
The Take Profit is calculated using a Risk/Reward multiplier.
Separate risk-reward ratios can be set for long and short positions.
Visual elements
The Donchian Channel (upper, lower, and middle bands) is plotted on the chart.
High-High, Higher-Low, Lower-High, and Lower-Low markers are displayed when pivot conditions are met.
Each trade is visualized with three horizontal lines drawn for a limited number of recent trades:
Entry (blue)
Stop Loss (red)
Take Profit (green)
To keep the chart clean, only the last ten trades (30 lines in total) remain visible.
Entry filters
Two optional filters are included and can be enabled or disabled independently:
LWTI filter – Long trades are only allowed when the Larry Williams Trade Index is green, and short trades are only allowed when the index is red.
Volume filter – Trades are only allowed when the current volume is above its 30-period SMA.
Use case
The strategy is designed to test Donchian Channel breakout conditions with risk management and simple filters. It can serve as a foundation for further development, allowing traders to experiment with additional filters or money management rules.
Disclaimer
This strategy is for educational and research purposes only. It is not financial advice. Always test thoroughly before using any strategy in live trading, and make trading decisions at your own risk.
Hosoda’s CloudsMany investors aim to develop trading systems with a high win rate, mistakenly associating it with substantial profits. In reality, high returns are typically achieved through greater exposure to market trends, which inevitably lowers the win rate due to increased risk and more volatile conditions.
The system I present, called “Hosoda’s Clouds” in honor of Goichi Hosoda , the creator of the Ichimoku Kinko Hyo indicator, is likely one of the first profitable systems many traders will encounter. Designed to capture trends, it performs best in markets with clear directional movements and is less suitable for range-bound markets like Forex, which often exhibit lateral price action.
This system is not recommended for low timeframes, such as minute charts, due to the random and emotionally driven nature of price movements in those periods. For a deeper exploration of this topic, I recommend reading my article “Timeframe is Everything”, which discusses the critical importance of selecting the appropriate timeframe.
I suggest testing and applying the “Hosoda’s Clouds” strategy on assets with a strong trending nature and a proven track record of performance. Ideal markets include Tesla (1-hour, 4-hour, and daily), BTC/USDT (daily), SPY (daily), and XAU/USD (daily), as these have consistently shown clear directional trends over time.
Commissions and Configuration
Commissions can be adjusted in the system’s settings to suit individual needs. For evaluating the effectiveness of “Hosoda’s Clouds,” I’ve used a standard commission of $1 per order as a baseline, though this can be modified in the code to accommodate different brokers or preferences.
The margin per trade is set to $1,000 by default, but users are encouraged to experiment with different margin settings in the configuration to match their trading style.
Rules of the “Hosoda’s Clouds” System (Bullish Strategy)
This strategy is designed to capture trending movements in bullish markets using the Ichimoku Kinko Hyo indicator. The rules are as follows:
Long Entry: A long position is triggered when the Tenkan-sen crosses above the Kijun-sen below the Ichimoku cloud, identifying potential reversals or bounces in a bearish context.
Stop Loss (SL): Placed at the low of the candle 12 bars prior to the entry candle. This setting has proven optimal in my tests, but it can be adjusted in the code based on risk tolerance.
Take Profit (TP): The position is closed when the Tenkan-sen crosses below the bottom of the Ichimoku cloud (the minimum of Senkou Span A and Senkou Span B).
Notes on the Code
margin_long=0: Ideal for strategies requiring a fixed position size, particularly useful for manual entries or testing with a constant capital allocation.
margin_long=100: Recommended for high-frequency systems where positions are closed quickly, simulating gradual growth based on realized profits and reflecting real-world broker constraints.
System Performance
The following performance metrics account for $1 per order commissions and were tested on the specified assets and timeframes:
Tesla (H1)
Trades: 148
Win Rate: 29.05%
Period: Jan 2, 2014 – Jan 6, 2020 (+172%)
Simple Annual Growth Rate: +34.3%
Trades: 130
Win Rate: 30.77%
Period: Jan 2, 2020 – Sep 24, 2025 (+858.90%)
Simple Annual Growth Rate: +150.7%
Tesla (H4)
Trades: 102
Win Rate: 32.35%
Period: Jun 29, 2010 – Sep 24, 2025 (+11,356.36%)
Simple Annual Growth Rate: +758.5%
Tesla (Daily)
Trades: 56
Win Rate: 35.71%
Period: Jun 29, 2010 – Sep 24, 2025 (+3,166.64%)
Simple Annual Growth Rate: +211.5%
BTC/USDT (Daily)
Trades: 44
Win Rate: 31.82%
Period: Sep 30, 2017 – Sep 24, 2025 (+2,592.23%)
Simple Annual Growth Rate: +324.8%
SPY (Daily)
Trades: 81
Win Rate: 37.04%
Period: Jan 23, 1993 – Sep 24, 2025 (+476.90%)
Simple Annual Growth Rate: +14.3%
XAU/USD (Daily)
Trades: 216
Win Rate: 32.87%
Period: Jan 6, 1833 – Sep 24, 2025 (+5,241.73%)
Simple Annual Growth Rate: +27.1%
SPX (Daily)
Trades: 217
Win Rate: 38.25%
Period: Feb 1, 1871 – Sep 24, 2025 (+16,791.02%)
Simple Annual Growth Rate: +108.1%
Conclusion
With the “ Hosoda’s Clouds ” strategy, I aim to showcase the potential of technical analysis to generate consistent profits in trending markets, challenging recent doubts about its effectiveness. My goal is for this system to serve as both a practical tool for traders and a source of inspiration for the trading community I deeply respect. I hope it encourages the creation of new strategies, fosters creativity in technical analysis, and empowers traders to approach the markets with confidence and discipline.
WaveTrend MACD with Signals - LBI am writing to provide a clear explanation of how the Relative Strength Index (RSI) and the Moving Average Convergence Divergence (MACD) indicators can be used together to enhance trading decisions.
1. Purpose of Each Indicator
MACD identifies overall market trend and momentum by tracking the relationship between two moving averages.
RSI measures the speed and magnitude of price changes to highlight overbought or oversold conditions.
2. Combined Method
Trend Direction: Begin by confirming the trend with the MACD. A MACD line above the signal line and zero suggests an uptrend; below both indicates a downtrend.
Entry Timing: Use the RSI to time entries within that trend. In an uptrend, an RSI reading near 30–40 that turns upward signals a potential buy. In a downtrend, an RSI reading near 60–70 that turns downward signals a potential sell.
Momentum Confirmation: Ideally, the MACD histogram should be expanding in the direction of the intended trade to confirm strength.
3. Practical Application
For example, a long position may be considered when the MACD confirms an uptrend and the RSI shows a temporary dip (near 40) before rising. Conversely, a short position may be considered when the MACD confirms a downtrend and the RSI briefly rises toward 60 before declining.
This combination allows traders to align with the prevailing trend while entering at more favorable moments, thus improving overall trade quality and risk management.
mohamed rebouh zigzag//
// mohamed rebouh
//@version=5
//
// THIS CODE IS BASED FROM THE MT4 ZIGZAG INDICATOR
// THE ZIGZAG SETTINGS FOR THE MAIN ONE ON TRADINGVIEW DO NOT WORK THE SAME AS MT4
// I HOPE U LOVE IT
//
indicator(' mohamed rebouh ', overlay=true)
// inputs
Depth = input(12, title='Depth') // Depth
Deviation = input(5, title='Deviation') // Deviation
// ZigZag
var lastlow = 0.0
var lasthigh = 0.0
data(x) =>
d = request.security(syminfo.tickerid, timeframe.period, x)
d
getLow(x, y, z, a) =>
lastlow1 = y
v = data(x)
m = v == lastlow1 or data(z) - v > a * syminfo.mintick
if v != lastlow1
lastlow1 := v
if m
v := 0.0
v
getHigh(x, y, z, a) =>
lasthigh1 = y
v = data(x)
m = v == lasthigh1 or v - data(z) > a * syminfo.mintick
if v != lasthigh1
lasthigh1 := v
if m
v := 0.0
v
= getLow(ta.lowest(Depth), lastlow, low, Deviation)
lastlow := e
zBB = v != 0.0
= getHigh(ta.highest(Depth), lasthigh, high, Deviation)
lasthigh := e1
zSS = v1 != 0.0
zigzagDirection = -1
zigzagHigh = 0
zigzagLow = 0
zigzagDirection := zBB ? 0 : zSS ? 1 : nz(zigzagDirection , -1)
virtualLow = zigzagLow + 1
if not zBB or zBB and zigzagDirection == zigzagDirection and low > low
zigzagLow := nz(zigzagLow ) + 1
zigzagLow
virtualHigh = zigzagHigh + 1
if not zSS or zSS and zigzagDirection == zigzagDirection and high < high
zigzagHigh := nz(zigzagHigh ) + 1
zigzagHigh
line zigzag = line.new(bar_index - zigzagLow, low , bar_index - zigzagHigh, high , color=color.red, style=line.style_solid, width=2)
if zigzagDirection == zigzagDirection
line.delete(zigzag )
Algorithmic Value Oscillator [CRYPTIK1]Algorithmic Value Oscillator
Introduction: What is the AVO? Welcome to the Algorithmic Value Oscillator (AVO), a powerful, modern momentum indicator that reframes the classic "overbought" and "oversold" concept. Instead of relying on a fixed lookback period like a standard RSI, the AVO measures the current price relative to a significant, higher-timeframe Value Zone .
This gives you a more contextual and structural understanding of price. The core question it answers is not just "Is the price moving up or down quickly?" but rather, " Where is the current price in relation to its recently established area of value? "
This allows traders to identify true "premium" (overbought) and "discount" (oversold) levels with greater accuracy, all presented with a clean, futuristic aesthetic designed for the modern trader.
The Core Concept: Price vs. Value The market is constantly trying to find equilibrium. The AVO is built on the principle that the high and low of a significant prior period (like the previous day or week) create a powerful area of perceived value.
The Value Zone: The range between the high and low of the selected higher timeframe.
Premium Territory (Distribution Zone): When the oscillator moves into the glowing pink/purple zone above +100, it is trading at a premium.
Discount Territory (Accumulation Zone): When the oscillator moves into the glowing teal/blue zone below -100, it is trading at a discount.
Key Features
1. Glowing Gradient Oscillator: The main oscillator line is a dynamic visual guide to momentum.
The line changes color smoothly from light blue to neon teal as bullish momentum increases.
It shifts from hot pink to bright purple as bearish momentum increases.
Multiple transparent layers create a professional "glow" effect, making the trend easy to see at a glance.
2. Dynamic Volatility Histogram: This histogram at the bottom of the indicator is a custom volatility meter. It has been engineered to be adaptive, ensuring that the visual differences between high and low volatility are always clear and dramatic, no matter your zoom level. It uses a multi-color gradient to visualize the intensity of market volatility.
3. Volatility Regime Dashboard: This simple on-screen table analyzes the histogram and provides a clear, one-word summary of the current market state: Compressing, Stable, or Expanding.
How to Use the AVO: Trading Strategies
1. Reversion Trading This is the most direct way to use the indicator.
Look for Buys: When the AVO line drops into the teal "Accumulation Zone" (below -100), the price is trading at a discount. Watch for the oscillator to form a bottom and start turning up as a signal that buying pressure is returning.
Look for Sells: When the AVO line moves into the pink "Distribution Zone" (above +100), the price is trading at a premium. Watch for the oscillator to form a peak and start turning down as a signal that selling pressure is increasing.
2. Best Practices & Settings
Timeframe Synergy: The AVO is most effective when your chart timeframe is lower than your selected "Value Zone Source." For example, if you trade on the 1-hour chart, set your Value Zone to "Previous Day."
Confirmation is Key: This indicator provides powerful context, but it should not be used in isolation. Always combine its readings with your primary analysis, such as market structure and support/resistance levels.
Market Pressure Oscillator█ OVERVIEW
The Market Pressure Oscillator is an advanced technical indicator for TradingView, enabling traders to identify potential trend reversals and momentum shifts through candle-based pressure analysis and divergence detection. It combines a smoothed oscillator with moving average signals, overbought/oversold levels, and divergence visualization, enhanced by customizable gradients, dynamic band colors, and alerts for quick decision-making.
█ CONCEPT
The indicator measures buying or selling pressure based on candle body size (open-to-close difference) and direction, with optional smoothing for clarity and divergence detection between price action and the oscillator. It relies solely on candle data, offering insights into trend strength, overbought/oversold conditions, and potential reversals with a customizable visual presentation.
█ WHY USE IT?
- Divergence Detection: Identifies bullish and bearish divergences to reinforce signals, especially near overbought/oversold zones.
- Candle Pressure Analysis: Measures pressure based on candle body size, normalized to a ±100 scale.
- Signal Generation: Provides buy/sell signals via overbought/oversold crossovers, zero-line crossovers, moving average zero-line crossovers, and dynamic band color changes.
- Visual Clarity: Uses dynamic colors, gradients, and fill layers for intuitive chart analysis.
Flexibility: Extensive settings allow customization to individual trading preferences.
█ HOW IT WORKS?
- Candle Pressure Calculation: Computes candle body size as math.abs(close - open), normalized against the average body size over a lookback period (avgBody = ta.sma(body, len)). - Candle direction (bullish: +1, bearish: -1, neutral: 0) is multiplied by body weight to derive pressure.
- Cumulative Pressure: Sums pressure values over the lookback period (Lookback Length) and normalizes to ±100 relative to the maximum possible value.
- Smoothing: Optionally applies EMA (Smoothing Length) to normalized pressure.
- Moving Average: Calculates SMA (Moving Average Length) for trend confirmation (Moving Average (SMA)).
- Divergence Detection: Identifies bullish/bearish divergences by comparing price and oscillator pivot highs/lows within a specified range (Pivot Length). Divergence signals appear with a delay equal to the Pivot Length.
- Signals: Generates signals for:
Crossing oversold upward (buy) or overbought downward (sell).
Crossing the zero line by the oscillator or moving average (buy/sell).
Bullish/bearish divergences, marked with labels, enhancing signals, especially near overbought/oversold zones.
Dynamic band color changes when the moving average crosses MA overbought/oversold thresholds (green for oversold, red for overbought).
- Visualization: Plots the oscillator and moving average with dynamic colors, gradient fills, transparent bands, and labels, with customizable overbought/oversold levels.
Alerts: Built-in alerts for divergences, overbought/oversold crossovers, and zero-line crossovers (oscillator and moving average).
█ SETTINGS AND CUSTOMIZATION
- Lookback Length: Period for aggregating candle pressure (default: 14).
- Smoothing Length (EMA): EMA length for smoothing the oscillator (default: 1). Higher values smooth the signal but may reduce signal frequency; adjust overbought/oversold levels accordingly.
- Moving Average Length (SMA): SMA length for the moving average (default: 14, minval=1). Higher values make SMA a trend indicator, requiring adjusted MA overbought/oversold levels.
- Pivot Length (Left/Right): Candles for detecting pivot highs/lows in divergence calculations (default: 2, minval=1). Higher values reduce noise but add delay equal to the set value.
- Enable Divergence Detection: Enables divergence detection (default: true).
- Overbought/Oversold Levels: Thresholds for the oscillator (default: 30/-30) and moving average (default: 10/-10). For the moving average, no arrows appear; bands change color from gray to green (oversold) or red (overbought), reinforcing entry signals.
- Signal Type: Select signals to display: "None", "Overbought/Oversold", "Zero Line", "MA Zero Line", "All" (default: "Overbought/Oversold").
- Colors and Gradients: Customize colors for bullish/bearish oscillator, moving average, zero line, overbought/oversold levels, and divergence labels.
- Transparency: Adjust gradient fill transparency (default: 70, minval=0, maxval=100) and band/label transparency (default: 40, minval=0, maxval=100) for consistent visuals.
- Visualizations: Enable/disable moving average, gradients for zero/overbought/oversold levels, and gradient fills.
█ USAGE EXAMPLES
- Momentum Analysis: Observe the MPO Oscillator above 0 for bullish momentum or below 0 for bearish momentum. The SMA, being smoother, reacts slower and can confirm trend direction as a noise filter.
- Reversal Signals: Look for buy triangles when the oscillator crosses oversold upward, especially when the SMA is below the MA oversold threshold and the band turns green. Similarly, seek sell triangles when crossing overbought downward, with the SMA above the MA overbought threshold and the band turning red.
- Using Divergences: Treat bullish (green labels) and bearish (red labels) divergences as reinforcement for other signals, especially near overbought/oversold zones, indicating stronger potential trend reversals.
- Customization: Adjust lookback length, smoothing, and moving average length to specific instruments and timeframes to minimize false signals.
█ USER NOTES
Combine the indicator with tools like Fibonacci levels or pivot points to enhance accuracy.
Test different settings for lookback length, smoothing, and moving average length on your chosen instrument and timeframe to find optimal values.
Multi-Timeframe MACD Score (Customizable)this is a momentum based indicator to know the trend so we go with the trend.
UpDownBow + BullBear ZoneUpDownBow + BullBear UpDownBow + BullBear ZoneUpDoUpDownBow + BullBear ZoneUpDownBow + BullBear ZoneUpDownBow + BullBear ZoneUpDownBow + BullBear ZoneUpDownBow + BullBear ZonewnBow + BullBear ZoneUpDownBow + BullBear UpDownBow + BullBear ZoneUpDoUpDownBow + BullBear ZoneUpDownBow + BullBear ZoneUpDownBow + BullBear ZoneUpDownBow + BullBear ZoneUpDownBow + BullBear ZonewnBow + BullBear ZoneUpDownBow + BullBear UpDownBow + BullBear ZoneUpDoUpDownBow + BullBear ZoneUpDownBow + BullBear ZoneUpDownBow + BullBear ZoneUpDownBow + BullBear ZoneUpDownBow + BullBear ZonewnBow + BullBear ZoneUpDownBow + BullBear UpDownBow + BullBear ZoneUpDoUpDownBow + BullBear ZoneUpDownBow + BullBear ZoneUpDownBow + BullBear ZoneUpDownBow + BullBear ZoneUpDownBow + BullBear ZonewnBow + BullBear ZoneUpDownBow + BullBear UpDownBow + BullBear ZoneUpDoUpDownBow + BullBear ZoneUpDownBow + BullBear ZoneUpDownBow + BullBear ZoneUpDownBow + BullBear ZoneUpDownBow + BullBear ZonewnBow + BullBear ZoneUpDownBow + BullBear UpDownBow + BullBear ZoneUpDoUpDownBow + BullBear ZoneUpDownBow + BullBear ZoneUpDownBow + BullBear ZoneUpDownBow + BullBear ZoneUpDownBow + BullBear ZonewnBow + BullBear ZoneUpDownBow + BullBear UpDownBow + BullBear ZoneUpDoUpDownBow + BullBear ZoneUpDownBow + BullBear ZoneUpDownBow + BullBear ZoneUpDownBow + BullBear ZoneUpDownBow + BullBear ZonewnBow + BullBear ZoneUpDownBow + BullBear UpDownBow + BullBear ZoneUpDoUpDownBow + BullBear ZoneUpDownBow + BullBear ZoneUpDownBow + BullBear ZoneUpDownBow + BullBear ZoneUpDownBow + BullBear ZonewnBow + BullBear Zone
MACD Swing Trader MACD Swing Trader
Overview
The MACD Swing Trader is a Pine Script v5 indicator designed for swing trading on the BTC/USDT pair, optimized for 4-hour or daily timeframes. Built on the classic MACD (Moving Average Convergence Divergence) indicator, it incorporates a 200-period EMA trend filter and a unique feature to prevent consecutive Buy or Sell signals, ensuring cleaner and more reliable trade setups. This indicator is ideal for traders seeking high-probability entries and exits in the volatile crypto market, with a backtested win rate of approximately 80-87% on historical BTC/USDT data.
Features
MACD-Based Signals: Generates Buy signals on MACD line crossovers above the signal line (below zero) and Sell signals on crossunders (above zero), capturing momentum shifts.
EMA 200 Trend Filter: Only triggers Buy signals in uptrends (price > EMA 200) and Sell signals in downtrends (price < EMA 200), aligning trades with the broader market direction.
No Consecutive Signals: Prevents repetitive signals (e.g., no back-to-back Buy signals) until an opposite signal occurs, reducing noise and improving signal quality.
Visual Aids: Displays the EMA 200 line, color-coded trend background (green for uptrend, red for downtrend), and clear Buy/Sell labels on the chart.
Customizable Parameters: Adjustable MACD lengths (default: 12, 26, 9) and EMA length (default: 200) for fine-tuning to different market conditions.
Alerts: Built-in alert conditions for real-time notifications on Buy/Sell signals, compatible with TradingView's alert system.
Separate MACD Panel: Visualizes MACD and signal lines with a zero line for additional analysis.
How to Use
Setup: Add the indicator to TradingView by copying the Pine Script code into the Pine Editor and applying it to the BTC/USDT chart (recommended: 4h or daily timeframe).
Entry Rules:
Buy: Green "BUY" label appears below the price bar when MACD crosses above the signal line, MACD is below zero, and price is above EMA 200.
Sell: Red "SELL" label appears above the price bar when MACD crosses below the signal line, MACD is above zero, and price is below EMA 200.
Exit Rules: Use a trailing stop (e.g., ATR-based) or exit on the opposite signal. Aim for a risk-to-reward ratio of 2:1 or 3:1.
Backtesting: Validate performance using TradingView’s Strategy Tester. Historical backtests suggest a win rate of ~80-87% on BTC/USDT 4h, though results may vary.
Risk Management: Always use proper risk management (e.g., 1-3% risk per trade) and test thoroughly before live trading.
Notes
Market Specificity: Optimized for BTC/USDT due to its volatility and trending nature. Test on other pairs before use.
Customization: Adjust MACD or EMA parameters for different timeframes or assets. Consider adding volume filters for enhanced accuracy.
Risk Warning: Trading cryptocurrencies involves significant risk. Past performance does not guarantee future results. Only risk capital you can afford to lose.
Community Sharing
Feel free to share this indicator with the TradingView community! It’s designed to help swing traders capture high-probability setups while minimizing signal clutter. Feedback and suggestions for improvements are welcome.
StdDev Supertrend {CHIPA}StdDev Supertrend ~ C H I P A is a supertrend style trend engine that replaces ATR with standard deviation as the volatility core. It can operate on raw prices or log return volatility, with optional smoothing to control noise.
Key features include:
Supertrend trailing rails built from a stddev scaled envelope that flips the regime only when price closes through the opposite rail.
Returns-based mode that scales volatility by log returns for more consistent behavior across price regimes.
Optional smoothing on the volatility input to tune responsiveness versus stability.
Directional gap fill between price and the active trend line on the main chart; opacity adapts to the distance (vs ATR) so wide gaps read stronger and small gaps stay subtle.
Secondary pane view of the rails with the same adaptive fade, plus an optional candle overlay for context.
Clean alerts that fire once when state changes
Use cases: medium-term trend following, stop/flip systems, and visual regime confirmation when you prefer stddev-based distance over ATR.
Note: no walk-forward or robustness testing is implied; parameter choices and risk controls are on you.