aaa sibilio 5.5 New 4## **The Fundamental Characteristics of Moving Averages: Theoretical Principles and Strategic Applications**
### **The Non-Parallelism Principle: Mathematical Foundation**
The first fundamental principle governing moving averages establishes that **any moving average can never be parallel to its linear regression**. This is not coincidental or anomalous, but a direct consequence of the mathematical nature of moving averages.
**Theoretical explanation:** A moving average is a low-pass filter that removes high-frequency components from price data, while a linear regression represents the optimal linear trend over the considered period. Since the moving average maintains trace of oscillations around the trend (albeit attenuated), while the regression completely eliminates these oscillations to provide only the general direction, the two curves can never be identical or parallel.
**Crucial implication:** This characteristic certifies that **moving averages always have a curvilinear pattern** relative to their regression. The curvature is not an imperfection in the calculation, but the manifestation of the intrinsic dynamics of market data filtered through the moving average.
### **System Energy: Derivation from Curvature**
It is precisely this curvilinear characteristic that allows us to determine fundamental parameters such as **system energy**.
**Physical basis:** In physics, the potential energy of a curvilinear system is proportional to the deviation from the equilibrium trajectory (represented by the linear regression). In our context:
- **Potential energy** = Distance between moving average and its regression
- **Kinetic energy** = Speed of approach or separation between the two curves
- **Total system energy** = Sum of potential and kinetic energy
**Practical application:** When the moving average moves away from its regression, it accumulates potential energy that must be released. When it approaches rapidly, it manifests kinetic energy that can lead to overshooting the equilibrium point.
### **The Hierarchical Rolling Principle**
The second fundamental principle establishes that **curves roll around each other starting from longer periods toward shorter ones**. This phenomenon has deep roots in dynamical systems theory.
**Theoretical explanation:** Moving averages with longer periods have greater inertia and resistance to change (analogous to mass in physics). When a trend change occurs, it propagates first in long-period averages (which represent the dominant forces of the system), then progressively diffuses toward shorter-period averages.
**Propagation mechanism:**
1. **Macro level** (long averages): Change in direction of principal forces
2. **Medium level** (intermediate averages): Signal transmission
3. **Micro level** (short averages): Final manifestation of the change
### **Derived Strategic Formations**
This hierarchical rolling allows us to identify **important formations** for the strategy:
**Rolling Confluence:** When multiple averages of different periods simultaneously begin the rolling process, a high-probability reversal zone is created.
**Alignment Cascade:** The temporal sequence with which averages roll provides information about the strength and persistence of the imminent movement.
**Dynamic Resistance Zones:** Points where rolling encounters resistance indicate critical levels where opposing forces temporarily balance.
### **Strategic Implications**
These theoretical principles translate into concrete operational advantages:
1. **Energy predictability:** We can quantify the energy accumulated in the system and predict the strength of future movements
2. **Entry timing:** Hierarchical rolling provides a temporal sequence to optimize entry points
3. **Risk management:** Understanding system energy allows proper position sizing
The combination of these two principles - non-parallelism and hierarchical rolling - transforms moving averages from simple trend indicators into sophisticated tools for energetic and dynamic analysis of financial markets.
지표 및 전략
Volume Profile Trading Zones1. Understanding the Visual Elements
Lines on Chart:
Purple solid line (POC) = Point of Control - MOST volume traded here = strongest magnet for price
Red dashed line (VAH) = Value Area High - RESISTANCE when price is below
Green dashed line (VAL) = Value Area Low - SUPPORT when price is above
Histogram Colors:
Orange bars = High Volume Nodes (HVN) = Strong support/resistance zones
Blue bars = Low Volume Nodes (LVN) = Price moves through FAST (no buyers/sellers)
Gray bars = Normal volume areas
Trend Candle CounterComplete Tutorial: Trend Candle Counter Pine ScriptTable of Contents
Installation Guide
Understanding the Indicator
How It Works
Customization Options
Trading Strategies
Setting Up Alerts
Troubleshooting
1. Installation Guide {#installation}Step-by-Step Installation:Step 1: Open TradingView
Go to www.tradingview.com
Log in to your account
Step 2: Access Pine Editor
Click on "Pine Editor" tab at the bottom of the chart
Or press Alt + E (Windows) or Option + E (Mac)
Step 3: Create New Indicator
Click "Open" → "New blank indicator"
Delete any default code
Step 4: Paste the Script
Copy the entire Trend Candle Counter script
Paste it into the editor
Step 5: Save and Apply
Click "Save" (or Ctrl + S)
Give it a name: "Trend Candle Counter"
Click "Add to Chart"
✅ Done! The indicator should now appear on your chart.2. Understanding the Indicator {#understanding}What Does It Do?This indicator numbers each candle based on the current trend: {scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;} ::-webkit-scrollbar{display:none}Trend TypeNumberingVisualUptrend+1, +2, +3, +4...🟢 Green labelsDowntrend-1, -2, -3, -4...🔴 Red labelsTrend ChangeResets to ±1Label color switchesVisual Components:
Candle Labels - Numbers above each candle
Trend Line (EMA) - Green (up) / Red (down)
Background Shading - Light green/red tint
Info Table - Top-right corner showing:
Current trend direction
Current candle number
Current price
3. How It Works {#how-it-works}Trend Detection Logic:IF Close > EMA → UPTREND (positive counting)
IF Close < EMA → DOWNTREND (negative counting)
Counting Mechanism:Example Uptrend:Candle 1: Close > EMA → Label: +1
Candle 2: Close > EMA → Label: +2
Candle 3: Close > EMA → Label: +3
Candle 4: Close < EMA → Label: -1 (trend changed!)
Example Downtrend:Candle 1: Close < EMA → Label: -1
Candle 2: Close < EMA → Label: -2
Candle 3: Close < EMA → Label: -3
Candle 4: Close > EMA → Label: +1 (trend changed!)
Key Insight:The higher the absolute number, the longer the trend has been running!4. Customization Options {#customization}Accessing Settings:
Click the gear icon ⚙️ next to the indicator name
Go to "Inputs" tab
Available Parameters: {scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;} ::-webkit-scrollbar{display:none}ParameterDefaultDescriptionRecommendationTrend Detection Length14EMA period for trend5-10: Scalping14-20: Day trading50-200: Swing tradingShow Candle Numbers✅ YesDisplay labelsDisable for cleaner chartLabel SizeSmallSize of numbersTiny: Multi-timeframeLarge: Focus on one chartUptrend ColorGreenPositive number colorCustomize to preferenceDowntrend ColorRedNegative number colorCustomize to preferenceOptimization by Trading Style:For Scalpers (1m - 5m charts):Trend Detection Length: 5-10
Label Size: Tiny
Show Labels: Optional (can be cluttered)
For Day Traders (15m - 1h charts):Trend Detection Length: 14-20
Label Size: Small
Show Labels: Yes
For Swing Traders (4h - Daily charts):Trend Detection Length: 50-100
Label Size: Normal
Show Labels: Yes
5. Trading Strategies {#strategies}Strategy 1: Trend Reversal TradingEntry Signals:
Buy: When counter changes from negative to +1
Sell: When counter changes from positive to -1
Confirmation:
Wait for +2 or -2 to confirm trend strength
Use additional indicators (RSI, MACD) for validation
Example:Candle: -5, -6, -7, -8, +1, +2 ← BUY HERE
Stop Loss: Below the -8 candle low
Target: When counter reaches +8 to +10
Strategy 2: Trend Continuation TradingEntry Signals:
Buy: Enter on pullbacks during uptrend (e.g., at +3, +5, +7)
Sell: Enter on bounces during downtrend (e.g., at -3, -5, -7)
Risk Management:
Avoid entering at high numbers (+15, -15) - trend may be exhausted
Example:Candle: +1, +2, +3 ← Small pullback, BUY
Continue: +4, +5, +6, +7
Exit: When counter resets to -1
Strategy 3: Trend Exhaustion DetectionWarning Signs:
Counter reaches +10 or higher → Uptrend may be overextended
Counter reaches -10 or lower → Downtrend may be overextended
Action:
Tighten stop losses
Take partial profits
Watch for reversal patterns (doji, engulfing)
Strategy 4: Multi-Timeframe AnalysisSetup:
Add indicator to 3 timeframes (e.g., 15m, 1h, 4h)
Look for alignment
Best Trades:15m: +1 (new uptrend)
1h: +5 (established uptrend)
4h: +3 (strong uptrend)
→ HIGH PROBABILITY BUY
6. Setting Up Alerts {#alerts}Built-in Alert Conditions:The script includes 2 automatic alerts:
"Uptrend Started" - Triggers when counter = +1
"Downtrend Started" - Triggers when counter = -1
How to Set Up Alerts:Step 1: Right-click on chart
Select "Add Alert"
Step 2: Configure Alert
Condition: Select "Trend Candle Counter"
Choose: "Uptrend Started" or "Downtrend Started"
Options:
Once per bar close (recommended)
Webhook URL (for automation)
Step 3: Notification Settings
✅ Popup
✅ Send email
✅ Push notification (mobile app)
✅ Play sound
Step 4: Create Alert
Click "Create"
Custom Alert Ideas:Alert for Specific Candle Numbers:
Notify when counter reaches +5 or -5
Notify when counter exceeds +10 or -10 (exhaustion)
7. Troubleshooting {#troubleshooting}Common Issues & Solutions:Issue 1: Labels are too cluttered
Solution:
Disable "Show Candle Numbers" in settings
Use larger timeframe
Reduce label size to "tiny"
Issue 2: Too many false signals
Solution:
Increase "Trend Detection Length" (e.g., 20, 50)
Wait for +2 or -2 confirmation
Combine with other indicators
Issue 3: Trend line doesn't match price action
Solution:
Adjust EMA length to match your trading style
Consider using different trend detection (SMA, HMA)
Issue 4: Indicator not showing on chart
Solution:
Check if it's in a separate pane - move to main chart
Refresh the page
Re-add the indicator
Issue 5: Counter seems delayed
Solution:
This is normal - indicator confirms on candle close
For faster signals, use lower timeframe
Reduce EMA length (but expect more noise)
8. Advanced Tips 💡Combining with Other Indicators:Best Combinations:
RSI + Trend Candle Counter
Buy at +1 when RSI > 50
Sell at -1 when RSI < 50
MACD + Trend Candle Counter
Confirm +1 with MACD bullish crossover
Confirm -1 with MACD bearish crossover
Volume + Trend Candle Counter
Strong trends (+1) should have increasing volume
Low volume at high numbers (+10) = exhaustion
Reading Market Psychology: {scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;} ::-webkit-scrollbar{display:none}Counter ValueMarket Psychology+1 to +3Early adopters entering+4 to +7Momentum building+8 to +12FOMO phase+13+Extreme greed - caution!-1 to -3Early sellers-4 to -7Panic building-8 to -12Capitulation-13+Extreme fear - reversal likely9. Real Trading Example 📊Scenario: BTC/USD 1H ChartTime | Counter | Action
--------|---------|----------------------------------
10:00 | -8 | Downtrend established
11:00 | -9 | Still falling
12:00 | -10 | Exhaustion zone - watch closely
13:00 | +1 | ✅ BUY SIGNAL - Trend reversal!
14:00 | +2 | Confirmation - trend valid
15:00 | +3 | Hold position
16:00 | +4 | Add to position (optional)
17:00 | +5 | Move stop loss to breakeven
...
22:00 | +11 | Take partial profits
23:00 | +12 | Tighten stop loss
00:00 | -1 | ❌ EXIT - Trend reversed
fartbombLinReg fit (history): solid line showing the best-fit linear trend over the last len bars.
Projected offset (visual): same line shifted h bars right so you can see direction.
Future projection (segments): the actual next-h forecast, drawn from the last bar.
Forecast made h bars ago: circle at each bar’s target showing what was predicted h bars earlier.
H / X markers: a hit if that earlier forecast fell inside the bar’s high–low range.
Synthetic Implied APROverview
The Synthetic Implied APR is an artificial implied APR, designed to imitate the implied APR seen when trading cryptocurrency funding rates. It combines real-time funding rates with premium data to calculate an artificial market expectation of the annualized funding rate.
The (actual) implied APR is the market's expectation of the annualized funding rate. This is dependent on bid/ask impacts of the implied APR, something which is currently unavailable to fetch with TradingView. In essence, an implied APR of X% means traders believe that asset's funding fees to average X% when annualized.
What's important to understand, is that the actual value of the synthetic implied APR is not relevant. We only simply use its relative changes when we trade (i.e if it crosses above/below its MA for a given weight). Even for the same asset, the implied APRs will change depending on days to maturity.
How it calculates
The synthetic implied APR is calculated with these steps:
Collects premium data from perpetual futures markets using optimized lower timeframe requests (check my 'Predicted Funding Rates' indicator)
Calculates the funding rate by adding the premium to an interest rate component (clamped within exchange limits)
Derives the underlying APR from the 8-hour funding rate (funding rate × 3 × 365)
Apply a weighed formula that imitates both the direction (underlying APR) with the volatility of prices (from the premium index and funding)
premium_component = (prem_avg / 50 ) * 365
weighedprem = (weight * fr) + ((1 - weight) * apr) + (premium_component * 0.3)
impliedAPR = math.avg(weighedprem, ta.sma(apr, maLength))
How to use it: Generally
Preface: Funding rates are an indication of market sentiment
If funding is positive, generally the market is bullish as longs are willing to pay shorts funding
If funding is negative, generally the market is bearish as shorts are willing to pay longs funding
So, this script can be used like a typical oscillator:
Bullish: If implied APR > MA OR if implied APR MA is green
Bearish: If implied APR < MA OR if implied APR MA is red
The components:
Synthetic Implied APR: The main metric. At current setting of 0.7, it imitates volatility
Weight: The higher the value, the smoother the synthetic implied APR is (and MA too). This value is very important to the imitation. At 0.7, it imitates the actual volatility of the implied APR. At weight = 1, it becomes very smooth. Perfect for trading
Synthetic Implied APR Moving Average: A moving average of the Synthetic implied APR. Can choose from multiple selections, (SMA, EMA, WMA, HMA, VWMA, RMA)
How to use it: Trading Funding
When trading funding there're multiple ways to use it with different settings
Trade funding rates with trend changes
Settings: Weight = 1
Method 1: When the implied APR MA turns green, long funding rates (or short if red)
Method 2: When the implied APR crosses above the MA, long funding rates (or short when crosses below)
Trade funding rates with MA pullbacks
Settings: Weight = 0.7, timeframe 15m
In an uptrend: When implied APR crosses below then above the script, long funding opportunity
In an downtrend: When implied APR crosses above then below the script, shortfunding opportunity
You can determine the trend with the method before, using a weight of 1
To trade funding rates, it's best to have these 3 scripts at these settings:
Predicted Funding Rates: This allows you to see the predicted funding rates and see if they've maxxed out for added confluence too (+/-0.01% usually for Binance BTC futures)
Synthetic implied APR: At weight 1, the MA provides a good trend (whether close above/below or colour change)
Synthetic implied APR: At weight 0.7, it provides a good imitation of volatility
How to use it: Trading Futures
When trading futures:
You can determine roughly what the trend is, if the assumption is made that funding rates can help identify trends if used as a sentiment indicator. It should be supplemented with traditional trend trading methods
To prevent whipsaws, weight should remain high
Long trend: When the implied APR MA turns green OR when it crosses above its MA
Short trend: When the implied APR MA turns red OR when it below above its MA
Why it's original
This indicator introduces a unique synthetic weighting system that combines funding rates, underlying APR, and premium components in a way not found in existing TradingView scripts. Trading funding rates is a niche area, there aren't that many scripts currently available. And to my knowledge, there's no synthetic implied APR scripts available on TradingView either. So I believe this script to be original in that sense.
Notes
Because it depends on my triangular weighting algos, optimal accuracy is found on timeframes that are 4H or less. On higher timeframes, the accuracy drops off. Best timeframes for intraday trading using this are 15m or 1 hour
The higher the timeframe, the lower the MA one should use. At 1 hour, 200 or higher is best. At say, 4h, length of 50 is best
Only works for coins that have a Binance premium index
Inputs
Funding Period - Select between "1 Hour" or "8 Hour" funding cycles. 8 hours is standard for Binance
Table - Toggle the information dashboard on/off to show or hide real-time metrics including funding rate, premium, and APR value
Weight - Controls the balance between funding rate (higher values = smoother) and APR (lower values = more responsive) in the calculation, ranging from 0.0 to 1.0. Default is 0.7, this imitates the volatility
Auto Timeframe Implied Length - Automatically calculates optimal smoothing length based on your chart timeframe for consistent behavior across different time periods
Manual Implied Length - Sets a fixed smoothing length (in bars) when auto mode is disabled, with lower values being more responsive and higher values being smoother
Show Implied APR MA - Displays an additional moving average line of the Synthetic Implied APR to help identify trend direction and crossover signals
MA Type for Implied APR - Selects the calculation method (SMA, EMA, WMA, HMA, VWMA, or RMA) for the moving average, each offering different responsiveness and lag characteristics
MA Length for Implied APR - Sets the lookback period (1-500 bars) for the moving average, with shorter lengths providing more signals and longer lengths filtering noise
Show Underlying APR - Displays the raw APR calculation (without synthetic weighting) as a reference line to compare against the main indicator
Bullish Color - Sets the color for positive values in the table and rising MA line
Bearish Color - Sets the color for negative values in the table and falling MA line
Table Background - Customizes the background color and transparency of the information dashboard
Table Text Color - Sets the color for label text in the left column of the information table
Table Text Size - Controls the font size of table text with options from Tiny to Huge
Horizontal Lines [Yellow]The Horizontal Lines indicator is a simple yet powerful visual tool designed for traders in forex, options, and other financial markets. It allows users to mark and track key price levels directly on their chart with clear, bright yellow lines.
RD-DynamicTSMADescription of the RD-DynamicTSMA Pine Script Indicator:
This single indicator dynamically adjusts the three SMAs to key periods used by professional traders across timeframes:
Daily: 10, 21, 50 periods (standard for swing trading trends).
Weekly+: 10, 21, 30 periods (optimized for positional & longer-term views).
Lengths auto-update on timeframe switches.
ADX (Colored by Slope)_V2Option added to select 28/28 or 14/14. Also added a yellow line to mark level 20. Adx will turn red if it is lower than previous candle , else it will turn green.
Normalized WMA Oscillator | OquantNormalized WMA Oscillator | Oquant
The Normalized WMA Oscillator is a trend-momentum indicator designed to help traders visualize the relative position of a Weighted Moving Average (WMA) within its recent price range.
What is a WMA and How It Works:
A Weighted Moving Average (WMA) is a type of moving average that gives more weight to recent price data, making it more responsive to price changes compared to a simple moving average. Each price point in the lookback period is multiplied by a weighting factor, with the most recent prices having the highest weights. The WMA helps traders identify potential trends more quickly.
This indicator applies min-max normalization to the standard WMA, scaling its values between 0 and 1 over a configurable lookback period. This allows traders to see whether the WMA is near its recent highs, lows, or midpoint, regardless of the absolute price level.
Key Features:
WMA Source Input: Choose price source for wma calculation.
Customizable WMA Length: Adjust the sensitivity of the WMA.
Min-Max Normalization Length: Smooth the scaling of WMA values between 0 and 1.
Signal Thresholds: Configurable upper and lower thresholds to indicate potential entries.
Visual Alerts: Color-coded oscillator and candles plot for bullish (green) and bearish (purple) signals.
Alerts Ready: Built-in alert conditions for crossovers and crossunders of the oscillator.
How It Works:
Calculate the WMA on the selected source.
Normalize its value using the minimum and maximum WMA values over the specified lookback period.
Generate long signals when the normalized WMA moves above the upper threshold, and short signals when it moves below the lower threshold.
Plot the oscillator and candles in green for bullish signals and purple for bearish signals.
Inputs:
Source: Data used for WMA calculation.
WMA Length: Period for Weighted Moving Average.
Min-Max Length: Lookback period for min-max scaling.
Upper Threshold: Level above which a long signal is considered.
Lower Threshold: Level below which a short signal is considered.
⚠️ Disclaimer: This indicator is intended for educational and informational purposes only. Trading/investing involves risk, and past performance does not guarantee future results. Always test and evaluate indicators/strategies before applying them in live markets. Use at your own risk.
mZigzagLibrary "mZigzag"
Matrix implementation of zigzag to allow further possibilities.
Main advantage of this library over previous zigzag methods is that you can attach any number of indicator/oscillator information to zigzag
calculate(length, ohlc, indicatorHigh, indicatorLow, numberOfPivots, supertrendLength)
calculates zigzag and related information
Parameters:
length (simple int) : is zigzag length
ohlc (array) : array of OHLC values to be used for zigzag calculation
indicatorHigh (array) : Array of indicator values calculated based on high price of OHLC
indicatorLow (array) : Array of indicators values calculated based on low price of OHLC
numberOfPivots (simple int) : Number of pivots to be returned
supertrendLength (simple int) : is number of pivot history to calculate supertrend
Returns: valueMatrix Matrix containing zigzag pivots for price and indicators
directionMatrix Matrix containing direction of price and indicator values at pivots
ratioMatrix Matrix containing ratios of price and indicator values at pivots
divergenceMatrix matrix containing divergence details for each indicators
doubleDivergenceMatrix matrix containing double divergence details for each indicators
barArray Array containing pivot bars
supertrendDir is direction of zigzag based supertrend
supertrend is supertrend value of zigzag based supertrend
newZG is true if a new pivot is added to array
doubleZG is true if last calculation returned two new pivots (Happens on extreme price change)
calculateplain(length, ohlc, indicatorHigh, indicatorLow, numberOfPivots, offset)
calculates zigzag and related information uses shift/unshift rather than pop and push. Also does not calculate divergence and ratios.
Parameters:
length (simple int) : is zigzag length
ohlc (array) : array of OHLC values to be used for zigzag calculation
indicatorHigh (array) : Array of indicator values calculated based on high price of OHLC
indicatorLow (array) : Array of indicators values calculated based on low price of OHLC
numberOfPivots (simple int) : Number of pivots to be returned
offset (simple int)
Returns: valueMatrix Matrix containing zigzag pivots for price and indicators
directionArray Matrix containing direction of price and indicator values at pivots
barArray Array containing pivot bars
newZG is true if a new pivot is added to array
doubleZG is true if last calculation returned two new pivots (Happens on extreme price change)
draw(valueMatrix, directionMatrix, ratioMatrix, divergenceMatrix, doubleDivergenceMatrix, barArray, newZG, doubleZG, indicatorLabels, lineColor, lineWidth, lineStyle, showLabel, showIndicators)
draws zigzag and related information based on preprocessed values
Parameters:
valueMatrix (matrix) : is matrix containing values of price and indicators
directionMatrix (matrix) : is matrix containing direction of price and indicators
ratioMatrix (matrix) : is matrix containing retracement ratios of price and indicators
divergenceMatrix (matrix)
doubleDivergenceMatrix (matrix)
barArray (array) : is array of pivot bars
newZG (bool) : is bool which tells whether new zigzag pivot is formed or not
doubleZG (bool) : is bool which teels us if the bar has both high and low zigzag
indicatorLabels (array)
lineColor (color) : zigzag line color. set to blue by default
lineWidth (int) : zigzag line width. set to 1 by default
lineStyle (string) : zigzag line style. set to line.style_solid by default
showLabel (bool) : Show pivot label
showIndicators (bool) : Include indicators in labels. If set to false, indicators are shown as tooltips
Returns: valueMatrix Matrix containing zigzag pivots for price and indicators
directionMatrix Matrix containing direction of price and indicator values at pivots
ratioMatrix Matrix containing ratios of price and indicator values at pivots
divergenceMatrix matrix containing divergence details for each indicators
doubleDivergenceMatrix matrix containing double divergence details for each indicators
barArray Array containing pivot bars
zigzaglines array of zigzag lines
zigzaglabels array of zigzag labels
draw(length, ohlc, indicatorLabels, indicatorHigh, indicatorLow, numberOfPivots, lineColor, lineWidth, lineStyle, showLabel, showIndicators)
draws zigzag and related information
Parameters:
length (simple int) : is zigzag length
ohlc (array) : array of OHLC values to be used for zigzag calculation
indicatorLabels (array) : Array of name of indicators passed
indicatorHigh (array) : Array of indicator values calculated based on high price of OHLC
indicatorLow (array) : Array of indicators values calculated based on low price of OHLC
numberOfPivots (simple int) : Number of pivots to be returned
lineColor (color) : zigzag line color. set to blue by default
lineWidth (int) : zigzag line width. set to 1 by default
lineStyle (string) : zigzag line style. set to line.style_solid by default
showLabel (bool) : Show pivot label
showIndicators (bool) : Include indicators in labels. If set to false, indicators are shown as tooltips
Returns: valueMatrix Matrix containing zigzag pivots for price and indicators
directionMatrix Matrix containing direction of price and indicator values at pivots
ratioMatrix Matrix containing ratios of price and indicator values at pivots
divergenceMatrix matrix containing divergence details for each indicators
doubleDivergenceMatrix matrix containing double divergence details for each indicators
barArray Array containing pivot bars
zigzaglines array of zigzag lines
zigzaglabels array of zigzag labels
AIO Entry Size CalculatorThis indicator is designed to help traders dynamically adjust their position size and drawdown expectations when their trading capital changes.
By entering your original backtest parameters — including base capital, base drawdown percentage, and base position size — along with your current capital, the script calculates two key scenarios:
Lock Drawdown %: Keeps the original drawdown percentage unchanged and calculates the new position size required.
Lock Position Size: Keeps the original position size unchanged and shows how your drawdown percentage will change.
The results are displayed in a clear, color-coded table, allowing you to instantly see how capital fluctuations affect your risk profile.
With customizable themes (dark/light) and highlight options, it’s an essential tool for risk management, portfolio rebalancing, and position sizing decisions based on real backtest data.
Additionally, this indicator is highly useful when combined with TradingView strategies — helping you interpret backtest results more accurately and translate them into real-world position sizing adjustments as your account balance evolves.
Daily Markers (adjustable)Draws daily vertical markers to visually indicate the beginning of a new day. These can be easily offset for your time zone, or e.g. for the beginning of your trading day.
Time Range by exp3rtsTime Window highlights a custom time range directly on your chart, helping you focus on specific market sessions or trading hours.
Key Features:
Highlights a custom time range with a shaded background
Fully adjustable start and end time (hour & minute)
Supports multiple time zones (e.g., GMT, UTC, Europe/Berlin)
Optional market color shading inside the window (bull/bear neutral tone)
Use Cases:
Mark London Open, New York Session, or any session overlap
Focus on high-probability trading hours
Visualize your backtesting timeframe or algo activity window
Track premarket or after-hours activity for futures or indices
Customization:
Set the beginning and end time in your local or exchange time zone
Choose your timezone string (e.g., "GMT", "Etc/UTC", "America/New_York")
Automatically colors candles in the time window for easy visibility
Jarass regression linesDouble Linear Regression Ultimate + MA Ribbon (DLRC + MA)
The DLRC + MA indicator is an advanced technical analysis tool that combines double linear regression channels with a moving average ribbon (MA Ribbon). Designed for traders who want to simultaneously track trend, volatility, and potential support/resistance levels.
Key Features:
1. Double Linear Regression Channels:
• Inner Channel – shorter period, more sensitive to recent price movements.
• Outer Channel – longer period, reflects the long-term trend.
• Both channels display upper and lower boundaries and a midline.
• Optional logarithmic scale for price adjustment.
• Real-time R² values to assess regression accuracy.
2. MA Ribbon:
• Up to 4 different moving averages simultaneously.
• Supports SMA, EMA, SMMA (RMA), WMA, VWMA.
• Each MA can be individually enabled/disabled, with customizable period, source, and color.
• Helps identify trend direction and dynamic support/resistance levels.
3. Visualization:
• Channels are filled with semi-transparent colors for clarity.
• Midline for quick trend direction assessment.
• Label displays R² values of the channels in real time.
4. Suitable For:
• Short-term and long-term traders seeking a combination of linear regression analysis and classic trend-following tools.
• Useful for identifying overbought/oversold zones and potential trend reversal points.
Summary:
DLRC + MA combines statistical precision of linear regression with intuitive trend visualization via a MA ribbon. It provides quick insight into market direction, volatility, and potential turning points, all in one chart overlay.
CVD Spaghetti - Multi-Exchange (Spot)CVD Spaghetti – Multi-Exchange (Spot)
The CVD Spaghetti – Multi-Exchange (Spot) indicator provides a consolidated view of Cumulative Volume Delta (CVD) across multiple spot exchanges in a single chart. By plotting exchange-specific CVD lines simultaneously, it allows traders to track differences in buy/sell pressure between venues and gain a broader perspective on market flows.
What It Does
Calculates CVD per exchange: The script estimates volume delta (buy vs. sell pressure) by analyzing whether trades occur on the bid or ask side, then accumulates these values over time.
Multi-exchange coverage: Supports Binance, Bybit, Coinbase, Upbit, OKX, Bitget, Gate, and others, with optional toggles to include/exclude exchanges. Each exchange is plotted in a distinct color, with labels automatically added on the last bar.
Anchor period resets: CVD can be anchored to a timeframe (default: daily UTC reset). This ensures cumulative calculations remain relevant and comparable across sessions.
Customizable visuals: Includes configurable colors for each exchange and a baseline zero line for reference. Vertical dashed markers highlight reset periods.
Why It’s Useful
CVD is often used as a proxy for identifying hidden market sentiment. While price alone may not reveal whether moves are driven by aggressive buying or selling, CVD can highlight whether buyers or sellers dominate. By comparing this across exchanges:
Traders can detect imbalances between venues (e.g., Binance vs. Coinbase) which may hint at arbitrage flows, liquidity shifts, or localized pressure.
Strong divergence in CVD across exchanges may indicate regional demand/supply, market maker activity, or structural differences in order flow.
Anchored resets prevent drift, allowing consistent tracking of daily flows and avoiding misleading long-term accumulation.
Technical Notes
Built for spot market pairs; the base currency is automatically detected from the active chart symbol.
Uses lower timeframe volume aggregation internally to approximate delta, making it adaptable across intraday and higher timeframes.
If an exchange symbol is unavailable or invalid, the script ignores it gracefully.
Works best when applied to liquid assets with active spot markets across multiple exchanges.
The indicator is informational, not predictive—it does not generate buy/sell signals but helps contextualize price action through order flow analysis.
Applications in Trading
Confirmation tool: Use CVD trends to confirm whether a breakout is supported by buying volume or is fading on weak participation.
Exchange comparison: Identify which venues lead or lag in buy/sell pressure to anticipate short-term shifts.
Market structure analysis: Combine with price action, liquidity zones, or volume profiles to deepen understanding of accumulation and distribution phases.
MA Crossover BIFTY BNF with Broker Inputs//@version=6
strategy("MA Crossover with Broker Inputs", overlay=true, margin_long=100, margin_short=100, process_orders_on_close=true)
// === BROKER & ORDER SETTINGS ===
broker = input.string("Dhan", title="Broker", options= )
orderType = input.string("MKT", title="Order Type", options= )
clientID = input.string("", title="Client ID (Optional)")
secretKey = input.string("", title="Secret Key (from JSON)")
// === INSTRUMENT SELECTION ===
instrument = input.string("BANKNIFTY", title="Select Instrument", options= )
expiryMode = input.string("Auto", title="Expiry Mode", options= )
manualExpiry = input.string("17Dec2025", title="Manual Expiry Date (if Manual Mode)")
optionType = input.string("CE", title="Option Type", options= )
strikeSel = input.string("ATM", title="Strike Selection", options= )
// === RISK MANAGEMENT ===
stopLossPts = input.int(50, title="Stop Loss (points)")
takeProfitPts = input.int(100, title="Take Profit (points)")
// === STRATEGY LOGIC: Moving Average Crossover ===
fastLength = input.int(9, title="Fast MA Length")
slowLength = input.int(18, title="Slow MA Length")
price = close
maFast = ta.sma(price, fastLength)
maSlow = ta.sma(price, slowLength)
// Crossover Long
if (ta.crossover(maFast, maSlow))
strategy.entry("Long", strategy.long, comment="MA Crossover Long")
// Crossunder Short
if (ta.crossunder(maFast, maSlow))
strategy.entry("Short", strategy.short, comment="MA Crossover Short")
// Apply SL and TP
strategy.exit("Exit Long", from_entry="Long", stop=close - stopLossPts, limit=close + takeProfitPts)
strategy.exit("Exit Short", from_entry="Short", stop=close + stopLossPts, limit=close - takeProfitPts)
// === PLOTS ===
plot(maFast, color=color.green, title="Fast MA")
plot(maSlow, color=color.red, title="Slow MA")
Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)
Power Hour Breakout Signals [LuxAlgo]The Power Hour Breakout tool helps traders identify key price levels from the Power Hour and spot breakouts from those levels easily. This tool features Power Hour extensions, Fibonacci levels, and session break marks for the trader's convenience.
🔶 USAGE
The Power Hour is defined as the last hour of the trading session and is set by default from 3:00 p.m. to 4:00 p.m. New York time. During this period, volume and volatility enter the market. Traders using higher timeframes may use this period to enter or exit positions by placing MOC (Market on Close) orders.
This tool highlights the Power Hour and the top and bottom price levels. Each time prices break out from these levels, a signal is displayed on the chart.
We can use the Power Hour to gauge market sentiment:
Bullish sentiment: Price trades above the Power Hour.
Mixed sentiment: Price trades within the Power Hour.
Bearish sentiment: Price trades below the Power Hour.
🔹 Displaying Power Hours and Breakouts
By default, all detected Power Hours are displayed. Traders can manually adjust this number by disabling the "Display All" parameter in the Settings panel.
Breakouts are displayed by default, too, but this feature can be disabled as well.
The chart above shows different configurations of these parameters.
🔹 Power Hour Extensions
Traders can use Power Hour extensions as potential targets for breakout signals.
In the settings panel, traders can select the percentage of the Power Hour price range to use for each extension. For example, 100% uses the full range, 200% uses the range twice, and so on.
As seen on the chart, traders can configure different percentages for the top and bottom extensions.
🔹 Fibonacci Levels
Traders can display default or custom Fibonacci levels on the Power Hour range to identify retracement opportunities and evaluate market movement strength. Each level can be enabled or disabled, as well as customized by level, color, and line style.
For example, as we can see on the chart, prices attempt to break out at the Power Hour top level, then retrace to the 0.618 Fibonacci level, and then rise to the 200% Power Hour top extension.
🔶 SETTINGS
Display Last X Power Hours: Select how many Power Hours to display or enable the Display All feature.
Power Hour (NY Time): Choose a custom Power Hour in New York time.
🔹 Breakouts
Breakouts: Enable or disable breakouts.
Bullish Breakout: Select color for bullish breakouts.
Bearish Breakout: Select color for bearish breakouts.
🔹 Extensions
Top Extension: Enable or disable the top extension and choose the percentage of Power Hour to use.
Bottom extension: Enable or disable the bottom extension and choose the percentage of Power Hour 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.
🔹 Style
Power Hour Colors
Extension Transparency: Choose the extension's transparency. 0 is solid, and 100 is fully transparent.
Session Breaks: Enable or disable session breaks.
X Trade Planlets you define up to 10 fully manual price levels and ranges—each with its own toggle, two prices (for a band/box), an optional note, and a color. The tool draws lines that start at the first bar of a chosen anchor timeframe (e.g., Daily) and extend to the right, mirroring the “fresh start-of-session” look. If two prices are entered, the area between them is shaded using the same color at 60% transparency, so the line and box fill are visually consistent.
Key Features
10 explicit categories (Cat 1 … Cat 10)
Each category includes:
Enable/disable toggle
Price 1 (line) and Price 2 (optional, defines box top/bottom)
Note (optional): label shows note only; hidden automatically if blank
Color: used for the line, box border, and box fill (with 60% transparency)
Anchor-aware drawing
Lines and boxes begin at the new bar of your selected Anchor Timeframe (e.g., D/W/H4), producing clean, session-style extensions.
Clean visuals
Line width is standardized at 1 for a crisp, unobtrusive look
Labels are aligned to the right of current bars and inherit user label styling options (size, text color, background)
No historical dependence
The indicator does not compute or display historical pivots, opens, or derived levels. Everything is user-defined.
Inputs (Per Category)
Cat N (toggle): Show/hide the category
Price 1: Primary level; a horizontal line is drawn when set
Price 2 (optional): When set with Price 1, a box is drawn between the two values
Note (optional): Free-text label; shown only if non-empty
Color: Applies to line, box border, and box fill (fill uses 60% transparency)
Global Inputs
Anchor Timeframe: Timeframe whose new bar defines the start (anchor) of all lines/boxes
Extend Right (bars): Number of bars to extend into the future
Labels (on/off) and label style options (size, text color, background)
How It Works
On the first bar and on each new bar of the anchor timeframe, the indicator captures the current bar index as the anchor for each category.
For each enabled category:
If Price 1 is set, the script draws a horizontal line from the anchor to extend_len bars into the future.
If Price 2 is also set, a box spanning Price 1 ↔ Price 2 is drawn from the anchor to the same future point.
If a Note is provided, a right-side label is rendered at the level (or box midpoint). If the note is empty, no label is shown.
Visual objects are refreshed every bar to ensure alignment with current settings.
Common Use Cases
Scenario planning & playbooks: Define “watch zones” (e.g., Look Above & Fail) and keep them consistent across sessions.
Manual S/R & liquidity areas: Mark hand-picked levels/ranges you care about, without auto-calculated clutter.
Session-like anchoring: Start-of-day/week anchoring to mimic institutional levels that reset each period.
Trade management: Color-coded bands for entries, invalidation, and targets with clear notes