Sinyal Gabungan Lengkap (TWAP + Vol + Waktu)Sinyal Gabungan Lengkap (TWAP + Vol + Waktu) volume btc dan total3 dan ema
Forecasting
Bull/Bear Flag + 9-21 EMA Cross with Targetssimple chart indicator help with buy sell targets using bear and bull flag along with moving averages on chart -helpful for beginner traders
🟥 Synthetic 10Y Real Yield (US10Y - Breakeven)This script calculates and plots a synthetic U.S. 10-Year Real Yield by subtracting the 10-Year Breakeven Inflation Rate (USGGBE10) from the nominal 10-Year Treasury Yield (US10Y).
Real yields are a core macro driver for gold, crypto, growth stocks, and bond pricing, and are closely monitored by institutional traders.
The script includes key reference lines:
0% = Below zero = deeply accommodative regime
1.5% = Common threshold used by macro desks to evaluate gold upside breakout conditions
📈 Use this to monitor macro shifts in real-time and front-run capital flows during major CPI, NFP, and Fed events.
Update Frequency: Daily (based on Treasury market data)
Spiderlines BTCUSD - daily/weekly📘 Documentation – Daily and Weekly Spider Lines for Bitcoin
🔹 Purpose of the Script
This script draws dynamic “Spider Lines” in the Bitcoin chart.
The lines connect certain historical candles with a reference candle and extend to the right.
These act as guideline levels that can serve as potential support or resistance zones.
🔹 How It Works
The script operates in two modes, depending on the active chart timeframe:
Weekly Mode (timeframe.isweekly)
The reference date is July 1, 2019.
The number of weeks since that date is calculated.
This defines the connection candle (connection_candle).
Several predefined offsets (e.g., +32, +34, +36 …) are added to the reference to determine starting candles.
Lines are drawn from these candles toward the connection candle.
→ Line color: green
Daily Mode (timeframe.isdaily)
Same reference date: July 1, 2019.
The number of days since that date is calculated.
Again, a connection candle is set.
A different set of offsets (e.g., +224, +238, +252 …) defines the starting candles.
Lines are drawn accordingly.
→ Line color: red
🔹 Line Logic
Each line connects:
Start → bar_index at high
End → bar_index at close
Lines are extended indefinitely to the right (extend.right).
Appearance: dashed style, width 2.
🔹 Error Handling
If a calculated candle index does not exist in the chart history (e.g., chart data does not go back far enough),
a label is plotted in the chart showing the message:
"Daily idx out of range: 252"
This way, missing lines can be diagnosed easily.
🔹 Color Convention
Weekly Spider Lines → Green
Daily Spider Lines → Red
🔹 Use Cases
Visualization of historical cyclic line patterns.
Helps in technical chart analysis: spotting potential reaction zones in price movement.
Designed mainly for long-term traders and analysts observing Bitcoin in Daily or Weekly timeframes.
🔹 Limitations
Works only on Daily and Weekly charts.
Requires chart data going back to July 1, 2019.
Based purely on fixed offsets → not a classical indicator like Moving Averages or RSI.
Analyst Targets ProbabilityThis indicator calculates the probability of the current stock price reaching or exceeding the analyst-provided high, average, and low price targets within a one-year time horizon. It utilizes a geometric Brownian motion (GBM) model, a standard approach in financial modeling that assumes log-normal price distribution with constant volatility.
### Key Features:
- **Analyst Targets**: Automatically pulls the high, average, and low one-year price targets from TradingView's syminfo data.
- **Risk-Free Rate**: Fetched from the 1-year US Treasury yield (symbol: TVC:US01Y). Defaults to 4% if unavailable.
- **Dividend Yield**: Uses trailing twelve-month (TTM) dividends per share (DPS) from financial data, divided by current price. Defaults to 0% if unavailable.
- **Volatility**: Computed as annualized historical volatility based on 252 trading days of daily log returns. Falls back to a 20-day period if insufficient data, or defaults to 30% if still unavailable.
- **Probability Calculation**: Employs the barrier hitting probability formula under GBM:
- Drift (μ) = risk-free rate - dividend yield - (volatility² / 2)
- The formula for probability P of hitting target H from current price S₀ over time T is:
P = Φ(d₊) + (H / S₀)^p ⋅ Φ(d₋) for H > S₀ (or adjusted for H < S₀)
Where l = ln(max(H, S₀)/min(H, S₀)), ν = drift, p = -2ν / σ², d₊ = (-l + νT) / (σ√T), d₋ = (-l - νT) / (σ√T), and Φ is the standard normal CDF (approximated using a polynomial method for accuracy).
- **Output Display**: A table in the top-right corner shows each target type, its value, and the estimated probability (as a percentage). "N/A" appears if data is unavailable or calculations cannot proceed (e.g., zero volatility).
### Assumptions and Limitations:
- Assumes constant volatility and drift, no transaction costs, and continuous trading (real markets may deviate due to jumps, news events, or changing conditions).
- Probabilities are model-based estimates and not guarantees; they represent the likelihood under risk-neutral measure.
- Best suited for stocks with available analyst targets and historical data; may default to assumptions for less-liquid symbols.
- No user inputs required—fully automated using TradingView's data sources.
This script is provided under the Mozilla Public License 2.0. For educational and informational purposes only; not financial advice. Test on your charts and consider backtesting for validation.
𝑨𝒔𝒕𝒂𝒓 - TyrAstar – Tyr is a dynamic RSI system with adaptive EMA and divergence detection.
@v1.0
Dynamic RSI period adjusts to volatility & market activity
Adaptive EMA smooths RSI with variable length
Optional Gaussian Kernel smoothing for noise reduction
Highlights bullish & bearish divergences automatically
Clean visualization with color coding and fills
Works in real time with no repainting
PDD — Pullback & Breakout Alerts (PopsStocks) • INDICATOR🟢 Trader-Friendly (simple & clear)
Description:
This indicator highlights pullback and breakout trade opportunities on PDD (Pinduoduo). It automatically marks pullback buy zones, breakout levels, stops, and profit targets. Signals are based on bullish reversal candles (inside pullback zones) and confirmed breakouts above resistance. Includes optional EMAs for trend context and built-in alerts, making it easy to catch setups in real time.
🔵 Technical/Backtest-Friendly (for advanced users)
Description:
A price-action-based tool for identifying structured entries on PDD (Pinduoduo). The script plots dynamic pullback zones, breakout resistance levels, stops, and risk/reward targets. Signal logic combines candlestick reversals (bullish engulfing, hammer), volume filters, and optional higher-low buildup checks. 20/50 EMA overlays provide trend confirmation. Designed for traders who want defined rules, alert automation, and clear risk-to-reward planning.
Monthly MA Box for S&P 500 or othersThis moving average helps detect when the asset is undervalued or overvalued. Users can adjust the spread between the moving averages.
Major Wars with a signifiant economic impactThis indicator highlights major wars that have had a significant economic impact worldwide. It allows users to easily see their effects on the charts.
Dow Theory Indicator## 🎯 Key Features of the Indicator
### 📈 Complete Implementation of Dow Theory
- Three-tier trend structure: primary trend (50 periods), secondary trend (20 periods), and minor trend (10 periods).
- Swing point analysis: automatically detects critical swing highs and lows.
- Trend confirmation mechanism: strict confirmation logic based on consecutive higher highs/higher lows or lower highs/lower lows.
- Volume confirmation: ensures price moves are supported by trading volume.
### 🕐 Flexible Timeframe Parameters
All key parameters are adjustable, making it especially suitable for U.S. equities:
Trend analysis parameters:
- Primary trend period: 20–200 (default 50; recommended 50–100 for U.S. stocks).
- Secondary trend period: 10–100 (default 20; recommended 15–30 for U.S. stocks).
- Minor trend period: 5–50 (default 10; recommended 5–15 for U.S. stocks).
Dow Theory parameters:
- Swing high/low lookback: 5–50 (default 10).
- Trend confirmation bar count: 1–10 (default 3).
- Volume confirmation period: 10–100 (default 20).
### 🇺🇸 U.S. Market Optimizations
- Session awareness: distinguishes Regular Trading Hours (9:30–16:00 EST) from pre-market and after-hours.
- Pre/post-market weighting: adjustable weighting factor for signals during extended hours.
- Earnings season filter: automatically adjusts sensitivity during earnings periods.
- U.S.-optimized default parameters.
## 🎨 Visualization
1. Trend lines: three differently colored trend lines.
2. Background fill: green (uptrend) / red (downtrend) / gray (neutral).
3. Signal markers: arrows, labels, and warning icons.
4. Swing point markers: small triangles at key turning points.
5. Info panel: real-time display of eight key metrics.
## 🚨 Alert System
- Trend turning to up/down.
- Strong bullish/bearish signals (dual confirmation).
- Volume divergence warning.
- New swing high/low formed.
## 📋 How to Use
1. Open the Pine Editor in TradingView.
2. Copy the contents of dow_theory_indicator.pine.
3. Paste and click “Add to chart.”
4. Adjust parameters based on trading style:
- Long-term investing: increase all period parameters.
- Swing trading: use the default parameters.
- Short-term trading: decrease all period parameters.
## 💡 Parameter Tips for U.S. Stocks
- Large-cap blue chips (AAPL, MSFT): primary 60–80, secondary 25–30.
- Mid-cap growth stocks: primary 40–60, secondary 18–25.
- Small-cap high-volatility stocks: primary 30–50, secondary 15–20.
Reference Point Extension StrategyThe script accepts the user to enter a date and time when live market starts trading. ex. Nasdaq starts live trading at 9.30 am New York time. Based on the time & candle characteristics and mathematical calculation it draws 2 line RED & green which are no trade zones and breakout on either side can result in achieving the marked targets. Wait for a candle to close above or below the no trade zone and next candle to break its high or low. Put the SL above or below the RED or Green line.
SMC Analysis - Fair Value Gaps (Enhanced)SMC Analysis - Fair Value Gaps (Enhanced) Script Summary
Overview
The "SMC Analysis - Fair Value Gaps (Enhanced)" script, written in Pine Script (version 6), is a technical analysis indicator designed for TradingView to identify and visualize Fair Value Gaps (FVGs) on a price chart. It supports both the main timeframe and multiple higher timeframes (MTF) for comprehensive market analysis. FVGs are price gaps formed by a three-candle pattern, indicating potential areas of market inefficiency where price may return to fill the gap.
Key Features
FVG Detection:
Identifies bullish FVGs: Occur when the high of a candle two bars prior is lower than the low of the current candle, with the middle candle being bullish (close > open).
Identifies bearish FVGs: Occur when the low of a candle two bars prior is higher than the high of the current candle, with the middle candle being bearish (close < open).
Visualizes FVGs as colored boxes on the chart (green for bullish, red for bearish).
Mitigation Tracking:
Tracks when FVGs are touched (price overlaps the gap range) or mitigated (price fully closes the gap).
Strict Mode: Marks an FVG as mitigated when price touches the gap range.
Normal Mode: Requires a full breakthrough (price crossing the gap’s bottom for bullish FVGs or top for bearish FVGs) for mitigation.
Optionally converts FVG box borders to dashed lines and increases transparency when partially touched.
Multi-Timeframe (MTF) Support:
Analyzes FVGs on three user-defined higher timeframes (default: 15m, 60m, 240m).
Displays MTF FVGs with distinct labels and slightly more transparent colors.
Ensures no duplicate processing of MTF bars to maintain performance.
Customization Options:
FVG Length: Adjustable duration for how long FVGs are displayed (default: 20 bars).
Show/Hide FVGs: Toggle visibility for main timeframe and each MTF.
Color Customization: User-defined colors for bullish and bearish FVGs (default: green and red).
Display Options: Toggle for showing dashed lines after partial touches and strict mitigation mode.
Performance Optimization:
Limits the number of displayed boxes (50 for main timeframe, 20 per MTF) to prevent performance issues.
Automatically removes older boxes to maintain a clean chart.
Functionality
Visualization: Draws boxes around detected FVGs, with customizable colors and text labels ("FVG" for main timeframe, "FVG " for MTF).
Dynamic Updates: Extends or terminates FVG boxes based on mitigation status and user settings.
Efficient Storage: Uses arrays to manage FVG data (boxes, tops, bottoms, indices, mitigation status, and touch status) separately for main and MTF analyses.
Use Case
This indicator is designed for traders using Smart Money Concepts (SMC) to identify areas of market inefficiency (FVGs) for potential price reversals or continuations. The MTF support allows analysis across different timeframes, aiding in confirming trends or spotting higher-timeframe support/resistance zones.
Seasonality - Multiple Timeframes📊 Seasonality - Multiple Timeframes
🎯 What This Indicator Does
This advanced seasonality indicator analyzes historical price patterns across multiple configurable timeframes and projects future seasonal behavior based on statistical averages. Unlike simple seasonal overlays, this indicator provides gap-resistant architecture specifically designed for commodity futures markets and other instruments with contract rolls.
🔧 Key Features
Multiple Timeframe Analysis
Three Independent Timeframes: Configure separate historical periods (e.g., 5Y, 10Y, 15Y) for comprehensive analysis
Individual Control: Enable/disable historical lines and projections independently for each timeframe
Color Customization: Distinct colors for historical patterns and future projections
Advanced Architecture
Gap-Resistant Design: Handles missing data and contract rolls in futures markets seamlessly
Calendar-Day Normalization: Uses 365-day calendar system for accurate seasonal comparisons
Outlier Filtering: Automatically excludes extreme price movements (>10% daily changes)
Roll Detection: Identifies and excludes contract roll periods to maintain data integrity
Real-Time Projections
Forward-Looking Analysis: Projects seasonal patterns into the future based on remaining calendar days
Configurable Projection Length: Adjust forecast period from 10 to 150 bars
Data Interpolation: Optional gap-filling for smoother seasonal curves
📈 How It Works
Data Collection Process
The indicator collects daily price returns for each calendar day (1-365) over your specified historical periods. For each timeframe, it:
Calculates daily returns while excluding roll periods and outliers
Accumulates these returns by calendar day across multiple years
Computes average seasonal performance from January 1st to current date
Projects remaining seasonal pattern based on historical averages
🎯 Designed For
Primary Use Cases
Commodity Futures Trading: Corn, soybeans, coffee, sugar, cocoa, natural gas, crude oil
Seasonal Strategy Development: Identify optimal entry/exit timing based on historical patterns
Pattern Validation: Confirm seasonal tendencies across different time horizons
Market Timing: Compare current performance against historical seasonal expectations
Trading Applications
Trend Confirmation: Use multiple timeframes to validate seasonal direction
Risk Assessment: Understand seasonal volatility patterns
Position Sizing: Adjust exposure based on seasonal performance consistency
Calendar Spread Analysis: Identify seasonal price relationships
⚙️ Configuration Guide
Timeframe Setup
Configure each timeframe independently:
Years: Set historical lookback period (1-20 years)
Historical Display: Show/hide the seasonal pattern line
Projection Display: Enable/disable future seasonal projection
Colors: Customize line colors for visual clarity
Display Options
Current YTD: Compare actual year-to-date performance
Info Table: Detailed performance comparison across timeframes
Projection Bars: Control forward-looking projection length
Fill Gaps: Interpolate missing data points for smoother curves
Debug Features
Enable debug mode to validate data quality:
Data Point Counts: Verify sufficient historical data per calendar day
Roll Detection Status: Monitor contract roll identification
Empty Days Analysis: Identify potential data gaps
Calculation Verification: Debug seasonal price computations
📊 Interpretation Guidelines
Strong Seasonal Signal
All three timeframes align in the same direction
Current price follows seasonal expectation
Sufficient data points (>3 years minimum per timeframe)
Seasonal Divergence
Different timeframes show conflicting patterns
Recent years deviate from longer-term averages
Current price significantly above/below seasonal expectation
Data Quality Indicators
Green Status: Adequate data across all calendar days
Red Warnings: Insufficient data or excessive gaps
Roll Detection: Proper handling of futures contract changes
⚠️ Important Considerations
Data Requirements
Minimum History: At least 3-5 years for reliable seasonal analysis
Continuous Data: Best results with daily continuous contract data
Market Hours: Designed for traditional market session data
Limitations
Past Performance: Historical patterns don't guarantee future results
Market Changes: Structural shifts can alter traditional seasonal patterns
External Factors: Weather, geopolitics, and policy changes affect seasonal behavior
Contract Rolls: Some data gaps may occur during futures roll periods
🔍 Technical Specifications
Performance Optimizations
Array Management: Efficient data storage using Pine Script arrays
Gap Handling: Robust price calculation with fallback mechanisms
Memory Usage: Optimized for large historical datasets (max_bars_back = 4000)
Real-Time Updates: Live calculation updates as new data arrives
Calculation Accuracy
Outlier Filtering: Excludes daily moves >10% to prevent data distortion
Roll Detection: 8% threshold for identifying contract changes
Data Validation: Multiple checks for price continuity and data integrity
🚀 Getting Started
Add to Chart: Apply indicator to your desired futures contract or commodity
Configure Timeframes: Set historical periods (recommend 5Y, 10Y, 15Y)
Enable Projections: Turn on future seasonal projections for forward guidance
Validate Data: Use debug mode initially to ensure sufficient historical data
Interpret Patterns: Compare current price action against seasonal expectations
💡 Pro Tips
Multiple Confirmations: Use all three timeframes for stronger signal validation
Combine with Technicals: Integrate seasonal analysis with technical indicators
Monitor Divergences: Pay attention when current price deviates from seasonal pattern
Adjust for Volatility: Consider seasonal volatility patterns for position sizing
Regular Updates: Recalibrate settings annually to maintain relevance
---
This indicator represents years of development focused on commodity market seasonality. It provides institutional-grade seasonal analysis previously available only to professional trading firms.
Machine Learning : Neural Network Prediction -EasyNeuro-Machine Learning: Neural Network Prediction
— An indicator that learns and predicts price movements using a neural network —
Overview
The indicator “Machine Learning: Neural Network Prediction” uses price data from the chart and applies a three-layer Feedforward Neural Network (FNN) to estimate future price movements.
Key Features
Normally, training and inference with neural networks require advanced programming languages that support machine learning frameworks (such as TensorFlow or PyTorch) as well as high-performance hardware with GPUs. However, this indicator independently implements the neural network mechanism within TradingView’s Pine Script environment, enabling real-time training and prediction directly on the chart.
Since Pine Script does not support matrix operations, the backpropagation algorithm—necessary for neural network training—has been implemented entirely through scalar operations. This unique approach makes the creation of such a groundbreaking indicator possible.
Significance of Neural Networks
Neural networks are a core machine learning method, forming the foundation of today’s widely used generative AI systems, such as OpenAI’s GPT and Google’s Gemini. The feedforward neural network adopted in this indicator is the most classical architecture among neural networks. One key advantage of neural networks is their ability to perform nonlinear predictions.
All conventional indicators—such as moving averages and oscillators like RSI—are essentially linear predictors. Linear prediction inherently lags behind past price fluctuations. In contrast, nonlinear prediction makes it theoretically possible to dynamically anticipate future price movements based on past patterns. This offers a significant benefit for using neural networks as prediction tools among the multitude of available indicators.
Moreover, neural networks excel at pattern recognition. Since technical analysis is largely based on recognizing market patterns, this makes neural networks a highly compatible approach.
Structure of the Indicator
This indicator is based on a three-layer feedforward neural network (FNN). Every time a new candlestick forms, the model samples random past data and performs online learning using stochastic gradient descent (SGD).
SGD is known as a more versatile learning method compared to standard gradient descent, particularly effective for uncertain datasets like financial market price data. Considering Pine Script’s computational constraints, SGD is a practical choice since it can learn effectively from small amounts of data. Because online learning is performed with each new candlestick, the indicator becomes a little “smarter” over time.
Adjustable Parameters
Learning Rate
Specifies how much the network’s parameters are updated per training step. Values between 0.0001 and 0.001 are recommended. Too high causes divergence and unstable predictions, while too low prevents sufficient learning.
Iterations per Online Learning Step
Specifies how many training iterations occur with each new candlestick. More iterations improve accuracy but may cause timeouts if excessive.
Seed
Random seed for initializing parameters. Changing the seed may alter performance.
Architecture Settings
Number of nodes in input and hidden layers:
Increasing input layer nodes allows predictions based on longer historical periods. Increasing hidden layer nodes increases the network’s interpretive capacity, enabling more flexible nonlinear predictions. However, more nodes increase computational cost exponentially, risking timeouts and overfitting.
Hidden layer activation function (ReLU / Sigmoid / Tanh):
Sigmoid:
Classical function, outputs between 0–1, approximates a normal distribution.
Tanh:
Similar to Sigmoid but outputs between -1 and 1, centered around 0, often more accurate.
ReLU:
Simple function (outputs input if ≥ 0, else 0), efficient and widely effective.
Input Features (selectable and combinable)
RoC (Rate of Change):
Measures relative price change over a period. Useful for predicting movement direction.
RSI (Relative Strength Index):
Oscillator showing how much price has risen/fallen within a period. Widely used to anticipate direction and momentum.
Stdev (Standard Deviation, volatility):
Measures price variability. Useful for volatility prediction, though not directional.
Optionally, input data can be smoothed to stabilize predictions.
Other Parameters
Data Sampling Window:
Period from which random samples are drawn for SGD.
Prediction Smoothing Period:
Smooths predictions to reduce spikes, especially when RoC is used.
Prediction MA Period:
Moving average applied to smoothed predictions.
Visualization Features
The internal state of the neural network is displayed in a table at the upper-right of the chart:
Network architecture:
Displays the structure of input, hidden, and output layers.
Node activations:
Shows how input, hidden, and output node values dynamically change with market conditions.
This design allows traders to intuitively understand the inner workings of the neural network, which is often treated as a black box.
Glossary of Terms
Feature:
Input variables fed to the model (RoC/RSI/Stdev).
Node/Unit:
Smallest computational element in a layer.
Activation Function:
Nonlinear function applied to node outputs (ReLU/Sigmoid/Tanh).
MSE (Mean Squared Error):
Loss function using average squared errors.
Gradient Descent (GD/SGD):
Optimization method that gradually adjusts weights in the direction that reduces loss.
Online Learning:
Training method where the model updates sequentially with each new data point.
Event Contract Signal Predictor [10-min Chart]Description:
This script is designed for high-probability event contract trading on 10-minute charts. It combines proprietary LSMA wave trend analysis with custom high-pass filtering and dynamic volume-based order book detection to generate precise long and short entry signals.
Key Features:
• LSMA Wave Trend: Captures short-term momentum with a custom linear regression over smoothed RSI values.
• High-Pass Filter & Peak Detection: Reduces noise and identifies extreme price movements for precise timing.
• Dynamic Order Book Ratio: Monitors buy/sell volume imbalance in real-time to confirm trade validity.
• Signal Confluence: Long or short signals appear only when multiple conditions align (trend, momentum, volume), reducing false triggers.
• Immediate Signal Display: Signals appear on the first candle after condition confirmation; no need to wait for candle close.
• Adjustable Parameters: Users can customize resonance thresholds, smoothing periods, and trigger sensitivity for different markets.
How to Use:
1. Apply the script to a 10-minute chart.
2. Observe green circles (long) and red circles (short) marking potential entries.
3. Combine with your risk management strategy for optimal results.
Note:
This script is closed-source to protect proprietary logic. While the exact calculations are not revealed, this description provides enough context for traders to understand how signals are generated and applied.
ESTP MeterAuto Entry/SL/TP + Meter (no dashboard / no MA50 plot / no fixed levels)
Idea
The indicator builds Entry / SL / TP1–TP3 zones and highlights bars when the odds of trend continuation are high. Under the hood it runs a multi-factor Meter with HTF filtering, volume, volatility, and breakout context. It does not draw a dashboard, MA50 line, or fixed levels — only the working zones and setup highlights.
How it works
Signal LONG/SHORT comes from a combo of:
RSI(14), MACD (line/signal/hist), and trend vs SMA50 (used internally only, not plotted).
HTF filter (tfHTF): direction alignment on the higher timeframe via EMA50, RSI, MACD-hist.
Breakout factor: a brLen lookback high/low break in the trend direction boosts the score.
Meter/Score (0–100): weighted sum of RVOL, ATR%, TREND, ADX, BREAK, with a chop penalty when EMA20–EMA50 gap is small.
Bar highlight: when Score ≥ 70 and there’s a breakout in the aligned trend direction.
Zones:
On signal change (bar close) it pins Entry at the close.
SL: at the most recent confirmed pivot (5×5). If no pivot yet, a fallback SL = ±2% from Entry.
TP1/TP2/TP3: from wave = |Entry − SL| using your Fib multipliers.
Zones are drawn 20 bars forward with labels for Entry/SL/TP.
Key Inputs
TP1/TP2/TP3 Fib: 0.618 / 1.0 / 1.618 by default.
HTF (tfHTF): higher-timeframe filter (default 60m).
brLen: breakout lookback (suggest 20–50).
rvolMin / atrNorm: normalization floors for relative volume and ATR%.
emaBandMin: minimum EMA20–EMA50 gap; below this, score is penalized.
showBarHL: toggle bar highlighting.
Note: adxMin is reserved for future use (not enforced as a hard filter in this version).
Practical use
Timeframes: best from M15 to H4. On M1–M5, raise brLen and rvolMin to fight noise.
Markets: liquid futures/crypto/FX. For thin symbols, reduce RVOL impact.
Exits: scale out across TP1/TP2/TP3; after TP1, move to break-even.
Context filter: trade only when HTF & LTF align (built into the logic).
Risk: position size from SL distance; keep risk ≤ 1–2% per trade.
Caveats (repainting / behavior)
Pivot-based SL confirms after 5 bars — by design it’s delayed. Until then, a ±2% safety SL is used.
Zones/labels are placed on bar close when the signal flips — this reduces flicker and intrabar artifacts.
HTF data uses request.security — prefer closed bars to avoid intrabar higher-TF whipsaws.
This is an indicator, not a strategy; no guarantees. Forward-test and tune per market/TF.
Suggested presets
Trend/Swing (H1–H4): brLen=30–50, rvolMin=1.2–1.5, atrNorm=0.02–0.03, emaBandMin=0.002–0.004.
Intraday (M15–M30): brLen=20–30, rvolMin=1.1–1.3, atrNorm=0.03–0.05, emaBandMin=0.0015–0.003.
Futty (Futures Lot Calculator)Futty – Futures Risk & Position Sizing Tool
Futty is a risk management and position sizing indicator designed for futures traders.
It automatically detects the dollar value per point for popular CME futures (Equity, Forex, Commodities, Bonds, Metals, etc.) and helps you calculate the optimal lot size based on:
Account size 💰
Risk percentage (%)
Entry, Stop Loss, and Take Profit levels
The indicator plots Entry, SL, and TP zones on the chart, shows risk/reward labels, and provides a clean info table displaying account size, risk %, dollar per point, cash at risk, and recommended lot size.
With Futty, you can trade with clarity, knowing your exact risk exposure and position size before entering any futures trade.
TLThe Trade Lean Indicator is a custom-built market tool designed for traders who want a clean, professional, and actionable view of price action without unnecessary noise. It combines trend tracking, liquidity mapping, and momentum signals into a single framework that adapts across multiple timeframes.
Unlike generic indicators, Trade Lean focuses on clarity over clutter. It highlights the key zones that truly matter: supply and demand levels, liquidity pockets, and directional momentum shifts. Whether you’re day trading, swing trading, or just scanning charts for setups, the indicator helps you quickly identify:
Trend bias (bullish, bearish, or neutral)
Liquidity zones where market reactions are most likely
Momentum impulses vs corrective moves
Breakout and recovery points to confirm direction
This makes it easier to lean into high-probability setups and avoid overtrading.
Planetary Speed - CEPlanetary Speed - Community Edition
Welcome to the Planetary Speed - Community Edition , a specialized tool designed to enhance W.D. Gann-inspired trading by plotting the speed of selected planets. This indicator measures changes in planetary ecliptic longitudes, which may correlate with market timing and volatility, making it ideal for traders analyzing equities, forex, commodities, and cryptocurrencies.
Overview
The Planetary Speed - Community Edition calculates the speed of a chosen planet (Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, or Pluto) by comparing its ecliptic longitude across time. Supporting heliocentric and geocentric modes, the script plots speed data with high precision across various chart timeframes, particularly for markets open 24/7 like cryptocurrencies. Traders can customize line colors and add multiple instances for multi-planet analysis, aligning with Gann’s belief that planetary cycles influence market trends.
Key Features
Plots the speed of eight planets (Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto) based on ecliptic longitude changes
Supports heliocentric and geocentric modes for flexible analysis
Customizes line colors for clear visualization of planetary speed data
Projects future speed data up to 250 days with daily resolution
Works across default TradingView timeframes (except monthly) for continuous markets
Enables multiple script instances for tracking different planets on the same chart
How to Use
Access the script’s settings to configure preferences
Choose a planet from Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, or Pluto
Select heliocentric or geocentric mode for calculations
Customize the line color for speed data visualization
Review plotted speed data to identify potential market timing or volatility shifts
Add multiple instances to track different planets simultaneously
Get Started
The Planetary Speed - Community Edition provides full functionality for astrological market analysis. Designed to highlight Gann’s planetary cycles, this tool empowers traders to explore celestial influences. Trade wisely and harness the power of planetary speed!
Planetary Signs - CEPlanetary Signs - Community Edition
Welcome to the Planetary Signs - Community Edition , a specialized tool designed to enhance W.D. Gann-inspired trading by highlighting zodiac sign transitions for selected planets. This indicator marks when planets enter specific zodiac signs, which may correlate with market turning points, making it ideal for traders analyzing equities, forex, commodities, and cryptocurrencies.
Overview
The Planetary Signs - Community Edition calculates the ecliptic longitude of a chosen planet (Sun, Moon, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, or Pluto) and highlights periods when it enters user-selected zodiac signs (Aries, Taurus, Gemini, etc.). Supporting heliocentric and geocentric modes, the script plots sign transitions with minute-level accuracy, syncing perfectly with chart timeframes. Traders can customize colors for each sign and add multiple instances for multi-planet analysis, aligning with Gann’s belief that zodiac transitions influence market trends.
Key Features
Highlights zodiac sign transitions for ten celestial bodies (Sun, Moon, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto)
Supports heliocentric and geocentric modes (Pluto heliocentric-only; Sun and Moon geocentric)
Allows selection of one or multiple zodiac signs with customizable highlight colors
Plots vertical lines and labels (e.g., “☿ 0 ♈ Aries”) at sign transitions with minute-level accuracy
Projects future sign transitions up to 120 days with daily resolution
Enables multiple script instances for tracking different planets or signs on the same chart
How to Use
Access the script’s settings to configure preferences
Choose a planet from the Sun, Moon, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, or Pluto
Select one or more zodiac signs (e.g., Aries, Taurus) to highlight
Customize the highlight color for each selected zodiac sign
Select heliocentric or geocentric mode for calculations
Review highlighted periods and labeled lines to identify zodiac sign transitions
Use transitions to anticipate potential market turning points, integrating Gann’s astrological principles
Get Started
The Planetary Signs - Community Edition provides full functionality for astrological market analysis. Designed to highlight Gann’s zodiac cycles, this tool empowers traders to explore celestial transitions. Trade wisely and harness the power of planetary alignments!
Martingale Strategy Simulator [BackQuant]Martingale Strategy Simulator
Purpose
This indicator lets you study how a martingale-style position sizing rule interacts with a simple long or short trading signal. It computes an equity curve from bar-to-bar returns, adapts position size after losing streaks, caps exposure at a user limit, and summarizes risk with portfolio metrics. An optional Monte Carlo module projects possible future equity paths from your realized daily returns.
What a martingale is
A martingale sizing rule increases stake after losses and resets after a win. In its classical form from gambling, you double the bet after each loss so that a single win recovers all prior losses plus one unit of profit. In markets there is no fixed “even-money” payout and returns are multiplicative, so an exact recovery guarantee does not exist. The core idea is unchanged:
Lose one leg → increase next position size
Lose again → increase again
Win → reset to the base size
The expectation of your strategy still depends on the signal’s edge. Sizing does not create positive expectancy on its own. A martingale raises variance and tail risk by concentrating more capital as a losing streak develops.
What it plots
Equity – simulated portfolio equity including compounding
Buy & Hold – equity from holding the chart symbol for context
Optional helpers – last trade outcome, current streak length, current allocation fraction
Optional diagnostics – daily portfolio return, rolling drawdown, metrics table
Optional Monte Carlo probability cone – p5, p16, p50, p84, p95 aggregate bands
Model assumptions
Bar-close execution with no slippage or commissions
Shorting allowed and frictionless
No margin interest, borrow fees, or position limits
No intrabar moves or gaps within a bar (returns are close-to-close)
Sizing applies to equity fraction only and is capped by your setting
All results are hypothetical and for education only.
How the simulator applies it
1) Directional signal
You pick a simple directional rule that produces +1 for long or −1 for short each bar. Options include 100 HMA slope, RSI above or below 50, EMA or SMA crosses, CCI and other oscillators, ATR move, BB basis, and more. The stance is evaluated bar by bar. When the stance flips, the current trade ends and the next one starts.
2) Sizing after losses and wins
Position size is a fraction of equity:
Initial allocation – the starting fraction, for example 0.15 means 15 percent of equity
Increase after loss – multiply the next allocation by your factor after a losing leg, for example 2.00 to double
Reset after win – return to the initial allocation
Max allocation cap – hard ceiling to prevent runaway growth
At a high level the size after k consecutive losses is
alloc(k) = min( cap , base × factor^k ) .
In practice the simulator changes size only when a leg ends and its PnL is known.
3) Equity update
Let r_t = close_t / close_{t-1} − 1 be the symbol’s bar return, d_{t−1} ∈ {+1, −1} the prior bar stance, and a_{t−1} the prior bar allocation fraction. The simulator compounds:
eq_t = eq_{t−1} × (1 + a_{t−1} × d_{t−1} × r_t) .
This is bar-based and avoids intrabar lookahead. Costs, slippage, and borrowing costs are not modeled.
Why traders experiment with martingale sizing
Mean-reversion contexts – if the signal often snaps back after a string of losses, adding size near the tail of a move can pull the average entry closer to the turn
Behavioral or microstructure edges – some rules have modest edge but frequent small whipsaws; size escalation may shorten time-to-recovery when the edge manifests
Exploration and stress testing – studying the relationship between streaks, caps, and drawdowns is instructive even if you do not deploy martingale sizing live
Why martingale is dangerous
Martingale concentrates capital when the strategy is performing worst. The main risks are structural, not cosmetic:
Loss streaks are inevitable – even with a 55 percent win rate you should expect multi-loss runs. The probability of at least one k-loss streak in N trades rises quickly with N.
Size explodes geometrically – with factor 2.0 and base 10 percent, the sequence is 10, 20, 40, 80, 100 (capped) after five losses. Without a strict cap, required size becomes infeasible.
No fixed payout – in gambling, one win at even odds resets PnL. In markets, there is no guaranteed bounce nor fixed profit multiple. Trends can extend and gaps can skip levels.
Correlation of losses – losses cluster in trends and in volatility bursts. A martingale tends to be largest just when volatility is highest.
Margin and liquidity constraints – leverage limits, margin calls, position limits, and widening spreads can force liquidation before a mean reversion occurs.
Fat tails and regime shifts – assumptions of independent, Gaussian returns can understate tail risk. Structural breaks can keep the signal wrong for much longer than expected.
The simulator exposes these dynamics in the equity curve, Max Drawdown, VaR and CVaR, and via Monte Carlo sketches of forward uncertainty.
Interpreting losing streaks with numbers
A rough intuition: if your per-trade win probability is p and loss probability is q=1−p , the chance of a specific run of k consecutive losses is q^k . Over many trades, the chance that at least one k-loss run occurs grows with the number of opportunities. As a sanity check:
If p=0.55 , then q=0.45 . A 6-loss run has probability q^6 ≈ 0.008 on any six-trade window. Across hundreds of trades, a 6 to 8-loss run is not rare.
If your size factor is 1.5 and your base is 10 percent, after 8 losses the requested size is 10% × 1.5^8 ≈ 25.6% . With factor 2.0 it would try to be 10% × 2^8 = 256% but your cap will stop it. The equity curve will still wear the compounded drawdown from the sequence that led to the cap.
This is why the cap setting is central. It does not remove tail risk, but it prevents the sizing rule from demanding impossible positions
Note: The p and q math is illustrative. In live data the win rate and distribution can drift over time, so real streaks can be longer or shorter than the simple q^k intuition suggests..
Using the simulator productively
Parameter studies
Start with conservative settings. Increase one element at a time and watch how the equity, Max Drawdown, and CVaR respond.
Initial allocation – lower base reduces volatility and drawdowns across the board
Increase factor – set modestly above 1.0 if you want the effect at all; doubling is aggressive
Max cap – the most important brake; many users keep it between 20 and 50 percent
Signal selection
Keep sizing fixed and rotate signals to see how streak patterns differ. Trend-following signals tend to produce long wrong-way streaks in choppy ranges. Mean-reversion signals do the opposite. Martingale sizing interacts very differently with each.
Diagnostics to watch
Use the built-in metrics to quantify risk:
Max Drawdown – worst peak-to-trough equity loss
Sharpe and Sortino – volatility and downside-adjusted return
VaR 95 percent and CVaR – tail risk measures from the realized distribution
Alpha and Beta – relationship to your chosen benchmark
If you would like to check out the original performance metrics script with multiple assets with a better explanation on all metrics please see
Monte Carlo exploration
When enabled, the forecast draws many synthetic paths from your realized daily returns:
Choose a horizon and a number of runs
Review the bands: p5 to p95 for a wide risk envelope; p16 to p84 for a narrower range; p50 as the median path
Use the table to read the expected return over the horizon and the tail outcomes
Remember it is a sketch based on your recent distribution, not a predictor
Concrete examples
Example A: Modest martingale
Base 10 percent, factor 1.25, cap 40 percent, RSI>50 signal. You will see small escalations on 2 to 4 loss runs and frequent resets. The equity curve usually remains smooth unless the signal enters a prolonged wrong-way regime. Max DD may rise moderately versus fixed sizing.
Example B: Aggressive martingale
Base 15 percent, factor 2.0, cap 60 percent, EMA cross signal. The curve can look stellar during favorable regimes, then a single extended streak pushes allocation to the cap, and a few more losses drive deep drawdown. CVaR and Max DD jump sharply. This is a textbook case of high tail risk.
Strengths
Bar-by-bar, transparent computation of equity from stance and size
Explicit handling of wins, losses, streaks, and caps
Portable signal inputs so you can A–B test ideas quickly
Risk diagnostics and forward uncertainty visualization in one place
Example, Rolling Max Drawdown
Limitations and important notes
Martingale sizing can escalate drawdowns rapidly. The cap limits position size but not the possibility of extended adverse runs.
No commissions, slippage, margin interest, borrow costs, or liquidity limits are modeled.
Signals are evaluated on closes. Real execution and fills will differ.
Monte Carlo assumes independent draws from your recent return distribution. Markets often have serial correlation, fat tails, and regime changes.
All results are hypothetical. Use this as an educational tool, not a production risk engine.
Practical tips
Prefer gentle factors such as 1.1 to 1.3. Doubling is usually excessive outside of toy examples.
Keep a strict cap. Many users cap between 20 and 40 percent of equity per leg.
Stress test with different start dates and subperiods. Long flat or trending regimes are where martingale weaknesses appear.
Compare to an anti-martingale (increase after wins, cut after losses) to understand the other side of the trade-off.
If you deploy sizing live, add external guardrails such as a daily loss cut, volatility filters, and a global max drawdown stop.
Settings recap
Backtest start date and initial capital
Initial allocation, increase-after-loss factor, max allocation cap
Signal source selector
Trading days per year and risk-free rate
Benchmark symbol for Alpha and Beta
UI toggles for equity, buy and hold, labels, metrics, PnL, and drawdown
Monte Carlo controls for enable, runs, horizon, and result table
Final thoughts
A martingale is not a free lunch. It is a way to tilt capital allocation toward losing streaks. If the signal has a real edge and mean reversion is common, careful and capped escalation can reduce time-to-recovery. If the signal lacks edge or regimes shift, the same rule can magnify losses at the worst possible moment. This simulator makes those trade-offs visible so you can calibrate parameters, understand tail risk, and decide whether the approach belongs anywhere in your research workflow.