MEMEC - Meme Coin Market Cap [Da_Prof]For this indicator, the meme coin market cap of the top meme coins are added together to get an estimate of the total meme coin market cap back to the first meme coin, DOGE. Meme.C does this natively on TradingView, but its data only goes back to 19 May 2025. For the indicator, MEME.C supersedes the addition of all the individual meme coins (i.e., from 19 May 2025 to present). The start of MEME.C is labeled on the chart by default, but can be removed by deselecting the label in the settings.
After the creation of DOGE, but before data is available for Meme.C, the highest market cap meme coins are added together to estimate the meme coin market cap. The meme coins used by default are DOGE, SHIB, PEPE, BONK, FLOKI, PENGU, TRUMP, SPX6900, FARTCOIN, WIF, M, BRETT, B, MOG, APE, TURBO, DOG, and POPCAT. Users can select if they wish to disregard any or all of these coins. As of the creation of the indicator, DOGE, SHIB, and PEPE have CRYPTOCAP symbols on TradingView. Therefore, the true market cap of these coins is integrated into this indicator. The other meme coin market caps are estimated using price and the circulating supply as of 09/16/2025. I make no claims as to the indicator's exact accuracy. In fact, it isn't exactly accurate since I utilized the circulating supply on the day it was created, so for meme coins that have a changing supply, the market cap will be at least slightly inaccurate. Use this indicator at your own risk.
To use the indicator, it is best to plot overlayed on the CRYPTOCAP:DOGE chart. You can decide whether or not to hide the DOGE market cap.
Educational
Simple Technicals Table📊 Simple Technicals Table
🎯 A comprehensive technical analysis dashboard displaying key pivot points and moving averages across multiple timeframes
📋 OVERVIEW
The Simple Technicals Table is a powerful indicator that organizes essential trading data into a clean, customizable table format. It combines Fibonacci-based pivot points with critical moving averages for both daily and weekly timeframes, giving traders instant access to key support/resistance levels and trend information.
Perfect for:
Technical analysts studying multi-timeframe data
Chart readers needing quick reference levels
Market researchers analyzing price patterns
Educational purposes and data visualization
🚀 KEY FEATURES
📊 Dual Timeframe Analysis
Daily (D1) and Weekly (W1) data side-by-side
Real-time updates as market conditions change
Seamless comparison between timeframes
🎯 Fibonacci Pivot Points
R3, R2, R1 : Resistance levels using Fibonacci ratios (38.2%, 61.8%, 100%)
PP : Central pivot point from previous period's data
S1, S2, S3 : Support levels with same methodology
📈 Complete EMA Suite
EMA 10 : Short-term trend identification
EMA 20 : Popular swing trading reference
EMA 50 : Medium-term trend confirmation
EMA 100 : Institutional support/resistance
EMA 200 : Long-term trend determination
📊 Essential Indicators
RSI 14 : Momentum for overbought/oversold conditions
ATR 14 : Volatility measurement for risk management
🎨 Full Customization
9 table positions : Place anywhere on your chart
5 text sizes : Tiny to huge for optimal visibility
Custom colors : Background, headers, and text
Optional pivot lines : Visual weekly levels on chart
⚙️ HOW IT WORKS
Fibonacci Pivot Calculation:
Pivot Point (PP) = (High + Low + Close) / 3
Range = High - Low
Resistance Levels:
R1 = PP + (Range × 0.382)
R2 = PP + (Range × 0.618)
R3 = PP + (Range × 1.000)
Support Levels:
S1 = PP - (Range × 0.382)
S2 = PP - (Range × 0.618)
S3 = PP - (Range × 1.000)
Smart Price Formatting:
< $1: 5 decimal places (crypto-friendly)
$1-$10: 4 decimal places
$10-$100: 3 decimal places
> $100: 2 decimal places
📊 TECHNICAL ANALYSIS APPLICATIONS
⚠️ EDUCATIONAL PURPOSE ONLY
This indicator is designed solely for technical analysis and educational purposes . It provides data visualization to help understand market structure and price relationships.
📈 Data Analysis Uses
Support & Resistance Identification : Visualize Fibonacci-based pivot levels
Trend Analysis : Study EMA relationships and price positioning
Multi-Timeframe Study : Compare daily and weekly technical data
Market Structure : Understand key technical levels and indicators
📚 Educational Benefits
Learn about Fibonacci pivot point calculations
Understand moving average relationships
Study RSI and ATR indicator values
Practice multi-timeframe technical analysis
🔍 Data Visualization Features
Organized table format for easy data reading
Color-coded levels for quick identification
Real-time technical indicator values
Historical data integrity maintained
🛠️ SETUP GUIDE
1. Installation
Search "Simple Technicals Table" in indicators
Add to chart (appears in middle-left by default)
Table displays automatically on any timeframe
2. Customization
Table Position : Choose from 9 locations
Text Size : Adjust for screen resolution
Colors : Match your chart theme
Pivot Lines : Toggle weekly level visualization
3. Optimization Tips
Use larger text on mobile devices
Dark backgrounds work well with light text
Enable pivot lines for visual reference
✅ BEST PRACTICES
Recommended Usage:
Use for technical analysis and educational study only
Combine with other analytical methods for comprehensive analysis
Study multi-timeframe data relationships
Practice understanding technical indicator values
Important Notes:
Levels based on previous period's data
Most effective in trending markets
No repainting - uses confirmed data only
Works on all instruments and timeframes
🔧 TECHNICAL SPECS
Performance:
Pine Script v5 optimized code
Minimal CPU/memory usage
Real-time data updates
No lookahead bias
Compatibility:
All chart types (Candlestick, Bar, Line)
Any instrument (Stocks, Forex, Crypto, etc.)
All timeframes supported
Mobile and desktop friendly
Data Accuracy:
Precise floating-point calculations
Historical data integrity maintained
No future data leakage
📱 DEVICE SUPPORT
✅ Desktop browsers (Chrome, Firefox, Safari, Edge)
✅ TradingView mobile app (iOS/Android)
✅ TradingView desktop application
✅ Light and dark themes
✅ All screen resolutions
📋 VERSION INFO
Version 1.0 - Initial Release
Fibonacci-based pivot calculations
Dual timeframe support (Daily/Weekly)
Complete EMA suite (10, 20, 50, 100, 200)
RSI and ATR indicators
Fully customizable interface
Optional pivot line visualization
Smart price formatting
Mobile-optimized display
⚠️ DISCLAIMER
This indicator is designed for technical analysis, educational and informational purposes ONLY . It provides data visualization and technical calculations to help users understand market structure and price relationships.
⚠️ NOT FOR TRADING DECISIONS
This tool does NOT provide trading signals or investment advice
All data is for analytical and educational purposes only
Users should not base trading decisions solely on this indicator
Always conduct thorough research and analysis before making any financial decisions
📚 Educational Use Only
Use for learning technical analysis concepts
Study market data and indicator relationships
Practice chart reading and data interpretation
Understand mathematical calculations behind technical indicators
The Simple Technicals Table provides technical data visualization to assist in market analysis education. It does not constitute financial advice, trading recommendations, or investment guidance. Users are solely responsible for their own research and decisions.
Author: ToTrieu
Version: 1.0
Category: Technical Analysis / Support & Resistance
License: Open source for educational use
💬 Questions? Comments? Feel free to reach out!
Otekura Range Trade Algorithm [Tradebuddies]The Range Trade Algorithm calculates the levels for Monday.
On the chart you will see that the Monday levels will be marked as 1 0 -1.
The M High level calculates Monday's high close and plots it on the screen.
M Low calculates the low close of Monday and plots it on the screen.
The coloured lines on the screen are the points of the range levels formulated with fibonacci values.
The indicator has its own Value table. The prices of the levels are written.
Potential Range breakout targets tell prices at points matching the fibonacci values. These are Take profit or reversal points.
Buy and Sell indicators are determined by the range breakout.
Users can set an alarm on the indicator and receive direct notification with their targets when a new range occurs.
Fib values are multiplied by range values and create an average target according to the price situation. These values represent an area. Breakdown targets show that the target is targeted until the area.
Candle Sweep Alert - MoonThis Pine Script is designed to detect Bearish Sweep and Bullish Sweep patterns on a TradingView chart and trigger alerts and notifications.
Bearish Sweep occurs when the current candle’s high is higher than the previous high, the close is lower than the open (bearish), and the current low is either lower or higher than the previous low.
Bullish Sweep occurs when the current candle’s low is lower than the previous low, the close is higher than the open (bullish), and the current high is either lower or higher than the previous high.
Alerts and notifications will be triggered when these conditions are met, helping traders monitor market movements automatically.
Fibonacci Retracement Levels📘 User Guide & Detailed Explanation
📌 Overview
This indicator automatically plots Fibonacci retracement levels on your chart based on the highest high and lowest low within a chosen lookback period. It helps traders quickly identify potential support and resistance zones derived from Fibonacci ratios.
Unlike manual Fibonacci drawing tools, this script continuously updates the levels as new candles form, saving time and ensuring consistency.
⚙️ Inputs & Settings
Show Fibonacci Retracement (true/false)
Toggle the Fibonacci levels on or off.
Fib Lookback Range (bars)
Defines how many past candles are used to find the swing high and swing low.
Example: If set to 100, the indicator scans the last 100 bars for the highest high and lowest low, then plots the retracement levels between those two points.
Fib Levels to Show
All → Displays all common retracement levels (0%, 23.6%, 38.2%, 50%, 61.8%, 78.6%, 100%).
Main only → Displays only the key levels (38.2%, 50%, 61.8%) with thicker lines for emphasis.
None → Hides all Fibonacci levels (useful if you just want to see high/low markers).
📊 What Appears on the Chart
Horizontal Fib Lines:
The retracement levels are drawn across the chart.
38.2% (green), 50% (orange), 61.8% (red) → Main Fibonacci levels that often act as strong support/resistance.
Other levels (0%, 23.6%, 78.6%, 100%) → Optional additional retracements.
Range High Marker (red triangle up):
Marks the highest high within the lookback range.
Range Low Marker (green triangle down):
Marks the lowest low within the lookback range.
🛠 How to Use It
Identify Swing Points Automatically
No need to manually draw retracements. The script automatically picks the highest and lowest points in the selected range.
Trade Reversals & Pullbacks
Buyers often look for price to bounce near 38.2% or 61.8% retracement levels.
Sellers often target retracements during rallies.
Trend Continuation
If price breaks through a level and holds, the next Fibonacci level becomes the next target zone.
Combine with Other Tools
Works best when combined with:
Support/Resistance zones
Candlestick patterns
Trend indicators (EMA, SMA, MACD)
📈 Example Use Cases
In an uptrend, use the indicator to find pullback entries at 38.2%–61.8% retracements.
In a downtrend, watch for rejection at retracement levels as potential continuation signals.
On range-bound markets, Fibonacci levels often line up with key support/resistance.
⚠️ Notes & Limitations
Fibonacci levels are not guaranteed reversal points — they are probability-based support/resistance areas.
The lookback range setting is crucial. Too short = noisy signals, too long = levels may not reflect the most recent swing.
Should always be used with other confirmation tools (volume, trend analysis, candlestick structure).
📝 Credits & License
This script is published as open source for educational and trading purposes.
You are free to use, share, and modify it under TradingView’s open-source script guidelines.
Regards,
Shunya.Trade
world wide web shunya dot trade
Sero📌 sero Indicator – Guide & Explanation
What the Indicator Does
The sero Indicator is a custom oscillator designed to identify market momentum shifts between bullish (pump) and bearish (dump) phases. It works by normalizing price action using a range calculation, then smoothing it with an EMA. The resulting line (sero value) oscillates on a scale around 0 to 100, giving clear visual cues about momentum strength.
Key concepts inside the code:
c0 → The average price for each bar (High + Low + Close ÷ 3).
a1 & a2 → The 15-bar highest and lowest values of this average price.
a3 → The range (difference between high and low).
sero → A smoothed (EMA-based) normalized oscillator that fluctuates with momentum strength.
The indicator then highlights pumps (upward momentum) and dumps (downward momentum ) with color-coded line breaks.
How It Looks on Chart
When loaded, you’ll see:
A yellow oscillator line (sero) moving up and down.
Red segments on the line → mark slow or strong pumps (bullish momentum).
Green segments on the line → mark slow or strong dumps (bearish momentum).
These color changes act as momentum confirmation signals.
Signals & Interpretation
sero Line (Yellow)
The main oscillator line.
Higher readings = strong bullish momentum.
Lower readings = strong bearish momentum.
Red Segments (Pump Detection)
Appear when sero rises above its previous value.
Thicker Red Line = Stronger pump (sero > 20).
Suggests upward price acceleration.
Green Segments (Dump Detection)
Appear when sero falls below its previous value.
Thicker Green Line = Stronger dump (sero < 20).
Suggests downward price acceleration.
How to Use the sero Indicator
✅ Trend Confirmation
Use sero alongside your main chart to confirm trend direction.
Sustained red (pump) signals = bullish phase.
Sustained green (dump) signals = bearish phase.
✅ Momentum Shifts
Watch for changes in color (from green → red or red → green). These flips may indicate a potential reversal or acceleration in trend.
✅ Threshold Levels (20 level)
The code emphasizes the 20 threshold:
Pump signals above 20 → more reliable bullish confirmation.
Dump signals below 20 → stronger bearish conviction.
✅ Entry & Exit Support
Enter long trades when yellow line rises and red pump segments form.
Enter short trades when yellow line falls and green dump segments form.
Consider exits when momentum color weakens or flips direction.
Best Practices
Always combine with price action, support/resistance, or volume analysis.
Works best on shorter timeframes (intraday scalping/day trading).
Avoid relying on a single pump/dump signal – wait for consistency across multiple bars.
Summary
The sero Indicator is a momentum oscillator that visually highlights bullish and bearish momentum using dynamic color changes. Traders can use it to spot pumps, dumps, and trend shifts more easily than with traditional oscillators.
I welcome your feedback on this analysis/minds/indicator, as it will inform and enhance my future work.
Regards,
Shunya.Trade
world wide web shunya dot trade
SMT Divergences Dual Lookback - MoonTradesThis Pine Script, titled "SMT Divergences Dual Lookback", is designed to detect and visualize divergences between two comparison symbols (symbols A and B) using two different lookback periods. The script specifically identifies bullish and bearish divergences based on pivot highs and lows and marks them on the chart with color-coded labels.
Bullish Divergence (Swing High) is marked when a price swing low diverges from a pivot low, indicating potential upward momentum.
Bearish Divergence (Swing Low) is marked when a price swing high diverges from a pivot high, indicating potential downward momentum.
The script works with two customizable comparison symbols and can also apply a specific timeframe for divergence detection (separate from the chart’s default timeframe). The results are displayed with labels showing the corresponding symbols, helping traders identify potential reversal points or continuation trends.
Users can customize the lookback periods and the colors for the divergence markers. This tool aids in technical analysis for traders who focus on multi-timeframe and multi-symbol divergence strategies.
RiskGlowRiskGlow is an all-in-one trend indicator that combines a dynamic baseline + channel, SSL (2 levels), exit line, and risk reading via ATR. It features an ultra-readable neon design (fluorescent blue & red) + ready-to-use alerts for clear entries/continuities/exits.
Who is it for?
NNFX method (recommended for daily), swing & position trading
Forex, crypto, indices, commodities
Traders who want a clean trend reading + actionable alerts without overloading
What the indicator displays
Configurable baseline (SMA/EMA/DEMA/TEMA/LSMA/WMA/MF/VAMA/TMA/HMA/JMA/Kijun v2/EDSMA/McGinley)
Channel around the baseline (True Range or simple range) to visualize neutral zone ⇄ breakout
SSL1 (direction) and SSL2 (continuation)
Exit line dedicated to quick exits
Bars colored by status (bullish/bearish/neutral)
Risk panel (or last candlestick label): risk level, entry distance, volatility percentile, ATR
Key alerts (breakouts, SSL2 continuations, baseline crosses, exits)
Signal logic (summary)
Trend (Baseline + Channel):
Above the upper band ⇒ bullish bias; below the lower band ⇒ bearish bias; between the two ⇒ neutral.
SSL1: Confirms the trend.
SSL2 (Continuation): Validates a continuation if the price remains on the right side of the baseline and SSL2, with a configurable ½ ATR margin.
Exit: Price crossover ↔ exit line for clear exits.
Alert diamonds: Bar > 1 ATR inside the baseline channel ⇒ risk of a false breakout.
INDICADOR INSTITUCIONAL FVG + FRACTAL + FIBOINSTITUCIONAL INDICATOR
Help to identify FGV´S + Fractals + FIBO
Candle Range Theory (CRT) +Candle Range Theory (CRT)+
Summary
Purpose: Projects a Higher Timeframe (HTF) candle’s range onto your current chart and adds a compact multi-timeframe confluence table to judge premium/discount, trend vs pullback, and alignment.
What it draws:
HTF Range: Active HTF High, Low, and the 50% Equilibrium (EQ) line. Range updates while the HTF bar is building and resets when a new HTF bar starts.
Confluence Table (optional): Up to 5 rows, each pairing a configurable HTF and LTF. Background tint shows premium/discount relative to that row’s HTF EQ. The row label reports directional state (bullish/bearish and pullback/continuation) using simple bar-close momentum checks and a configurable lookback.
How the Confluence Table works
Rows: Up to five independent HTF/LTF pairs (each row can be toggled on/off and configured).
Location: Price vs that row’s HTF EQ
Above EQ = Premium (maroon tint by default)
Below EQ = Discount (green tint by default)
Direction/State: A bar-close momentum read combined with HTF location to label:
Bullish continuation / Bearish continuation
Bullish pullback (upward momentum in discount) / Bearish pullback (downward momentum in premium)
Lookback control:
Uniform Lookback ON: HTF and LTF both use a 1-bar lookback (more responsive).
Uniform Lookback OFF: HTF uses a slightly longer lookback on higher frames for stability; LTF remains 1-bar for responsiveness.
Disclaimer:
This script is for educational and informational purposes only and does not constitute financial advice, investment advice, or trading recommendations. Trading involves substantial risk; you can lose some or all of your capital. Past performance or examples are not indicative of future results. The author provides no warranties regarding accuracy, completeness, or fitness for any purpose and disclaims liability for any losses arising from the use of this tool. Always use your own judgment, confirm on bar close, and consider multiple factors (e.g., volatility, liquidity, news) before taking any action. You are solely responsible for your trading decisions.
Navigator Range Pro+Title Navigator Range Pro+
What it is Navigator Range Pro+ is a confluence-first indicator that blends multi-timeframe (MTF) trend bias with a Dealing Range (DR) framework. It helps you quickly see when higher timeframes align and pairs that bias with clean breakout triggers from a current range. Designed to reduce noise and keep charts readable.
What you’ll see
Dealing Range: Auto-detected range top/bottom with a midline. Choose Stuck (pivot-based, fixed) or Dynamic (rolling highest/lowest) modes.
MTF Bias: Higher timeframe trend bias derived from a selectable moving average (SMA/EMA).
Compact Info Panel (table): A configurable on-chart panel that summarizes each higher timeframe’s bias, optional lower-timeframe analog labels, and a confluence tally. You can position it, resize text, and set columns/rows to fit your layout.
Clean Charting: Flip labels are optional and default to off, so alerts can fire without covering price action.
How it works
Bias engine: Computes bullish/bearish bias for each selected higher timeframe using your chosen MA length/type, then aggregates them into a confluence count.
DR engine: Finds or follows the current trading range and calculates a midline reference for signals or context.
Signals: You can use pure confluence, pure DR breakouts, or a combined “Bias + DR” confirmation for higher-quality entries.
Inputs to know
HTF Ranges (comma separated): Higher timeframes to assess (e.g., W,D,240,60,15).
MA Length/Type: Controls the bias engine’s sensitivity.
DR Mode: Stuck (pivot-based, fixed until a new pivot confirms) or Dynamic (rolling high/low by lookback).
Swing Length / Dynamic Lookback / Extend Right: Shape how the range is found and displayed.
Panel Position / Text Size / Panel Columns / Panel Rows: Customize the on-chart table.
Alerts: Min HTFs to align and Strict alignment (no opposite) to refine confluence.
Show Flip Labels on Chart: Optional visual flip labels; alerts are unaffected if kept off.
Alert conditions
Multi-TF Confluence Bullish: Minimum number of HTFs are bullish (optionally strict).
Multi-TF Confluence Bearish: Minimum number of HTFs are bearish (optionally strict).
DR Breakout Up: Close crosses above DR top.
DR Breakout Down: Close crosses below DR bottom.
Bias + DR Combo Bullish: Bullish confluence and price above your DR threshold (Midline or Top/Bottom).
Bias + DR Combo Bearish: Bearish confluence and price below your DR threshold (Midline or Top/Bottom).
Tips
For live trading, “Once per bar close” alerts are the safest and most consistent.
Increase the Min HTFs to align to reduce noise; switch Combo Threshold to Top/Bottom for fewer, stronger momentum entries.
Keep flip labels off to maintain a clean chart (alerts still fire).
Disclaimer This script is for educational and informational purposes only and does not constitute financial, investment, or trading advice. Trading involves risk, including the risk of loss. You are solely responsible for your own trading decisions. Past performance does not guarantee future results. Always test on a demo and consult a licensed professional where appropriate.
壹神趨勢過濾器壹神趨勢過濾器 (2-pole)
此指標利用雙極濾波器 (Two-pole Filter) 來平滑價格波動,並以顏色與提示符號顯示市場趨勢變化,幫助交易者判斷多空趨勢。
僅供教育與研究使用,未經本人授權請勿盜用。
English:
YiShen Trend Filter (2-pole)
This indicator applies a two-pole filter to smooth price fluctuations and uses color gradients and signal markers to highlight market trend shifts. It is designed to help traders identify bullish and bearish conditions.
Disclaimer: For educational and research purposes only. Unauthorized use or redistribution is strictly prohibited.
Simple MA Crossover - TradicatorsSimple MA Crossover is a beginner-friendly indicator that visualizes moving average crossovers to help identify potential trend shifts. It uses two simple moving averages (SMA):
A Fast Moving Average (short-term)
A Slow Moving Average (long-term)
When the fast MA crosses above the slow MA, a green BUY label appears below the candle. When the fast MA crosses below the slow MA, a red SELL label appears above the candle.
These crossovers can be used as basic signals to suggest potential trend continuation or reversal points. The indicator works on all timeframes and can be used with various assets.
📌 This script is for educational and illustrative purposes only and should not be considered financial advice. Use it in conjunction with your own research, trading strategy, and risk management practices.
Add the Indicator
Open any chart on TradingView
Click on the Indicators tab
Search for “Simple MA Crossover” and add it to your chart
How It Works
The script plots two colored lines:
Orange Line: Fast Moving Average (default 9-period)
Blue Line: Slow Moving Average (default 21-period)
When the orange line crosses above the blue line → a BUY signal is printed
When the orange line crosses below the blue line → a SELL signal is printed
Customization
You can change the lengths of the moving averages in the settings to match your style
Works on any chart — crypto, stocks, forex, etc.
Try different timeframes (15min, 1H, 4H, Daily) to see what suits your strategy best
Reminder
Always test the indicator on a demo account before using it in live trading
Combine this tool with your own technical/fundamental analysis
No indicator guarantees profits or prevents losses
Copeland Dynamic Dominance Matrix System | GForgeCopeland Dynamic Dominance Matrix System | GForge - v1
---
📊 COMPREHENSIVE SYSTEM OVERVIEW
The GForge Dynamic BB% TrendSync System represents a revolutionary approach to algorithmic portfolio management, combining cutting-edge statistical analysis, momentum detection, and regime identification into a unified framework. This system processes up to 39 different cryptocurrency assets simultaneously, using advanced mathematical models to determine optimal capital allocation across dynamic market conditions.
Core Innovation: Multi-Dimensional Analysis
Unlike traditional single-asset indicators, this system operates on multiple analytical dimensions:
Momentum Analysis: Dual Bollinger Band Modified Deviation (DBBMD) calculations
Relative Strength: Comprehensive dominance matrix with head-to-head comparisons
Fundamental Screening: Alpha and Beta statistical filtering
Market Regime Detection: Five-component statistical testing framework
Portfolio Optimization: Dynamic weighting and allocation algorithms
Risk Management: Multi-layered protection and regime-based positioning
---
🔧 DETAILED COMPONENT BREAKDOWN
1. Dynamic Bollinger Band % Modified Deviation Engine (DBBMD)
The foundation of this system is an advanced oscillator that combines two independent Bollinger Band systems with asymmetric parameters to create unique momentum readings.
Technical Implementation:
[
// BB System 1: Fast-reacting with extended standard deviation
primary_bb1_ma_len = 40 // Shorter MA for responsiveness
primary_bb1_sd_len = 65 // Longer SD for stability
primary_bb1_mult = 1.0 // Standard deviation multiplier
// BB System 2: Complementary asymmetric design
primary_bb2_ma_len = 8 // Longer MA for trend following
primary_bb2_sd_len = 66 // Shorter SD for volatility sensitivity
primary_bb2_mult = 1.7 // Wider bands for reduced noise
Key Features:
Asymmetric Design: The intentional mismatch between MA and Standard Deviation periods creates unique oscillation characteristics that traditional Bollinger Bands cannot achieve
Percentage Scale: All readings are normalized to 0-100% scale for consistent interpretation across assets
Multiple Combination Modes:
BB1 Only: Fast/reactive system
BB2 Only: Smooth/stable system
Average: Balanced blend (recommended)
Both Required: Conservative (both must agree)
Either One: Aggressive (either can trigger)
Mean Deviation Filter: Additional volatility-based layer that measures the standard deviation of the DBBMD% itself, creating dynamic trigger bands
Signal Generation Logic:
// Primary thresholds
primary_long_threshold = 71 // DBBMD% level for bullish signals
primary_short_threshold = 33 // DBBMD% level for bearish signals
// Mean Deviation creates dynamic bands around these thresholds
upper_md_band = combined_bb + (md_mult * bb_std)
lower_md_band = combined_bb - (md_mult * bb_std)
// Signal triggers when DBBMD crosses these dynamic bands
long_signal = lower_md_band > long_threshold
short_signal = upper_md_band < short_threshold
For more information on this BB% indicator, find it here:
2. Revolutionary Dominance Matrix System
This is the system's most sophisticated innovation - a comprehensive framework that compares every asset against every other asset to determine relative strength hierarchies.
Mathematical Foundation:
The system constructs a mathematical matrix where each cell represents whether asset i dominates asset j:
// Core dominance matrix (39x39 for maximum assets)
var matrix dominance_matrix = matrix.new(39, 39, 0)
// For each qualifying asset pair (i,j):
for i = 0 to active_count - 1
for j = 0 to active_count - 1
if i != j
// Calculate price ratio BB% TrendSync for asset_i/asset_j
ratio_array = calculate_price_ratios(asset_i, asset_j)
ratio_dbbmd = calculate_dbbmd(ratio_array)
// Asset i dominates j if ratio is in uptrend
if ratio_dbbmd_state == 1
matrix.set(dominance_matrix, i, j, 1)
Copeland Scoring Algorithm:
Each asset receives a dominance score calculated as:
Dominance Score = Total Wins - Total Losses
// Calculate net dominance for each asset
for i = 0 to active_count - 1
wins = 0
losses = 0
for j = 0 to active_count - 1
if i != j
if matrix.get(dominance_matrix, i, j) == 1
wins += 1
else
losses += 1
copeland_score = wins - losses
array.set(dominance_scores, i, copeland_score)
Head-to-Head Analysis Process:
Ratio Construction: For each asset pair, calculate price_asset_A / price_asset_B
DBBMD Application: Apply the same DBBMD analysis to these ratios
Trend Determination: If ratio DBBMD shows uptrend, Asset A dominates Asset B
Matrix Population: Store dominance relationships in mathematical matrix
Score Calculation: Sum wins minus losses for final ranking
This creates a tournament-style ranking where each asset's strength is measured against all others, not just against a benchmark.
3. Advanced Alpha & Beta Filtering System
The system incorporates fundamental analysis through Capital Asset Pricing Model (CAPM) calculations to filter assets based on risk-adjusted performance.
Alpha Calculation (Excess Return Analysis):
// CAPM Alpha calculation
f_calc_alpha(asset_prices, benchmark_prices, alpha_length, beta_length, risk_free_rate) =>
// Calculate asset and benchmark returns
asset_returns = calculate_returns(asset_prices, alpha_length)
benchmark_returns = calculate_returns(benchmark_prices, alpha_length)
// Get beta for expected return calculation
beta = f_calc_beta(asset_prices, benchmark_prices, beta_length)
// Average returns over period
avg_asset_return = array_average(asset_returns) * 100
avg_benchmark_return = array_average(benchmark_returns) * 100
// Expected return using CAPM: E(R) = Beta * Market_Return + Risk_Free_Rate
expected_return = beta * avg_benchmark_return + risk_free_rate
// Alpha = Actual Return - Expected Return
alpha = avg_asset_return - expected_return
Beta Calculation (Volatility Relationship):
// Beta measures how much an asset moves relative to benchmark
f_calc_beta(asset_prices, benchmark_prices, length) =>
// Calculate return series for both assets
asset_returns =
benchmark_returns =
// Populate return arrays
for i = 0 to length - 1
asset_return = (current_price - previous_price) / previous_price
benchmark_return = (current_bench - previous_bench) / previous_bench
// Calculate covariance and variance
covariance = calculate_covariance(asset_returns, benchmark_returns)
benchmark_variance = calculate_variance(benchmark_returns)
// Beta = Covariance(Asset, Market) / Variance(Market)
beta = covariance / benchmark_variance
Filtering Applications:
Alpha Filter: Only includes assets with alpha above specified threshold (e.g., >0.5% monthly excess return)
Beta Filter: Screens for desired volatility characteristics (e.g., beta >1.0 for aggressive assets)
Combined Screening: Both filters must pass for asset qualification
Dynamic Thresholds: User-configurable parameters for different market conditions
4. Intelligent Tie-Breaking Resolution System
When multiple assets have identical dominance scores, the system employs sophisticated methods to determine final rankings.
Standard Tie-Breaking Hierarchy:
// Primary tie-breaking logic
if score_i == score_j // Tied dominance scores
// Level 1: Compare Beta values (higher beta wins)
beta_i = array.get(beta_values, i)
beta_j = array.get(beta_values, j)
if beta_j > beta_i
swap_positions(i, j)
else if beta_j == beta_i
// Level 2: Compare Alpha values (higher alpha wins)
alpha_i = array.get(alpha_values, i)
alpha_j = array.get(alpha_values, j)
if alpha_j > alpha_i
swap_positions(i, j)
Advanced Tie-Breaking (Head-to-Head Analysis):
For the top 3 performers, an enhanced tie-breaking mechanism analyzes direct head-to-head price ratio performance:
// Advanced tie-breaker for top performers
f_advanced_tiebreaker(asset1_idx, asset2_idx, lookback_period) =>
// Calculate price ratio over lookback period
ratio_history =
for k = 0 to lookback_period - 1
price_ratio = price_asset1 / price_asset2
array.push(ratio_history, price_ratio)
// Apply simplified trend analysis to ratio
current_ratio = array.get(ratio_history, 0)
average_ratio = calculate_average(ratio_history)
// Asset 1 wins if current ratio > average (trending up)
if current_ratio > average_ratio
return 1 // Asset 1 dominates
else
return -1 // Asset 2 dominates
5. Five-Component Aggregate Market Regime Filter
This sophisticated framework combines multiple statistical tests to determine whether market conditions favor trending strategies or require defensive positioning.
Component 1: Augmented Dickey-Fuller (ADF) Test
Tests for unit root presence to distinguish between trending and mean-reverting price series.
// Simplified ADF implementation
calculate_adf_statistic(price_series, lookback) =>
// Calculate first differences
differences =
for i = 0 to lookback - 2
diff = price_series - price_series
array.push(differences, diff)
// Statistical analysis of differences
mean_diff = calculate_mean(differences)
std_diff = calculate_standard_deviation(differences)
// ADF statistic approximation
adf_stat = mean_diff / std_diff
// Compare against threshold for trend determination
is_trending = adf_stat <= adf_threshold
Component 2: Directional Movement Index (DMI)
Classic Wilder indicator measuring trend strength through directional movement analysis.
// DMI calculation for trend strength
calculate_dmi_signal(high_data, low_data, close_data, period) =>
// Calculate directional movements
plus_dm_sum = 0.0
minus_dm_sum = 0.0
true_range_sum = 0.0
for i = 1 to period
// Directional movements
up_move = high_data - high_data
down_move = low_data - low_data
// Accumulate positive/negative movements
if up_move > down_move and up_move > 0
plus_dm_sum += up_move
if down_move > up_move and down_move > 0
minus_dm_sum += down_move
// True range calculation
true_range_sum += calculate_true_range(i)
// Calculate directional indicators
di_plus = 100 * plus_dm_sum / true_range_sum
di_minus = 100 * minus_dm_sum / true_range_sum
// ADX calculation
dx = 100 * math.abs(di_plus - di_minus) / (di_plus + di_minus)
adx = dx // Simplified for demonstration
// Trending if ADX above threshold
is_trending = adx > dmi_threshold
Component 3: KPSS Stationarity Test
Complementary test to ADF that examines stationarity around trend components.
// KPSS test implementation
calculate_kpss_statistic(price_series, lookback, significance_level) =>
// Calculate mean and variance
series_mean = calculate_mean(price_series, lookback)
series_variance = calculate_variance(price_series, lookback)
// Cumulative sum of deviations
cumulative_sum = 0.0
cumsum_squared_sum = 0.0
for i = 0 to lookback - 1
deviation = price_series - series_mean
cumulative_sum += deviation
cumsum_squared_sum += math.pow(cumulative_sum, 2)
// KPSS statistic
kpss_stat = cumsum_squared_sum / (lookback * lookback * series_variance)
// Compare against critical values
critical_value = significance_level == 0.01 ? 0.739 :
significance_level == 0.05 ? 0.463 : 0.347
is_trending = kpss_stat >= critical_value
Component 4: Choppiness Index
Measures market directionality using fractal dimension analysis of price movement.
// Choppiness Index calculation
calculate_choppiness(price_data, period) =>
// Find highest and lowest over period
highest = price_data
lowest = price_data
true_range_sum = 0.0
for i = 0 to period - 1
if price_data > highest
highest := price_data
if price_data < lowest
lowest := price_data
// Accumulate true range
if i > 0
true_range = calculate_true_range(price_data, i)
true_range_sum += true_range
// Choppiness calculation
range_high_low = highest - lowest
choppiness = 100 * math.log10(true_range_sum / range_high_low) / math.log10(period)
// Trending if choppiness below threshold (typically 61.8)
is_trending = choppiness < 61.8
Component 5: Hilbert Transform Analysis
Phase-based cycle detection and trend identification using mathematical signal processing.
// Hilbert Transform trend detection
calculate_hilbert_signal(price_data, smoothing_period, filter_period) =>
// Smooth the price data
smoothed_price = calculate_moving_average(price_data, smoothing_period)
// Calculate instantaneous phase components
// Simplified implementation for demonstration
instant_phase = smoothed_price
delayed_phase = calculate_moving_average(price_data, filter_period)
// Compare instantaneous vs delayed signals
phase_difference = instant_phase - delayed_phase
// Trending if instantaneous leads delayed
is_trending = phase_difference > 0
Aggregate Regime Determination:
// Combine all five components
regime_calculation() =>
trending_count = 0
total_components = 0
// Test each enabled component
if enable_adf and adf_signal == 1
trending_count += 1
if enable_adf
total_components += 1
// Repeat for all five components...
// Calculate trending proportion
trending_proportion = trending_count / total_components
// Market is trending if proportion above threshold
regime_allows_trading = trending_proportion >= regime_threshold
The system only allows asset positions when the specified percentage of components indicate trending conditions. During choppy or mean-reverting periods, the system automatically positions in USD to preserve capital.
6. Dynamic Portfolio Weighting Framework
Six sophisticated allocation methodologies provide flexibility for different market conditions and risk preferences.
Weighting Method Implementations:
1. Equal Weight Distribution:
// Simple equal allocation
if weighting_mode == "Equal Weight"
weight_per_asset = 1.0 / selection_count
for i = 0 to selection_count - 1
array.push(weights, weight_per_asset)
2. Linear Dominance Scaling:
// Linear scaling based on dominance scores
if weighting_mode == "Linear Dominance"
// Normalize scores to 0-1 range
min_score = array.min(dominance_scores)
max_score = array.max(dominance_scores)
score_range = max_score - min_score
total_weight = 0.0
for i = 0 to selection_count - 1
score = array.get(dominance_scores, i)
normalized = (score - min_score) / score_range
weight = 1.0 + normalized * concentration_factor
array.push(weights, weight)
total_weight += weight
// Normalize to sum to 1.0
for i = 0 to selection_count - 1
current_weight = array.get(weights, i)
array.set(weights, i, current_weight / total_weight)
3. Conviction Score (Exponential):
// Exponential scaling for high conviction
if weighting_mode == "Conviction Score"
// Combine dominance score with DBBMD strength
conviction_scores =
for i = 0 to selection_count - 1
dominance = array.get(dominance_scores, i)
dbbmd_strength = array.get(dbbmd_values, i)
conviction = dominance + (dbbmd_strength - 50) / 25
array.push(conviction_scores, conviction)
// Exponential weighting
total_weight = 0.0
for i = 0 to selection_count - 1
conviction = array.get(conviction_scores, i)
normalized = normalize_score(conviction)
weight = math.pow(1 + normalized, concentration_factor)
array.push(weights, weight)
total_weight += weight
// Final normalization
normalize_weights(weights, total_weight)
Advanced Features:
Minimum Position Constraint: Prevents dust allocations below specified threshold
Concentration Factor: Adjustable parameter controlling weight distribution aggressiveness
Dominance Boost: Extra weight for assets exceeding specified dominance thresholds
Dynamic Rebalancing: Automatic weight recalculation on portfolio changes
7. Intelligent USD Management System
The system treats USD as a competing asset with its own dominance score, enabling sophisticated cash management.
USD Scoring Methodologies:
Smart Competition Mode (Recommended):
f_calculate_smart_usd_dominance() =>
usd_wins = 0
// USD beats assets in downtrends or weak uptrends
for i = 0 to active_count - 1
asset_state = get_asset_state(i)
asset_dbbmd = get_asset_dbbmd(i)
// USD dominates shorts and weak longs
if asset_state == -1 or (asset_state == 1 and asset_dbbmd < long_threshold)
usd_wins += 1
// Calculate Copeland-style score
base_score = usd_wins - (active_count - usd_wins)
// Boost during weak market conditions
qualified_assets = count_qualified_long_assets()
if qualified_assets <= active_count * 0.2
base_score := math.round(base_score * usd_boost_factor)
base_score
Auto Short Count Mode:
// USD dominance based on number of bearish assets
usd_dominance = count_assets_in_short_state()
// Apply boost during low activity
if qualified_long_count <= active_count * 0.2
usd_dominance := usd_dominance * usd_boost_factor
Regime-Based USD Positioning:
When the five-component regime filter indicates unfavorable conditions, the system automatically overrides all asset signals and positions 100% in USD, protecting capital during choppy markets.
8. Multi-Asset Infrastructure & Data Management
The system maintains comprehensive data structures for up to 39 assets simultaneously.
Data Collection Framework:
// Full OHLC data matrices (200 bars depth for performance)
var matrix open_data = matrix.new(39, 200, na)
var matrix high_data = matrix.new(39, 200, na)
var matrix low_data = matrix.new(39, 200, na)
var matrix close_data = matrix.new(39, 200, na)
// Real-time data collection
if barstate.isconfirmed
for i = 0 to active_count - 1
ticker = array.get(assets, i)
= request.security(ticker, timeframe.period,
[open , high , low , close ],
lookahead=barmerge.lookahead_off)
// Store in matrices with proper shifting
matrix.set(open_data, i, 0, nz(o, 0))
matrix.set(high_data, i, 0, nz(h, 0))
matrix.set(low_data, i, 0, nz(l, 0))
matrix.set(close_data, i, 0, nz(c, 0))
Asset Configuration:
The system comes pre-configured with 39 major cryptocurrency pairs across multiple exchanges:
Major Pairs: BTC, ETH, XRP, SOL, DOGE, ADA, etc.
Exchange Coverage: Binance, KuCoin, MEXC for optimal liquidity
Configurable Count: Users can activate 2-39 assets based on preferences
Custom Tickers: All asset selections are user-modifiable
---
⚙️ COMPREHENSIVE CONFIGURATION GUIDE
Portfolio Management Settings
Maximum Portfolio Size (1-10):
Conservative (1-2): High concentration, captures strong trends
Balanced (3-5): Moderate diversification with trend focus
Diversified (6-10): Lower concentration, broader market exposure
Dominance Clarity Threshold (0.1-1.0):
Low (0.1-0.4): Prefers diversification, holds multiple assets frequently
Medium (0.5-0.7): Balanced approach, context-dependent allocation
High (0.8-1.0): Concentration-focused, single asset preference
Signal Generation Parameters
DBBMD Thresholds:
// Standard configuration
primary_long_threshold = 71 // Conservative: 75+, Aggressive: 65-70
primary_short_threshold = 33 // Conservative: 25-30, Aggressive: 35-40
// BB System parameters
bb1_ma_len = 40 // Fast system: 20-50
bb1_sd_len = 65 // Stability: 50-80
bb2_ma_len = 8 // Trend: 60-100
bb2_sd_len = 66 // Sensitivity: 10-20
Risk Management Configuration
Alpha/Beta Filters:
Alpha Threshold: 0.0-2.0% (higher = more selective)
Beta Threshold: 0.5-2.0 (1.0+ for aggressive assets)
Calculation Periods: 20-50 bars (longer = more stable)
Regime Filter Settings:
Trending Threshold: 0.3-0.8 (higher = stricter trend requirements)
Component Lookbacks: 30-100 bars (balance responsiveness vs stability)
Enable/Disable: Individual component control for customization
---
📊 PERFORMANCE TRACKING & VISUALIZATION
Real-Time Dashboard Features
The compact dashboard provides essential information:
Current Holdings: Asset names and allocation percentages
Dominance Score: Current position's relative strength ranking
Active Assets: Qualified long signals vs total asset count
Returns: Total portfolio performance percentage
Maximum Drawdown: Peak-to-trough decline measurement
Trade Count: Total portfolio transitions executed
Regime Status: Current market condition assessment
Comprehensive Ranking Table
The left-side table displays detailed asset analysis:
Ranking Position: Numerical order by dominance score
Asset Symbol: Clean ticker identification with color coding
Dominance Score: Net wins minus losses in head-to-head comparisons
Win-Loss Record: Detailed breakdown of dominance relationships
DBBMD Reading: Current momentum percentage with threshold highlighting
Alpha/Beta Values: Fundamental analysis metrics when filters enabled
Portfolio Weight: Current allocation percentage in signal portfolio
Execution Status: Visual indicator of actual holdings vs signals
Visual Enhancement Features
Color-Coded Assets: 39 distinct colors for easy identification
Regime Background: Red tinting during unfavorable market conditions
Dynamic Equity Curve: Portfolio value plotted with position-based coloring
Status Indicators: Symbols showing execution vs signal states
---
🔍 ADVANCED TECHNICAL FEATURES
State Persistence System
The system maintains asset states across bars to prevent excessive switching:
// State tracking for each asset and ratio combination
var array asset_states = array.new(1560, 0) // 39 * 40 ratios
// State changes only occur on confirmed threshold breaks
if long_crossover and current_state != 1
current_state := 1
array.set(asset_states, asset_index, 1)
else if short_crossover and current_state != -1
current_state := -1
array.set(asset_states, asset_index, -1)
Transaction Cost Integration
Realistic modeling of trading expenses:
// Transaction cost calculation
transaction_fee = 0.4 // Default 0.4% (fees + slippage)
// Applied on portfolio transitions
if should_execute_transition
was_holding_assets = check_current_holdings()
will_hold_assets = check_new_signals()
// Charge fees for meaningful transitions
if transaction_fee > 0 and (was_holding_assets or will_hold_assets)
fee_amount = equity * (transaction_fee / 100)
equity -= fee_amount
total_fees += fee_amount
Dynamic Memory Management
Optimized data structures for performance:
200-Bar History: Sufficient for calculations while maintaining speed
Matrix Operations: Efficient storage and retrieval of multi-asset data
Array Recycling: Memory-conscious data handling for long-running backtests
Conditional Calculations: Skip unnecessary computations during initialization
12H 30 assets portfolio
---
🚨 SYSTEM LIMITATIONS & TESTING STATUS
CURRENT DEVELOPMENT PHASE: ACTIVE TESTING & OPTIMIZATION
This system represents cutting-edge algorithmic trading technology but remains in continuous development. Key considerations:
Known Limitations:
Requires significant computational resources for 39-asset analysis
Performance varies significantly across different market conditions
Complex parameter interactions may require extensive optimization
Slippage and liquidity constraints not fully modeled for all assets
No consideration for market impact in large position sizes
Areas Under Active Development:
Enhanced regime detection algorithms
Improved transaction cost modeling
Additional portfolio weighting methodologies
Machine learning integration for parameter optimization
Cross-timeframe analysis capabilities
---
🔒 ANTI-REPAINTING ARCHITECTURE & LIVE TRADING READINESS
One of the most critical aspects of any trading system is ensuring that signals and calculations are based on confirmed, historical data rather than current bar information that can change throughout the trading session. This system implements comprehensive anti-repainting measures to ensure 100% reliability for live trading .
The Repainting Problem in Trading Systems
Repainting occurs when an indicator uses current, unconfirmed bar data in its calculations, causing:
False Historical Signals: Backtests appear better than reality because calculations change as bars develop
Live Trading Failures: Signals that looked profitable in testing fail when deployed in real markets
Inconsistent Results: Different results when running the same indicator at different times during a trading session
Misleading Performance: Inflated win rates and returns that cannot be replicated in practice
GForge Anti-Repainting Implementation
This system eliminates repainting through multiple technical safeguards:
1. Historical Data Usage for All Calculations
// CRITICAL: All calculations use PREVIOUS bar data (note the offset)
= request.security(ticker, timeframe.period,
[open , high , low , close , close],
lookahead=barmerge.lookahead_off)
// Store confirmed previous bar OHLC for calculations
matrix.set(open_data, i, 0, nz(o1, 0)) // Previous bar open
matrix.set(high_data, i, 0, nz(h1, 0)) // Previous bar high
matrix.set(low_data, i, 0, nz(l1, 0)) // Previous bar low
matrix.set(close_data, i, 0, nz(c1, 0)) // Previous bar close
// Current bar close only for visualization
matrix.set(current_prices, i, 0, nz(c0, 0)) // Live price display
2. Confirmed Bar State Processing
// Only process data when bars are confirmed and closed
if barstate.isconfirmed
// All signal generation and portfolio decisions occur here
// using only historical, unchanging data
// Shift historical data arrays
for i = 0 to active_count - 1
for bar = math.min(data_bars, 199) to 1
// Move confirmed data through historical matrices
old_data = matrix.get(close_data, i, bar - 1)
matrix.set(close_data, i, bar, old_data)
// Process new confirmed bar data
calculate_all_signals_and_dominance()
3. Lookahead Prevention
// Explicit lookahead prevention in all security calls
request.security(ticker, timeframe.period, expression,
lookahead=barmerge.lookahead_off)
// This ensures no future data can influence current calculations
// Essential for maintaining signal integrity across all timeframes
4. State Persistence with Historical Validation
// Asset states only change based on confirmed threshold breaks
// using historical data that cannot change
var array asset_states = array.new(1560, 0)
// State changes use only confirmed, previous bar calculations
if barstate.isconfirmed
=
f_calculate_enhanced_dbbmd(confirmed_price_array, ...)
// Only update states after bar confirmation
if long_crossover_confirmed and current_state != 1
current_state := 1
array.set(asset_states, asset_index, 1)
Live Trading vs. Backtesting Consistency
The system's architecture ensures identical behavior in both environments:
Backtesting Mode:
Uses historical offset data for all calculations
Processes confirmed bars with `barstate.isconfirmed`
Maintains identical signal generation logic
No access to future information
Live Trading Mode:
Uses same historical offset data structure
Waits for bar confirmation before signal updates
Identical mathematical calculations and thresholds
Real-time price display without affecting signals
Technical Implementation Details
Data Collection Timing
// Example of proper data collection timing
if barstate.isconfirmed // Wait for bar to close
// Collect PREVIOUS bar's confirmed OHLC data
for i = 0 to active_count - 1
ticker = array.get(assets, i)
// Get confirmed previous bar data (note offset)
=
request.security(ticker, timeframe.period,
[open , high , low , close , close],
lookahead=barmerge.lookahead_off)
// ALL calculations use prev_* values
// current_close only for real-time display
portfolio_calculations_use_previous_bar_data()
Signal Generation Process
// Signal generation workflow (simplified)
if barstate.isconfirmed and data_bars >= minimum_required_bars
// Step 1: Calculate DBBMD using historical price arrays
for i = 0 to active_count - 1
historical_prices = get_confirmed_price_history(i) // Uses offset data
= calculate_dbbmd(historical_prices)
update_asset_state(i, state)
// Step 2: Build dominance matrix using confirmed data
calculate_dominance_relationships() // All historical data
// Step 3: Generate portfolio signals
new_portfolio = generate_target_portfolio() // Based on confirmed calculations
// Step 4: Compare with previous signals for changes
if portfolio_signals_changed()
execute_portfolio_transition()
Verification Methods for Users
Users can verify the anti-repainting behavior through several methods:
1. Historical Replay Test
Run the indicator on historical data
Note signal timing and portfolio changes
Replay the same period - signals should be identical
No retroactive changes in historical signals
2. Intraday Consistency Check
Load indicator during active trading session
Observe that previous day's signals remain unchanged
Only current day's final bar should show potential signal changes
Refresh indicator - historical signals should be identical
Live Trading Deployment Considerations
Data Quality Assurance
Exchange Connectivity: Ensure reliable data feeds for all 39 assets
Missing Data Handling: System includes safeguards for data gaps
Price Validation: Automatic filtering of obvious price errors
Timeframe Synchronization: All assets synchronized to same bar timing
Performance Impact of Anti-Repainting Measures
The robust anti-repainting implementation requires additional computational resources:
Memory Usage: 200-bar historical data storage for 39 assets
Processing Delay: Signals update only after bar confirmation
Calculation Overhead: Multiple historical data validations
Alert Timing: Slight delay compared to current-bar indicators
However, these trade-offs are essential for reliable live trading performance and accurate backtesting results.
Critical: Equity Curve Anti-Repainting Architecture
The most sophisticated aspect of this system's anti-repainting design is the temporal separation between signal generation and performance calculation . This creates a realistic trading simulation that perfectly matches live trading execution.
The Timing Sequence
// STEP 1: Store what we HELD during the current bar (for performance calc)
if barstate.isconfirmed
// Record positions that were active during this bar
array.clear(held_portfolio)
array.clear(held_weights)
for i = 0 to array.size(execution_portfolio) - 1
array.push(held_portfolio, array.get(execution_portfolio, i))
array.push(held_weights, array.get(execution_weights, i))
// STEP 2: Calculate performance based on what we HELD
portfolio_return = 0.0
for i = 0 to array.size(held_portfolio) - 1
held_asset = array.get(held_portfolio, i)
held_weight = array.get(held_weights, i)
// Performance from current_price vs reference_price
// This is what we ACTUALLY earned during this bar
if held_asset != "USD"
current_price = get_current_price(held_asset) // End of bar
reference_price = get_reference_price(held_asset) // Start of bar
asset_return = (current_price - reference_price) / reference_price
portfolio_return += asset_return * held_weight
// STEP 3: Apply return to equity (realistic timing)
equity := equity * (1 + portfolio_return)
// STEP 4: Generate NEW signals for NEXT period (using confirmed data)
= f_generate_target_portfolio()
// STEP 5: Execute transitions if signals changed
if signal_changed
// Update execution_portfolio for NEXT bar
array.clear(execution_portfolio)
array.clear(execution_weights)
for i = 0 to array.size(new_signal_portfolio) - 1
array.push(execution_portfolio, array.get(new_signal_portfolio, i))
array.push(execution_weights, array.get(new_signal_weights, i))
Why This Prevents Equity Curve Repainting
Performance Attribution: Returns are calculated based on positions that were **actually held** during each bar, not future signals
Signal Timing: New signals are generated **after** performance calculation, affecting only **future** bars
Realistic Execution: Mimics real trading where you earn returns on current positions while planning future moves
No Retroactive Changes: Once a bar closes, its performance contribution to equity is permanent and unchangeable
The One-Bar Offset Mechanism
This system implements a critical one-bar timing offset:
// Bar N: Performance Calculation
// ================================
// 1. Calculate returns on positions held during Bar N
// 2. Update equity based on actual holdings during Bar N
// 3. Plot equity point for Bar N (based on what we HELD)
// Bar N: Signal Generation
// ========================
// 4. Generate signals for Bar N+1 (using confirmed Bar N data)
// 5. Send alerts for what will be held during Bar N+1
// 6. Update execution_portfolio for Bar N+1
// Bar N+1: The Cycle Continues
// =============================
// 1. Performance calculated on positions from Bar N signals
// 2. New signals generated for Bar N+2
Alert System Timing
The alert system reflects this sophisticated timing:
Transaction Cost Realism
Even transaction costs follow realistic timing:
// Fees applied when transitioning between different portfolios
if should_execute_transition
// Charge fees BEFORE taking new positions (realistic timing)
if transaction_fee > 0
fee_amount = equity * (transaction_fee / 100)
equity -= fee_amount // Immediate cost impact
total_fees += fee_amount
// THEN update to new portfolio
update_execution_portfolio(new_signals)
transitions += 1
// Fees reduce equity immediately, affecting all future calculations
// This matches real trading where fees are deducted upon execution
LIVE TRADING CERTIFICATION:
This system has been specifically designed and tested for live trading deployment. The comprehensive anti-repainting measures ensure that:
Backtesting results accurately represent real trading potential
Signals are generated using only confirmed, historical data
No retroactive changes can occur to previously generated signals
Portfolio transitions are based on reliable, unchanging calculations
Performance metrics reflect realistic trading outcomes including proper timing
Users can deploy this system with confidence that live trading results will closely match backtesting performance, subject to normal market execution factors such as slippage and liquidity.
---
⚡ ALERT SYSTEM & AUTOMATION
The system provides comprehensive alerting for automation and monitoring:
Available Alert Conditions
Portfolio Signal Change: Triggered when new portfolio composition is generated
Regime Override Active: Alerts when market regime forces USD positioning
Individual Asset Signals: Can be configured for specific asset transitions
Performance Thresholds: Drawdown or return-based notifications
---
📈 BACKTESTING & PERFORMANCE ANALYSIS
8 Comprehensive Metrics Tracking
The system maintains detailed performance statistics:
Equity Curve: Real-time portfolio value progression
Returns Calculation: Total and annualized performance metrics
Drawdown Analysis: Peak-to-trough decline measurements
Transaction Counting: Portfolio transition frequency
Fee Tracking: Cumulative transaction cost impact
Win Rate Analysis: Success rate of position changes
Backtesting Configuration
// Backtesting parameters
initial_capital = 10000.0 // Starting capital
use_custom_start = true // Enable specific start date
custom_start = timestamp("2023-09-01") // Backtest beginning
transaction_fee = 0.4 // Combined fees and slippage %
// Performance calculation
total_return = (equity - initial_capital) / initial_capital * 100
current_drawdown = (peak_equity - equity) / peak_equity * 100
---
🔧 TROUBLESHOOTING & OPTIMIZATION
Common Configuration Issues
Insufficient Data: Ensure 100+ bars available before start date
[*} Not Compiling: Go on an asset's price chart with 2 or 3 years of data to
make the system compile or just simply reapply the indicator again
Too Many Assets: Reduce active count if experiencing timeouts
Regime Filter Too Strict: Lower trending threshold if always in USD
Excessive Switching: Increase MD multiplier or adjust thresholds
---
💡 USER FEEDBACK & ENHANCEMENT REQUESTS
The continuous evolution of this system depends heavily on user experience and community feedback. Your insights will help motivate me for new improvements and new feature developments.
---
⚖️ FINAL COMPREHENSIVE RISK DISCLAIMER
TRADING INVOLVES SUBSTANTIAL RISK OF LOSS
This indicator is a sophisticated analytical tool designed for educational and research purposes. Important warnings and considerations:
System Limitations:
No algorithmic system can guarantee profitable outcomes
Complex systems may fail in unexpected ways during extreme market events
Historical backtesting does not account for all real-world trading challenges
Slippage, liquidity constraints, and market impact can significantly affect results
System parameters require careful optimization and ongoing monitoring
The creator and distributor of this indicator assume no liability for any financial losses, system failures, or adverse outcomes resulting from its use. This tool is provided "as is" without any warranties, express or implied.
By using this indicator, you acknowledge that you have read, understood, and agreed to assume all risks associated with algorithmic trading and cryptocurrency investments.
ORB + Volume FilterI created this for testing purposes only. If this script works as expected I will add a better description.
Zakaat CalculatorZakaat Calculator
The Zakaat Calculator is a dedicated tool designed to assist with transparent and structured wealth assessments based on Islamic finance principles. This script dynamically references live gold and silver prices, applies Nisab thresholds, and evaluates whether Zakaat is obligatory based on the user’s net worth.
Core Features
Live market data: Automatically fetches daily gold and silver prices (TVC:GOLD & TVC:SILVER).
Nisab thresholds: Choose between the gold standard (85g) or silver standard (595g) to set the eligibility baseline.
Flexible inputs: Enter your current holdings across gold, silver, investments, and cash.
Automated calculation: Compares your total net worth against the selected Nisab threshold and calculates the payable Zakaat at a customizable percentage (default 2.5%).
Clear visualization: Results are displayed in a structured on-chart table for full transparency, including thresholds, holdings, total net worth, and final Zakaat due.
Practical Use
This tool is built for individuals who want a precise, real-time view of their Zakaat obligations. By combining faith-based calculation rules with live market data, it ensures accuracy and ease of use.
Note
This indicator is designed for educational and personal financial planning purposes. It may also be used for broader applications such as donations or calculating contributions towards charitable causes. Always consult with qualified scholars or financial advisors for personal guidance.
RDGD Levels: Master + Weekly + Daily - NQ ES YM RTYTitle: RDGD Levels: Master + Experts + Weekly - NQ ES YM RTY
Description:
This script allows you to manually set and manage Master, Weekly, and Daily levels for multiple index (ES, NQ, YM, RTY). Each level can be fully customized with your own price inputs, colors, line styles, and widths.
A key feature is TradingView’s built-in “Save as Default” option: once you enter your custom values, you can save them and easily reload the same levels the next day, week, or later. This makes it convenient to carry forward your price levels without re-entering them each time. You can also update or modify saved defaults anytime, ensuring your levels are always aligned with your current trading plan.
The script provides:
Master Levels (8 per preset)
Weekly High / Mid / Low
Daily Levels (Mon–Fri, with High, Mid, Low + next-day references)
Independent visibility toggles for each section and preset
Customizable label offsets for clear chart organization
This flexibility makes it easy to prepare, save, and reuse levels consistently across your trading sessions.
Features:
Master Levels: 8 manually configurable levels with uniform color, style, and thickness for long-term reference.
Weekly Levels: High, Mid, and Low levels to track weekly market structure.
Daily Levels: Day-specific levels for Monday through Friday. Each day includes High, Mid, Low, and additional next-day levels where applicable (Day-N logic).
Custom Styling: Set colors, line width, and line style for master, weekly, and daily levels individually.
Labels with Offsets: Price labels displayed at customizable bar offsets for easy reference without cluttering the chart.
On/Off Toggles: Enable or disable any section (Master, Weekly, Daily, or specific weekdays) independently.
Fully Manual Inputs: All levels are entered manually, giving full control over your strategy or trading plan.
Benefits:
Visualize multiple key levels simultaneously without manual drawing.
Quickly identify potential support and resistance areas.
Adaptable for different stocks or instruments with customizable inputs.
Helps with intraday, swing, and long-term trading analysis.
Note:
Designed for use on any chart timeframe.
Levels are drawn as lines extending both left and right, with labels for easy reference.
GoodGuys Spot — Good Buy / Good Sell + Auto DCA Transform your long-term spot investments with a simple and readable signal flow: Good Buy / Good Sell based on confirmed daily pivots, intelligent automatic DCA, an MTF chart (1D/3D/1W), partial TPs, and dynamic exits (trailing/locking/EMA200).
Ideal for crypto, indices, and stocks in 1D timeframes.
Why this indicator?
Immediate visual clarity: green “Good Buy” dots on lows, red “Good Sell” dots on highs, with adjustable text (size & offset).
Designed for the long-term investor: EMA50/EMA200 trend filter + RSI midline (optional).
Truly usable DCA: three modes (Time / Price / Hybrid), budget per purchase, cooldown, stops below the EMA50, auto-reset.
Exit discipline: Configurable partial TPs, trailing on local ATH, buffer on EMA200, "lock" after TP1 or beyond a defined ROI.
Multi-timeframe control: 1D/3D/1W mini-dashboard to read the market regime at a glance.
Ready for automation: structured alerts + CSV export via alert() (integrable into your external tools).
How it works (in brief)
Good Buy / Good Sell Signals (Daily)
Good Buy: Appearance of a confirmed daily pivot low (ta.pivotlow), optionally filtered by trend (Close > EMA200 & EMA50 > EMA200 & RSI ≥ midline).
Good Sell: Confirmed daily pivot high (ta.pivothigh) — visual peak marker.
Anti-repaint: “Confirm at close” option (recommended).
Automatic DCA
Modes:
Time (weekly / monthly / every N days),
Price (steps below EMA50: DCA1/DCA2/DCA3),
Hybrid (priority price, otherwise time trigger).
Security & Logic: DCA budget, cooldown in days, cap on the number of purchases, resetting of levels when the price crosses back above the EMA50, "Only Bull" option (only buy if the price is bullish LT).
Integrated tracking: cumulative investment, accumulated units, average price, PnL%.
Exits / Protection
Partial TPs (TP1/TP2/TP3) expressed as a % above the avg cost.
Trailing:
from the position's local ATH (exit if retracement is X%),
and/or EMA200 + buffer.
Profit Lock: after TP1, or beyond a defined ROI (raises a protective stop level).
MTF Dashboard (1D/3D/1W)
Displays the regime (bull/bear) based on the Close vs. EMA50/200 and RSI.
Helps you stay aligned with the underlying trend.
What you see on the chart
Green/red dots at pivots (automatic offset on the pivot candlestick).
Enlarged and offset “Good Buy / Good Sell” text (up for SELL, down for BUY) — fully adjustable.
EMA50 / EMA200, Candlestick Exit, TP lines (TP1/TP2/TP3), dynamic exit line (trailing/lock).
DCA Bands (manual markers below EMA50).
Two tables:
DCA/PnL (invested, units, avg cost, PnL%, PnL$, trail level),
MTF 1D/3D/1W (rate, position vs. EMA, RSI).
Main Settings
Pivots: sensitivity (left/right bars), BUY trend filter (Close>EMA200), marker styles (Circles / Triangles / Arrows / Labels).
Good Buy/Sell text: size (Small → Very Large), BUY offset (×ATR), SELL offset (×ATR).
Auto DCA: mode (Off / Time / Price / Hybrid), "Only Bull", budget/buy, cooldown, stops below EMA50, reset above EMA50.
Exits: TP1/TP2/TP3 (%), trailing (retracement from ATH), trailing EMA200 (+buffer), lock (after TP1 or ROI ≥X%).
Display: show/hide MAs, candlesticks, tables, TP levels, dynamic exit line.
Anti-repaint: “Confirm on close” (enabled by default).
Alerts Included
Create an alert with "Any alert() function call" to receive messages and CSV:
GOOD BUY (1D Pivot Down)
GOOD SELL (1D Pivot Up)
DCA BUY (Daily)
Partial TP 1 / 2 / 3
DYNAMIC EXIT (Daily) (Trailing/Lock/EMA200)
Best Practices & Limitations
Timeframe: The algorithm is designed for 1D (daily). Signals use confirmed pivots; enable "Confirm at Close" to avoid any ambiguity.
Trend Filter: For long-term spot trading, the Only Bull mode + EMA/RSI filter reduces counter-trend buying.
Position Sizing: Auto DCA is not financial advice—adapt your budget, cooldown, and levels to your risk.
No Guarantees: Markets involve risks. Past performance is no guarantee of future performance.
Who is it for?
Long-term spot investors who want to buy on structured pullbacks (pivots & levels) and exit cleanly.
Users who want to standardize their entries/exits and automatically track their PnL/avg cost.
Getting Started (2 minutes)
Open a 1D asset and add JB Spot LT — Good Buy/Sell + DCA Auto (Daily).
In the inputs:
Choose your marker style and Good Buy/Sell text size.
Set DCA Mode (e.g., Hybrid), budget, cooldown, and thresholds.
Leave "Confirm at close" enabled.
Create an alert "Any alert() function call" (optional: enable CSV Export for your logs).
Momentum Flow SupportPeace -
This indicator was created to help identify trend flow through the lense
of the 200, 50, and 20 Exponential Moving Averages.
If the 20 and 50 EMA are above (or below) the 200 EMA, the 200 EMA will be either
a green or red color respectively.
- The indicator has many options to work with -
-There are check boxes for each indicator element to appear -
1) The "Moving Average Flow" buy/sell arrow will appear
if price closes beyond the 20 EMA.
2) Bollinger Bands are available for the chart (or not).
An arrow will appear if price reaches a bollinger band extreme.
3) MACD is available as well. A circle appears when there is
an MACD moment.
----there are so many creative ways to work with the MFS indicator---
I like the 1 min chart for signals, while being aware if price is aprroaching
a Key level (support or resistance). The usual rule is to "not sell into support"
or "buy into resistance".
I like working with 15 min and 1 hour or 4 hour charts
for key structure levels. (See "Momentum Flow Build 9-25" Indicator if U dig)
Here is one of many strategy ideas if U dig:
If price is moving with energetic displacement,
(and not too close to a key stucture level), then
there may be a trade opportunity.
Patience is the essence of the process
A good rule is, if there is no energetic price displacement, then no trading.
There is either "Market Maker" intention
to move price or not. (If/Then)
If there is energetic price displacement in the flow of the 20/50/200 EMA,
and price retraces to Bollinger Band extremes (preferably to an FVG - Fair Value Gap),
the idea is look for an "engulfing candle" moment as a trade entry potential in the direction of the overall "Momentum Flow". A "probabilistic mindset" is the key, and the "Mindset is the win".
Peace -
Momentum Flow Build 9-25Peace -
Here's my amateur perspective on "Smart Money Concepts" if U dig...
The MFB indicator was created to identify the trading session levels
of Asian Session (6pm to 12am EST), London Session (12am to 6am EST),
and the first 5 min NY open candle.
These levels are known for being key areas to watch for "Manipulation",
because "Market Makers" are looking to take stops (liquidity).
The puzzle:
Once price "sweeps" a level, then what will be the next "draw on liquidity"?
Will there be a reversal from the Key Level and a price move towards
another Key level?
Will price seem to be reversing, yet have a Displacement through a level
and retrace to the FVG area before continuing through the level?
Will price choose to consolidate and build up liquidity at the key level, before a
"Consolidative breakout" later in the day?
I try to watch how price responds to recent highs and lows for an "intention reading".
Are there "Sweeps and FVG/IFVG" moments? Is price respecting FVGs? Are FVG/IFVG signals
being invalidated? That may mean a "choppy" market. Every day is different.
Displacement (FVG) tells us about Market Maker intention.
That's why I try to wait Displacement. No displacement (FVG), no trading.
I like to work with the 5 min chart to identify if price is:
1) "Displacing" through a level, and being "accepted".
(or)
2) Has price "Failed to displace" a level, and maybe reverse.
The puzzle (to me), is learning how to work with a "Mechanical" and "Proven" strategy
that nurtures a Peace of Mind process.
Some people like working with the 1 minute chart at "Key Levels" and
some people like the 5 min chart FVG/IFVG strategy at key levels for trade entries.
For example, with the rule: "If there is no displacement, then no trading" in mind.
If there are Fair Value Gaps (FVGs) away from a level, then we watch to see if
the FVGs are respected (retrace and engulfing), or inverted. If an FVG is inverted,
then I find its best to wait for a retrace to the level where price closed above/below
the original FVG. (I am learning)
The game of Manipulation (sweeps of levels and displacement), is often a manipulation of a manipulation? (ex: FVG-IFVG-and sweep of the IFVG?)
So, the key for me, is to have Peace of Mind while working with a "Probabilistic Mindset".
Onwards and upwards.
Peace -