EBP Candle Marker### **EBP Candle Marker – TradingView Indicator**
The **EBP Candle Marker** is a specialized TradingView indicator designed to identify and highlight potential liquidity sweep candles. This indicator visually emphasizes key price action patterns where the market sweeps previous highs or lows and closes in the opposite direction, often signaling potential reversals or liquidity grabs.
---
### 📊 **Indicator Logic:**
1. **Bullish Sweep:**
- The current candle’s **low** is lower than the previous candle’s **low** (indicating a liquidity sweep).
- The **close** is above both the **open** and **close** of the previous candle.
2. **Bearish Sweep:**
- The current candle’s **high** is higher than the previous candle’s **high** (indicating a liquidity sweep).
- The **close** is below both the **open** and **close** of the previous candle.
---
### 🎨 **Visual Representation:**
- **Yellow Candle Body:** Highlights any candle meeting the bullish or bearish sweep conditions.
---
### 🔔 **Alert Functionality:**
The indicator supports setting custom alerts in TradingView for:
- **Bullish Sweep Detected** – Notifies when a bullish sweep occurs.
- **Bearish Sweep Detected** – Notifies when a bearish sweep occurs.
These alerts are compatible across any timeframe, providing flexibility to monitor key market conditions.
---
### 📈 **Use Cases:**
- **Liquidity Sweep Detection:** Identify areas where the market may be triggering stop-loss orders or liquidity hunts.
- **Reversal Confirmation:** Enhance trade confirmation by identifying potential reversal zones.
- **Scalping & Swing Trading:** Suitable for both short-term and long-term trading strategies across multiple timeframes.
Candlestick analysis
PSP - NQ ES YMThe PSP - NQ ES YM indicator tracks the price movements of the NQ, ES, and YM futures to identify correlation and divergence between them.
🔸 Orange dot (above candle) → When NQ and ES have opposite trends (one up, one down).
🔹 Blue dot (below candle) → When YM differs from either NQ or ES, but NQ and ES are aligned.
🟠🔹 Both dots on the same candle → When NQ and ES differ, and one of them also differs from YM.
🟢 Green dot (above candle at 12 AM NY time) → Marks the daily open at 12 AM New York time.
This helps traders spot market divergence patterns between major indices and potential trading opportunities. 🚀
Sweep Engulf 2 Candle🔍 Overview:
This script identifies Bullish Engulfing and Bearish Engulfing candlestick patterns on the chart. These formations are widely used in technical analysis to spot potential reversals in price action. The indicator helps traders quickly identify these patterns by marking them directly on the chart with small arrows.
📌 Features:
✅ Bullish Engulfing & Bearish Engulfing Detection
✅ Customizable Display Options (Enable/Disable Bullish or Bearish signals)
✅ Real-Time Alerts (Receive notifications when a pattern is formed)
✅ Optimized Marker Size (Smaller icons for better chart visibility)
📊 How It Works:
1. Bullish Engulfing Condition:
The second candle's low is lower than the first candle's low.
The second candle's close is higher than the first candle's open (if the first candle is bearish) OR higher than the first candle's close (if the first candle is bullish).
2. Bearish Engulfing Condition:
The second candle's high is higher than the first candle's high.
The second candle's close is lower than the first candle's close (if the first candle is bearish) OR lower than the first candle's open (if the first candle is bullish).
⚙️ How to Use:
Add the script to your TradingView chart.
Adjust settings to enable/disable Bullish or Bearish Engulfing patterns.
Enable alerts to receive real-time notifications when a pattern is detected.
Use this indicator to support your technical analysis and trade decisions.
📌 Notes:
This indicator is best used in combination with other technical analysis tools like support & resistance levels, trendlines, or volume analysis.
It works on all timeframes and asset
15-Minute ORB by @RhinoTradezOverview
Hey traders, ready to jump on the morning breakout train? The 15-Minute ORB by @RhinoTradez
is your go-to pal for rocking the Opening Range Breakout (ORB) scene, zeroing in on the first 15 minutes of the U.S. market day—9:30 to 9:45 AM Eastern Time. Picture this: sleek orange lines mark the high and low of that opening rush, but they only hang out during regular trading hours (9:30 AM-4:00 PM ET) and reset fresh each day—no old baggage here! Built in Pine Script v6 for that cutting-edge feel, it’s loaded with breakout signals and alerts to keep your trading game strong—ideal for SPY, QQQ, or any ticker you love.
Crafted by @RhinoTradez
to fuel your daily grind—let’s hit those breakouts running!
What It Does
The ORB strategy is all about that early market spark: the 9:30-9:45 AM range sets the battlefield, and breakouts signal the charge. Here’s the rundown:
Captures the Range : Snags the high and low from the 9:30-9:45 AM ET candle—U.S. market kickoff, locked in.
Daily Refresh : Wipes yesterday’s lines at 9:30 AM ET each day—today’s all that matters.
Regular Hours Focus : Orange lines shine from 9:45 AM to 4:00 PM ET, vanishing outside those hours.
Breakout Signals : Green triangles for upside breaks, red for downside, all within regular hours.
Alerts You : Chimes in with “Price broke above 15-min ORB High: 597” (or below the low) when the move hits.
It’s your morning breakout blueprint—simple, focused, and trader-ready.
Functionality Breakdown:
15-Minute ORB Snap:
Locks the high and low of the 9:30-9:45 AM ET candle on a 15-minute chart (EST/EDT auto-adjusted).
Resets daily at 9:30 AM ET—yesterday’s range is outta here.
Regular Hours Only:
Lines glow from 9:45 AM to 4:00 PM ET, keeping pre-market and after-hours clean.
Breakout Flags:
Marks price busting above the ORB high (green triangle below bar) or below the low (red triangle above), only during 9:30 AM-4:00 PM.
Alert Action:
Drops a custom alert with the breakout price (e.g., “Price broke below 15-min ORB Low: 594”)—stay in the know, hands-free.
Customization Options
Keep it chill with one slick tweak:
ORB Line Color : Starts at orange—vibrant and trader-cool! Flip it to blue, purple, or any shade you dig in the settings. Make it yours.
How to Use It
Pop It On: Add it to a 15-minute chart—SPY, QQQ, or your hot pick works like a dream.
Time It Right: Set your chart to “America/New_York” time (Chart Settings > Time Zone) to sync with 9:30 AM ET.
Choose Your Color: Dive into the indicator settings and pick your ORB line color—orange kicks it off, but you’re in charge.
Set Alerts: Right-click the indicator, add an alert with “Any alert() function call,” and catch breakouts live.
Ride the Wave: Green triangle? Upward vibe. Red? Downside alert. Mix with volume or candles for extra punch.
Pro Tips
15-Minute Only : Tailored for that 9:30-9:45 AM ET candle—other timeframes won’t sync up.
Daily Reset : Lines refresh at 9:30 AM ET—always today’s play.
Breakout Boost : High volume or RSI can seal the deal on those triangle signals.
No Clutter : Lines stick to 9:30 AM-4:00 PM ET—your chart stays tidy.
Brought to you by @RhinoTradez
in Pine Script v6, this ORB script’s your morning breakout wingman. Slap it on, pick a color, and let’s chase those moves together! Happy trading!
Volume Width Based Candles
Overview
This indicator reimagines traditional candlestick charts by adjusting the horizontal width of each candle based on the bar’s trading volume. In other words, candles with higher volume appear wider, while those with lower volume are drawn narrower. This extra visual dimension can help traders quickly identify bars with significant volume relative to a defined lookback period.
Key Components
Volume Normalization:
The script calculates the highest volume over a user-defined lookback period (default is 100 bars).
Each bar’s volume is then normalized by dividing it by this maximum value. The result is a value between 0 and 1 that represents how the current volume compares to the maximum over the lookback.
Variable Candle Width Calculation:
A base multiplier (default set to 0.4) is used to control how much the volume influences the candle width.
The normalized volume is multiplied by this multiplier to compute an offset value.
Instead of using timestamps (which could lead to drawing objects too far into the future), the script uses the bar_index (the sequential index of bars) to determine the left and right positions of each candle.
The left and right x–positions are calculated by subtracting and adding the offset from the current bar index, respectively.
Candle Body & Wick Drawing:
Candle Body:
The body is drawn using box.new as a rectangle.
The top and bottom of the box are determined by the higher and lower values of the open and close prices.
The color of the candle is set based on whether the bar is bullish (green) or bearish (red).
Wicks:
The upper wick is drawn from the high of the bar down to the top of the body.
The lower wick is drawn from the low up to the bottom of the body.
These are created using line.new at the current bar index.
Handling Edge Cases:
The indicator includes conditions to avoid drawing errors on the very first bar (or any bar where prior data is unavailable).
It also converts the calculated x–coordinates (which are derived from the bar index plus a floating point offset) to integers since box.new requires integer values for positioning.
What It Tells the Trader
Volume Visualization:
Wider candles indicate bars where trading volume is high relative to recent history, potentially highlighting periods of increased market activity.
Narrower candles suggest lower volume, which can signal less interest or participation during that bar.
Contextual Price Action:
By integrating volume into the visual representation of each candle, traders get an immediate sense of the strength behind price movements.
This can be particularly useful for spotting potential breakouts, reversals, or confirming trends when analyzed alongside traditional price-based indicators.
Customization Options
Volume Lookback Period:
You can adjust the number of bars considered when determining the maximum volume. A shorter period may be more responsive to recent changes, while a longer period provides a broader context.
Base Width Multiplier:
Adjusting this multiplier changes how pronounced the effect of volume is on the candle’s width. Increasing it will make high-volume candles even wider, and decreasing it will reduce the difference between high and low volume candles.
Final Thoughts
This indicator is a creative way to overlay volume information directly onto the price chart without the need for separate volume bars. It provides an at-a-glance understanding of market activity and can be a valuable addition to a trader’s toolkit, especially for those who prefer visual cues integrated with price action. However, due to limitations (like the maximum number of drawn boxes), it’s best used on charts with a moderate amount of historical data or with appropriate adjustments to manage performance.
Capitulation Volume Detector by @RhinoTradezOverview
Hey traders, want to catch the market when it’s totally losing it? The Capitulation Volume Detector is your go-to buddy for spotting those wild moments when panic selling takes over. Picture this: prices plummet, volume explodes, and everyone’s bailing out—that’s capitulation, and it might just signal a turning point. This script throws a bright marker on your chart whenever the chaos hits, so you can decide if it’s time to jump in or sit tight. Built fresh in Pine Script v6, it’s sleek, customizable, and packs an alert to keep you posted—perfect for stocks, indices like SPY, or even crypto chaos.
Inspired by epic sell-offs like March 2020’s COVID crash, this tool’s here to help you navigate the storm with a smile (and maybe a profit).
What It Does
Capitulation volume is that “everyone’s out!” moment: a steep price drop meets a massive volume surge, hinting that sellers are tapped out. It’s not a guaranteed reversal—sometimes the bleeding continues—but it’s a loud clue that fear’s peaked. Here’s the magic:
Volume Check : Measures current volume against a customizable average (default: 20 bars).
Price Plunge : Tracks the percentage drop from the last close.
Capitulation Cal l: When volume rockets past your threshold (e.g., 2x average) and price tanks (e.g., -5%), you get a red triangle above the bar.
Stay Alert : Fires off a detailed message (e.g., “Volume 300M > 200M, Drop -10%”) so you’re never caught off guard.
Think of it as your market meltdown radar—simple, effective, and ready to roll.
Functionality Breakdown
Volume Surge Spotter :
Uses a 20-bar Simple Moving Average (SMA) of volume as your baseline.
Flags any bar where volume exceeds this average by your chosen multiplier (default: 2x).
Price Drop Detector :
Calculates the percentage change from the prior close.
Triggers when the drop’s bigger than your set limit (default: -5%).
Capitulation Marker:
Combines both signals: high volume + sharp drop = capitulation.
Slaps a red triangle above the bar for instant “whoa, there it is!” vibes.
Real-Time Alerts :
Sends a custom alert with volume and drop details, keeping you in the loop without babysitting the chart.
Customization Options
Tune it to your trading style with these easy settings:
Volume Multiplier (x Avg): Starts at 2.0 (2x average volume). Bump it to 3.0 for only the wildest spikes or dial it to 1.5 for more frequent catches. Range: 1.0-10.0, step 0.1.
Price Drop Threshold (%): Default 5.0 (a -5% drop). Go big with 10.0 for crash-level falls or ease to 3.0 for lighter dips. Range: 1.0-20.0, step 0.1.
Average Volume Period: Default 20 bars. Stretch it to 50 for a broader view or shrink to 10 for quick reactions. Range: 1-100.
Capitulation Marker Color: Red by default—because panic’s loud! Switch it to blue, green, or pink to match your chart’s personality.
How to Use It
Drop It On : Add it to any chart with volume data—SPY daily for market moves, /ES 15-minute for intraday action, or your go-to stock.
Play with Settings : Hit the indicator’s config gear and tweak the multiplier, drop threshold, period, or marker color to fit your vibe.
Set an Alert : Right-click the indicator, add an alert with “Any alert() function call,” and get pinged when capitulation strikes.
Watch the Action : Look for those red triangles on big drop days—pair with your favorite reversal signals for extra oomph.
Pro Tips
Daily Charts : Catch market-wide capitulations like March 23, 2020 (SPY: -10%, 3x volume).
Intraday : Spot flash crashes or sector sell-offs on 15-minute or 5-minute bars.
Context Matters : High volume alone isn’t enough—check the VIX or candlestick patterns (e.g., hammers) to confirm a bottom.
Dynamic Price ImpulseThis indicator is designed to capture price momentum without the lag typically found in traditional oscillators.
Core Mechanics
Instead of using simple price differences, the indicator normalizes changes relative to the average true range (ATR), making it adaptive to different volatility regimes.
By squaring the normalized change while preserving its sign, the indicator responds more aggressively to stronger price moves while remaining sensitive to smaller ones.
The indicator identifies periods when volatility is expanding, which often precede significant price movements.
Trading Strategy Applications
1. Momentum Signals:
o When the indicator crosses above zero, look for long entries
o When it crosses below zero, look for short entries
o The stronger the impulse (farther from zero), the stronger the signal
2. Early Trend Detection:
o Volatility expansion markers (yellow circles) often appear at the beginning of new trends
o Use these as early warning signals to prepare for potential entries
3. Trend Continuation:
o Strong readings in the direction of the trend suggest continuation
o Weakening readings suggest the trend may be losing steam
4. Counter-Trend Opportunities:
o Look for divergences between price and the indicator for potential reversals
o When price makes a new high but the indicator doesn't, consider potential shorts (and vice versa)
Fine-Tuning
• Length (14): Controls the lookback period for ATR calculation. Lower values make it more responsive but noisier.
• Threshold (1.5): Determines how much volatility needs to expand to trigger the volatility expansion signal.
• Smoothing (3): Reduces noise in the signal. Higher values reduce false signals but introduce more lag.
Volume Weighted Sign ChangeThe VWSCI measures the relationship between price reversals and volume. Specifically, it calculates the proportion of total volume in a given window that occurs at bars where the price changes direction—i.e., where the price difference switches from positive to negative or vice versa, indicating a local maximum or minimum.
• Low VWSCI values (close to 0) suggest that little volume is associated with price reversals, which typically occurs in strong trending markets where price moves consistently in one direction with high volume, and pullbacks (if any) occur on low volume.
• High VWSCI values (closer to 100) indicate that a significant portion of the volume is tied to price turning points, which is characteristic of a ranging or choppy market with frequent reversals.
This approach combines price action (via sign changes in price differences) and volume, offering a novel twist on traditional momentum or volume-based indicators like RSI, OBV, or the Volume-Price Trend.
Engulfing Candles (ATR-Based)This indicator detects Engulfing Patterns with an ATR-based filtering mechanism and trend confirmation. Unlike a basic engulfing pattern indicator that only checks if a current candle engulfs the previous one, this script incorporates trend detection using either the 50-period SMA alone or a combination of 50 and 200-period SMAs to ensure that signals align with the broader trend. The indicator identifies Bullish Engulfing patterns when a strong bullish candle engulfs a smaller bearish candle in a downtrend and Bearish Engulfing patterns when a strong bearish candle engulfs a smaller bullish candle in an uptrend. It also generates alerts and visually marks these patterns with labels ("BU" for bullish and "BE" for bearish) while highlighting the background accordingly.
What sets this indicator apart from a normal engulfing indicator is its ATR-based filtering system, which ensures that only significant engulfing candles are considered. Instead of accepting any engulfing pattern, the script measures candle body size relative to 1.5x ATR (configurable) to filter out weak signals. It also differentiates between long-bodied and small-bodied candles to confirm that the engulfing pattern represents real momentum shifts. This approach reduces false signals caused by small, insignificant candles and ensures that traders focus on high-probability reversal patterns. By integrating trend-based filtering and ATR-based confirmation, this indicator provides more reliable and context-aware engulfing signals than a standard engulfing pattern detector.
MSB BOS Market Structure [FTB]Track Market Structure Breaks (MSB) and Breaks of Structure (BOS) on your charts. This indicator does exactly that without clutter and with easy-to-spot.
🔑 Features:
MSB (Market Structure Break): Shows when price flips and breaks the previous high/low — possible start of a new trend.
BOS (Break of Structure): Highlights key structural breakouts in line with the existing trend.
✅ Pivot-Based Analysis (Body Focused)
Uses candle body-based pivot highs and lows to find clean market structure points (no wicks confusion here!).
Adjustable pivot strength — control how many candles you want on either side to define a swing.
✅ Clean Visual Markings
MSB and BOS lines with optional labels so you see exactly where breaks happen.
Customizable line style (Solid, Dashed, Dotted) to match your chart aesthetic.
Optional pivot markers to show minor swing highs/lows.
✅ Alerts Ready
Set alerts for any MSB or BOS, or filter to specific bullish/bearish breaks — never miss a key level again
💡 How to Use This Indicator:
Identify Trend Shifts: Use MSB to spot early trend reversals — when a previous structure breaks against the trend.
Catch Continuations: Watch for BOS to confirm trend continuation — great for riding the trend!
⚙️ Settings You Can Adjust:
Pivot Strength: How many candles to look back and forward for swing points (default: 3).
Show Pivots: Optional — highlight swing highs and lows for extra clarity.
FTB Smart Trader System — Market Maker Levels, EMAs & VectorsThe FTB Trade Engine is an indicator suite I built for myself as a crypto trader. It's designed specifically for trading Institution levels, EMAs, PVSRA Volume Candles, and Session Timings. It helps me spot high probability trade setups without overcomplicating things.
🔑 Features of this Indicator
📌 🔥 Key Session Levels (extend lines in settings as needed)
✅ Weekly High & Low (HOW/LOW) — Automatically plots the previous week's high and low
✅ Daily High & Low (HOD/LOD) — Marks the prior day's range
✅ Asia Session High & Low — Plots the Asian session’s high and low, helping you detect potential breakouts or fakeouts, as Asia often sets the initial high and low of the day.
✅ 50% Asia Level — Automatically calculates and displays the midpoint between Asia’s high and low, an important level for intraday trading.
📌 🔥 Advanced EMA Suite
✅ Includes 10, 20, 50, 200, and 800 EMAs — providing key zones of support, resistance, and trend direction.
👀 Good to know: the break of the 50EMA WITH a vector candle is significant for reversals.
📌 🔥 PVSRA Candles
(👀 IMPORTANT: To properly view PVSRA candles, make sure to UNCHECK all default candle settings — Color Bars, Body, Borders, and Wick — in your chart's candle settings.)
✅ Price, Volume, Support & Resistance Analysis (PVSRA) Candles — These special candles combine price action with volume analysis, color-coded to highlight areas potentially influenced by market makers, institutions, and large players. Perfect for identifying key volume zones and quickly analyzing any coin or pair without switching tools.
Candle Colors Explained:
Bullish Candles:
🟢 Green — 200% increase in volume on bullish moves (strong buyer presence).
🔵 Blue — 150% increase in bullish volume, but may also indicate fatigue or possible reversal.
⚪ White — Normal bullish volume (standard green candles).
Bearish Candles:
🔴 Red — 200% increase in bearish volume compared to the last 10 candles (strong selling).
🟣 Magenta — 150% increase in bearish volume, signaling possible continuation or exhaustion.
⚫ Gray — Normal bearish volume (standard red candles).
*Auto Backtest & Optimize EngineFull-featured Engine for Automatic Backtesting and parameter optimization. Allows you to test millions of different combinations of stop-loss and take profit parameters, including on any connected indicators.
⭕️ Key Futures
Quickly identify the optimal parameters for your strategy.
Automatically generate and test thousands of parameter combinations.
A simple Genetic Algorithm for result selection.
Saves time on manual testing of multiple parameters.
Detailed analysis, sorting, filtering and statistics of results.
Detailed control panel with many tooltips.
Display of key metrics: Profit, Win Rate, etc..
Comprehensive Strategy Score calculation.
In-depth analysis of the performance of different types of stop-losses.
Possibility to use to calculate the best Stop-Take parameters for your position.
Ability to test your own functions and signals.
Customizable visualization of results.
Flexible Stop-Loss Settings:
• Auto ━ Allows you to test all types of Stop Losses at once(listed below).
• S.VOLATY ━ Static stop based on volatility (Fixed, ATR, STDEV).
• Trailing ━ Classic trailing stop following the price.
• Fast Trail ━ Accelerated trailing stop that reacts faster to price movements.
• Volatility ━ Dynamic stop based on volatility indicators.
• Chandelier ━ Stop based on price extremes.
• Activator ━ Dynamic stop based on SAR.
• MA ━ Stop based on moving averages (9 different types).
• SAR ━ Parabolic SAR (Stop and Reverse).
Advanced Take-Profit Options:
• R:R: Risk/Reward ━ sets TP based on SL size.
• T.VOLATY ━ Calculation based on volatility indicators (Fixed, ATR, STDEV).
Testing Modes:
• Stops ━ Cyclical stop-loss testing
• Pivot Point Example ━ Example of using pivot points
• External Example ━ Built-in example how test functions with different parameters
• External Signal ━ Using external signals
⭕️ Usage
━ First Steps:
When opening, select any point on the chart. It will not affect anything until you turn on Manual Start mode (more on this below).
The chart will immediately show the best results of the default Auto mode. You can switch Part's to try to find even better results in the table.
Now you can display any result from the table on the chart by entering its ID in the settings.
Repeat steps 3-4 until you determine which type of Stop Loss you like best. Then set it in the settings instead of Auto mode.
* Example: I flipped through 14 parts before I liked the first result and entered its ID so I could visually evaluate it on the chart.
Then select the stop loss type, choose it in place of Auto mode and repeat steps 3-4 or immediately follow the recommendations of the algorithm.
Now the Genetic Algorithm at the bottom right will prompt you to enter the Parameters you need to search for and select even better results.
Parameters must be entered All at once before they are updated. Enter recommendations strictly in fields with the same names.
Repeat steps 5-6 until there are approximately 10 Part's left or as you like. And after that, easily pour through the remaining Parts and select the best parameters.
━ Example of the finished result.
━ Example of use with Takes
You can also test at the same time along with Take Profit. In this example, I simply enabled Risk/Reward mode and immediately specified in the TP field Maximum RR, Minimum RR and Step. So in this example I can test (3-1) / 0.1 = 20 Takes of different sizes. There are additional tips in the settings.
━
* Soon you will start to understand how the system works and things will become much easier.
* If something doesn't work, just reset the engine settings and start over again.
* Use the tips I have left in the settings and on the Panel.
━ Details:
Sort ━ Sorting results by Score, Profit, Trades, etc..
Filter ━ Filtring results by Score, Profit, Trades, etc..
Trade Type ━ Ability to disable Long\Short but only from statistics.
BackWin ━ Backtest Window Number of Candle the script can test.
Manual Start ━ Enabling it will allow you to call a Stop from a selected point. which you selected when you started the engine.
* If you have a real open position then this mode can help to save good Stop\Take for it.
1 - 9 Сheckboxs ━ Allow you to disable any stop from Auto mode.
Ex Source - Allow you to test Stops/Takes from connected indicators.
Connection guide:
//@version=6
indicator("My script")
rsi = ta.rsi(close, 14)
buy = not na(rsi) and ta.crossover (rsi, 40) // OS = 40
sell = not na(rsi) and ta.crossunder(rsi, 60) // OB = 60
Signal = buy ? +1 : sell ? -1 : 0
plot(Signal, "🔌Connector🔌", display = display.none)
* Format the signal for your indicator in a similar style and then select it in Ex Source.
⭕️ How it Works
Hypothesis of Uniform Distribution of Rare Elements After Mixing.
'This hypothesis states that if an array of N elements contains K valid elements, then after mixing, these valid elements will be approximately uniformly distributed.'
'This means that in a random sample of k elements, the proportion of valid elements should closely match their proportion in the original array, with some random variation.'
'According to the central limit theorem, repeated sampling will result in an average count of valid elements following a normal distribution.'
'This supports the assumption that the valid elements are evenly spread across the array.'
'To test this hypothesis, we can conduct an experiment:'
'Create an array of 1,000,000 elements.'
'Select 1,000 random elements (1%) for validation.'
'Shuffle the array and divide it into groups of 1,000 elements.'
'If the hypothesis holds, each group should contain, on average, 1~ valid element, with minor variations.'
* I'd like to attach more details to My hypothesis but it won't be very relevant here. Since this is a whole separate topic, I will leave the minimum part for understanding the engine.
Practical Application
To apply this hypothesis, I needed a way to generate and thoroughly mix numerous possible combinations. Within Pine, generating over 100,000 combinations presents significant challenges, and storing millions of combinations requires excessive resources.
I developed an efficient mechanism that generates combinations in random order to address these limitations. While conventional methods often produce duplicates or require generating a complete list first, my approach guarantees that the first 10% of possible combinations are both unique and well-distributed. Based on my hypothesis, this sampling is sufficient to determine optimal testing parameters.
Most generators and randomizers fail to accommodate both my hypothesis and Pine's constraints. My solution utilizes a simple Linear Congruential Generator (LCG) for pseudo-randomization, enhanced with prime numbers to increase entropy during generation. I pre-generate the entire parameter range and then apply systematic mixing. This approach, combined with a hybrid combinatorial array-filling technique with linear distribution, delivers excellent generation quality.
My engine can efficiently generate and verify 300 unique combinations per batch. Based on the above, to determine optimal values, only 10-20 Parts need to be manually scrolled through to find the appropriate value or range, eliminating the need for exhaustive testing of millions of parameter combinations.
For the Score statistic I applied all the same, generated a range of Weights, distributed them randomly for each type of statistic to avoid manual distribution.
Score ━ based on Trade, Profit, WinRate, Profit Factor, Drawdown, Sharpe & Sortino & Omega & Calmar Ratio.
⭕️ Notes
For attentive users, a little tricks :)
To save time, switch parts every 3 seconds without waiting for it to load. After 10-20 parts, stop and wait for loading. If the pause is correct, you can switch between the rest of the parts without loading, as they will be cached. This used to work without having to wait for a pause, but now it does slower. This will save a lot of time if you are going to do a deeper backtest.
Sometimes you'll get the error “The scripts take too long to execute.”
For a quick fix you just need to switch the TF or Ticker back and forth and most likely everything will load.
The error appears because of problems on the side of the site because the engine is very heavy. It can also appear if you set too long a period for testing in BackWin or use a heavy indicator for testing.
Manual Start - Allow you to Start you Result from any point. Which in turn can help you choose a good stop-stick for your real position.
* It took me half a year from idea to current realization. This seems to be one of the few ways to build something automatic in backtest format and in this particular Pine environment. There are already better projects in other languages, and they are created much easier and faster because there are no limitations except for personal PC. If you see solutions to improve this system I would be glad if you share the code. At the moment I am tired and will continue him not soon.
Also You can use my previosly big Backtest project with more manual settings(updated soon)
Indiq 2.0The functionality of the indicator includes the following features:
Moving Averages (MA):
The ability to adjust periods for short (short_ma_length) and long (long_ma_length) moving averages.
Display of moving averages on the chart:
Short MA (blue line).
Long MA (red line).
Generation of buy and sell signals:
Buy (BUY): When the short MA crosses the long MA from below.
Sell (SELL): When the short MA crosses the long MA from above.
Visualization of signals on the chart:
Buy is displayed as a green BUY marker below the candle.
Sell is displayed as a red SELL marker above the candle.
Liquidity Heatmap:
Liquidity levels:
Levels are calculated based on the closing price and a step (liquidity_step).
Levels are grouped by the nearest price values.
Volumes at levels:
Volume (volume) is accumulated for each liquidity level.
Levels with a volume less than min_volume_filter are not displayed.
Time filtering:
Levels that have not been updated within the last time_filter bars are not displayed.
Volatility filtering:
Levels are filtered by volatility (ATR) to exclude those outside the volatility range.
Color gradient:
The color of levels depends on volume (gradient from gradient_start_color to gradient_end_color).
Visualization:
Liquidity levels are displayed as horizontal lines.
Volumes at levels are shown as text labels.
RSI Filtering:
The ability to enable/disable RSI filtering (rsi_filter).
Liquidity levels are filtered based on overbought (rsi_overbought) and oversold (rsi_oversold) conditions.
Levels that do not meet RSI conditions are not displayed.
MACD Filtering:
The ability to enable/disable MACD filtering (macd_filter).
Liquidity levels are filtered based on the MACD histogram condition (e.g., only if the histogram is above zero).
Levels that do not meet MACD conditions are not displayed.
Display of Market Maker Buys:
Condition for market maker buys:
Volume exceeds the average volume over the last 20 bars by 2 times.
Closing price is above the opening price.
Market maker buys are displayed on the chart as orange MM Buy markers below the candle.
Indicator Settings:
Moving average parameters:
short_ma_length: Period for the short MA.
long_ma_length: Period for the long MA.
Liquidity heatmap parameters:
liquidity_step: Step between liquidity levels.
max_levels: Maximum number of levels to display.
time_filter: Time filter (last N bars).
min_volume_filter: Minimum volume for displaying a level.
volatility_filter: Volatility filter (ATR multiplier).
RSI parameters:
rsi_filter: Enable/disable RSI filtering.
rsi_overbought: Overbought RSI level.
rsi_oversold: Oversold RSI level.
MACD parameters:
macd_filter: Enable/disable MACD filtering.
Color settings:
gradient_start_color: Starting color of the gradient.
gradient_end_color: Ending color of the gradient.
Visualization:
Moving averages:
Short MA: Blue line.
Long MA: Red line.
Signals:
Buy: Green BUY marker.
Sell: Red SELL marker.
Liquidity heatmap:
Liquidity levels: Horizontal lines with a color gradient.
Volumes: Text labels at levels.
Market maker buys:
Orange MM Buy markers.
Alerts:
The ability to set alerts for signals:
Buy (BUY).
Sell (SELL).
Additional Features:
Flexible filter settings:
Filtering by time, volume, volatility, RSI, and MACD.
Extensibility:
The ability to add new filters (e.g., Stochastic, Volume Profile, etc.).
Visual customization:
Adjustment of colors, sizes, and display styles.
Summary:
The indicator provides a comprehensive tool for analyzing liquidity, generating trading signals, and tracking market maker activity. It combines:
A liquidity heatmap.
Signals based on moving averages.
Filtering by RSI and MACD.
Display of market maker buys.
Flexible settings and visualization.
This indicator is suitable for traders who want to analyze liquidity levels, identify entry and exit points, and monitor the actions of large market players.
Candle Size Alertت وضیحات برای انتشار ابزار در TradingView
🔹 نام ابزار: Candle Size Alert
🔹 توضیحات:
این اندیکاتور برای شناسایی کندلهای بزرگ طراحی شده است. این ابزار میانگین اندازهی ۱۰ کندل گذشته را محاسبه کرده و اگر کندل فعلی ۳ برابر میانگین کندلهای قبلی باشد، یک لیبل هشدار در بالای کندل نمایش میدهد. همچنین میتوان هشدارهای معاملاتی را از طریق alertcondition() فعال کرد.
🔹 ویژگیها:
✅ امکان تغییر تعداد کندلهای محاسبه شده (پیشفرض: ۱۰)
✅ امکان تنظیم ضریب حساسیت (پیشفرض: ۳ برابر)
✅ نمایش لیبل هشدار در بالای کندلهای بزرگ
✅ پشتیبانی از هشدارهای خودکار (AlertCondition)
⚠️ نکته: این اندیکاتور فقط برای تحلیل استفاده میشود و سیگنال خرید یا فروش ارائه نمیدهد.
🔹 Indicator Name: Candle Size Alert
🔹 Description:
This indicator detects large candles by calculating the average size of the last 10 candles. If the current candle is 3 times larger than the average of the previous candles, a warning label appears above the candle. Additionally, automated alerts can be triggered using alertcondition().
🔹 Features:
✅ Adjustable candle count for calculations (default: 10)
✅ Customizable sensitivity multiplier (default: 3x)
✅ Visual alert label above large candles
✅ Supports automated alerts (AlertCondition)
⚠️ Note: This indicator is for analysis purposes only and does not provide buy/sell signals.
Swing Finder By Akash
This script is designed to highlight areas on a chart where there are **three or more consecutive candles** of the same color (bullish or bearish). It provides a visual indication of extended bullish or bearish momentum by changing the background color and marking the starting point of these areas.
### **How it works:**
1. **Identifying Bullish and Bearish Candles:**
- **Bullish candles** are defined as candles where the closing price is higher than the opening price (close > open).
- **Bearish candles** are defined as candles where the closing price is lower than the opening price (close < open).
2. **Consecutive Candle Counters:**
- A counter for **bullish candles** (`bullishCount`) and **bearish candles** (`bearishCount`) is maintained to track consecutive occurrences of bullish and bearish candles.
- These counters are **incremented** when consecutive bullish or bearish candles occur. They are **reset** to zero whenever a trend reversal happens (e.g., from bullish to bearish or vice versa).
3. **Area Marking:**
- If there are **three or more consecutive bullish candles**, the background is highlighted in **green** to indicate a bullish area.
- If there are **three or more consecutive bearish candles**, the background is highlighted in **red** to indicate a bearish area.
- A **green label** is plotted below the bars where the bullish area starts, and a **red label** is plotted above the bars where the bearish area starts.
### **Visual Indicators:**
- **Background Color:**
- **Green** for areas with 3 or more consecutive bullish candles.
- **Red** for areas with 3 or more consecutive bearish candles.
- **Labels:**
- A **green label** is plotted below the chart to mark the start of a bullish area.
- A **red label** is plotted above the chart to mark the start of a bearish area.
### **Usage:**
- This indicator can help traders identify strong trends, as consecutive bullish or bearish candles often indicate extended momentum in one direction.
- By marking these areas, traders can potentially look for entry points or identify when trends may be losing strength or reversing.
---
Feel free to adjust the description if you'd like it to reflect more specific details based on your use case!
Risk-Based Position Size ProRisk-Based Position Size Indicator
Overview:
The Risk-Based Position Size Indicator helps traders determine the appropriate position size for each trade based on their total capital and risk percentage. This indicator dynamically calculates position size using two different methods:
Wick Range (High - Low): Calculates position size based on the total range of the candlestick.
Candle Body (Close - Open): Calculates position size using only the body of the candlestick, ignoring wicks.
It provides a visual representation of position sizing as a histogram and adjusts dynamically based on price movement.
Key Features:
✅ Two Calculation Modes:
Wick Range (Red Bars) – Uses the entire candlestick range (High - Low).
Candle Body (Blue Bars) – Uses only the difference between Close and Open.
✅ Customizable Risk Settings:
Define Total Capital (default: $100,000).
Set Risk Percentage per trade (default: 1%).
✅ Automatic Position Sizing:
Adjusts position size dynamically for each candlestick.
Prevents division errors when the range is zero.
✅ Rounding Option:
Toggle rounding of position size for better readability.
✅ Clear Visual Representation:
Displayed as a histogram for easy interpretation.
Red bars for Wick Range, Blue bars for Candle Body calculations.
How to Use:
Add the indicator to your TradingView chart.
Set your Total Capital and Risk Percentage in the settings.
Choose a Calculation Method:
Wick Range: Uses High - Low for sizing.
Candle Body: Uses absolute difference of Close - Open.
If desired, enable Round Position Size for easier interpretation.
Observe the histogram bars to see the calculated position size for each candle.
This indicator is useful for risk management, ensuring that position sizes are aligned with account size and market volatility. 🚀
New Features & Fixes:
✅ User can select decimal precision (0 to 5 places) from the settings.
✅ If rounding is enabled, values are rounded based on the chosen precision.
✅ If rounding is disabled, original values are shown without forced rounding.
✅ Wick Range (Red) & Candle Body (Blue) are still plotted together.
Now, you have full control over how many decimal places to display! 🎯
Cryptogenik's Inflation-Adjusted Candles v2025Inflation-Adjusted Price Indicator by Cryptogenik
This indicator adjusts price data for inflation, allowing you to visualize how stock/asset prices would look with constant purchasing power. By using Consumer Price Index (CPI) data from FRED, it transforms nominal prices into inflation-adjusted values that reflect real-world purchasing power.
What This Indicator Does
The Inflation-Adjusted Price indicator converts traditional price charts to show what prices would be if the purchasing power of currency remained constant. This is essential for long-term analysis, as it removes the distortion caused by inflation when comparing prices across different time periods.
Key Features
Displays inflation-adjusted price candles alongside original prices
Uses official CPI data from the Federal Reserve (FRED:CPIAUCSL)
Allows easy comparison between nominal and real prices
Helps identify true price movements by filtering out the effects of inflation
Perfect for long-term investors and macroeconomic analysis
How To Use It
Apply the indicator to any chart
Green/red candles show the inflation-adjusted prices
Gray line shows the original unadjusted price
The information label displays the current CPI value
This indicator is particularly valuable for analyzing stocks, commodities, and other assets over periods of 5+ years, where inflation effects become significant. It helps answer the question: "Has this asset truly increased in value, or is the price increase just reflecting inflation?"
Technical Details
The indicator calculates adjusted prices using the formula: (price / CPI) * 100, which effectively shows prices as a percentage of current purchasing power. This approach normalizes all prices to a consistent standard, making historical comparisons more meaningful.
Cryptogenik's Inflation-Adjusted Candles v2025
Previous Day LevelsThis indicator plots the previous day's high, low, and 50% levels, providing a framework for analyzing price behavior relative to these key levels.
Full Description:
The Previous Day Levels indicator is a tool designed to help traders analyze price action based on key levels from the previous trading session. By plotting the high, low, and mid-point (50%) of the prior day’s range, traders can assess potential market bias and directional tendencies for the current trading day.
Key Features:
Plots the previous day’s high (100%), low (0%), and intermediate levels (25%, 50%, 75%).
Allows users to customize line visibility, color, style, and width.
Helps traders identify potential support and resistance zones.
Provides a bias framework for determining whether price is more likely to target the previous high or low based on behavior around the 50% level.
Use Case:
This indicator is particularly useful for intraday and short-term traders who incorporate price action into their strategy.
If price trades above the 50% level and holds, it suggests a bullish bias, indicating that price may aim for the previous day's high.
If price trades below the 50% level and holds, it suggests a bearish bias, indicating that price may aim for the previous day's low.
The high and low levels can act as key support and resistance zones, where price may react or reverse.
How to Use:
Apply the indicator to your chart.
Observe how price interacts with the 50% level.
Use price behavior around these levels to establish a directional bias.
Adjust the line styles and colors to match your personal preference.
Disclaimer:
This indicator is a tool for market analysis and does not provide financial advice. Always perform your own analysis and risk management when trading.
Strong Engulfing Candlestick (With Alerts)Detect only Strong Bullish and Strong Bearish Engulfing candle patterns and provide visual signals along with alerts.
Key Features
Bullish Engulfing Detection:
Conditions:
Current candle's close > open (bullish).
Previous candle's close < open (bearish).
Current candle's high ≥ Previous candle's high (includes wicks).
Current candle's low ≤ Previous candle's low (includes wicks).
The body of the current bullish candle is stronger than the previous bearish candle.
Signal: Plots a green upward arrow below the bar when conditions are met.
Bearish Engulfing Detection:
Conditions:
Current candle's close < open (bearish).
Previous candle's close > open (bullish).
Current candle's high ≥ Previous candle's high (includes wicks).
Current candle's low ≤ Previous candle's low (includes wicks).
The body of the current bearish candle is stronger than the previous bullish candle.
Signal: Plots a red downward arrow above the bar when conditions are met.
Alerts:
Custom alerts are included for both bullish and bearish engulfing patterns:
Bullish Alert Message: "Strong Bullish Engulfing detected!"
Bearish Alert Message: "Strong Bearish Engulfing detected!"
CLS Patterns + Price Action Levels📌 Key Features:
✅ CLS Candle Patterns Detection:
CLS Type 1 (Sweeps & Closes Opposite) – Confirms liquidity sweeps with opposite direction close.
CLS Type 2 (Sweeps but No Opposite Close) – Identifies liquidity traps without full reversal.
CLS Type 3 (Engulfing Candles) – Strong momentum shifts with engulfing price action.
CLS Type 4 (Order Block Reversals) – Institutional order flow recognition.
✅ Institutional & Price Action Levels:
250 Pip Institutional Levels – Major S&R zones for Forex & Indices.
Minor Quarter Points (25 Pips) – Intraday precision for refined entries.
✅ Liquidity Imbalance & Order Flow Gaps:
Detects early impulse moves & liquidity voids
Highlights areas of market inefficiency & potential reversals
✅ Higher Timeframe EMA for Trend Confirmation:
Customizable Weekly 3 EMA Overlay
Dynamic color change based on price action
✅ Built-in Alerts for CLS Patterns:
Real-time alerts for CLS buy/sell signals
Configurable notifications for trade execution
🎯 How to Use:
1️⃣ Enable CLS Pattern Signals to spot liquidity sweep candles with directional confirmation.
2️⃣ Use Institutional & QP Levels to identify key areas where price is likely to react.
3️⃣ Monitor Liquidity Imbalances to detect inefficient price moves that may fill.
4️⃣ Confirm Trend with HTF EMA to trade with momentum.
5️⃣ Set Alerts for CLS patterns and key price levels to stay ahead of the market.
This indicator is ideal for Forex, Indices, and Crypto traders looking to refine their entries with precise price action confirmations.
TWAP & VWAP CombinedThis script integrates Time Weighted Average Price (TWAP) and Volume Weighted Average Price (VWAP) into a single TradingView indicator, allowing traders to analyze both price-weighted and volume-weighted trends simultaneously.
Features:
TWAP Calculation:
Computes the average price over a specified anchor period (e.g., daily).
Resets and recalculates TWAP when the anchor period changes.
Uses the OHLC4 (Open, High, Low, Close average) as the default price source.
VWAP Calculation:
Computes the VWAP based on the selected anchor period (Session, Week, Month, etc.).
Allows the option to hide VWAP when the timeframe is 1D or higher.
Uses HLC3 (High, Low, Close average) as the default source.
Dynamically resets VWAP at the start of a new period.
Customization Options:
Users can modify the source price for TWAP and VWAP calculations.
Adjustable offsets for both indicators to shift plots forward or backward.
Ability to select different VWAP anchor periods, including earnings, dividends, and splits.
Error Handling:
Displays an error message if volume data is missing, ensuring VWAP functions correctly.
Mushir's Inside Candle IndicatorThis indicator detects inside candle formations on the chart’s current timeframe. It highlights when a candle’s range is fully engulfed by the previous candle’s range, provided the previous candle meets specific criteria.
How It Works ?
It shows the formation of inside candle on the charts to help in find trades.
Mother Candle Validation
The previous candle must be a “leg candle” with a strong body and minimal wicks relative to its body size, ensuring a robust structure.
Inside Candle Detection
The current candle qualifies as an inside candle if:
Its high is ≤ the previous candle’s high.
Its low is ≥ the previous candle’s low.
Why Use This Indicator?
Adapts to the chart’s current timeframe—no manual adjustments needed.
Easily gives you the identification of inside candles
Minimalistic Design
Better results in trending market
How to use it?
- when the inside candle is formed there are certain conditions:
1. if the next candle first crosses the high of inside candle, look for a potential buy trade with RR as 2:1 while stoploss being just below the low of inside candle.
2. if the next candle first crosses the low of inside candle, look for a potential sell trade with RR as 2:1 while stoploss being just above the high of inside candle.
3. if 2:1 is achieved, then increase the partial target to 3:1 while bringing the stoploss to the entry point.
4. if the high is crossed first and then the low is crossed or vice versa then the trade is invalidated.
Happy Trading!
Mehul - ADX Zero LagThis script combines two popular technical indicators into a single visualization:
1. **Average Directional Index (ADX)**:
- Measures trend strength on a scale from 0-100 (now normalized to 0-1 by dividing by 100)
- Displayed as a red line
- Adjustable smoothing and length parameters
2. **Zero Lag MACD (Modified Moving Average Convergence Divergence)**:
- An enhanced version of the traditional MACD with reduced lag
- Shows the relationship between fast and slow moving averages
- Main components include:
- MACD line (black)
- Signal line (gray)
- Histogram (green for positive, purple for negative)
- EMA of the MACD line (red)
- Optional crossing dots
Key features of the combined indicator:
- **Scale Adjustment**: Both indicators can be scaled independently (adxScale and macdScale parameters)
- **Visibility Toggles**: Each indicator can be shown or hidden
- **Advanced Customization**: Parameters for both indicators can be fine-tuned
- **Algorithm Selection**: Option to choose between the "Glaz" algorithm or the "real" zero lag algorithm
- **Display Options**: Toggles for visualization elements like crossing dots
The most significant technical aspect is that both indicators are displayed in the same pane with compatible scaling, achieved by normalizing the ADX values and applying user-defined scale factors to both indicators.
This combined indicator is designed to give traders a comprehensive view of both trend strength (from ADX) and momentum/direction (from Zero Lag MACD) in a single, easy-to-read visualization.