MTF MACD 2 By YuthavithiIf you want a good strategy without repaint. This one might be for you. Excellent profitable for BTCUSD3M for OKCoin.
It uses multiple time frame MACD for trading decision. To avoid repaint, set the delay period = 1 for both long term and midterm.
The idea is that, if long term, mid term and current time frame all agree on traidng direction, the trade will take place.
I also uses it in my automated trading bot with good result.
www.tradingview.com
Buscar en scripts para "btc期权交割时间"
(CRISIS) aggregateBTCvol v0.2.4Aggregate multiple exchange volumes into single indicator
This update adds:
*Moving Average
*Add/change/disable to up 6 securities without touching code.
*Monochrome mode for dark themes.
BTC Volume Index 1.1 beta [Dia]Indicator calculates total volume across multiple bitcoin exchanges. The influence of each exchange can be adjusted seperately.
0 fee exchanges default to 50%
0 fee futures default to 10%
Define custom lookback periods for price breakout detection.
Look for low-volume price reversals in those candles immediately following high volume peaks. The lower the volume and the greater the open/close price difference of that 2nd candle is compared to the previous one, the higher the likelihood of a local top/bottom being in.
Note:
Bar highlighting is still experimental, future versions will include better filtering options.
Use for confirmation only, not as standalone trading system.
Bifurcation Zone - CAEBifurcation Zone — Cognitive Adversarial Engine (BZ-CAE)
Bifurcation Zone — CAE (BZ-CAE) is a next-generation divergence detection system enhanced by a Cognitive Adversarial Engine that evaluates both sides of every potential trade before presenting signals. Unlike traditional divergence indicators that show every price-oscillator disagreement regardless of context, BZ-CAE applies comprehensive market-state intelligence to identify only the divergences that occur in favorable conditions with genuine probability edges.
The system identifies structural bifurcation points — critical junctures where price and momentum disagree, signaling potential reversals or continuations — then validates these opportunities through five interconnected intelligence layers: Trend Conviction Scoring , Directional Momentum Alignment , Multi-Factor Exhaustion Modeling , Adversarial Validation , and Confidence Scoring . The result is a selective, context-aware signal system that filters noise and highlights high-probability setups.
This is not a "buy the arrow" indicator. It's a decision support framework that teaches you how to read market state, evaluate divergence quality, and make informed trading decisions based on quantified intelligence rather than hope.
What Sets BZ-CAE Apart: Technical Architecture
The Problem With Traditional Divergence Indicators
Most divergence indicators operate on a simple rule: if price makes a higher high and RSI makes a lower high, show a bearish signal. If price makes a lower low and RSI makes a higher low, show a bullish signal. This creates several critical problems:
Context Blindness : They show counter-trend signals in powerful trends that rarely reverse, leading to repeated losses as you fade momentum.
Signal Spam : Every minor price-oscillator disagreement generates an alert, overwhelming you with low-quality setups and creating analysis paralysis.
No Quality Ranking : All signals are treated identically. A marginal divergence in choppy conditions receives the same visual treatment as a high-conviction setup at a major exhaustion point.
Single-Sided Evaluation : They ask "Is this a good long?" without checking if the short case is overwhelmingly stronger, leading you into obvious bad trades.
Static Configuration : You manually choose RSI 14 or Stochastic 14 and hope it works, with no systematic way to validate if that's optimal for your instrument.
BZ-CAE's Solution: Cognitive Adversarial Intelligence
BZ-CAE solves these problems through an integrated five-layer intelligence architecture:
1. Trend Conviction Score (TCS) — 0 to 1 Scale
Most indicators check if ADX is above 25 to determine "trending" conditions. This binary approach misses nuance. TCS is a weighted composite metric:
Formula : 0.35 × normalize(ADX, 10, 35) + 0.35 × structural_strength + 0.30 × htf_alignment
Structural Strength : 10-bar SMA of consecutive directional bars. Captures persistence — are bulls or bears consistently winning?
HTF Alignment : Multi-timeframe EMA stacking (20/50/100/200). When all EMAs align in the same direction, you're in institutional trend territory.
Purpose : Quantifies how "locked in" the trend is. When TCS exceeds your threshold (default 0.80), the system knows to avoid counter-trend trades unless other factors override.
Interpretation :
TCS > 0.85: Very strong trend — counter-trading is extremely high risk
TCS 0.70-0.85: Strong trend — favor continuation, require exhaustion for reversals
TCS 0.50-0.70: Moderate trend — context matters, both directions viable
TCS < 0.50: Weak/choppy — reversals more viable, range-bound conditions
2. Directional Momentum Alignment (DMA) — ATR-Normalized
Formula : (EMA21 - EMA55) / ATR14
This isn't just "price above EMA" — it's a regime-aware momentum gauge. The same $100 price movement reads completely differently in high-volatility crypto versus low-volatility forex. By normalizing with ATR, DMA adapts its interpretation to current market conditions.
Purpose : Quantifies the directional "force" behind current price action. Positive = bullish push, negative = bearish push. Magnitude = strength.
Interpretation :
DMA > 0.7: Strong bullish momentum — bearish divergences risky
DMA 0.3 to 0.7: Moderate bullish bias
DMA -0.3 to 0.3: Balanced/choppy conditions
DMA -0.7 to -0.3: Moderate bearish bias
DMA < -0.7: Strong bearish momentum — bullish divergences risky
3. Multi-Factor Exhaustion Modeling — 0 to 1 Probability
Single-metric exhaustion detection (like "RSI > 80") misses complex market states. BZ-CAE aggregates five independent exhaustion signals:
Volume Spikes : Current volume versus 50-bar average
2.5x average: 0.25 weight
2.0x average: 0.15 weight
1.5x average: 0.10 weight
Divergence Present : The fact that a divergence exists contributes 0.30 weight — structural momentum disagreement is itself an exhaustion signal.
RSI Extremes : Captures oscillator climax zones
RSI > 80 or < 20: 0.25 weight
RSI > 75 or < 25: 0.15 weight
Pin Bar Detection : Identifies rejection candles (2:1 wick-to-body ratio, indicating failed breakout attempts): 0.15 weight
Extended Runs : Consecutive bars above/below EMA20 without pullback
30+ bars: 0.15 weight (market hasn't paused to consolidate)
Total exhaustion score is the sum of all applicable weights, capped at 1.0.
Purpose : Detects when strong trends become vulnerable to reversal. High exhaustion can override trend filters, allowing counter-trend trades at genuine turning points that basic indicators would miss.
Interpretation :
Exhaustion > 0.75: High probability of climax — yellow background shading alerts you visually
Exhaustion 0.50-0.75: Moderate overextension — watch for confirmation
Exhaustion < 0.50: Fresh move — trend can continue, counter-trend trades higher risk
4. Adversarial Validation — Game Theory Applied to Trading
This is BZ-CAE's signature innovation. Before approving any signal, the engine quantifies BOTH sides of the trade simultaneously:
For Bullish Divergences , it calculates:
Bull Case Score (0-1+) :
Distance below EMA20 (pullback quality): up to 0.25
Bullish EMA alignment (close > EMA20 > EMA50): 0.25
Oversold RSI (< 40): 0.25
Volume confirmation (> 1.2x average): 0.25
Bear Case Score (0-1+) :
Price below EMA50 (structural weakness): 0.30
Very oversold RSI (< 30, indicating knife-catching): 0.20
Differential = Bull Case - Bear Case
If differential < -0.10 (default threshold), the bear case is dominating — signal is BLOCKED or ANNOTATED.
For Bearish Divergences , the logic inverts (Bear Case vs Bull Case).
Purpose : Prevents trades where you're fighting obvious strength in the opposite direction. This is institutional-grade risk management — don't just evaluate your trade, evaluate the counter-trade simultaneously.
Why This Matters : You might see a bullish divergence at a local low, but if price is deeply below major support EMAs with strong bearish momentum, you're catching a falling knife. The adversarial check catches this and blocks the signal.
5. Confidence Scoring — 0 to 1 Quality Assessment
Every signal that passes initial filters receives a comprehensive quality score:
Formula :
0.30 × normalize(TCS) // Trend context
+ 0.25 × normalize(|DMA|) // Momentum magnitude
+ 0.20 × pullback_quality // Entry distance from EMA20
+ 0.15 × state_quality // ADX + alignment + structure
+ 0.10 × divergence_strength // Slope separation magnitude
+ adversarial_bonus (0-0.30) // Your side's advantage
Purpose : Ranks setup quality for filtering and position sizing decisions. You can set a minimum confidence threshold (default 0.35) to ensure only quality setups reach your chart.
Interpretation :
Confidence > 0.70: Premium setup — consider increased position size
Confidence 0.50-0.70: Good quality — standard size
Confidence 0.35-0.50: Acceptable — reduced size or skip if conservative
Confidence < 0.35: Marginal — blocked in Filtering mode, annotated in Advisory mode
CAE Operating Modes: Learning vs Enforcement
Off : Disables all CAE logic. Raw divergence pipeline only. Use for baseline comparison.
Advisory : Shows ALL signals regardless of CAE evaluation, but annotates signals that WOULD be blocked with specific warnings (e.g., "Bull: strong downtrend (TCS=0.87)" or "Adversarial bearish"). This is your learning mode — see CAE's decision logic in action without missing educational opportunities.
Filtering : Actively blocks low-quality signals. Only setups that pass all enabled gates (Trend Filter, Adversarial Validation, Confidence Gating) reach your chart. This is your live trading mode — trust the system to enforce discipline.
CAE Filter Gates: Three-Layer Protection
When CAE is enabled, signals must pass through three independent gates (each can be toggled on/off):
Gate 1: Strong Trend Filter
If TCS ≥ tcs_threshold (default 0.80)
And signal is counter-trend (bullish in downtrend or bearish in uptrend)
And exhaustion < exhaustion_required (default 0.50)
Then: BLOCK signal
Logic: Don't fade strong trends unless the move is clearly overextended
Gate 2: Adversarial Validation
Calculate both bull case and bear case scores
If opposing case dominates by more than adv_threshold (default 0.10)
Then: BLOCK signal
Logic: Avoid trades where you're fighting obvious strength in the opposite direction
Gate 3: Confidence Gating
Calculate composite confidence score (0-1)
If confidence < min_confidence (default 0.35)
Then: In Filtering mode, BLOCK signal; in Advisory mode, ANNOTATE with warning
Logic: Only take setups with minimum quality threshold
All three gates work together. A signal must pass ALL enabled gates to fire.
Visual Intelligence System
Bifurcation Zones (Supply/Demand Blocks)
When a divergence signal fires, BZ-CAE draws a semi-transparent box extending 15 bars forward from the signal pivot:
Demand Zones (Bullish) : Theme-colored box (cyan in Cyberpunk, blue in Professional, etc.) labeled "Demand" — marks where smart money likely placed buy orders as price diverged at the low.
Supply Zones (Bearish) : Theme-colored box (magenta in Cyberpunk, orange in Professional) labeled "Supply" — marks where smart money likely placed sell orders as price diverged at the high.
Theory : Divergences represent institutional disagreement with the crowd. The crowd pushed price to an extreme (new high or low), but momentum (oscillator) is waning, indicating smart money is taking the opposite side. These zones mark order placement areas that become future support/resistance.
Use Cases :
Exit targets: Take profit when price returns to opposite-side zone
Re-entry levels: If price returns to your entry zone, consider adding
Stop placement: Place stops just beyond your zone (below demand, above supply)
Auto-Cleanup : System keeps the last 20 zones to prevent chart clutter.
Adversarial Bar Coloring — Real-Time Market Debate Heatmap
Each bar is colored based on the Bull Case vs Bear Case differential:
Strong Bull Advantage (diff > 0.3): Full theme bull color (e.g., cyan)
Moderate Bull Advantage (diff > 0.1): 50% transparency bull
Neutral (diff -0.1 to 0.1): Gray/neutral theme
Moderate Bear Advantage (diff < -0.1): 50% transparency bear
Strong Bear Advantage (diff < -0.3): Full theme bear color (e.g., magenta)
This creates a real-time visual heatmap showing which side is "winning" the market debate. When bars flip from cyan to magenta (or vice versa), you're witnessing a shift in adversarial advantage — a leading indicator of potential momentum changes.
Exhaustion Shading
When exhaustion score exceeds 0.75, the chart background displays a semi-transparent yellow highlight. This immediate visual warning alerts you that the current move is at high risk of reversal, even if trend indicators remain strong.
Visual Themes — Six Aesthetic Options
Cyberpunk : Cyan/Magenta/Yellow — High contrast, neon aesthetic, excellent for dark-themed trading environments
Professional : Blue/Orange/Green — Corporate color palette, suitable for presentations and professional documentation
Ocean : Teal/Red/Cyan — Aquatic palette, calming for extended monitoring sessions
Fire : Orange/Red/Coral — Warm aggressive colors, high energy
Matrix : Green/Red/Lime — Code aesthetic, homage to classic hacker visuals
Monochrome : White/Gray — Minimal distraction, maximum focus on price action
All visual elements (signal markers, zones, bar colors, dashboard) adapt to your selected theme.
Divergence Engine — Core Detection System
What Are Divergences?
Divergences occur when price action and momentum indicators disagree, creating structural tension that often resolves in a change of direction:
Regular Divergence (Reversal Signal) :
Bearish Regular : Price makes higher high, oscillator makes lower high → Potential trend reversal down
Bullish Regular : Price makes lower low, oscillator makes higher low → Potential trend reversal up
Hidden Divergence (Continuation Signal) :
Bearish Hidden : Price makes lower high, oscillator makes higher high → Downtrend continuation
Bullish Hidden : Price makes higher low, oscillator makes lower low → Uptrend continuation
Both types can be enabled/disabled independently in settings.
Pivot Detection Methods
BZ-CAE uses symmetric pivot detection with separate lookback and lookforward periods (default 5/5):
Pivot High : Bar where high > all highs within lookback range AND high > all highs within lookforward range
Pivot Low : Bar where low < all lows within lookback range AND low < all lows within lookforward range
This ensures structural validity — the pivot must be a clear local extreme, not just a minor wiggle.
Divergence Validation Requirements
For a divergence to be confirmed, it must satisfy:
Slope Disagreement : Price slope and oscillator slope must move in opposite directions (for regular divs) or same direction with inverted highs/lows (for hidden divs)
Minimum Slope Change : |osc_slope| > min_slope_change / 100 (default 1.0) — filters weak, marginal divergences
Maximum Lookback Range : Pivots must be within max_lookback bars (default 60) — prevents ancient, irrelevant divergences
ATR-Normalized Strength : Divergence strength = min(|price_slope| × |osc_slope| × 10, 1.0) — quantifies the magnitude of disagreement in volatility context
Regular divergences receive 1.0× weight; hidden divergences receive 0.8× weight (slightly less reliable historically).
Oscillator Options — Five Professional Indicators
RSI (Relative Strength Index) : Classic overbought/oversold momentum indicator. Best for: General purpose divergence detection across all instruments.
Stochastic : Range-bound %K momentum comparing close to high-low range. Best for: Mean reversion strategies and range-bound markets.
CCI (Commodity Channel Index) : Measures deviation from statistical mean, auto-normalized to 0-100 scale. Best for: Cyclical instruments and commodities.
MFI (Money Flow Index) : Volume-weighted RSI incorporating money flow. Best for: Volume-driven markets like stocks and crypto.
Williams %R : Inverse stochastic looking back over period, auto-adjusted to 0-100. Best for: Reversal detection at extremes.
Each oscillator has adjustable length (2-200, default 14) and smoothing (1-20, default 1). You also set overbought (50-100, default 70) and oversold (0-50, default 30) thresholds.
Signal Timing Modes — Understanding Repainting
BZ-CAE offers two timing policies with complete transparency about repainting behavior:
Realtime (1-bar, peak-anchored)
How It Works :
Detects peaks 1 bar ago using pattern: high > high AND high > high
Signal prints on the NEXT bar after peak detection (bar_index)
Visual marker anchors to the actual PEAK bar (bar_index - 1, offset -1)
Signal locks in when bar CONFIRMS (closes)
Repainting Behavior :
On the FORMING bar (before close), the peak condition may change as new prices arrive
Once bar CLOSES (barstate.isconfirmed), signal is locked permanently
This is preview/early warning behavior by design
Best For :
Active monitoring and immediate alerts
Learning the system (seeing signals develop in real-time)
Responsive entry if you're watching the chart live
Confirmed (lookforward)
How It Works :
Uses Pine Script's built-in ta.pivothigh() and ta.pivotlow() functions
Requires full pivot validation period (lookback + lookforward bars)
Signal prints pivot_lookforward bars after the actual peak (default 5-bar delay)
Visual marker anchors to the actual peak bar (offset -pivot_lookforward)
No Repainting Behavior
Best For :
Backtesting and historical analysis
Conservative entries requiring full confirmation
Automated trading systems
Swing trading with larger timeframes
Tradeoff :
Delayed entry by pivot_lookforward bars (typically 5 bars)
On a 5-minute chart, this is a 25-minute delay
On a 4-hour chart, this is a 20-hour delay
Recommendation : Use Confirmed for backtesting to verify system performance honestly. Use Realtime for live monitoring only if you're actively watching the chart and understand pre-confirmation repainting behavior.
Signal Spacing System — Anti-Spam Architecture
Even after CAE filtering, raw divergences can cluster. The spacing system enforces separation:
Three Independent Filters
1. Min Bars Between ANY Signals (default 12):
Prevents rapid-fire clustering across both directions
If last signal (bull or bear) was within N bars, block new signal
Ensures breathing room between all setups
2. Min Bars Between SAME-SIDE Signals (default 24, optional enforcement):
Prevents bull-bull or bear-bear spam
Separate tracking for bullish and bearish signal timelines
Toggle enforcement on/off
3. Min ATR Distance From Last Signal (default 0, optional):
Requires price to move N × ATR from last signal location
Ensures meaningful price movement between setups
0 = disabled, 0.5-2.0 = typical range for enabled
All three filters work independently. A signal must pass ALL enabled filters to proceed.
Practical Guidance :
Scalping (1-5m) : Any 6-10, Same-side 12-20, ATR 0-0.5
Day Trading (15m-1H) : Any 12, Same-side 24, ATR 0-1.0
Swing Trading (4H-D) : Any 20-30, Same-side 40-60, ATR 1.0-2.0
Dashboard — Real-Time Control Center
The dashboard (toggleable, four corner positions, three sizes) provides comprehensive system intelligence:
Oscillator Section
Current oscillator type and value
State: OVERBOUGHT / OVERSOLD / NEUTRAL (color-coded)
Length parameter
Cognitive Engine Section
TCS (Trend Conviction Score) :
Current value with emoji state indicator
🔥 = Strong trend (>0.75)
📊 = Moderate trend (0.50-0.75)
〰️ = Weak/choppy (<0.50)
Color: Red if above threshold (trend filter active), yellow if moderate, green if weak
DMA (Directional Momentum Alignment) :
Current value with emoji direction indicator
🐂 = Bullish momentum (>0.5)
⚖️ = Balanced (-0.5 to 0.5)
🐻 = Bearish momentum (<-0.5)
Color: Green if bullish, red if bearish
Exhaustion :
Current value with emoji warning indicator
⚠️ = High exhaustion (>0.75)
🟡 = Moderate (0.50-0.75)
✓ = Low (<0.50)
Color: Red if high, yellow if moderate, green if low
Pullback :
Quality of current distance from EMA20
Values >0.6 are ideal entry zones (not too close, not too far)
Bull Case / Bear Case (if Adversarial enabled):
Current scores for both sides of the market debate
Differential with emoji indicator:
📈 = Bull advantage (>0.2)
➡️ = Balanced (-0.2 to 0.2)
📉 = Bear advantage (<-0.2)
Last Signal Metrics Section (New Feature)
When a signal fires, this section captures and displays:
Signal type (BULL or BEAR)
Bars elapsed since signal
Confidence % at time of signal
TCS value at signal time
DMA value at signal time
Purpose : Provides a historical reference for learning. You can see what the market state looked like when the last signal fired, helping you correlate outcomes with conditions.
Statistics Section
Total Signals : Lifetime count across session
Blocked Signals : Count and percentage (filter effectiveness metric)
Bull Signals : Total bullish divergences
Bear Signals : Total bearish divergences
Purpose : System health monitoring. If blocked % is very high (>60%), filters may be too strict. If very low (<10%), filters may be too loose.
Advisory Annotations
When CAE Mode = Advisory, this section displays warnings for signals that would be blocked in Filtering mode:
Examples:
"Bull spacing: wait 8 bars"
"Bear: strong uptrend (TCS=0.87)"
"Adversarial bearish"
"Low confidence 32%"
Multiple warnings can stack, separated by " | ". This teaches you CAE's decision logic transparently.
How to Use BZ-CAE — Complete Workflow
Phase 1: Initial Setup (First Session)
Apply BZ-CAE to your chart
Select your preferred Visual Theme (Cyberpunk recommended for visibility)
Set Signal Timing to "Confirmed (lookforward)" for learning
Choose your Oscillator Type (RSI recommended for general use, length 14)
Set Overbought/Oversold to 70/30 (standard)
Enable both Regular Divergence and Hidden Divergence
Set Pivot Lookback/Lookforward to 5/5 (balanced structure)
Enable CAE Intelligence
Set CAE Mode to "Advisory" (learning mode)
Enable all three CAE filters: Strong Trend Filter , Adversarial Validation , Confidence Gating
Enable Show Dashboard , position Top Right, size Normal
Enable Draw Bifurcation Zones and Adversarial Bar Coloring
Phase 2: Learning Period (Weeks 1-2)
Goal : Understand how CAE evaluates market state and filters signals.
Activities :
Watch the dashboard during signals :
Note TCS values when counter-trend signals fail — this teaches you the trend strength threshold for your instrument
Observe exhaustion patterns at actual turning points — learn when overextension truly matters
Study adversarial differential at signal times — see when opposing cases dominate
Review blocked signals (orange X-crosses):
In Advisory mode, you see everything — signals that would pass AND signals that would be blocked
Check the advisory annotations to understand why CAE would block
Track outcomes: Were the blocks correct? Did those signals fail?
Use Last Signal Metrics :
After each signal, check the dashboard capture of confidence, TCS, and DMA
Journal these values alongside trade outcomes
Identify patterns: Do confidence >0.70 signals work better? Does your instrument respect TCS >0.85?
Understand your instrument's "personality" :
Trending instruments (indices, major forex) may need TCS threshold 0.85-0.90
Choppy instruments (low-cap stocks, exotic pairs) may work best with TCS 0.70-0.75
High-volatility instruments (crypto) may need wider spacing
Low-volatility instruments may need tighter spacing
Phase 3: Calibration (Weeks 3-4)
Goal : Optimize settings for your specific instrument, timeframe, and style.
Calibration Checklist :
Min Confidence Threshold :
Review confidence distribution in your signal journal
Identify the confidence level below which signals consistently fail
Set min_confidence slightly above that level
Day trading : 0.35-0.45
Swing trading : 0.40-0.55
Scalping : 0.30-0.40
TCS Threshold :
Find the TCS level where counter-trend signals consistently get stopped out
Set tcs_threshold at or slightly below that level
Trending instruments : 0.85-0.90
Mixed instruments : 0.80-0.85
Choppy instruments : 0.75-0.80
Exhaustion Override Level :
Identify exhaustion readings that marked genuine reversals
Set exhaustion_required just below the average
Typical range : 0.45-0.55
Adversarial Threshold :
Default 0.10 works for most instruments
If you find CAE is too conservative (blocking good trades), raise to 0.15-0.20
If signals are still getting caught in opposing momentum, lower to 0.07-0.09
Spacing Parameters :
Count bars between quality signals in your journal
Set min bars ANY to ~60% of that average
Set min bars SAME-SIDE to ~120% of that average
Scalping : Any 6-10, Same 12-20
Day trading : Any 12, Same 24
Swing : Any 20-30, Same 40-60
Oscillator Selection :
Try different oscillators for 1-2 weeks each
Track win rate and average winner/loser by oscillator type
RSI : Best for general use, clear OB/OS
Stochastic : Best for range-bound, mean reversion
MFI : Best for volume-driven markets
CCI : Best for cyclical instruments
Williams %R : Best for reversal detection
Phase 4: Live Deployment
Goal : Disciplined execution with proven, calibrated system.
Settings Changes :
Switch CAE Mode from Advisory to Filtering
System now actively blocks low-quality signals
Only setups passing all gates reach your chart
Keep Signal Timing on Confirmed for conservative entries
OR switch to Realtime if you're actively monitoring and want faster entries (accept pre-confirmation repaint risk)
Use your calibrated thresholds from Phase 3
Enable high-confidence alerts: "⭐ High Confidence Bullish/Bearish" (>0.70)
Trading Discipline Rules :
Respect Blocked Signals :
If CAE blocks a trade you wanted to take, TRUST THE SYSTEM
Don't manually override — if you consistently disagree, return to Phase 2/3 calibration
The block exists because market state failed intelligence checks
Confidence-Based Position Sizing :
Confidence >0.70: Standard or increased size (e.g., 1.5-2.0% risk)
Confidence 0.50-0.70: Standard size (e.g., 1.0% risk)
Confidence 0.35-0.50: Reduced size (e.g., 0.5% risk) or skip if conservative
TCS-Based Management :
High TCS + counter-trend signal: Use tight stops, quick exits (you're fading momentum)
Low TCS + reversal signal: Use wider stops, trail aggressively (genuine reversal potential)
Exhaustion Awareness :
Exhaustion >0.75 (yellow shading): Market is overextended, reversal risk is elevated — consider early exit or tighter trailing stops even on winning trades
Exhaustion <0.30: Continuation bias — hold for larger move, wide trailing stops
Adversarial Context :
Strong differential against you (e.g., bullish signal with bear diff <-0.2): Use very tight stops, consider skipping
Strong differential with you (e.g., bullish signal with bull diff >0.2): Trail aggressively, this is your tailwind
Practical Settings by Timeframe & Style
Scalping (1-5 Minute Charts)
Objective : High frequency, tight stops, quick reversals in fast-moving markets.
Oscillator :
Type: RSI or Stochastic (fast response to quick moves)
Length: 9-11 (more responsive than standard 14)
Smoothing: 1 (no lag)
OB/OS: 65/35 (looser thresholds ensure frequent crossings in fast conditions)
Divergence :
Pivot Lookback/Lookforward: 3/3 (tight structure, catch small swings)
Max Lookback: 40-50 bars (recent structure only)
Min Slope Change: 0.8-1.0 (don't be overly strict)
CAE :
Mode: Advisory first (learn), then Filtering
Min Confidence: 0.30-0.35 (lower bar for speed, accept more signals)
TCS Threshold: 0.70-0.75 (allow more counter-trend opportunities)
Exhaustion Required: 0.45-0.50 (moderate override)
Strong Trend Filter: ON (still respect major intraday trends)
Adversarial: ON (critical for scalping protection — catches bad entries quickly)
Spacing :
Min Bars ANY: 6-10 (fast pace, many setups)
Min Bars SAME-SIDE: 12-20 (prevent clustering)
Min ATR Distance: 0 or 0.5 (loose)
Timing : Realtime (speed over precision, but understand repaint risk)
Visuals :
Signal Size: Tiny (chart clarity in busy conditions)
Show Zones: Optional (can clutter on low timeframes)
Bar Coloring: ON (helps read momentum shifts quickly)
Dashboard: Small size (corner reference, not main focus)
Key Consideration : Scalping generates noise. Even with CAE, expect lower win rate (45-55%) but aim for favorable R:R (2:1 or better). Size conservatively.
Day Trading (15-Minute to 1-Hour Charts)
Objective : Balance quality and frequency. Standard divergence trading approach.
Oscillator :
Type: RSI or MFI (proven reliability, volume confirmation with MFI)
Length: 14 (industry standard, well-studied)
Smoothing: 1-2
OB/OS: 70/30 (classic levels)
Divergence :
Pivot Lookback/Lookforward: 5/5 (balanced structure)
Max Lookback: 60 bars
Min Slope Change: 1.0 (standard strictness)
CAE :
Mode: Filtering (enforce discipline from the start after brief Advisory learning)
Min Confidence: 0.35-0.45 (quality filter without being too restrictive)
TCS Threshold: 0.80-0.85 (respect strong trends)
Exhaustion Required: 0.50 (balanced override threshold)
Strong Trend Filter: ON
Adversarial: ON
Confidence Gating: ON (all three filters active)
Spacing :
Min Bars ANY: 12 (breathing room between all setups)
Min Bars SAME-SIDE: 24 (prevent bull/bear clusters)
Min ATR Distance: 0-1.0 (optional refinement, typically 0.5-1.0)
Timing : Confirmed (1-bar delay for reliability, no repainting)
Visuals :
Signal Size: Tiny or Small
Show Zones: ON (useful reference for exits/re-entries)
Bar Coloring: ON (context awareness)
Dashboard: Normal size (full visibility)
Key Consideration : This is the "sweet spot" timeframe for BZ-CAE. Market structure is clear, CAE has sufficient data, and signal frequency is manageable. Expect 55-65% win rate with proper execution.
Swing Trading (4-Hour to Daily Charts)
Objective : Quality over quantity. High conviction only. Larger stops and targets.
Oscillator :
Type: RSI or CCI (robust on higher timeframes, smooth longer waves)
Length: 14-21 (capture larger momentum swings)
Smoothing: 1-3
OB/OS: 70/30 or 75/25 (strict extremes)
Divergence :
Pivot Lookback/Lookforward: 5/5 or 7/7 (structural purity, major swings only)
Max Lookback: 80-100 bars (broader historical context)
Min Slope Change: 1.2-1.5 (require strong, undeniable divergence)
CAE :
Mode: Filtering (strict enforcement, premium setups only)
Min Confidence: 0.40-0.55 (high bar for entry)
TCS Threshold: 0.85-0.95 (very strong trend protection — don't fade established HTF trends)
Exhaustion Required: 0.50-0.60 (higher bar for override — only extreme exhaustion justifies counter-trend)
Strong Trend Filter: ON (critical on HTF)
Adversarial: ON (avoid obvious bad trades)
Confidence Gating: ON (quality gate essential)
Spacing :
Min Bars ANY: 20-30 (substantial separation)
Min Bars SAME-SIDE: 40-60 (significant breathing room)
Min ATR Distance: 1.0-2.0 (require meaningful price movement)
Timing : Confirmed (purity over speed, zero repaint for swing accuracy)
Visuals :
Signal Size: Small or Normal (clear markers on zoomed-out view)
Show Zones: ON (important HTF levels)
Bar Coloring: ON (long-term trend awareness)
Dashboard: Normal or Large (comprehensive analysis)
Key Consideration : Swing signals are rare but powerful. Expect 2-5 signals per month per instrument. Win rate should be 60-70%+ due to stringent filtering. Position size can be larger given confidence.
Dashboard Interpretation Reference
TCS (Trend Conviction Score) States
0.00-0.50: Weak/Choppy
Emoji: 〰️
Color: Green/cyan
Meaning: No established trend. Range-bound or consolidating. Both reversal and continuation signals viable.
Action: Reversals (regular divs) are safer. Use wider profit targets (market has room to move). Consider mean reversion strategies.
0.50-0.75: Moderate Trend
Emoji: 📊
Color: Yellow/neutral
Meaning: Developing trend but not locked in. Context matters significantly.
Action: Check DMA and exhaustion. If DMA confirms trend and exhaustion is low, favor continuation (hidden divs). If exhaustion is high, reversals are viable.
0.75-0.85: Strong Trend
Emoji: 🔥
Color: Orange/warning
Meaning: Well-established trend with persistence. Counter-trend is high risk.
Action: Require exhaustion >0.50 for counter-trend entries. Favor continuation signals. Use tight stops on counter-trend attempts.
0.85-1.00: Very Strong Trend
Emoji: 🔥🔥
Color: Red/danger (if counter-trading)
Meaning: Locked-in institutional trend. Extremely high risk to fade.
Action: Avoid counter-trend unless exhaustion >0.75 (yellow shading). Focus exclusively on continuation opportunities. Momentum is king here.
DMA (Directional Momentum Alignment) Zones
-2.0 to -1.0: Strong Bearish Momentum
Emoji: 🐻🐻
Color: Dark red
Meaning: Powerful downside force. Sellers are in control.
Action: Bullish divergences are counter-momentum (high risk). Bearish divergences are with-momentum (lower risk). Size down on longs.
-0.5 to 0.5: Neutral/Balanced
Emoji: ⚖️
Color: Gray/neutral
Meaning: No strong directional bias. Choppy or consolidating.
Action: Both directions have similar probability. Focus on confidence score and adversarial differential for edge.
1.0 to 2.0: Strong Bullish Momentum
Emoji: 🐂🐂
Color: Bright green/cyan
Meaning: Powerful upside force. Buyers are in control.
Action: Bearish divergences are counter-momentum (high risk). Bullish divergences are with-momentum (lower risk). Size down on shorts.
Exhaustion States
0.00-0.50: Fresh Move
Emoji: ✓
Color: Green
Meaning: Trend is healthy, not overextended. Room to run.
Action: Counter-trend trades are premature. Favor continuation. Hold winners for larger moves. Avoid early exits.
0.50-0.75: Mature Move
Emoji: 🟡
Color: Yellow
Meaning: Move is aging. Watch for signs of climax.
Action: Tighten trailing stops on winning trades. Be ready for reversals. Don't add to positions aggressively.
0.75-0.85: High Exhaustion
Emoji: ⚠️
Color: Orange
Background: Yellow shading appears
Meaning: Move is overextended. Reversal risk elevated significantly.
Action: Counter-trend reversals are higher probability. Consider early exits on with-trend positions. Size up on reversal divergences (if CAE allows).
0.85-1.00: Critical Exhaustion
Emoji: ⚠️⚠️
Color: Red
Background: Yellow shading intensifies
Meaning: Climax conditions. Reversal imminent or underway.
Action: Aggressive reversal trades justified. Exit all with-trend positions. This is where major turns occur.
Confidence Score Tiers
0.00-0.30: Low Quality
Color: Red
Status: Blocked in Filtering mode
Action: Skip entirely. Setup lacks fundamental quality across multiple factors.
0.30-0.50: Moderate Quality
Color: Yellow/orange
Status: Marginal — passes in Filtering only if >min_confidence
Action: Reduced position size (0.5-0.75% risk). Tight stops. Conservative profit targets. Skip if you're selective.
0.50-0.70: High Quality
Color: Green/cyan
Status: Good setup across most quality factors
Action: Standard position size (1.0-1.5% risk). Normal stops and targets. This is your bread-and-butter trade.
0.70-1.00: Premium Quality
Color: Bright green/gold
Status: Exceptional setup — all factors aligned
Visual: Double confidence ring appears
Action: Consider increased position size (1.5-2.0% risk, maximum). Wider stops. Larger targets. High probability of success. These are rare — capitalize when they appear.
Adversarial Differential Interpretation
Bull Differential > 0.3 :
Visual: Strong cyan/green bar colors
Meaning: Bull case strongly dominates. Buyers have clear advantage.
Action: Bullish divergences favored (with-advantage). Bearish divergences face headwind (reduce size or skip). Momentum is bullish.
Bull Differential 0.1 to 0.3 :
Visual: Moderate cyan/green transparency
Meaning: Moderate bull advantage. Buyers have edge but not overwhelming.
Action: Both directions viable. Slight bias toward longs.
Differential -0.1 to 0.1 :
Visual: Gray/neutral bars
Meaning: Balanced debate. No clear advantage either side.
Action: Rely on other factors (confidence, TCS, exhaustion) for direction. Adversarial is neutral.
Bear Differential -0.3 to -0.1 :
Visual: Moderate red/magenta transparency
Meaning: Moderate bear advantage. Sellers have edge but not overwhelming.
Action: Both directions viable. Slight bias toward shorts.
Bear Differential < -0.3 :
Visual: Strong red/magenta bar colors
Meaning: Bear case strongly dominates. Sellers have clear advantage.
Action: Bearish divergences favored (with-advantage). Bullish divergences face headwind (reduce size or skip). Momentum is bearish.
Last Signal Metrics — Post-Trade Analysis
After a signal fires, dashboard captures:
Type : BULL or BEAR
Bars Ago : How long since signal (updates every bar)
Confidence : What was the quality score at signal time
TCS : What was trend conviction at signal time
DMA : What was momentum alignment at signal time
Use Case : Post-trade journaling and learning.
Example: "BULL signal 12 bars ago. Confidence: 68%, TCS: 0.42, DMA: -0.85"
Analysis : This was a bullish reversal (regular div) with good confidence, weak trend (TCS), but strong bearish momentum (DMA). The bet was that momentum would reverse — a counter-momentum play requiring exhaustion confirmation. Check if exhaustion was high at that time to justify the entry.
Track patterns:
Do your best trades have confidence >0.65?
Do low-TCS signals (<0.50) work better for you?
Are you more successful with-momentum (DMA aligned with signal) or counter-momentum?
Troubleshooting Guide
Problem: No Signals Appearing
Symptoms : Chart loads, dashboard shows metrics, but no divergence signals fire.
Diagnosis Checklist :
Check dashboard oscillator value : Is it crossing OB/OS levels (70/30)? If oscillator stays in 40-60 range constantly, it can't reach extremes needed for divergence detection.
Are pivots forming? : Look for local swing highs/lows on your chart. If price is in tight consolidation, pivots may not meet lookback/lookforward requirements.
Is spacing too tight? : Check "Last Signal" metrics — how many bars since last signal? If <12 and your min_bars_ANY is 12, spacing filter is blocking.
Is CAE blocking everything? : Check dashboard Statistics section — what's the blocked signal count? High blocks indicate overly strict filters.
Solutions :
Loosen OB/OS Temporarily :
Try 65/35 to verify divergence detection works
If signals appear, the issue was threshold strictness
Gradually tighten back to 67/33, then 70/30 as appropriate
Lower Min Confidence :
Try 0.25-0.30 (diagnostic level)
If signals appear, filter was too strict
Raise gradually to find sweet spot (0.35-0.45 typical)
Disable Strong Trend Filter Temporarily :
Turn off in CAE settings
If signals appear, TCS threshold was blocking everything
Re-enable and lower TCS_threshold to 0.70-0.75
Reduce Min Slope Change :
Try 0.7-0.8 (from default 1.0)
Allows weaker divergences through
Helpful on low-volatility instruments
Widen Spacing :
Set min_bars_ANY to 6-8
Set min_bars_SAME_SIDE to 12-16
Reduces time between allowed signals
Check Timing Mode :
If using Confirmed, remember there's a pivot_lookforward delay (5+ bars)
Switch to Realtime temporarily to verify system is working
Realtime has no delay but repaints
Verify Oscillator Settings :
Length 14 is standard but might not fit all instruments
Try length 9-11 for faster response
Try length 18-21 for slower, smoother response
Problem: Too Many Signals (Signal Spam)
Symptoms : Dashboard shows 50+ signals in Statistics, confidence scores mostly <0.40, signals clustering close together.
Solutions :
Raise Min Confidence :
Try 0.40-0.50 (quality filter)
Blocks bottom-tier setups
Targets top 50-60% of divergences only
Tighten OB/OS :
Use 70/30 or 75/25
Requires more extreme oscillator readings
Reduces false divergences in mid-range
Increase Min Slope Change :
Try 1.2-1.5 (from default 1.0)
Requires stronger, more obvious divergences
Filters marginal slope disagreements
Raise TCS Threshold :
Try 0.85-0.90 (from default 0.80)
Stricter trend filter blocks more counter-trend attempts
Favors only strongest trend alignment
Enable ALL CAE Gates :
Turn on Trend Filter + Adversarial + Confidence
Triple-layer protection
Blocks aggressively — expect 20-40% reduction in signals
Widen Spacing :
min_bars_ANY: 15-20 (from 12)
min_bars_SAME_SIDE: 30-40 (from 24)
Creates substantial breathing room
Switch to Confirmed Timing :
Removes realtime preview noise
Ensures full pivot validation
5-bar delay filters many false starts
Problem: Signals in Strong Trends Get Stopped Out
Symptoms : You take a bullish divergence in a downtrend (or bearish in uptrend), and it immediately fails. Dashboard showed high TCS at the time.
Analysis : This is INTENDED behavior — CAE is protecting you from low-probability counter-trend trades.
Understanding :
Check Last Signal Metrics in dashboard — what was TCS when signal fired?
If TCS was >0.85 and signal was counter-trend, CAE correctly identified it as high risk
Strong trends rarely reverse cleanly without major exhaustion
Your losses here are the system working as designed (blocking bad odds)
If You Want to Override (Not Recommended) :
Lower TCS_threshold to 0.70-0.75 (allows more counter-trend)
Lower exhaustion_required to 0.40 (easier override)
Disable Strong Trend Filter entirely (very risky)
Better Approach :
TRUST THE FILTER — it's preventing costly mistakes
Wait for exhaustion >0.75 (yellow shading) before counter-trending strong TCS
Focus on continuation signals (hidden divs) in high-TCS environments
Use Advisory mode to see what CAE is blocking and learn from outcomes
Problem: Adversarial Blocking Seems Wrong
Symptoms : You see a divergence that "looks good" visually, but CAE blocks with "Adversarial bearish/bullish" warning.
Diagnosis :
Check dashboard Bull Case and Bear Case scores at that moment
Look at Differential value
Check adversarial bar colors — was there strong coloring against your intended direction?
Understanding :
Adversarial catches "obvious" opposing momentum that's easy to miss
Example: Bullish divergence at a local low, BUT price is deeply below EMA50, bearish momentum is strong, and RSI shows knife-catching conditions
Bull Case might be 0.20 while Bear Case is 0.55
Differential = -0.35, far beyond threshold
Block is CORRECT — you'd be fighting overwhelming opposing flow
If You Disagree Consistently
Review blocked signals on chart — scroll back and check outcomes
Did those blocked signals actually work, or did they fail as adversarial predicted?
Raise adv_threshold to 0.15-0.20 (more permissive, allows closer battles)
Disable Adversarial Validation temporarily (diagnostic) to isolate its effect
Use Advisory mode to learn adversarial patterns over 50-100 signals
Remember : Adversarial is conservative BY DESIGN. It prevents "obvious" bad trades where you're fighting strong strength the other way.
Problem: Dashboard Not Showing or Incomplete
Solutions :
Toggle "Show Dashboard" to ON in settings
Try different dashboard sizes (Small/Normal/Large)
Try different positions (Top Left/Right, Bottom Left/Right) — might be off-screen
Some sections require CAE Enable = ON (Cognitive Engine section won't appear if CAE is disabled)
Statistics section requires at least 1 lifetime signal to populate
Check that visual theme is set (dashboard colors adapt to theme)
Problem: Performance Lag, Chart Freezing
Symptoms : Chart loading is slow, indicator calculations cause delays, pinch-to-zoom lags.
Diagnosis : Visual features are computationally expensive, especially adversarial bar coloring (recalculates every bar).
Solutions (In Order of Impact) :
Disable Adversarial Bar Coloring (MOST EXPENSIVE):
Turn OFF "Adversarial Bar Coloring" in settings
This is the single biggest performance drain
Immediate improvement
Reduce Vertical Lines :
Lower "Keep last N vertical lines" to 20-30
Or set to 0 to disable entirely
Moderate improvement
Disable Bifurcation Zones :
Turn OFF "Draw Bifurcation Zones"
Reduces box drawing calculations
Moderate improvement
Set Dashboard Size to Small :
Smaller dashboard = fewer cells = less rendering
Minor improvement
Use Shorter Max Lookback :
Reduce max_lookback to 40-50 (from 60+)
Fewer bars to scan for divergences
Minor improvement
Disable Exhaustion Shading :
Turn OFF "Show Market State"
Removes background coloring calculations
Minor improvement
Extreme Performance Mode :
Disable ALL visual enhancements
Keep only triangle markers
Dashboard Small or OFF
Use Minimal theme if available
Problem: Realtime Signals Repainting
Symptoms : You see a signal appear, but on next bar it disappears or moves.
Explanation :
Realtime mode detects peaks 1 bar ago: high > high AND high > high
On the FORMING bar (before close), this condition can change as new prices arrive
Example: At 10:05, high (10:04 bar) was 100, current high is 99 → peak detected
At 10:05:30, new high of 101 arrives → peak condition breaks → signal disappears
At 10:06 (bar close), final high is 101 → no peak at 10:04 anymore → signal gone permanently
This is expected behavior for realtime responsiveness. You get preview/early warning, but it's not locked until bar confirms.
Solutions :
Use Confirmed Timing :
Switch to "Confirmed (lookforward)" mode
ZERO repainting — pivot must be fully validated
5-bar delay (pivot_lookforward)
What you see in history is exactly what would have appeared live
Accept Realtime Repaint as Tradeoff :
Keep Realtime mode for speed and alerts
Understand that pre-confirmation signals may vanish
Only trade signals that CONFIRM at bar close (check barstate.isconfirmed)
Use for live monitoring, NOT for backtesting
Trade Only After Confirmation :
In Realtime mode, wait 1 full bar after signal appears before entering
If signal survives that bar close, it's locked
This adds 1-bar delay but removes repaint risk
Recommendation : Use Confirmed for backtesting and conservative trading. Use Realtime only for active monitoring with full understanding of preview behavior.
Risk Management Integration
BZ-CAE is a signal generation system, not a complete trading strategy. You must integrate proper risk management:
Position Sizing by Confidence
Confidence 0.70-1.00 (Premium) :
Risk: 1.5-2.0% of account (MAXIMUM)
Reasoning: High-quality setup across all factors
Still cap at 2% — even premium setups can fail
Confidence 0.50-0.70 (High Quality) :
Risk: 1.0-1.5% of account
Reasoning: Standard good setup
Your bread-and-butter risk level
Confidence 0.35-0.50 (Moderate Quality) :
Risk: 0.5-1.0% of account
Reasoning: Marginal setup, passes minimum threshold
Reduce size or skip if you're selective
Confidence <0.35 (Low Quality) :
Risk: 0% (blocked in Filtering mode)
Reasoning: Insufficient quality factors
System protects you by not showing these
Stop Placement Strategies
For Reversal Signals (Regular Divergences) :
Place stop beyond the divergence pivot plus buffer
Bullish : Stop below the divergence low - 1.0-1.5 × ATR
Bearish : Stop above the divergence high + 1.0-1.5 × ATR
Reasoning: If price breaks the pivot, divergence structure is invalidated
For Continuation Signals (Hidden Divergences) :
Place stop beyond recent swing in opposite direction
Bullish continuation : Stop below recent swing low (not the divergence pivot itself)
Bearish continuation : Stop above recent swing high
Reasoning: You're trading with trend, allow more breathing room
ATR-Based Stops :
1.5-2.0 × ATR is standard
Scale by timeframe:
Scalping (1-5m): 1.0-1.5 × ATR (tight)
Day trading (15m-1H): 1.5-2.0 × ATR (balanced)
Swing (4H-D): 2.0-3.0 × ATR (wide)
Never Use Fixed Dollar/Pip Stops :
Markets have different volatility
50-pip stop on EUR/USD ≠ 50-pip stop on GBP/JPY
Always normalize by ATR or pivot structure
Profit Targets and Scaling
Primary Target :
2-3 × ATR from entry (minimum 2:1 reward-risk)
Example : Entry at 100, ATR = 2, stop at 97 (1.5 × ATR) → target at 106 (3 × ATR) = 2:1 R:R
Scaling Out Strategy :
Take 50% off at 1.5 × ATR (secure partial profit)
Move stop to breakeven
Trail remaining 50% with 1.0 × ATR trailing stop
Let winners run if trend persists
Targets by Confidence :
High Confidence (>0.70) : Aggressive targets (3-4 × ATR), trail wider (1.5 × ATR)
Standard Confidence (0.50-0.70) : Normal targets (2-3 × ATR), standard trail (1.0 × ATR)
Low Confidence (0.35-0.50) : Conservative targets (1.5-2 × ATR), tight trail (0.75 × ATR)
Use Bifurcation Zones :
If opposite-side zone is visible on chart (from previous signal), use it as target
Example : Bullish signal at 100, prior supply zone at 110 → use 110 as target
Zones mark institutional resistance/support
Exhaustion-Based Exits :
If you're in a trade and exhaustion >0.75 develops (yellow shading), consider early exit
Market is overextended — reversal risk is high
Take profit even if target not reached
Trade Management by TCS
High TCS + Counter-Trend Trade (Risky) :
Use very tight stops (1.0-1.5 × ATR)
Conservative targets (1.5-2 × ATR)
Quick exit if trade doesn't work immediately
You're fading momentum — respect it
Low TCS + Reversal Trade (Safer) :
Use wider stops (2.0-2.5 × ATR)
Aggressive targets (3-4 × ATR)
Trail with patience
Genuine reversal potential in weak trend
High TCS + Continuation Trade (Safest) :
Standard stops (1.5-2.0 × ATR)
Very aggressive targets (4-5 × ATR)
Trail wide (1.5-2.0 × ATR)
You're with institutional momentum — let it run
Educational Value — Learning Machine Intelligence
BZ-CAE is designed as a learning platform, not just a tool:
Advisory Mode as Teacher
Most indicators are binary: signal or no signal. You don't learn WHY certain setups are better.
BZ-CAE's Advisory mode shows you EVERY potential divergence, then annotates the ones that would be blocked in Filtering mode with specific reasons:
"Bull: strong downtrend (TCS=0.87)" teaches you that TCS >0.85 makes counter-trend very risky
"Adversarial bearish" teaches you that the opposing case was dominating
"Low confidence 32%" teaches you that the setup lacked quality across multiple factors
"Bull spacing: wait 8 bars" teaches you that signals need breathing room
After 50-100 signals in Advisory mode, you internalize the CAE's decision logic. You start seeing these factors yourself BEFORE the indicator does.
Dashboard Transparency
Most "intelligent" indicators are black boxes — you don't know how they make decisions.
BZ-CAE shows you ALL metrics in real-time:
TCS tells you trend strength
DMA tells you momentum alignment
Exhaustion tells you overextension
Adversarial shows both sides of the debate
Confidence shows composite quality
You learn to interpret market state holistically, a skill applicable to ANY trading system beyond this indicator.
Divergence Quality Education
Not all divergences are equal. BZ-CAE teaches you which conditions produce high-probability setups:
Quality divergence : Regular bullish div at a low, TCS <0.50 (weak trend), exhaustion >0.75 (overextended), positive adversarial differential, confidence >0.70
Low-quality divergence : Regular bearish div at a high, TCS >0.85 (strong uptrend), exhaustion <0.30 (not overextended), negative adversarial differential, confidence <0.40
After using the system, you can evaluate divergences manually with similar intelligence.
Risk Management Discipline
Confidence-based position sizing teaches you to adjust risk based on setup quality, not emotions:
Beginners often size all trades identically
Or worse, size UP on marginal setups to "make up" for losses
BZ-CAE forces systematic sizing: premium setups get larger size, marginal setups get smaller size
This creates a probabilistic approach where your edge compounds over time.
What This Indicator Is NOT
Complete transparency about limitations and positioning:
Not a Prediction System
BZ-CAE does not predict future prices. It identifies structural divergences (price-momentum disagreements) and assesses current market state (trend, exhaustion, adversarial conditions). It tells you WHEN conditions favor a potential reversal or continuation, not WHAT WILL HAPPEN.
Markets are probabilistic. Even premium-confidence setups fail ~30-40% of the time. The system improves your probability distribution over many trades — it doesn't eliminate risk.
Not Fully Automated
This is a decision support tool, not a trading robot. You must:
Execute trades manually based on signals
Manage positions (stops, targets, trailing)
Apply discretionary judgment (news events, liquidity, context)
Integrate with your broader strategy and risk rules
The confidence scores guide position sizing, but YOU determine final risk allocation based on your account size, risk tolerance, and portfolio context.
Not Beginner-Friendly
BZ-CAE requires understanding of:
Divergence trading concepts (regular vs hidden, reversal vs continuation)
Market state interpretation (trend vs range, momentum, exhaustion)
Basic technical analysis (pivots, support/resistance, EMAs)
Risk management fundamentals (position sizing, stops, R:R)
This is designed for intermediate to advanced traders willing to invest time learning the system. If you want "buy the arrow" simplicity, this isn't the tool.
Not a Holy Grail
There is no perfect indicator. BZ-CAE filters noise and improves signal quality significantly, but:
Losing trades are inevitable (even at 70% win rate, 30% still fail)
Market conditions change rapidly (yesterday's strong trend becomes today's chop)
Black swan events occur (fundamentals override technicals)
Execution matters (slippage, fees, emotional discipline)
The system provides an EDGE, not a guarantee. Your job is to execute that edge consistently with proper risk management over hundreds of trades.
Not Financial Advice
BZ-CAE is an educational and analytical tool. All trading decisions are your responsibility. Past performance (backtested or live) does not guarantee future results. Only risk capital you can afford to lose. Consult a licensed financial advisor for investment advice specific to your situation.
Ideal Market Conditions
Best Performance Characteristics
Liquid Instruments :
Major forex pairs (EUR/USD, GBP/USD, USD/JPY)
Large-cap stocks and index ETFs (SPY, QQQ, AAPL, MSFT)
High-volume crypto (BTC, ETH)
Major commodities (Gold, Oil, Natural Gas)
Reasoning: Clean price structure, clear pivots, meaningful oscillator behavior
Trending with Consolidations :
Markets that trend for 20-40 bars, then consolidate 10-20 bars, repeat
Creates divergences at consolidation boundaries (reversals) and within trends (continuations)
Both regular and hidden divs find opportunities
5-Minute to Daily Timeframes :
Below 5m: too much noise, false pivots, CAE metrics unstable
Above daily: too few signals, edge diminishes (fundamentals dominate)
Sweet spot: 15m to 4H for most traders
Consistent Volume and Participation :
Regular trading sessions (not holidays or thin markets)
Predictable volatility patterns
Avoid instruments with sudden gaps or circuit breakers
Challenging Conditions
Extremely Low Liquidity :
Penny stocks, exotic forex pairs, low-volume crypto
Erratic pivots, unreliable oscillator readings
CAE metrics can't assess market state properly
Very Low Timeframes (1-Minute or Below) :
Dominated by market microstructure noise
Divergences are everywhere but meaningless
CAE filtering helps but still unreliable
Extended Sideways Consolidation :
100+ bars of tight range with no clear pivots
Oscillator hugs midpoint (45-55 range)
No divergences to detect
Fundamentally-Driven Gap Markets :
Earnings releases, economic data, geopolitical events
Price gaps over stops and targets
Technical structure breaks down
Recommendation: Disable trading around known events
Calculation Methodology — Technical Depth
For users who want to understand the math:
Oscillator Computation
Each oscillator type calculates differently, but all normalize to 0-100:
RSI : ta.rsi(close, length) — Standard Relative Strength Index
Stochastic : ta.stoch(high, low, close, length) — %K calculation
CCI : (ta.cci(hlc3, length) + 100) / 2 — Normalized from -100/+100 to 0-100
MFI : ta.mfi(hlc3, length) — Volume-weighted RSI equivalent
Williams %R : ta.wpr(length) + 100 — Inverted stochastic adjusted to 0-100
Smoothing: If smoothing > 1, apply ta.sma(oscillator, smoothing)
Divergence Detection Algorithm
Identify Pivots :
Price high pivot: ta.pivothigh(high, lookback, lookforward)
Price low pivot: ta.pivotlow(low, lookback, lookforward)
Oscillator high pivot: ta.pivothigh(osc, lookback, lookforward)
Oscillator low pivot: ta.pivotlow(osc, lookback, lookforward)
Store Recent Pivots :
Maintain arrays of last 10 pivots with bar indices
When new pivot confirmed, unshift to array, pop oldest if >10
Scan for Slope Disagreements :
Loop through last 5 pivots
For each pair (current pivot, historical pivot):
Check if within max_lookback bars
Calculate slopes: (current - historical) / bars_between
Regular bearish: price_slope > 0, osc_slope < 0, |osc_slope| > min_threshold
Regular bullish: price_slope < 0, osc_slope > 0, |osc_slope| > min_threshold
Hidden bearish: price_slope < 0, osc_slope > 0, osc_slope > min_threshold
Hidden bullish: price_slope > 0, osc_slope < 0, |osc_slope| > min_threshold
Important Disclaimers and Terms
Performance Disclosure
Past performance, whether backtested or live-traded, does not guarantee future results. Markets change. What works today may not work tomorrow. Hypothetical or simulated performance results have inherent limitations and do not represent actual trading.
Risk of Loss
Trading involves substantial risk of loss. Only trade with risk capital you can afford to lose entirely. The high degree of leverage often available in trading can work against you as well as for you. Leveraged trading may result in losses exceeding your initial deposit.
Not Financial Advice
BZ-CAE is an educational and analytical tool for technical analysis. It is not financial advice, investment advice, or a recommendation to buy or sell any security or instrument. All trading decisions are your sole responsibility. Consult a licensed financial advisor for advice specific to your circumstances.
Technical Indicator Limitations
BZ-CAE is a technical analysis tool based on price and volume data. It does not account for:
Fundamental analysis (earnings, economic data, financial health)
Market sentiment and positioning
Geopolitical events and news
Liquidity conditions and market microstructure changes
Regulatory changes or exchange rules
Integrate with broader analysis and strategy. Do not rely solely on technical indicators for trading decisions.
Repainting Acknowledgment
As disclosed throughout this documentation:
Realtime mode may repaint on forming bars before confirmation (by design for preview functionality)
Confirmed mode has zero repainting (fully validated pivots only)
Choose timing mode appropriate for your use case. Understand the tradeoffs.
Testing Recommendation
ALWAYS test on demo/paper accounts before committing real capital. Validate the indicator's behavior on your specific instruments and timeframes. Learn the system thoroughly in Advisory mode before using Filtering mode.
Learning Resources :
In-indicator tooltips (hover over setting names for detailed explanations)
This comprehensive publishing statement (save for reference)
User guide in script comments (top of code)
Final Word — Philosophy of BZ-CAE
BZ-CAE is not designed to replace your judgment — it's designed to enhance it.
The indicator identifies structural inflection points (bifurcations) where price and momentum disagree. The Cognitive Engine evaluates market state to determine if this disagreement is meaningful or noise. The Adversarial model debates both sides of the trade to catch obvious bad setups. The Confidence system ranks quality so you can choose your risk appetite.
But YOU still execute. YOU still manage risk. YOU still learn from outcomes.
This is intelligence amplification, not intelligence replacement.
Use Advisory mode to learn how expert traders evaluate market state. Use Filtering mode to enforce discipline when emotions run high. Use the dashboard to develop a systematic approach to reading markets. Use confidence scores to size positions probabilistically.
The system provides an edge. Your job is to execute that edge with discipline, patience, and proper risk management over hundreds of trades.
Markets are probabilistic. No system wins every trade. But a systematic edge + disciplined execution + proper risk management compounds over time. That's the path to consistent profitability. BZ-CAE gives you the edge. The discipline and risk management are on you.
Taking you to school. — Dskyz, Trade with insight. Trade with anticipation.
Crypto Correlation Oscillator# Crypto Correlation Oscillator
**Companion indicator for Tri-Align Crypto Trend**
## Overview
The Crypto Correlation Oscillator helps you identify **alpha opportunities** and **market regime changes** by showing how closely your coin follows Bitcoin and other assets over time. It displays rolling correlations as an oscillator in a separate pane below your price chart.
## What It Does
This indicator calculates **Pearson correlations** between different trading pairs on a rolling window (default: 100 bars). Correlations range from **-1.0** (perfect inverse relationship) to **+1.0** (perfect positive relationship), with **0** meaning no correlation.
### The 5 Correlation Lines
1. **Blue (thick line) - Coin vs BTC**: The most important metric
- **High correlation (>0.7)**: Your coin is just following BTC - no independent movement
- **Low correlation (<0.3)**: Your coin has **alpha** - it's moving independently from BTC
- **Negative correlation**: Your coin moves opposite to BTC (rare but powerful)
2. **Purple - Coin/BTC vs BTC**: Inverse relationship check
- **Negative values**: When BTC rises, your coin weakens relative to BTC
- **Positive values**: When BTC rises, your coin strengthens against BTC
3. **Orange - Coin vs Coin/BTC**: Structural consistency check
- Shows how well the Coin/USDT and Coin/BTC pairs maintain their mathematical relationship
- Unusual values can indicate liquidity issues or market inefficiencies
4. **Light Red - Coin vs USDT.D** (optional): Stablecoin dominance correlation
- Shows how your coin correlates with USDT dominance
- Useful for understanding flight-to-safety dynamics
5. **Light Green - Coin vs BTC.D** (optional): Bitcoin dominance correlation
- Shows how your coin correlates with BTC dominance
- Helps identify altcoin season vs BTC dominance cycles
## How to Read It
### Finding Alpha Opportunities
- **Low blue line (<0.3)**: Your coin is decoupled from BTC → potential alpha
- **Blue line dropping**: Coin is gaining independence from BTC
- **Blue line spiking to >0.9**: Coin is a "BTC clone" with no independent movement
### Regime Change Detection
- **Blue line crossing 0.5**: Major shift in correlation behavior
- **Purple line turning negative**: Coin starting to weaken when BTC rises (warning sign)
- **Sharp correlation changes**: Market structure is shifting - adjust strategy
### Visual Zones
- **Blue background**: High correlation zone (>0.7) - coin just following BTC
- **Red background**: Inverse correlation zone (<-0.5) - coin moving opposite to BTC
### Reference Lines
- **+1.0 / -1.0**: Perfect correlation boundaries (dotted gray)
- **+0.5 / -0.5**: Moderate correlation thresholds (dotted gray)
- **0.0**: Zero correlation line (solid gray)
## Dynamic Legend
The legend table (top-right) automatically shows the actual symbol names based on your chart:
- **Example on SOLUSDT**: Shows "SOL vs BTC", "SOL/BTC vs BTC", "SOL vs SOL/BTC", etc.
- **Color boxes**: Match the plot colors for easy identification
- **Live values**: Current correlation numbers update in real-time
- **Tooltips**: Hover over labels for interpretation guidance
## Configuration
### Key Inputs
- **Correlation Lookback** (default: 100): Number of bars for rolling correlation window
- Shorter = more reactive, noisier
- Longer = smoother, slower to detect changes
- **Correlation Smoothing** (default: 5): EMA smoothing period for raw correlations
- Reduces noise while preserving trends
- **Symbol Detection**: Auto-detects symbols from your chart, or use manual overrides
- **Dominance Pairs**: Toggle USDT.D and BTC.D correlations on/off
## Usage Tips
1. **Combine with main Tri-Align indicator**: Use correlation for context, Tri-Align for entry/exit signals
2. **Watch for divergences**: Correlation changing while price moves in sync can signal upcoming shift
3. **Adjust lookback period**: Use shorter (50-70) for day trading, longer (150-200) for position trading
4. **Focus on the blue line**: It's your primary alpha indicator
## Technical Details
- **Calculation**: Pearson correlation coefficient with EMA smoothing
- **Data source**: Close prices from `request.security()` (multi-timeframe capable)
- **Update frequency**: Every bar on your selected timeframe
- **Overlay**: False (displays in separate pane)
## Quick Interpretation Guide
| Blue Line Value | Interpretation | Action |
|----------------|----------------|--------|
| > 0.9 | Coin is a BTC clone | Avoid - no alpha opportunity |
| 0.7 - 0.9 | High correlation | Standard altcoin behavior |
| 0.3 - 0.7 | Moderate correlation | Some independence emerging |
| < 0.3 | Low correlation | **Strong alpha opportunity** |
| < 0 | Inverse correlation | Rare - potential hedge asset |
| Purple Line | Interpretation |
|-------------|----------------|
| Strongly negative | Coin weakens when BTC rises - risky |
| Near zero | Coin/BTC pair moves independently of BTC |
| Positive | Coin strengthens with BTC - ideal |
## Version History
### v1.0 (Initial Release)
- Pearson correlation calculation with configurable lookback
- 5 correlation pairs: Coin vs BTC, Coin/BTC vs BTC, Coin vs Coin/BTC, USDT.D, BTC.D
- EMA smoothing to reduce noise
- Visual zones for high/inverse correlation
- Dynamic legend with symbol name extraction
- Auto-symbol detection matching main Tri-Align indicator
Other alts compensated capitalization [Peregringlk]DISCLAIMER: I'm not a native English speaker, so let me know please about mistakes in my wording.
Introduction
==========
This indicator (the middle one in the image) shows how the "others altcoins" (all altcoins except coins with high capitalization) are adding own value to its capitalization by removing BTC price changes. By "own value" I mean USD value gaining by actual buys in BTC markets beyong arbitrage effects of BTC price changes.
The main idea is that, if bitcoin has increased is value by 20%, and the other altcoins has increased its capitalization by 30%, the chart will only plot an increased of 10%. In other words, it will show its increased capitalization measured in BTC (the combined altcoin/BTC market is uptrending). Its purpose is to try to identify altseasons. A bit more concisely, the graph will only grow when both USD and BTC capitalization are growing. If any of them are going down, the graph will go down as well.
Rationale
========
- Altseasons are characterized by an incresed in BTC value of almost every altcoin during some period of time, although not all at once, but distributed over the altseason. For example, in the crazy altseason of Dec17/Jan18, almost every (low capitalized) altcoin increased its BTC value by a minimum of +300%, some at the beginning of the season, some at the end.
- When this happens, BTC loss capitalization dominance, but this also can happen if BTC is downtrending while altcoins are being bought in BTC markets but its USD value doesn't change too much. This happens when altcoins are uptrending in BTC price, but there are actually no gain of USD value because the BTC gain in value is not enough to compensate the BTC fall in price. Since BTC is losing USD price, but altcoins are not, dominance falls. So, looking at BTC dominance is not enough to spot possible beginnings of altseasons, because of arbitrage of other effects.
- The "big altcoins" are removed from the counting because one single big capitalized altcoin that grows, let's say, a 20%, will have an observable effect on the total altcoin capitalization, even if the rest of the altcoins are stagnated in price. For example, at today's date (8th April 2020), Ethereum by itself has the 23.89% of the total altcoins capitalization. A +10% in Ethereum price will increase the total altcoin capitalization by a +2.38%. I wanted to remove that effect to focus on generalized price changes of all altcoins. Remember that there are only 9 big altcoins 9 coins representing the 71% of the alts capitalization, while there are exists more than 5000 altcoins in total.
- Another key factor is that I want to focus on what happens in alt/BTC markets, because almost every altcoin can be traded against BTC, and most of them can only be traded against BTC. However, big altcoins can usually be traded against USD or other alt coins or fiat currencies as well. Removing the big alts from the equation helps (just a bit) to simplify the interpretation of the chart because arbitrage effects of those "impactfull" alts are limited (although not removed, because arbitrage also happens cross-markets).
- There are situations where BTC price is going up, alts USD capitalization is going up as well, but alts BTC capitalization is going down because altcoins are being sold in BTC markets, it just happens that the speed of the selling is not high enough as to compensated the increased in BTC price. That makes the USD capitalization grows, while alts are really being dumped in BTC markets. I wanted to reflect that effect as well by making sure that the graph is growing only when both USD and BTC capitalization of alts are growing.
Interpretation
============
If you want, you can see this chart as if plotting the Other alts capitalization as if priced against a fictional coin FCOIN, that start by having a price of 1, that combines the up and downs of both BTC price and alts USD capitalization in a very conservative way: if FCOIN price goes up, means that the other alts are gained USD value but only when they have overcome BTC price changes. Otherwise, it goes down.
If this fictional FCOIN has went up during some days straight with a total gain of maybe, greater than 10%, we are maybe in front of the start of an altseason. Sometimes, maybe (it requires some more years to extract a theory out of here), it can be used as proxy of the BTC near future (trend changes or continuations): if this FCOIN goes up, while BTC is doing nothing relevant or even is going down, it could signal that "people" is getting prepared and a generalized altcoin accumulation process has started, because of a combined people's assumption that BTC will start to have an stable uptrend, or will continue the current trend soon. There's some matches in the past about that, but there are also false positives, as usual.
Additionally, four customizable EMAs are added to the script, by default 21, 50, 100 and 150.
Definitions
=========
- Let's call `altcap_btc` the altcoin capitalization in USD, divided by BTC price. In other words, `altcap_btc` is the capitalization in terms of BTC.
- Let's call `x` the BTC price change rate as `btc_price_current_candle / btc_price_previous_candle`. So, if BTC has grown a +20%, `x = 1.20`, and if BTC has gone down a -20%, `x = 0.80`.
- Let's call `y` the `altcap_btc` price change rate, calculated as before but for `altcap_btc`.
- For pure math equivalence, `x * y` is thus the USD capitalization change rate.
Calculation
=========
For plotting the graph, for each candle, I choose a change rate, and then I plot the total accumulated change rate as by `ch0 * ch1 * ch2 * .... * ch_today`, where each `chX` is the choosen change rate of each candle since the beginning of the chart. So, if the "alts compensated value" has grown yesterday +20% and today's -10%, `1.20 * 0.9 = 1.08`, which means that in two days the compensated value has grown an 8% in total.
- If `x * y > 1` (USD cap is growing), I take `y` as change rate (alt/btc change rate).
- If both `x` and `y` are `> 1`, then the graph grows because I'm taking `y`.
- If `x > 1` and `y < 1`, the graph goes down because I'm taking `y`, reflecting the BTC markets are dumping.
- If `x < 1` and `y > 1`, the graph goes up because I'm taking `y`, reflecting the BTC markets are pumping so much that it overcomes the btc fall.
- `x < 1` and `y < 1` is impossible here because `x * y` must be `> 1` by precondition.
- If `x * y < 1` (USD cap is going down), I take `y` or `x * y` depending on the individual change rates:
- If `x` and `y` go in different directions (one up and the other down), I take `x * y` to reflect that USD capitalization has gone down. I don't take `y` here because it could be `> 1`, and I don't want to make the graph grow if alts are lossing USD value. Also, if `y < 1` and I take `y` the graph will go down faster than USD capitalization and I want to show that "alts compensated value is gown down slower than BTC because some boughts are happening". I don't take `x` either here for the same reasons.
- If both `x` and `y` are `< 1`, I take `y`, because otherwise the graph would be less than 0.000001 today after two years of bleeding, making literally impossible to see if alts "grow tomorrow".
- `x > 1` and `y > 1` is impossible here because `x * y` must be `< 1` by precondition.
Spot Symbols for CryptoLibrary "CryptoSpotSymbols"
This Library has one purpose only. It generate Symbols for the Crypto Spot Market, like all the currencies pairs of most Crypto Exchanges available to TradingView.
Have a look at .find() , which is an all in one function.
Binance(basecurrency)
Generate 27 Symbols for the Spot Market of Binance.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
BinanceUS(basecurrency)
Generate seven Symbols for the Spot Market of BinanceUS.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
Bitfinex(basecurrency)
Generate 12 Symbols for the Spot Market of Bitfinex.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
bitFlyer(basecurrency)
Generate three Symbols for the Spot Market of bitFlyer.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
Bitget(basecurrency)
Generate seven Symbols for the Spot Market of Bitget.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
Bithumb(basecurrency)
Generate two Symbols for the Spot Market of Bithumb.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
bitkub(basecurrency)
Generate one Symbol for the Spot Market of bitkub.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns: THB
BitMEX(basecurrency)
Generate two Symbols for the Spot Market of BitMEX.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
bitpanda_pro(basecurrency)
Generate six Symbols for the Spot Market of bitpanda pro.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
bitrue(basecurrency)
Generate nine Symbols for the Spot Market of bitrue.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
Bitstamp(basecurrency)
Generate eight Symbols for the Spot Market of Bitstamp.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
BITTREX(basecurrency)
Generate six Symbols for the Spot Market of BITTREX.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
BTSE(basecurrency)
Generate 15 Symbols for the Spot Market of BTSE.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
BYBIT(basecurrency)
Generate five Symbols for the Spot Market of BYBIT.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
CapitalCom(basecurrency)
Generate five Symbols for the Spot Market of capital.com.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
coinbase(basecurrency)
Generate seven Symbols for the Spot Market of coinbase.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
CoinEx(basecurrency)
Generate three Symbols for the Spot Market of CoinEx.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
CurrencyCom(basecurrency)
Generate 30 Symbols for the Spot Market of currency.com.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
Delta(basecurrency)
Generate one Symbol for the Spot Market of Delta.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns: USDT
Deribit(basecurrency)
Generate two Symbols for the Spot Market of Deribit.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
easyMarkets(basecurrency)
Generate one Symbol for the Spot Market of easyMarkets.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns: USD
Eightcap(basecurrency)
Generate one Symbol for the Spot Market of Eightcap.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns: USD
ExMo(basecurrency)
Generate ten Symbols for the Spot Market of ExMo.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
FOREXcom(basecurrency)
Generate four Symbols for the Spot Market of FOREX.com.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
FXCM(basecurrency)
Generate three Symbols for the Spot Market of FXCM.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
GateIO(basecurrency)
Generate five Symbols for the Spot Market of Gate.io.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
Gemini(basecurrency)
Generate ten Symbols for the Spot Market of Gemini.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
Kraken(basecurrency)
Generate 14 Symbols for the Spot Market of Kraken.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
KuCoin(basecurrency)
Generate 13 Symbols for the Spot Market of KuCoin.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
MEXC(basecurrency)
Generate six Symbols for the Spot Market of MEXC.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
OANDA(basecurrency)
Generate one Symbol for the Spot Market of OANDA.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns: USD
OKX(basecurrency)
Generate six Symbols for the Spot Market of OKX.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
Pepperstone(basecurrency)
Generate one Symbol for the Spot Market of Pepperstone.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns: USD
phemex(basecurrency)
Generate four Symbols for the Spot Market of phemex.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
POLONIEX(basecurrency)
Generate nine Symbols for the Spot Market of POLONIEX.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
Pyth(basecurrency)
Generate three Symbols for the Spot Market of Pyth.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
Skilling(basecurrency)
Generate four Symbols for the Spot Market of Skilling.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
TimeX(basecurrency)
Generate six Symbols for the Spot Market of TimeX.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
TradeStation(basecurrency)
Generate four Symbols for the Spot Market of TradeStation.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
UpBit(basecurrency)
Generate four Symbols for the Spot Market of UpBit.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
whitebit(basecurrency)
Generate 13 Symbols for the Spot Market of whitebit.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
WOOX(basecurrency)
Generate two Symbols for the Spot Market of WOO.
Parameters:
basecurrency (simple string) : Its the Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`.
Returns:
find(exchange, basecurrency)
Generate up to 30 Symbols for the Spot Market, depending on the market picked.
Parameters:
exchange (simple string) : The name of an Exchange. Case insensitivity. Optional. Default value is `syminfo.prefix`. If something else is put in here it will return `na` values.
basecurrency (simple string) : The Basecurrency to generate the Symbols with. Optional. Default value is `syminfo.basecurrency`
Returns: 30x string as tuple
CL Daily Bitcoin Volume (All exchange included, even Mt.GOX)This daily volume data contains collective total from
____________________________________________________
Historical:
BTC-e BTC/USD (From Q3 2011 to Q3 2016)
BTCChina BTC/CNY (From Q3 2011 to Q2 2017)
Coinsetter BTC/USD (From Q3 2014 to Q1 2016)
MtGox BTC/USD (From July 2010 - 2014 only))
OKcoin International BTC/USD (From Q3 2014 to Q2 2017)
____________________________________________________
Institutions:
CME Bitcoin Futures
Grayscale Bitcoin Trust OTC
____________________________________________________
Spot exchanges:
Bitfinex BTC/USD
Bitstamp BTC/USD
Coinbase BTC/USD
Coinbase BTC/EUR
Binance BTC/USDT
Binance BTC/USDC
Binance BTC/PAX
Gemini BTC/USD
itBit BTC/USD
Kraken BTC/EUR
Kraken BTC/USD
Huobi BTC/USDT
Korbit BTC/KRW
Bitflyer BTC/JPY
____________________________________________________
Others:
Bitmex
Noro's SILA v1.6L StrategyBacktesting
Backtesting (for all the time of existence of couple) only with software configurations to default (without optimization of parameters):
US = Uptrend-Sensivity
DS = Downtrend-Sensivity
It is recommended and by default:
- the normal market requires US=DS (for example US=5, DS=5)
- very bear market requires US DS, (for example US=5, DS=0)
- very bull market requires US DS, (US=0, DS=5)
Cryptocurrencies it is very bull market (US=0, DS=5)
Backtesting BTC/FIAT
D1 timeframe
identical parameters for all pairs
BTC/USD (Bitstamp) profit of +41805%
BTC/EUR (BTC-e) profit of +1147%
BTC/RUB (BTC-e) profit of +1162%
BTC/JPY (Bitflyer) profit of +215%
BTC/CNY (BTCChina) profit of 54948%
Backtesting ALTCOIN/BTC
D1 timeframe
identical parameters for all pairs
the exchange Poloniex
top-10 of cryptocurrencies on capitalization at the time of this text
NA = TradingView can't make backtest because of too low price of this cryptocurrency, or on the website there are no quotations of this cryptocurrency
ETH/BTC (Etherium) profit of +11690%
XRP/BTC (Ripple) loss of-100%
LTC/BTC (Litecoin) NA
ETC/BTC (Etherium Classic) profit of +214%
NEM/BTC loss of-49%
DASH/BTC profit of +106%
IOTA/BTC NA
XMR/BTC (Monero) profit of +96%
STRAT/BTC (Stratis) loss of-31%
ALTCOIN/ALTCOIN - not recomended
I don't need your money, I need reputation and likes.
ZenAlgo - DominatorThis indicator provides a structured multi-ticker overview of market momentum and relative strength by analyzing short-term price behavior across selected assets in comparison with broader crypto dominance and Bitcoin/ETH performance.
Ticker and Market Data Handling
The script accepts up to 9 user-defined symbols (tickers) along with BTCUSD and ETHUSD. For each symbol:
It retrieves the current price.
It also requests the daily opening price from the "D" timeframe to compute intraday percentage change.
For BTC, ETH, and dominance (sum of BTC, USDT, and USDC dominance), daily change is calculated using this same method.
This comparison enables tracking relative performance from the daily open, which provides meaningful insight into intraday strength or weakness among different assets.
Dominance Logic
The indicator aggregates dominance data from BTC , USDT , and USDC using TradingView’s CRYPTOCAP indices. This combined dominance is used as a reference in directional and status calculations. ETH dominance is also analyzed independently.
Changes in dominance are used to infer whether market attention is shifting toward Bitcoin/stablecoins (typically indicating risk-off sentiment) or away from them (typically risk-on behavior, benefiting altcoins).
Price Direction Estimation
The script estimates directional bias using an EMA-based deviation technique:
A short EMA (user-defined lookback , default 4 bars) is calculated.
The current close is compared to the EMA to assess directional bias.
Recent candle changes are also inspected to confirm a consistent short-term trend (e.g., 3 consecutive higher closes for "up").
A small threshold is used to avoid classifying flat movements as trends.
This directionality logic is applied separately to:
The selected ticker's price
BTC price
Combined dominance
This allows the script to contextualize the movement of each asset within broader market conditions.
Market Status Evaluation
A custom function analyzes ETH and BTC dominance trends along with their relative strength to define the overall market regime:
Altseason is identified when BTC dominance is declining, ETH dominance rising, and ETH outperforms BTC.
BTC Season occurs when BTC dominance is rising, ETH dominance falling, and BTC outperforms ETH.
If neither condition is met, the state is Neutral .
This classification is shown alongside each ticker's row in the table and helps traders assess whether market conditions favor Bitcoin, Ethereum, or altcoins in general.
Ticker Status Classification
Each ticker is analyzed independently using the earlier directional logic. Its status is then determined as follows:
Full Bull : Ticker is trending up while dominance is declining or BTC is also rising.
Bullish : Ticker is trending up but not supported by broader bullish context.
Bearish : Ticker is trending down but without broader confirmation.
Full Bear : Ticker is trending down while dominance rises or BTC falls.
Neutral : No strong directional bias or conflicting context.
This classification reflects short-term momentum and macro alignment and is color-coded in the results table.
Table Display and Plotting
A configurable table is shown on the chart, which:
Displays the name and status of each selected ticker.
Optionally includes BTC, ETH, and market state.
Uses color-coding for intuitive interpretation.
Additionally, price changes from the daily open are plotted for each selected ticker, BTC, ETH, and combined dominance. These values are also labeled directly on the chart.
Labeling and UX Enhancements
Labels next to the current candle display price and percent change for each active ticker and for BTC, ETH, and combined dominance.
Labels update each bar, and old labels are deleted to avoid clutter.
Ticker names are dynamically shortened by stripping exchange prefixes.
How to Use This Indicator
This tool helps traders:
Spot early rotations between Bitcoin and altcoins.
Identify intraday momentum leaders or laggards.
Monitor which tickers align with or diverge from broader market trends.
Detect possible sentiment shifts based on dominance trends.
It is best used on lower to mid timeframes (15m–4h) to capture intraday to short-term shifts. Users should cross-reference with longer-term trend tools or structural indicators when making directional decisions.
Interpretation of Values
% Change : Measures intraday move from daily open. Strong positive/negative values may indicate breakouts or reversals.
Status : Describes directional strength relative to market conditions.
Market State : Gives a general bias toward BTC dominance, ETH strength, or altcoin momentum.
Limitations & Considerations
The indicator does not analyze liquidity or volume directly.
All logic is based on short-term movements and may produce false signals in ranging or low-volume environments.
Dominance calculations rely on external CRYPTOCAP indices, which may differ from exchange-specific flows.
Added Value Over Other Free Tools
Unlike basic % change tables or price overlays, this indicator:
Integrates dominance-based macro context into ticker evaluation.
Dynamically classifies market regimes (BTC season / Altseason).
Uses multi-factor logic to determine ticker bias, avoiding single-metric interpretation.
Displays consolidated information in a table and chart overlays for rapid assessment.
Antares_messages_publicLibrary "Antares_messages_public"
This library add messages for yours strategy for use in Antares trading system for binance and bybit exchanges.
Данная библиотека позволяет формировать сообщения в алертах стратегий для Antares в более упрощенном для пользователя режиме, включая всплывающие подсказки и т.д.
set_leverage(token, market, ticker_id, leverage)
Set leverage for ticker on specified market.
Parameters:
token (string) : (integer or 0) token for trade in system, if = 0 then token part mess is empty. Токен, При значениb = 0 не включается в формирование строки алерта.
market (string) : (string) Spot 'binance' , 'bybit' . Futures ('binancefru','binancefro','bybitfu', 'bybitfi'). Строковая переменная названия биржи.
ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
leverage (float) : (float) leverage level. Устанавливаемое плечо.
Returns: 'Set leverage message'.
pause(time_pause)
Set pause in message. '::' -left and '::' -right included.
Parameters:
time_pause (int)
LongLimit(token, market, ticker_id, type_qty, quantity, price, orderId, leverageforqty)
Buy order with limit price and quantity.
Лимитный ордер на покупку(в лонг).
Parameters:
token (string) : (integer or 0) token for trade in system, if = 0 then token part mess is empty. Токен, При значениb = 0 не включается в формирование строки алерта.
market (string) : (string) Spot 'binance' , 'bybit' . Futures ('binancefru','binancefro','bybitfu', 'bybitfi'). Строковая переменная названия биржи.
ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
type_qty (string) : (string) type of quantity: 1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
quantity (float) : (float) orders size, see at 'type_qty'. Размер ордера, базы или % в соответствии с 'type_qty'
price (float) : (float) price for limit order. Цена по которой должен быть установлен лимитный ордер.
orderId (string) : (string) if use order id you may change or cancel your order after or set it ''. Используйте OrderId если хотите изменить или отменить ордер в будущем.
leverageforqty (bool) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
Returns: 'Limit Buy order'. Лимитный ордер на покупку (лонг).
LongMarket(token, market, ticker_id, type_qty, quantity, leverageforqty)
Market Buy order with quantity.
Рыночный ордер на покупку (в лонг).
Parameters:
token (string) : (integer or 0) token for trade in system, if = 0 then token part mess is empty. Токен, При значениb = 0 не включается в формирование строки алерта.
market (string) : (string) Spot 'binance' , 'bybit' . Futures ('binancefru','binancefro','bybitfu', 'bybitfi'). Строковая переменная названия биржи.
ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
type_qty (string) : (string) type of quantity: 1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
quantity (float) : (float) orders size, see at 'type_qty'. Размер ордера, базы или % в соответствии с 'type_qty'
leverageforqty (int) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
Returns: 'Market Buy order'. Маркетный ордер на покупку (лонг).
ShortLimit(token, market, ticker_id, type_qty, quantity, price, leverageforqty, orderId)
Sell order with limit price and quantity.
Лимитный ордер на продажу(в шорт).
Parameters:
token (string) : (integer or 0) token for trade in system, if = 0 then token part mess is empty. Токен, При значениb = 0 не включается в формирование строки алерта.
market (string) : (string) Spot 'binance' , 'bybit' . Futures ('binancefru','binancefro','bybitfu', 'bybitfi'). Строковая переменная названия биржи.
ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
type_qty (string) : (string) type of quantity: 1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
quantity (float) : (float) orders size, see at 'type_qty'. Размер ордера, базы или % в соответствии с 'type_qty'
price (float) : (float) price for limit order. Цена по которой должен быть установлен лимитный ордер.
leverageforqty (bool) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
orderId (string) : (string) if use order id you may change or cancel your order after or set it ''. Используйте OrderId если хотите изменить или отменить ордер в будущем.
Returns: 'Limit Sell order'. Лимитный ордер на продажу (шорт).
ShortMarket(token, market, ticker_id, type_qty, quantity, leverageforqty)
Sell by market price and quantity.
Рыночный ордер на продажу(в шорт).
Parameters:
token (string) : (integer or 0) token for trade in system, if = 0 then token part mess is empty. Токен, При значениb = 0 не включается в формирование строки алерта.
market (string) : (string) Spot 'binance' , 'bybit' . Futures ('binancefru','binancefro','bybitfu', 'bybitfi'). Строковая переменная названия биржи.
ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
type_qty (string) : (string) type of quantity: 1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
quantity (float) : (float) orders size, see at 'type_qty'. Размер ордера, базы или % в соответствии с 'type_qty'
leverageforqty (int) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
Returns: 'Market Sell order'. Маркетный ордер на продажу (шорт).
Cancel_by_ticker(token, market, ticker_id)
Cancel all orders for market and ticker in setups. Отменяет все ордера на заданной бирже и заданном токене(паре).
Parameters:
token (string)
market (string) : (string) Spot 'binance' , 'bybit' . Futures ('binancefru','binancefro','bybitfu', 'bybitfi'). Строковая переменная названия биржи.
ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
Returns: 'Cancel all orders'. Отмена всех ордеров на заданной бирже и заданном токене(паре).
Cancel_by_id(token, market, ticker_id, orderId)
Cancel order by Id for market and ticker in setups. Отменяет ордер по Id на заданной бирже и заданном токене(паре).
Parameters:
token (string)
market (string) : (string) Spot 'binance' , 'bybit' . Futures ('binancefru','binancefro','bybitfu', 'bybitfi'). Строковая переменная названия биржи.
ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
orderId (string)
Returns: 'Cancel order'. Отмена ордера по Id на заданной бирже и заданном токене(паре).
Close_positions(token, market, ticker_id)
Close all positions for market and ticker in setups. Закрывает все позиции на заданной бирже и заданном токене(паре).
Parameters:
token (string)
market (string) : (string) Spot 'binance' , 'bybit' . Futures ('binancefru','binancefro','bybitfu', 'bybitfi'). Строковая переменная названия биржи.
ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
Returns: 'Close positions'
CloseLongLimit(token, market, ticker_id, type_qty, quantity, price, orderId, leverageforqty)
Close limit order for long position. (futures)
Лимитный ордер на продажу(в шорт) для закрытия лонговой позиции(reduceonly).
Parameters:
token (string) : (integer or 0) token for trade in system, if = 0 then token part mess is empty. Токен, При значениb = 0 не включается в формирование строки алерта.
market (string) : (string) Spot 'binance' , 'bybit' . Futures ('binancefru','binancefro','bybitfu', 'bybitfi'). Строковая переменная названия биржи.
ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
type_qty (string) : (string) type of quantity: 1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
quantity (float) : (float) orders size, see at 'type_qty'. Размер ордера, базы или % в соответствии с 'type_qty'
price (float) : (float) price for limit order. Цена по которой должен быть установлен лимитный ордер.
orderId (string) : (string) if use order id you may change or cancel your order after or set it ''. Используйте OrderId если хотите изменить или отменить ордер в будущем.
leverageforqty (bool) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
Returns: 'Limit Sell order reduce only (close long position)'. Лимитный ордер на продажу для снижения текущего лонга(в шорт не входит).
CloseLongMarket(token, market, ticker_id, type_qty, quantity, leverageforqty)
Close market order for long position.
Рыночный ордер на продажу(в шорт) для закрытия лонговой позиции(reduceonly).
Parameters:
token (string) : (integer or 0) token for trade in system, if = 0 then token part mess is empty. Токен, При значениb = 0 не включается в формирование строки алерта.
market (string) : (string) Spot 'binance' , 'bybit' . Futures ('binancefru','binancefro','bybitfu', 'bybitfi'). Строковая переменная названия биржи.
ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
type_qty (string) : (string) type of quantity: 1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
quantity (float) : (float) orders size, see at 'type_qty'. Размер ордера, базы или % в соответствии с 'type_qty'
leverageforqty (bool) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
Returns: 'Market Sell order reduce only (close long position)'. Ордер на снижение/закрытие текущего лонга(в шорт не входит) по рыночной цене.
CloseShortLimit(token, market, ticker_id, type_qty, quantity, price, orderId, leverageforqty)
Close limit order for short position.
Лимитный ордер на покупку(в лонг) для закрытия шортовой позиции(reduceonly).
Parameters:
token (string) : (integer or 0) token for trade in system, if = 0 then token part mess is empty. Токен, При значениb = 0 не включается в формирование строки алерта.
market (string) : (string) Spot 'binance' , 'bybit' . Futures ('binancefru','binancefro','bybitfu', 'bybitfi'). Строковая переменная названия биржи.
ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
type_qty (string) : (string) type of quantity: 1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
quantity (float) : (float) orders size, see at 'type_qty'. Размер ордера, базы или % в соответствии с 'type_qty'
price (float) : (float) price for limit order. Цена по которой должен быть установлен лимитный ордер.
orderId (string) : (string) if use order id you may change or cancel your order after or set it ''. Используйте OrderId если хотите изменить или отменить ордер в будущем.
leverageforqty (bool) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
Returns: 'Limit Buy order reduce only (close short position)' . Лимитный ордер на покупку (лонг) для сокращения/закрытия текущего шорта.
CloseShortMarket(token, market, ticker_id, type_qty, quantity, leverageforqty)
Set Close limit order for long position.
Рыночный ордер на покупку(в лонг) для сокращения/закрытия шортовой позиции(reduceonly).
Parameters:
token (string) : (integer or 0) token for trade in system, if = 0 then token part mess is empty. Токен, При значениb = 0 не включается в формирование строки алерта.
market (string) : (string) Spot 'binance' , 'bybit' . Futures ('binancefru','binancefro','bybitfu', 'bybitfi'). Строковая переменная названия биржи.
ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
type_qty (string) : (string) type of quantity: 1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
quantity (float) : (float) orders size, see at 'type_qty'. Размер ордера, базы или % в соответствии с 'type_qty'
leverageforqty (bool) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
Returns: 'Market Buy order reduce only (close short position)'. Маркетного ордера на покупку (лонг) для сокращения/закрытия текущего шорта.
cancel_all_close(token, market, ticker_id)
Parameters:
token (string)
market (string)
ticker_id (string)
limit_tpsl_bybitfu(token, ticker_id, order_id, side, type_qty, quantity, price, tp_price, sl_price, leverageforqty)
Set multi order for Bybit : limit + takeprofit + stoploss
Выставление тройного ордера на Bybit лимитка со стоплоссом и тейкпрофитом
Parameters:
token (string) : (integer or 0) token for trade in system, if = 0 then token part mess is empty. Токен, При значениb = 0 не включается в формирование строки алерта.
ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
order_id (string)
side (bool) : (bool) "buy side" if true or "sell side" if false. true для лонга, false для шорта.
type_qty (string) : (string) type of quantity: 1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
quantity (float) : (float) orders size, see at 'type_qty'. Размер ордера, базы или % в соответствии с 'type_qty'
price (float) : (float) price for limit order by 'side'. Цена лимитного ордера
tp_price (float) : (float) price for take profit order.
sl_price (float) : (float) price for stoploss order
leverageforqty (bool) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
Returns: Set multi order for Bybit : limit + takeprofit + stoploss.
replace_limit_tpsl_bybitfu(token, ticker_id, order_id, side, type_qty, quantity, price, tp_price, sl_price, leverageforqty)
Change multi order for Bybit : limit + takeprofit + stoploss
Изменение тройного ордера на Bybit лимитка со стоплоссом и тейкпрофитом
Parameters:
token (string) : (integer or 0) token for trade in system, if = 0 then token part mess is empty. Токен, При значениb = 0 не включается в формирование строки алерта.
ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
order_id (string)
side (bool) : (bool) "buy side" if true or "sell side" if false. true для лонга, false для шорта.
type_qty (string) : (string) type of quantity: 1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
quantity (float) : (float) orders size, see at 'type_qty'. Размер ордера, базы или % в соответствии с 'type_qty'
price (float) : (float) price for limit order by 'side'. Цена лимитного ордера
tp_price (float) : (float) price for take profit order.
sl_price (float) : (float) price for stoploss order
leverageforqty (bool) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
Returns: Set multi order for Bybit : limit + takeprofit + stoploss.
long_stop(token, market, ticker_id, type_qty, quantity, l_stop, leverageforqty)
Stop market order for long position
Рыночный стоп-ордер на продажу для закрытия лонговой позиции.
Parameters:
token (string)
market (string) : (string) 'binance' , 'binancefru' etc.. Строковая переменная названия биржи.
ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
type_qty (string) : (string) type of quantity: 1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
quantity (float) : (float) orders size. Размер ордера.
l_stop (float) : (float) price for activation stop order. Цена активации стоп-ордера.
leverageforqty (bool) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
Returns: 'Stop Market Sell order (close long position)'. Маркетный стоп-ордер на снижения/закрытия текущего лонга.
short_stop(token, market, ticker_id, type_qty, quantity, s_stop, leverageforqty)
Stop market order for short position
Рыночный стоп-ордер на покупку(в лонг) для закрытия шорт позиции.
Parameters:
token (string)
market (string) : (string) 'binance' , 'binancefru' etc.. Строковая переменная названия биржи.
ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
type_qty (string) : (string) type of quantity: 1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
quantity (float) : (float) orders size. Размер ордера.
s_stop (float) : (float) price for activation stop order. Цена активации стоп-ордера.
leverageforqty (bool) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
Returns: 'Stop Market Buy order (close short position)'. Маркетный стоп-ордер на снижения/закрытия текущего шорта.
change_stop_l(token, market, ticker_id, type_qty, quantity, l_stop, leverageforqty)
Change Stop market order for long position
Изменяем стоп-ордер на продажу(в шорт) для закрытия лонг позиции.
Parameters:
token (string)
market (string) : (string) 'binance' , 'binancefru' etc.. Строковая переменная названия биржи.
ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
type_qty (string) : (string) type of quantity: 1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
quantity (float) : (float) orders size. Размер ордера.
l_stop (float) : (float) price for activation stop order. Цена активации стоп-ордера.
leverageforqty (bool) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
Returns: 'Change Stop Market Buy order (close long position)'. Смещает цену активации Маркетного стоп-ордер на снижения/закрытия текущего лонга.
change_stop_s(token, market, ticker_id, type_qty, quantity, s_stop, leverageforqty)
Change Stop market order for short position
Смещает цену активации Рыночного стоп-ордера на покупку(в лонг) для закрытия шорт позиции.
Parameters:
token (string)
market (string) : (string) 'binance' , 'binancefru' etc.. Строковая переменная названия биржи.
ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
type_qty (string)
quantity (float) : (float) orders size. Размер ордера.
s_stop (float) : (float) price for activation stop order. Цена активации стоп-ордера.
leverageforqty (bool) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
Returns: 'Change Stop Market Buy order (close short position)'. Смещает цену активации Маркетного стоп-ордер на снижения/закрытия текущего шорта.
open_long_position(token, market, ticker_id, type_qty, quantity, l_stop, leverageforqty)
Cancel and close all orders and positions by ticker , then open Long position by market price with stop order
Отменяет все лимитки и закрывает все позы по тикеру, затем открывает лонг по маркету с выставлением стопа (переворот позиции, при необходимости).
Parameters:
token (string)
market (string) : (string) 'binance' , 'binancefru' etc.. Строковая переменная названия биржи.
ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
type_qty (string) : (string) type of quantity: 1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
quantity (float) : (float) orders size. Размер ордера.
l_stop (float) : (float). Price for activation stop loss. Цена активации стоп-лосса.
leverageforqty (int) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
Returns: 'command_all_close + LongMarket + long_stop.
open_short_position(token, market, ticker_id, type_qty, quantity, s_stop, leverageforqty)
Cancel and close all orders and positions , then open Short position by market price with stop order
Отменяет все лимитки и закрывает все позы по тикеру, затем открывает шорт по маркету с выставлением стопа(переворот позиции, при необходимости).
Parameters:
token (string)
market (string) : (string) 'binance' , 'binancefru' etc.. Строковая переменная названия биржи.
ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
type_qty (string) : (string) type of quantity: 1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
quantity (float) : (float) orders size. Размер ордера.
s_stop (float) : (float). Price for activation stop loss. Цена активации стоп-лосса.
leverageforqty (int) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
Returns: 'command_all_close + ShortMarket + short_stop'.
open_long_trade(token, market, ticker_id, type_qty, quantity, l_stop, qty_ex1, price_ex1, qty_ex2, price_ex2, qty_ex3, price_ex3, leverageforqty)
Cancell and close all orders and positions , then open Long position by market price with stop order and take 1 ,take 2, take 3
Отменяет все лимитки и закрывает все позы по тикеру, затем открывает лонг по маркету с выставлением стопа и 3 тейками (переворот позиции, при необходимости).
Parameters:
token (string)
market (string) : (string) 'binance' , 'binancefru' etc.. Строковая переменная названия биржи.
ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
type_qty (string) : (string) type of quantity: 1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
quantity (float) : (float) enter order size, see at type_qty. Размер ордера входа, согласно type_qty.
l_stop (float) : (float). Price for activation stop loss. Цена активации стоп-лосса.
qty_ex1 (float) : (float). Quantity for 1th take see at type_qty, if = 0 string for order dont set. Размер лимитного ордера для 1го тейка, согласно type_qty.. Если 0, то строка для этого тейка не формируется
price_ex1 (float) : (float). Price for 1th take , if = 0 string for order dont set. Цена лимитного ордера для 1го тейка. Если 0, то строка для этого тейка не формируется
qty_ex2 (float) : (float). Quantity for 2th take see at type_qty, if = 0 string for order dont set. Размер лимитного ордера для 2го тейка, согласно type_qty..Если 0, то строка для этого тейка не формируется
price_ex2 (float) : (float). Price for 2th take, if = 0 string for order dont set. Цена лимитного ордера для 2го тейка. Если 0, то строка для этого тейка не формируется
qty_ex3 (float) : (float). Quantity for 3th take see at type_qty, if = 0 string for order dont set. Размер лимитного ордера для 2го тейка, согласно type_qty..Если 0, то строка для этого тейка не формируется
price_ex3 (float) : (float). Price for 3th take, if = 0 string for order dont set. Цена лимитного ордера для 3го тейка. Если 0, то строка для этого тейка не формируется
leverageforqty (int)
Returns: 'cancel_all_close + LongMarket + long_stop + CloseLongLimit1 + CloseLongLimit2+CloseLongLimit3'.
open_short_trade(token, market, ticker_id, type_qty, quantity, s_stop, qty_ex1, price_ex1, qty_ex2, price_ex2, qty_ex3, price_ex3, leverageforqty)
Cancell and close all orders and positions , then open Short position by market price with stop order and take 1 and take 2
Отменяет все лимитки и закрывает все позы по тикеру, затем открывает шорт по маркету с выставлением стопа и 3 тейками (переворот позиции, при необходимости).
Parameters:
token (string)
market (string) : (string) 'binance' , 'binancefru' etc.. Строковая переменная названия биржи.
ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
type_qty (string)
quantity (float)
s_stop (float) : (float). Price for activation stop loss. Цена активации стоп-лосса.
qty_ex1 (float) : (float). Quantity for 1th take see at type_qty, if = 0 string for order dont set. Размер лимитного ордера для 1го тейка, согласно type_qty.. Если 0, то строка для этого тейка не формируется
price_ex1 (float) : (float). Price for 1th take , if = 0 string for order dont set. Цена лимитного ордера для 1го тейка. Если 0, то строка для этого тейка не формируется
qty_ex2 (float) : (float). Quantity for 2th take see at type_qty, if = 0 string for order dont set. Размер лимитного ордера для 2го тейка, согласно type_qty..Если 0, то строка для этого тейка не формируется
price_ex2 (float) : (float). Price for 2th take, if = 0 string for order dont set. Цена лимитного ордера для 2го тейка. Если 0, то строка для этого тейка не формируется
qty_ex3 (float) : (float). Quantity for 3th take see at type_qty, if = 0 string for order dont set. Размер лимитного ордера для 2го тейка, согласно type_qty..Если 0, то строка для этого тейка не формируется
price_ex3 (float) : (float). Price for 3th take, if = 0 string for order dont set. Цена лимитного ордера для 3го тейка. Если 0, то строка для этого тейка не формируется
leverageforqty (int)
Returns: 'command_all_close + ShortMarket + short_stop + CloseShortLimit + CloseShortLimit(2)'.
Multi_LongLimit(token, market, ticker_id, type_qty, qty1, price1, qty2, price2, qty3, price3, qty4, price4, qty5, price5, qty6, price6, qty7, price7, qty8, price8, leverageforqty)
8 or less Buy orders with limit price and quantity.
До 8 Лимитных ордеров на покупку(в лонг).
Parameters:
token (string) : (integer or 0) token for trade in system, if = 0 then token part mess is empty. Токен, При значениb = 0 не включается в формирование строки алерта.
market (string) : (string) Spot 'binance' , 'bybit' . Futures ('binancefru','binancefro','bybitfu', 'bybitfi'). Строковая переменная названия биржи.
ticker_id (string) : (string) ticker in market ('btcusdt', 'ethusdt' etc...). Строковая переменная названия тикера (пары).
type_qty (string) : (string) type of quantity: 1. 'qty' or '' or na - standart (in coins), 2. 'quqty'- in assets (usdt,btc,etc..), 3.open% - open position(futures) or buy (spot) in % of base 4. close% - close in % of position (futures) or sell (spot) coins in % for current quantity
qty1 (float)
price1 (float)
qty2 (float)
price2 (float)
qty3 (float)
price3 (float)
qty4 (float)
price4 (float)
qty5 (float)
price5 (float)
qty6 (float)
price6 (float)
qty7 (float)
price7 (float)
qty8 (float)
price8 (float)
leverageforqty (bool) : (bool) use leverage in qty. Использовать плечо при расчете количества или нет.
Returns: 'Limit Buy order'. Лимитный ордер на покупку (лонг).
Cryptocurrency Market Sentiment v1.0Introduction:
Capable of observing the market sentiment of the cryptocurrency market
The relative status of BTC and altcoins
How it works:
1. The general uptrend process of the cryptocurrency market is BTC → ETH → high-cap altcoins → low-cap altcoins. When funds cannot push up BTC's market cap, funds gradually flow into smaller-cap altcoins until the upward trend ends.
2. Select ETH as the representative of altcoins, and understand the sentiment and current stage
3. Mathematical principle : divide the price of ETH by the price of BTC, and then apply it to the RSI formula .
How to use it:
1. Similar to the RSI indicator , when CMS enters the overbought zone, it represents an active altcoin market, a passionate market sentiment , and the end of the uptrend.
2. When CMS enters the oversold zone, it indicates the leading stage of BTC in the rising trend or the capital flow back to BTC in the declining process .
3. If CMS is at a low level, long positions should focus on altcoins, and short positions should focus on BTC, and vice versa.
----------------------------------------------------------------------------------------------------------
简单介绍:
能够观察加密市场市场情绪
BTC和寨币的相对状态
如何工作:
1、加密市场一般的上涨过程为 BTC → ETH → 大市值山寨 → 小市值山寨,当资金无法推动大市值的BTC上涨时,资金就会逐渐流向市值较小的山寨,直到一轮上涨结束。
2、选取ETH作为altcoins的代表,通过ETH与BTC的关系来了解加密市场的情绪和目前上涨的阶段。
3、数学原理:将ETH的价格/BTC的价格,随后将其带入RSI公式
如何使用:
1、与RSI指标类似,当cms进入超买时,代表寨币市场的活跃,市场情绪热烈,上涨进入尾声。
2、当cms进入超卖时,为上涨中BTC领涨的阶段或下降过程中资金回流BTC。
3、如果cms在低位,做多应关注altcoins,做空应关注btc,反之亦然。
MARA / mNAV=1 (x)What it does
This script overlays two signals on the MARA chart:
mNAV=1 fair-value line — the MARA price implied by Bitcoin NAV:
mNAV1 = (BTC price × BTC holdings) / MARA shares
Premium/Discount ratio — how far MARA trades vs. its NAV fair value:
Ratio = Close / mNAV1 (1.00 = fair; >1 = premium; <1 = discount)
Inputs
Shares outstanding (default: 370,460,000)
BTC holdings (official or estimated; you can roll forward +25 BTC/day if you want)
BTC symbol used for pricing (e.g., BTCUSD, BTCUSDT, BTCUSDTPERP)
How to use
When Price < mNAV=1 and Ratio < 1.00 → MARA trades at a discount to BTC NAV (potential mean-reversion if BTC is stable).
When Price > mNAV=1 and Ratio > 1.00 → premium (premium often compresses during BTC chop/weakness).
Rule of thumb (with ~53k BTC and 370.46M shares): +$1,000 BTC ≈ +$0.14 on the mNAV=1 line.
Visuals
Blue line = mNAV=1 (fair value) plotted directly on the MARA chart.
Purple line = Ratio (×) on a separate right-hand scale centered around 1.00.
Optional shading: green when Ratio > 1.05 (+5% premium), red when Ratio < 0.95 (−5% discount).
Alerts (suggested)
Premium > +5%: Ratio > 1.05
Discount < −5%: Ratio < 0.95
Notes
This is a proxy for NAV parity; it assumes your BTC holdings input is correct (official last report or your estimate).
Choice of BTC symbol matters; use the feed that best matches your workflow (spot, perp, or index).
The ratio is most informative when BTC is range-bound; during fast BTC moves MARA can overshoot temporarily.
Bitcoin Impact AnalyzerSummary of the "Bitcoin Impact Analyzer" script, the adjustments users can make, and an explanation of what the chart and table represent:
Script Summary:
The "Bitcoin Impact Analyzer" script is designed to help traders and analysts understand the relationship between a chosen altcoin and Bitcoin (BTC). It does this by:
Fetching price data for the specified altcoin and Bitcoin.
Calculating several key comparative metrics:
Normalized Prices: Shows the percentage performance of both assets from a common starting point.
Price Correlation: Measures how similarly the two assets' prices move over a defined period.
Beta: Indicates the altcoin's volatility relative to Bitcoin.
Altcoin/BTC Ratio: Shows the altcoin's value expressed in Bitcoin.
Fetching and displaying Bitcoin Dominance (BTC.D) data.
Visualizing these metrics on the chart as distinct plots.
Displaying the current values of these key metrics in a data table on the chart for quick reference.
The script aims to provide insights into whether an altcoin is outperforming or underperforming Bitcoin, how closely its price movements are tied to Bitcoin's, and its relative volatility.
User Adjustments:
Users can customize the script's behavior through several input settings:
Symbol Inputs:
Altcoin Symbol: Users can enter the ticker symbol for any altcoin they wish to analyze (e.g., BINANCE:ETHUSDT, KUCOIN:SOLUSDT).
Bitcoin Reference Symbol: Users can specify the Bitcoin pair to use as a reference, though BINANCE:BTCUSDT is a common default.
Lookback for Correlation/Beta:
Lookback Period: This integer value (default 50 periods) determines how many past candles are used to calculate the price correlation and beta.
A shorter lookback makes the metrics more sensitive to recent price action.
A longer lookback provides a smoother, more stable indication of the longer-term relationship.
Plot Visibility Options:
Users can toggle on or off the display of each individual plot on the chart:
Normalized BTC & Altcoin Prices
Altcoin/BTC Ratio
Correlation Plot
Bitcoin Dominance (BTC.D)
Beta Plot
This allows users to focus on specific metrics and reduce chart clutter.
What the Chart Represents:
The chart visually displays the historical trends and relationships of the selected metrics:
Normalized Prices Plot: Two lines (typically orange for BTC, blue for the altcoin) show the percentage growth of each asset from the start of the loaded chart data (or the first available data point for each symbol). This makes it easy to see which asset has performed better over time on a relative basis.
Correlation Plot: A single line (purple) oscillates between -1 and +1.
Values near +1 indicate a strong positive correlation (altcoin and BTC prices tend to move in the same direction).
Values near -1 indicate a strong negative correlation (they tend to move in opposite directions).
Values near 0 indicate little to no linear relationship.
Lines at +0.7 and -0.7 are often plotted as thresholds for "strong" correlation.
Beta Plot (if enabled): A single line (teal) shows the altcoin's volatility relative to BTC.
A Beta of 1 (often marked by a dashed line) means the altcoin has, on average, the same volatility as BTC.
Beta > 1 suggests the altcoin is more volatile than BTC (moves by a larger percentage for a given BTC move).
Beta < 1 suggests the altcoin is less volatile than BTC.
Bitcoin Dominance Plot: An area plot (gray) shows the percentage of the total cryptocurrency market capitalization that Bitcoin holds. This helps understand broader market sentiment and capital flows.
Altcoin/BTC Ratio Plot: A line (fuchsia) shows the price of the altcoin denominated in BTC.
An upward trend means the altcoin is gaining value against Bitcoin (outperforming).
A downward trend means the altcoin is losing value against Bitcoin (underperforming).
What the Table Represents:
The data table, typically located in the bottom-right corner of the chart, provides a snapshot of the current values for the most important calculated metrics. It includes:
Altcoin: The ticker symbol of the analyzed altcoin.
Bitcoin Ref: The ticker symbol of the Bitcoin reference.
Correlation (lookback): The current correlation coefficient between the altcoin and BTC, based on the specified lookback period. The value is color-coded (e.g., green for strong positive, red for strong negative).
Beta (lookback): The current beta value of the altcoin relative to BTC, based on the specified lookback period. The value may be color-coded to highlight significantly high or low volatility.
BTC.D Current: The current Bitcoin Dominance percentage.
ALT/BTC Ratio: The current price of the altcoin expressed in Bitcoin.
The table offers a quick, at-a-glance summary of the present market dynamics between the two assets without needing to interpret the lines on the chart for their exact current values.
Bitcoin Leverage Sentiment - Strategy [presentTrading]█ Introduction and How it is Different
The "Bitcoin Leverage Sentiment - Strategy " represents a novel approach in the realm of cryptocurrency trading by focusing on sentiment analysis through leveraged positions in Bitcoin. Unlike traditional strategies that primarily rely on price action or technical indicators, this strategy leverages the power of Z-Score analysis to gauge market sentiment by examining the ratio of leveraged long to short positions. By assessing how far the current sentiment deviates from the historical norm, it provides a unique lens to spot potential reversals or continuation in market trends, making it an innovative tool for traders who wish to incorporate market psychology into their trading arsenal.
BTC 4h L/S Performance
local
█ Strategy, How It Works: Detailed Explanation
🔶 Data Collection and Ratio Calculation
Firstly, the strategy acquires data on leveraged long (**`priceLongs`**) and short positions (**`priceShorts`**) for Bitcoin. The primary metric of interest is the ratio of long positions relative to the total of both long and short positions:
BTC Ratio=priceLongs / (priceLongs+priceShorts)
This ratio reflects the prevailing market sentiment, where values closer to 1 indicate a bullish sentiment (dominance of long positions), and values closer to 0 suggest bearish sentiment (prevalence of short positions).
🔶 Z-Score Calculation
The Z-Score is then calculated to standardize the BTC Ratio, allowing for comparison across different time periods. The Z-Score formula is:
Z = (X - μ) / σ
Where:
- X is the current BTC Ratio.
- μ is the mean of the BTC Ratio over a specified period (**`zScoreCalculationPeriod`**).
- σ is the standard deviation of the BTC Ratio over the same period.
The Z-Score helps quantify how far the current sentiment deviates from the historical norm, with high positive values indicating extreme bullish sentiment and high negative values signaling extreme bearish sentiment.
🔶 Signal Generation: Trading signals are derived from the Z-Score as follows:
Long Entry Signal: Occurs when the BTC Ratio Z-Score crosses above the thresholdLongEntry, suggesting bullish sentiment.
- Condition for Long Entry = BTC Ratio Z-Score > thresholdLongEntry
Long Exit/Short Entry Signal: Triggered when the BTC Ratio Z-Score drops below thresholdLongExit for exiting longs or below thresholdShortEntry for entering shorts, indicating a shift to bearish sentiment.
- Condition for Long Exit/Short Entry = BTC Ratio Z-Score < thresholdLongExit or BTC Ratio Z-Score < thresholdShortEntry
Short Exit Signal: Happens when the BTC Ratio Z-Score exceeds the thresholdShortExit, hinting at reducing bearish sentiment and a potential switch to bullish conditions.
- Condition for Short Exit = BTC Ratio Z-Score > thresholdShortExit
🔶Implementation and Visualization: The strategy applies these conditions for trade management, aligning with the selected trade direction. It visualizes the BTC Ratio Z-Score with horizontal lines at entry and exit thresholds, illustrating the current sentiment against historical norms.
█ Trade Direction
The strategy offers flexibility in trade direction, allowing users to choose between long, short, or both, depending on their market outlook and risk tolerance. This adaptability ensures that traders can align the strategy with their individual trading style and market conditions.
█ Usage
To employ this strategy effectively:
1. Customization: Begin by setting the trade direction and adjusting the Z-Score calculation period and entry/exit thresholds to match your trading preferences.
2. Observation: Monitor the Z-Score and its moving average for potential trading signals. Look for crossover events relative to the predefined thresholds to identify entry and exit points.
3. Confirmation: Consider using additional analysis or indicators for signal confirmation, ensuring a comprehensive approach to decision-making.
█ Default Settings
- Trade Direction: Determines if the strategy engages in long, short, or both types of trades, impacting its adaptability to market conditions.
- Timeframe Input: Influences signal frequency and sensitivity, affecting the strategy's responsiveness to market dynamics.
- Z-Score Calculation Period: Affects the strategy’s sensitivity to market changes, with longer periods smoothing data and shorter periods increasing responsiveness.
- Entry and Exit Thresholds: Set the Z-Score levels for initiating or exiting trades, balancing between capturing opportunities and minimizing false signals.
- Impact of Default Settings: Provides a balanced approach to leverage sentiment trading, with adjustments needed to optimize performance across various market conditions.
Correlation Table by VanHelsingCorrelation Table by VanHelsing
Explanation:
So we have three asset with correlation to current asset which is a BTC, also you can use it for ETH
But why only three assets? Because this one fits the best to identify a trend of BTC.
By using let's say a GOLD this table will be far away from accuracy then this three Nasdaq, ES1!(S&P500), DXY the best one for this.
Inside a script we have kama's
(Developed by Perry Kaufman, Kaufman's Adaptive Moving Average (KAMA) is a moving average designed to account for market noise or volatility. KAMA will closely follow prices when the price swings are relatively small and the noise is low. KAMA will adjust when the price swings widen and follow prices from a greater distance. This trend-following indicator can be used to identify the overall trend, time turning points and filter price movements.)
Now you know that KAMA is good solution for fast reaction of trend change and following it.
Now we have three assets with correlation to BTC and three kama's for them to know which trend is there.
Good!
What next?
Next is a scoring for up trend and down trend for BTC
For Understanding I will use DXY and BTC correlation
Lets consider that DXY is moving down and kama detected it,
we have down trend on DXY. How we can score it for BTC buy or sell?
Down trend DXY and negaive correlation to BTC lets say -0.5
In this way it scoring it like 0.5 for buy BTC, because if DXY moving down it means BTC moving up because of negative correlation.
Lets say DXY moving up and correlation with BTC is again -0.5
then what? It scoring -0.5 for sell BTC because since DXY moves up and correlation is negative BTC should move down.
Okay again what if DXY moving up and correlation is positive 0.5?
Then BTC is 0.5 for buy
What if DXY down correlation 0.5? Then BTC score for sell is -0.5
In first look it seems litle bit complicated, but actually it is not, it just take a time for understand. Hope you Enjoy this lesson and hope you will enjoy this indicator!
How to read a table:
Describtion about minimalistic mode
Altcoins capitalization histogram [peregringlk]This script superseeds "Other altcoins BTC capitalization histogram". The previous versions was a bit confusing in my opinion and lacked some generalization, so I'm now publishing this improved version.
It shows 6 pieces of info:
- Green columns: BTC price change for that day.
- Red bars: Altcoins capitalization change for that day, measured in bitcoins (altcoins_USD_capitalization / BTCUSD)
- Green/red background: green if that day the USD capitalization change was a gain, and red if it was a loss.
- Green line: accum BTC price change for the selected last days.
- Red line: accum altcoin capitalization change measured in BTC for the selected days.
- Dotted blue sequence: accum altcoin USD capitalization change for the selected days.
The base line of the histogram is 1 instead of 0, because I'm showing the price changes as multipliers (price change rates), so if there have been a +20% market movement, the calculated value will be 1.2, and if there have been a -20% market movement, then the value will be 0.8. 1 means no movement (preserved price/capitalization). Price and capitalization changes will be calculated using candle closes.
About the accumulated price changes, it will calculate the accumulated multiplication of the corresponding price change multipliers. For example, if you have set you want 3 days for the accumulation rates, and the last three days saw a -20%, +10% and +15% price/capitalization changes, the current value for the line will be 0.8*1.1*1.15 = 1.0120, or a +1.2% price change respect to the day before yesterday.
By default, if you are looking any ALTBTC market (for example, ETHBTC), instead of showing the USD and BTC capitalization of all alts, it will take the BTC and USD prices of the current market (the USD price will be calculated as ALTBTC * BTCUSD; and the BTCUSD price will be taken from BITSTAMP, the one with the longest BTC history I know in tradingview). If you are looking any other markets that is not paired with BTC, then it will take the USD capitalization of all altcoins, and the BTC capitalization will be calculated as altcoins_USD_capitalization / BTCUSD (from BITSTAMP as well).
Also, remember that, in both cases (alts capitalization or price), the graph will consistently respect the following rule:
- btc_usd_price_change * alt/capitalization_btc_price_change = alt_usd_price_change.
That applies for both the green/red bars respect to the background, and the green/red line respect to the blue dotted sequence.
Lastly, you may want to know if, in case btc price and altbtc price or capitalization go in opposite directions, who gain the battle? For example, if BTCUSD moved +20%, and an ALTBTC price moved -20%, the result is a loss, because 1.2*0.8 = 0.96, so the ALTUSD price or capitalization moved -4% (remember that, for preserving the USD value, if today's bitcoin change rate is x, the altbtc change rate must be 1/x; so for a -20% BTCUSD price movement, there must be at least a +25% ALTBTC price change to don't loss USD value, because 1/0.8 = 1.25). The background is what shows you that: if the background is green, it means that for that day there was a total USD gain of value, and when it's red, then it was a loss of USD value.
You can customize the following things:
- Accum change rate interval: the "selected days". By default 7.
- Take alts-capitalization?: By default unmarked. The effect when is unmarked is what I have explained in the previous paragraph. If you mark it, then it will use the USD_capitalization of all alts no matter what market you are looking right now.
- Which capitalization do you want? There are three options, that applies when "Take alts-capitalization?" is marked, or otherwise, when you are not looking a BTC-paired market.
- - - All-alts (default option): take CRYPTOCAP:TOTAL2 security as reference Alts-capitalization, which represents all altcoins.
- - - Other-alts: take CRYPTOCAP:OTHERS security as reference Alts-capitalization, which represents all altcoin except the 9 most capitalized alts.
- - - Big-alts: take CRYPTOCAP:TOTAL2 - CRYPTOCAP:OTHERS as reference Alts-capitalization, which represenst only the 9 most capitalized alts.
The idea of this script is:
A) Figuring out what is causing a USD value gain or loss, the alts market movements, or the BTC price change. So you can spot if some altcoin, or all altcoins combined, are gaining or loosing value by themselves or because of bitcoin.
B) Trying to spot or discover some patterns that allows you to identify altseasons. Once an altseason has been developed, the chart will show it in a pretty obvious way (massive red line bells and dotted blue lines with very high values during a period of various weeks). The hard problem is to spot it in advance, and maybe this graph can help.
CMC Macro Regime PanelOverview (what it is):
A macro‑regime gate built entirely from TradingView-native symbols (CRYPTOCAP, FRED, DXY/VIX, HYG/LQD). It aggregates central‑bank liquidity (Fed balance sheet − RRP − Treasury General Account), USD strength, credit conditions, stablecoin flows/dominance, tech beta and BTC–NDX co‑move into one normalized score (CLRC). The panel outputs Risk‑ON/OFF regimes, an Early 3/5 pre‑signal, and an automatic BTC vs ETH vs ALTs preference. It is intentionally scoped to Daily & Weekly reads (no intraday timing). Publish with a clean chart and a clear description as per TradingView rules.
TradingView
Why we also use other TradingView screens (and why that is compliant)
This script pulls data via request.security() from official TV symbols only; users often want to open the raw series on separate charts to sanity‑check:
CRYPTOCAP indices: TOTAL, TOTAL2, TOTAL3 (market cap aggregates) and dominance tickers like BTC.D, USDT.D. Helpful for regime & rotation (ALTs vs BTC). TradingView provides definitions for crypto market cap and dominance symbols.
TradingView
+3
TradingView
+3
TradingView
+3
FRED releases: WALCL (Fed assets, weekly), RRPONTSYD (ON RRP, daily), WTREGEN (TGA, weekly), M2SL (M2, monthly). These are the official macro sources exposed on TV.
FRED
+3
FRED
+3
FRED
+3
Risk proxies: TVC:DXY (USD index), TVC:VIX (implied vol), AMEX:HYG/AMEX:LQD (credit), NASDAQ:NDX (tech beta), BINANCE:ETHBTC. VIX/NDX relationship is well-documented; VIX measures 30‑day expected S&P500 vol.
TradingView
+2
TradingView
+2
Compliance note: Using multiple screens is optional for users, but it explains/justifies how components work together (a requirement for public scripts). Keep publication chart clean; use extra screens only to illustrate in the description.
TradingView
How it works (high level)
Liquidity block (Weekly/Monthly)
Net Liquidity = WALCL − RRPONTSYD − WTREGEN (YoY z‑score). WALCL is weekly (as of Wednesday) via H.4.1; RRP is daily; TGA is a Fed liability series. M2 YoY is monthly.
FRED
+3
FRED
+3
FRED
+3
Risk conditions (Daily)
DXY 3‑month momentum (inverted), VIX level (inverted), Credit (HYG/LQD ratio or HY OAS). VIX is a 30‑day constant‑maturity implied vol index per Cboe methodology.
Cboe
+1
Crypto‑internal (Daily)
Stablecoins (USDT+USDC+DAI 30‑day log change), USDT dominance (20‑day, inverted), TOTAL3 (63‑day momentum). Dominance symbols on TV follow a documented formula.
TradingView
Beta & co‑move (Daily)
NDX 63‑day momentum, BTC↔NDX 90‑day correlation.
All components become z‑scores (optionally clipped), weighted, missing inputs drop and weights renormalize. We never use lookahead; we confirm on bar close to avoid repainting per Pine docs (barstate.isconfirmed, multi‑TF).
TradingView
+2
TradingView
+2
What you see on the chart
White line (CLRC) = macro regime score.
Background: Green = Risk‑ON, Red = Risk‑OFF, Teal = Early 3/5 (pre‑signal).
Table: shows each component’s z‑score and the Preference: BTC / ETH / ALTs / Mixed.
Signals & interpretation
Designed for Daily (1D) and Weekly (1W) only.
Regime gates (default Fast preset):
Enter ON: CLRC ≥ +0.8; Hold ON while ≥ +0.5.
Enter OFF: CLRC ≤ −1.0; Hold OFF while ≤ −0.5.
0 / ±1 reading: CLRC is a standardized composite.
~0 = neutral baseline (no macro edge).
≥ +1 = strong macro tailwind (≈ +1σ).
≤ −1 = strong headwind (≈ −1σ).
Early 3/5 (teal): a fast pre‑signal when at least 3 of 5 daily checks align: USDT.D↓, DXY↓, VIX↓, HYG/LQD↑, ETHBTC↑ or TOTAL3↑. It often precedes a full ON flip—use for pre‑positioning rather than full sizing.
BTC/ETH/ALTs selector (only when ON):
ALTs when BTC.D↓ and (ETHBTC↑ or TOTAL3↑) ⇒ rotate down the risk curve.
BTC when BTC.D↑ and ETHBTC↓ ⇒ keep it concentrated.
ETH when ETHBTC↑ while BTC.D flat/up ⇒ add ETH beta.
(Dominance mechanics are documented by TV.)
TradingView
Dissonance (incompatibility) rules — when to stand down
Use these overrides to avoid false comfort:
CLRC > +1 but USDT.D↑ and/or VIX spikes day‑over‑day → downgrade to Neutral; wait for USDT.D to stabilize and VIX to cool (VIX is a fear gauge of 30‑day expectation).
Cboe Global Markets
CLRC > +1 but DXY↑ sharply (USD squeeze) → size below normal; require DXY momentum to roll over.
CLRC < −1 but Early 3/5 = true two days in a row → start reducing underweights; look for ON flip within a few bars.
NetLiq improving (W) but credit (HYG/LQD) deteriorating (D) → treat as mixed regime; prefer BTC over ALTs.
How to use (step‑by‑step)
A. Read on Daily (1D) — main regime
Open CRYPTOCAP:TOTAL3, 1D (panel applied).
Wait for bar close (use alerts on confirmed bar). Pine docs recommend barstate.isconfirmed to avoid repainting on realtime bars.
TradingView
If ON, check Preference (BTC / ETH / ALTs).
Then drop to 4H on your trading pair for micro entries (this indicator itself is not for intraday timing).
B. Confirm weekly macro (1W) — once per week)
Review WALCL/RRP/TGA after the H.4.1 release on Thursdays ~4:30 pm ET. WALCL is “Weekly, as of Wednesday”; M2 is Monthly—so do not expect daily responsiveness from these.
Federal Reserve
+2
FRED
+2
Recommended check times (practical schedule)
Daily regime read: right after your chart’s daily close (confirmed bar). For consistent timing across crypto, many users set chart timezone to UTC and read ~00:05 UTC; you can change chart timezone in TV’s settings.
TradingView
In‑day monitoring: optional spot checks 16:00 & 20:00 UTC (DXY/VIX move during US hours), but act only after the daily bar confirms.
Weekly macro pass: Thu 21:30–22:30 UTC (after H.4.1 4:30 pm ET) or Fri after daily close, to let weekly FRED series propagate.
Federal Reserve
Limitations & data latency (be explicit)
Higher‑TF data & confirmation: FRED weekly/monthly series will not reflect intraday risk in crypto; we aggregate them for regime, not for entry timing.
Repainting 101: Realtime bars move until close. This script does not use lookahead and follows Pine guidance on multi‑TF series; still, always act on confirmed bars.
TradingView
+1
Public‑library compliance: Title EN‑only; description starts in EN; clean chart; justify component mash‑up; no lookahead; no unrealistic claims.
TradingView
Alerts you can use
“Macro Risk‑ON (entry)” — fires on ON flip (confirmed bar).
“Macro Risk‑OFF (entry)” — fires on OFF flip.
“Early 3/5” — fires when the teal pre‑signal appears (not a regime flip).
“Preference change” — BTC/ETH/ALTs toggles while ON.
Publish note: Alerts are fine; just avoid implying guaranteed accuracy/performance.
TradingView
Background research (why these inputs matter)
Liquidity → Crypto: Fed H.4.1 timing and series definitions (WALCL, RRP, TGA) formalize the “net liquidity” concept used here.
FRED
+3
Federal Reserve
+3
FRED
+3
Stablecoins ↔ Non‑stable crypto: empirical work shows bi‑directional causality between stablecoin market cap and non‑stable crypto cap; stablecoin growth co‑moves with broader crypto activity.
Global liquidity link: world liquidity positively relates to total crypto market cap; lagged effects are observed at monthly horizons.
VIX/Uncertainty effect: fear shocks impair BTC’s “safe haven” behavior; VIX is a meaningful risk‑off read.
Dominance DashboardThe "Dominance Dashboard" is a TradingView indicator designed to provide traders with a clear and concise visual representation of Bitcoin Dominance (BTC.D). This script helps traders monitor BTC.D in real-time, offering insights into market dynamics and potential trading signals based on the changes in Bitcoin's market dominance.
Key Features
Real-Time BTC Dominance: Displays the current Bitcoin Dominance percentage.
Historical Comparison: Shows the previous day's Bitcoin Dominance for comparison.
Visual Indicators: Utilizes color-coded arrows to indicate changes in Bitcoin Dominance (increase or decrease).
Customizable Table Settings: Users can customize the position, size, and colors of the displayed table to suit their preferences.
How It Works
Data Retrieval: The script uses request.security to fetch the latest and previous day's BTC.D data.
Comparison Mechanism: It compares the current BTC Dominance with the previous day's value to determine whether BTC.D has increased, decreased, or remained unchanged.
Dynamic Table Display: Based on user preferences, the script dynamically adjusts the table's position, text size, and colors.
Using the Indicator
Table Settings:
Show Header: Toggle the visibility of the table header.
Position: Choose from various predefined positions (e.g., Top Right, Bottom Right) to place the dashboard on your chart.
Text Size: Select the text size (Tiny, Small, Normal, Large) for better readability.
Text and Border Colors: Customize the text and border colors to match your chart's theme.
Timeframe Settings:
Show Current BTC Dominance: Enable or disable the display of the current BTC Dominance percentage.
Underlying Concepts
BTC Dominance: Bitcoin Dominance (BTC.D) measures Bitcoin's market capitalization relative to the total market capitalization of all cryptocurrencies. Monitoring BTC.D helps traders understand the flow of capital in and out of Bitcoin compared to other cryptocurrencies.
Visual Change Indicators: The script uses simple arrow symbols (🔼 for an increase and 🔽 for a decrease) to provide quick visual cues about the direction of change in BTC Dominance. This feature helps traders quickly assess market conditions without deep analysis.
Practical Use Cases
Market Sentiment Analysis: A rising BTC Dominance could indicate a market shift towards Bitcoin, potentially signaling a bearish sentiment for altcoins. Conversely, a falling BTC Dominance might suggest increased interest in altcoins.
Trend Confirmation: Traders can use BTC Dominance trends to confirm their trading strategies. For example, if a trader is bullish on Bitcoin, an increasing BTC Dominance might reinforce their position.
Portfolio Management: By monitoring BTC Dominance, traders can make informed decisions about portfolio rebalancing between Bitcoin and other cryptocurrencies.
三维资金流向(多色版)1️⃣ Colors Correspond to Capital Flow
Based on your multi-color logic:
Green bars → BTC-only inflow
Blue bars → Major altcoins-only inflow
Yellow bars → BTC + major altcoins inflow simultaneously
Red bars → USDT inflow (risk-off / capital retreat)
On the chart, you can observe:
Red bars densely appearing → BTC and alt prices often consolidate or decline, indicating market funds are retreating to safety.
Green bars concentrated → BTC is generally in an uptrend, indicating capital is mainly flowing into BTC.
Blue bars appearing → Major altcoins may rise while BTC is flat, showing that altcoins are absorbing funds.
Yellow bars appearing → BTC and altcoins rise together, usually signaling an overall bullish market.
2️⃣ Observed Patterns
Capital flow vs price movement:
Green + Yellow bars concentrated → BTC shows clear upward movement
Blue bars concentrated → Altcoins rise noticeably
Red bars → Both BTC and altcoins may decline or consolidate
Capital rotation phenomenon:
Red → Green → Yellow → Blue → Can be seen as a rotation of USDT → BTC → BTC+Alt → Alt
This indicates that at different stages, the market rotates between risk-off, major assets, and altcoins.
Volatility:
Tall, frequently alternating bars → Market volatility is high
Short bars → Capital flow is weak, market tends to move sideways






















