NIFTY Option Buy Strategy MASTER v1This script is a complete option buying strategy framework for NIFTY, designed for both intraday and positional swing trades.
🔹 Built using multi-timeframe analysis (EMAs, MACD, RSI)
🔹 Combines key macro filters: India VIX, PCR, FII/DII net cash flows
🔹 Supports both Call (CE) and Put (PE) entries
🔹 Includes manual input dashboard for real-time market context
🔹 Trade logic includes:
Bollinger Band breakouts
Volume confirmation
VWAP filtering
EMA crossover + MACD alignment
Resistance/support proximity from option chain (manual)
📈 Smart Trade Management:
Multi-target system (e.g., exit 50% at RR=1, 50% at RR=2)
Trailing stop-loss after target 1 hits
Automatic exit on SL/TP or reverse signals
Visual markers for all entries, exits, and stops
📊 Built-in Dashboard:
Displays India VIX, PCR, FII/DII flows, and S/R levels
Strike price selection (ATM + offset logic)
🧪 Ideal for backtesting, alerts, and real-time execution.
Can be used with alerts + webhook for automated trading or signal generation.
⚠️ Note: This script is for educational purposes only. Always test on paper trading before going live.
Statistics
1.85I copied this indicator from 4c program so all credit to him/her. I just changed it from 2 SD to 1.85
DCA Investment Tracker Pro [tradeviZion]DCA Investment Tracker Pro: Educational DCA Analysis Tool
An educational indicator that helps analyze Dollar-Cost Averaging strategies by comparing actual performance with historical data calculations.
---
💡 Why I Created This Indicator
As someone who practices Dollar-Cost Averaging, I was frustrated with constantly switching between spreadsheets, calculators, and charts just to understand how my investments were really performing. I wanted to see everything in one place - my actual performance, what I should expect based on historical data, and most importantly, visualize where my strategy could take me over the long term .
What really motivated me was watching friends and family underestimate the incredible power of consistent investing. When Napoleon Bonaparte first learned about compound interest, he reportedly exclaimed "I wonder it has not swallowed the world" - and he was right! Yet most people can't visualize how their $500 monthly contributions today could become substantial wealth decades later.
Traditional DCA tracking tools exist, but they share similar limitations:
Require manual data entry and complex spreadsheets
Use fixed assumptions that don't reflect real market behavior
Can't show future projections overlaid on actual price charts
Lose the visual context of what's happening in the market
Make compound growth feel abstract rather than tangible
I wanted to create something different - a tool that automatically analyzes real market history, detects volatility periods, and shows you both current performance AND educational projections based on historical patterns right on your TradingView charts. As Warren Buffett said: "Someone's sitting in the shade today because someone planted a tree a long time ago." This tool helps you visualize your financial tree growing over time.
This isn't just another calculator - it's a visualization tool that makes the magic of compound growth impossible to ignore.
---
🎯 What This Indicator Does
This educational indicator provides DCA analysis tools. Users can input investment scenarios to study:
Theoretical Performance: Educational calculations based on historical return data
Comparative Analysis: Study differences between actual and theoretical scenarios
Historical Projections: Theoretical projections for educational analysis (not predictions)
Performance Metrics: CAGR, ROI, and other analytical metrics for study
Historical Analysis: Calculates historical return data for reference purposes
---
🚀 Key Features
Volatility-Adjusted Historical Return Calculation
Analyzes 3-20 years of actual price data for any symbol
Automatically detects high-volatility stocks (meme stocks, growth stocks)
Uses median returns for volatile stocks, standard CAGR for stable stocks
Provides conservative estimates when extreme outlier years are detected
Smart fallback to manual percentages when data insufficient
Customizable Performance Dashboard
Educational DCA performance analysis with compound growth calculations
Customizable table sizing (Tiny to Huge text options)
9 positioning options (Top/Middle/Bottom + Left/Center/Right)
Theme-adaptive colors (automatically adjusts to dark/light mode)
Multiple display layout options
Future Projection System
Visual future growth projections
Timeframe-aware calculations (Daily/Weekly/Monthly charts)
1-30 year projection options
Shows projected portfolio value and total investment amounts
Investment Insights
Performance vs benchmark comparison
ROI from initial investment tracking
Monthly average return analysis
Investment milestone alerts (25%, 50%, 100% gains)
Contribution tracking and next milestone indicators
---
📊 Step-by-Step Setup Guide
1. Investment Settings 💰
Initial Investment: Enter your starting lump sum (e.g., $60,000)
Monthly Contribution: Set your regular DCA amount (e.g., $500/month)
Return Calculation: Choose "Auto (Stock History)" for real data or "Manual" for fixed %
Historical Period: Select 3-20 years for auto calculations (default: 10 years)
Start Year: When you began investing (e.g., 2020)
Current Portfolio Value: Your actual portfolio worth today (e.g., $150,000)
2. Display Settings 📊
Table Sizes: Choose from Tiny, Small, Normal, Large, or Huge
Table Positions: 9 options - Top/Middle/Bottom + Left/Center/Right
Visibility Toggles: Show/hide Main Table and Stats Table independently
3. Future Projection 🔮
Enable Projections: Toggle on to see future growth visualization
Projection Years: Set 1-30 years ahead for analysis
Live Example - NASDAQ:META Analysis:
Settings shown: $60K initial + $500/month + Auto calculation + 10-year history + 2020 start + $150K current value
---
🔬 Pine Script Code Examples
Core DCA Calculations:
// Calculate total invested over time
months_elapsed = (year - start_year) * 12 + month - 1
total_invested = initial_investment + (monthly_contribution * months_elapsed)
// Compound growth formula for initial investment
theoretical_initial_growth = initial_investment * math.pow(1 + annual_return, years_elapsed)
// Future Value of Annuity for monthly contributions
monthly_rate = annual_return / 12
fv_contributions = monthly_contribution * ((math.pow(1 + monthly_rate, months_elapsed) - 1) / monthly_rate)
// Total expected value
theoretical_total = theoretical_initial_growth + fv_contributions
Volatility Detection Logic:
// Detect extreme years for volatility adjustment
extreme_years = 0
for i = 1 to historical_years
yearly_return = ((price_current / price_i_years_ago) - 1) * 100
if yearly_return > 100 or yearly_return < -50
extreme_years += 1
// Use median approach for high volatility stocks
high_volatility = (extreme_years / historical_years) > 0.2
calculated_return = high_volatility ? median_of_returns : standard_cagr
Performance Metrics:
// Calculate key performance indicators
absolute_gain = actual_value - total_invested
total_return_pct = (absolute_gain / total_invested) * 100
roi_initial = ((actual_value - initial_investment) / initial_investment) * 100
cagr = (math.pow(actual_value / initial_investment, 1 / years_elapsed) - 1) * 100
---
📊 Real-World Examples
See the indicator in action across different investment types:
Stable Index Investments:
AMEX:SPY (SPDR S&P 500) - Shows steady compound growth with standard CAGR calculations
Classic DCA success story: $60K initial + $500/month starting 2020. The indicator shows SPY's historical 10%+ returns, demonstrating how consistent broad market investing builds wealth over time. Notice the smooth theoretical growth line vs actual performance tracking.
MIL:VUAA (Vanguard S&P 500 UCITS) - Shows both data limitation and solution approaches
Data limitation example: VUAA shows "Manual (Auto Failed)" and "No Data" when default 10-year historical setting exceeds available data. The indicator gracefully falls back to manual percentage input while maintaining all DCA calculations and projections.
MIL:VUAA (Vanguard S&P 500 UCITS) - European ETF with successful 5-year auto calculation
Solution demonstration: By adjusting historical period to 5 years (matching available data), VUAA auto calculation works perfectly. Shows how users can optimize settings for newer assets. European market exposure with EUR denomination, demonstrating DCA effectiveness across different markets and currencies.
NYSE:BRK.B (Berkshire Hathaway) - Quality value investment with Warren Buffett's proven track record
Value investing approach: Berkshire Hathaway's legendary performance through DCA lens. The indicator demonstrates how quality companies compound wealth over decades. Lower volatility than tech stocks = standard CAGR calculations used.
High-Volatility Growth Stocks:
NASDAQ:NVDA (NVIDIA Corporation) - Demonstrates volatility-adjusted calculations for extreme price swings
High-volatility example: NVIDIA's explosive AI boom creates extreme years that trigger volatility detection. The indicator automatically switches to "Median (High Vol): 50%" calculations for conservative projections, protecting against unrealistic future estimates based on outlier performance periods.
NASDAQ:TSLA (Tesla) - Shows how 10-year analysis can stabilize volatile tech stocks
Stable long-term growth: Despite Tesla's reputation for volatility, the 10-year historical analysis (34.8% CAGR) shows consistent enough performance that volatility detection doesn't trigger. Demonstrates how longer timeframes can smooth out extreme periods for more reliable projections.
NASDAQ:META (Meta Platforms) - Shows stable tech stock analysis using standard CAGR calculations
Tech stock with stable growth: Despite being a tech stock and experiencing the 2022 crash, META's 10-year history shows consistent enough performance (23.98% CAGR) that volatility detection doesn't trigger. The indicator uses standard CAGR calculations, demonstrating how not all tech stocks require conservative median adjustments.
Notice how the indicator automatically detects high-volatility periods and switches to median-based calculations for more conservative projections, while stable investments use standard CAGR methods.
---
📈 Performance Metrics Explained
Current Portfolio Value: Your actual investment worth today
Expected Value: What you should have based on historical returns (Auto) or your target return (Manual)
Total Invested: Your actual money invested (initial + all monthly contributions)
Total Gains/Loss: Absolute dollar difference between current value and total invested
Total Return %: Percentage gain/loss on your total invested amount
ROI from Initial Investment: How your starting lump sum has performed
CAGR: Compound Annual Growth Rate of your initial investment (Note: This shows initial investment performance, not full DCA strategy)
vs Benchmark: How you're performing compared to the expected returns
---
⚠️ Important Notes & Limitations
Data Requirements: Auto mode requires sufficient historical data (minimum 3 years recommended)
CAGR Limitation: CAGR calculation is based on initial investment growth only, not the complete DCA strategy
Projection Accuracy: Future projections are theoretical and based on historical returns - actual results may vary
Timeframe Support: Works ONLY on Daily (1D), Weekly (1W), and Monthly (1M) charts - no other timeframes supported
Update Frequency: Update "Current Portfolio Value" regularly for accurate tracking
---
📚 Educational Use & Disclaimer
This analysis tool can be applied to various stock and ETF charts for educational study of DCA mathematical concepts and historical performance patterns.
Study Examples: Can be used with symbols like AMEX:SPY , NASDAQ:QQQ , AMEX:VTI , NASDAQ:AAPL , NASDAQ:MSFT , NASDAQ:GOOGL , NASDAQ:AMZN , NASDAQ:TSLA , NASDAQ:NVDA for learning purposes.
EDUCATIONAL DISCLAIMER: This indicator is a study tool for analyzing Dollar-Cost Averaging strategies. It does not provide investment advice, trading signals, or guarantees. All calculations are theoretical examples for educational purposes only. Past performance does not predict future results. Users should conduct their own research and consult qualified financial professionals before making any investment decisions.
---
© 2025 TradeVizion. All rights reserved.
LyroMAsLibrary "LyroMAs"
Custom Dynamic MA's that allow a dynamic calculation beginning from the first bar\ use getDynamicLength(maxLength) =>\\tmath.min(maxLength, bar_index + 1) \as length
SMA(sourceData, maxLength)
Dynamic SMA
Parameters:
sourceData (float)
maxLength (int)
EMA(src, length)
Dynamic EMA
Parameters:
src (float)
length (int)
DEMA(src, length)
Dynamic DEMA
Parameters:
src (float)
length (int)
TEMA(src, length)
Dynamic TEMA
Parameters:
src (float)
length (int)
WMA(src, length)
Dynamic WMA
Parameters:
src (float)
length (int)
HMA(src, length)
Dynamic HMA
Parameters:
src (float)
length (int)
VWMA(src, volsrc, length)
Dynamic VWMA
Parameters:
src (float)
volsrc (float)
length (int)
SMMA(src, length)
Dynamic SMMA
Parameters:
src (float)
length (int)
LSMA(src, length, offset)
Dynamic LSMA
Parameters:
src (float)
length (int)
offset (int)
RMA(src, length)
Dynamic RMA
Parameters:
src (float)
length (int)
ALMA(src, length, offset_sigma, sigma)
Dynamic ALMA
Parameters:
src (float)
length (int)
offset_sigma (float)
sigma (float)
ZLSMA(src, length)
Dynamic Zlsma
Parameters:
src (float)
length (int)
Thank you to @QuantraSystems for the dynamic codes.
Previous Day High/Low (8AM–4PM)A simple indicator for NQ and ES futures that marks the previous day high and low on the current trading day excluding premarket.
Session Status Table📌 Session Status Table
Session Status Table is an indicator that displays the real-time status of the four major trading sessions:
* 🇯🇵 Asia (Tokyo)
* 🇬🇧 London
* 🇺🇸 New York AM
* 🇺🇸 New York PM
It shows which sessions are currently open, how much time remains until they open or close, and optionally sends alerts in advance.
🧩 Features:
* Real-time session table — shows the status of each session on the chart.
* Color-coded statuses:
* 🟢 Green – Session is open
* 🔴 Red – Session is closed
* ⚪ Gray – Weekend
* Countdown timers until session open or close.
* User alerts — receive a notification a custom number of minutes before a session starts.
⚙️ Customization:
* Table position — fully configurable.
* Session colors — customizable for open, closed, and weekend states.
* Session labels — customizable with icons.
* Notifications:
* Enabled through TradingView's Alerts panel.
* User-defined lead time before session opens.
🕒 Time Zones:
All times are calculated in UTC to ensure consistency across different markets and regions, avoiding discrepancies from time zones and daylight saving time.
🚨 How to enable alerts:
1. Open the "Alerts" panel in TradingView.
2. Click "Create Alert".
3. In the condition dropdown, choose "Session Status Table".
4. Set to any alert() trigger.
5. Save — you'll be notified a set number of minutes before each session begins.
ℹ️ Technical Notes:
* Built with Pine Script version 6.
* Logically divided into clear sections: inputs, session calculations, table rendering, and alerts.
* Optimized for performance and reliability on all timeframes.
Ideal for traders who use session activity in their strategies — especially in Forex, crypto, and futures markets.
Kappa Weighted IndexI have created an indicator with options to select if you invested in separate stocks to get one price index I hope you will find helpful.
Any questions on that please give me a shout
Average Candle SizeMeasures the average candle size in ticks across a given number of candles. This can be set simply in the indicator settings. Then it displays the average candle size in the lower left hand corner of the screen.
Bilateral Filter For Loop [BackQuant]Bilateral Filter For Loop
The Bilateral Filter For Loop is an advanced technical indicator designed to filter out market noise and smooth out price data, thus improving the identification of underlying market trends. It employs a bilateral filter, which is a sophisticated non-linear filter commonly used in image processing and price time series analysis. By considering both spatial and range differences between price points, this filter is highly effective at preserving significant trends while reducing random fluctuations, ultimately making it suitable for dynamic trend-following strategies.
Please take the time to read the following:
Key Features
1. Bilateral Filter Calculation:
The bilateral filter is the core of this indicator and works by applying a weight to each data point based on two factors: spatial distance and price range difference. This dual weighting process allows the filter to preserve important price movements while reducing the impact of less relevant fluctuations. The filter uses two primary parameters:
Spatial Sigma (σ_d): This parameter adjusts the weight applied based on the distance of each price point from the current price. A larger spatial sigma means more smoothing, as further away values will contribute more heavily to the result.
Range Sigma (σ_r): This parameter controls how much weight is applied based on the difference in price values. Larger price differences result in smaller weights, while similar price values result in larger weights, thereby preserving the trend while filtering out noise.
The output of this filter is a smoothed version of the original price series, which eliminates short-term fluctuations, helping traders focus on longer-term trends. The bilateral filter is applied over a rolling window, adjusting the level of smoothing dynamically based on both the distance between values and their relative price movements.
2. For Loop Calculation for Trend Scoring:
A for-loop is used to calculate the trend score based on the filtered price data. The loop compares the current value to previous values within the specified window, scoring the trend as follows:
+1 for upward movement (when the filtered value is greater than the previous value).
-1 for downward movement (when the filtered value is less than the previous value).
The cumulative result of this loop gives a continuous trend score, which serves as a directional indicator for the market's momentum. By summing the scores over the window period, the loop provides an aggregate value that reflects the overall trend strength. This score helps determine whether the market is experiencing a strong uptrend, downtrend, or sideways movement.
3. Long and Short Conditions:
Once the trend score has been calculated, it is compared against predefined threshold levels:
A long signal is generated when the trend score exceeds the upper threshold, indicating that the market is in a strong uptrend.
A short signal is generated when the trend score crosses below the lower threshold, signaling a potential downtrend or trend reversal.
These conditions provide clear signals for potential entry points, and the color-coding helps traders quickly identify market direction:
Long signals are displayed in green.
Short signals are displayed in red.
These signals are designed to provide high-confidence entries for trend-following strategies, helping traders capture profitable movements in the market.
4. Trend Background and Bar Coloring:
The script offers customizable visual settings to enhance the clarity of the trend signals. Traders can choose to:
Color the bars based on the trend direction: Bars are colored green for long signals and red for short signals.
Change the background color to provide additional context: The background will be shaded green for a bullish trend and red for a bearish trend. This visual feedback helps traders to stay aligned with the prevailing market sentiment.
These features offer a quick visual reference for understanding the market's direction, making it easier for traders to identify when to enter or exit positions.
5. Threshold Lines for Visual Feedback:
Threshold lines are plotted on the chart to represent the predefined long and short levels. These lines act as clear markers for when the market reaches a critical threshold, triggering a potential buy (long) or sell (short) signal. By showing these threshold lines on the chart, traders can quickly gauge the strength of the market and assess whether the trend is strong enough to warrant action.
These thresholds can be adjusted based on the trader's preferences, allowing them to fine-tune the indicator for different market conditions or asset behaviors.
6. Customizable Parameters for Flexibility:
The indicator offers several parameters that can be adjusted to suit individual trading preferences:
Window Period (Bilateral Filter): The window size determines how many past price values are used to calculate the bilateral filter. A larger window increases smoothing, while a smaller window results in more responsive, but noisier, data.
Spatial Sigma (σ_d) and Range Sigma (σ_r): These values control how sensitive the filter is to price changes and the distance between data points. Fine-tuning these parameters allows traders to adjust the degree of noise reduction applied to the price series.
Threshold Levels: The upper and lower thresholds determine when the trend score crosses into long or short territory. These levels can be customized to better match the trader's risk tolerance or asset characteristics.
Visual Settings: Traders can customize the appearance of the chart, including the line width of trend signals, bar colors, and background shading, to make the indicator more readable and aligned with their charting style.
7. Alerts for Trend Reversals:
The indicator includes alert conditions for real-time notifications when the market crosses the defined thresholds. Traders can set alerts to be notified when:
The trend score crosses the long threshold, signaling an uptrend.
The trend score crosses the short threshold, signaling a downtrend.
These alerts provide timely information, allowing traders to take immediate action when the market shows a significant change in direction.
Final Thoughts
The Bilateral Filter For Loop indicator is a robust tool for trend-following traders who wish to reduce market noise and focus on the underlying trend. By applying the bilateral filter and calculating trend scores, this indicator helps traders identify strong uptrends and downtrends, providing reliable entry signals with minimal market noise. The customizable parameters, visual feedback, and alerting system make it a versatile tool for traders seeking to improve their timing and capture profitable market movements.
Thus following all of the key points here are some sample backtests on the 1D Chart
Disclaimer: Backtests are based off past results, and are not indicative of the future.
INDEX:BTCUSD
INDEX:ETHUSD
CRYPTO:SOLUSD
Position Size CalculatorIt is a position size calculation with 0.05% buffer to take swift entry on either sides with 0.5% risk on your overall capital
Portfolio Dashboard by DTRThe Portfolio Dashboard by DTR is a sophisticated yet user-friendly Pine Script indicator for TradingView, designed to empower traders with a comprehensive tool for managing and monitoring investment portfolios. Supporting up to 10 stocks, it delivers real-time performance metrics, risk analysis, and market insights in an intuitive, customizable dashboard—perfect for traders of all experience levels.
Key Features
Real-Time Portfolio Metrics: Tracks Return on Investment (ROI), Day's Profit and Loss (PNL), Risk of Profit (ROP), and Average Daily Range (ADR) with color-coded indicators for quick insights.
Individual Stock Insights: Displays detailed data for each stock, including ticker, trading setup, Last Traded Price (LTP) or Stop Loss (SL) status, position size, risk, portfolio risk, Risk-Reward (RR) or Gain%, daily change%, portfolio impact, and optional ADR.
Market Condition Analysis: Evaluates broader market trends using NSE:CNXSMALLCAP data, categorizing conditions as CHOPPY, BULL MARKET, BEAR MARKET, SHAKEOUT, or BEAR RALLY with visual color cues.
Customization Options:
Input total capital (scalable in Thousands, Lacs, or Crores) and maximum risk percentage.
Choose from B&W, Blue, Green, Red, Purple, or Transparent themes, with Dark Mode support.
Adjust dashboard and gauge positions (top/middle/bottom, left/center/right) and text sizes (tiny to huge).
Toggle display options like LTP, % change color, total row, ADR column, RR/Gain%, and empty rows.
Risk Management Tools: Calculates position sizes, individual and portfolio-level risks, and offers visual gauges for total allocation (% invested) and open risk (% of max risk). Supports setting Stop Loss to Break-Even (SL=BE).
Chart Enhancements: Optionally displays entry and stop loss lines on the chart with customizable styles (Dashed, Dotted, Normal) and dynamic labels for precise trade management.
How It Works
Setup: Users input portfolio details—ticker symbols, quantities, entry prices, stop losses, exits, and setups—for up to 10 stocks, along with capital and risk settings.
Data Processing: The indicator fetches daily high, low, close, and previous close data to compute metrics like ADR, percentage change, and Day's PNL for each stock.
Visualization: On the last bar, it generates a detailed table summarizing portfolio and stock-level data, alongside two gauges for allocation and risk, positioned per user preferences.
Chart Integration: When enabled, entry and SL lines with labels appear on the chart for the current ticker, updating dynamically based on price action.
How to Use
Add to Chart: Apply the indicator to your TradingView chart.
Configure Settings: In the settings panel, enter your total capital, stock details, and customize themes, positions, and display preferences.
Monitor Portfolio: Use the dashboard to assess portfolio health, risk exposure, and market conditions in real time.
Manage Trades: Leverage chart lines and labels to execute and adjust trades with precision.
Benefits
Centralized Oversight: Consolidates all essential portfolio data into one view.
Enhanced Risk Control: Provides real-time risk metrics and visual tools for proactive management.
Flexible Design: Adapts to various trading strategies and aesthetic preferences.
Intuitive Interface: Combines detailed analytics with clear, visually appealing presentation.
Important Notes
Accuracy: Ensure correct ticker symbols (e.g., NSE:RELIANCE) and price inputs for reliable results.
Timeframes: Optimized for daily or intraday charts; updates occur on the last bar.
Dependencies: Market condition and ADR calculations rely on NSE:CNXSMALLCAP data availability.
Elevate your trading with the Portfolio Dashboard by DTR—a powerful, all-in-one solution for portfolio management on TradingView. Take control of your investments today!
SY_Quant_AI_YJ📢 SY_Quant_AI_Alert Strategy Overview
Name: SY_Quant_AI_Alert
Purpose: Designed for real-time alerting when Long, Short, or Take-Profit signals are triggered. Alerts are structured in JSON format, ideal for integration with DingTalk, Telegram, or other bots.
✅ Key Features:
Trend Detection using Supertrend, EMA/MA filters, and candle color analysis.
Momentum Filtering with MACD crossover signals.
Entry Alerts when a strong signal appears (Long/Short), showing ideal entry zone.
Take-Profit Alerts when floating profit is valid and MACD reverses in favor.
Full JSON Alerts for easy automation and third-party integrations.
Cross-Sectional Altcoin Portfolio [BackQuant]Cross-Sectional Altcoin Portfolio
Introducing BackQuant's Cross-Sectional Altcoin Portfolio, a sophisticated trading system designed to dynamically rotate among a selection of major altcoins. This portfolio strategy compares multiple assets based on real-time performance metrics, such as momentum and trend strength, to select the strongest-performing coins. It uses a combination of adaptive scoring and regime filters to ensure the portfolio is aligned with favorable market conditions, minimizing exposure during unfavorable trends.
This system offers a comprehensive solution for crypto traders who want to optimize portfolio allocation based on cross-asset performance, while also accounting for market regimes. It allows traders to compare multiple altcoins dynamically and allocate capital to the top performers, ensuring the portfolio is always positioned in the most promising assets.
Key Features
1. Dynamic Asset Rotation:
The portfolio constantly evaluates the relative strength of 10 major altcoins: SOLUSD, RUNEUSD, ORDIUSD, DOGEUSDT, ETHUSD, ENAUSDT, RAYUSDT, PENDLEUSD, UNIUSD, and KASUSDT.
Using a ratio matrix, the system selects the strongest asset based on momentum and trend performance, dynamically adjusting the allocation as market conditions change.
2. Long-Only Portfolio with Cash Reserve:
The portfolio only takes long positions or remains in cash. The system does not enter short positions, reducing the risk of exposure during market downturns.
A powerful regime filter ensures the system is inactive during periods of market weakness, defined by the Universal Trend Performance Indicator (TPI) and other market data.
3. Equity Tracking:
The script provides real-time visualizations of portfolio equity compared to buy-and-hold strategies.
Users can compare the performance of the portfolio against holding individual assets (e.g., BTC, ETH) and see the benefits of the dynamic allocation.
4. Performance Metrics:
The system provides key performance metrics such as:
Sharpe Ratio: Measures risk-adjusted returns.
Sortino Ratio: Focuses on downside risk.
Omega Ratio: Evaluates returns relative to risk.
Maximum Drawdown: The maximum observed loss from a peak to a trough.
These metrics allow traders to assess the effectiveness of the strategy versus simply holding the assets.
5. Regime Filter:
The system incorporates a regime filter that evaluates the overall market trend using the TPI and other indicators. If the market is in a downtrend, the system exits positions and moves to cash, avoiding exposure to negative market conditions.
Users can customize the thresholds for the long and short trends to fit their risk tolerance.
6. Customizable Parameters:
Traders can adjust key parameters, such as the backtest start date, starting capital, leverage multiplier, and visualization options, including equity plot colors and line widths.
The system supports different levels of customizations for traders to optimize their strategies.
7. Equity and Buy-and-Hold Comparisons:
This script enables traders to see the side-by-side comparison of the portfolio’s equity curve and the equity curve of a buy-and-hold strategy for each asset.
The comparison allows users to evaluate the performance of the dynamic strategy versus holding the altcoins in isolation.
8. Forward Test (Out-of-Sample Testing):
The system includes a note that the portfolio provides out-of-sample forward tests, ensuring the robustness of the strategy. This is crucial for assessing the portfolio's performance beyond historical backtesting and validating its ability to adapt to future market conditions.
9. Visual Feedback:
The system offers detailed visual feedback on the current asset allocation and performance. Candles are painted according to the trend of the selected assets, and key metrics are displayed in real-time, including the momentum scores for each asset.
10. Alerts and Notifications:
Real-time alerts notify traders when the system changes asset allocations or moves to cash, ensuring they stay informed about portfolio adjustments.
Visual labels on the chart provide instant feedback on which asset is currently leading the portfolio allocation.
How the Rotation Works
The portfolio evaluates 10 different assets and calculates a momentum score for each based on their price action. This score is processed through a ratio matrix, which compares the relative performance of each asset.
Based on the rankings, the portfolio allocates capital to the top performers, ensuring it rotates between the strongest assets while minimizing exposure to underperforming assets.
If no asset shows strong performance, the system defaults to cash to preserve capital.
Final Thoughts
BackQuant’s Cross-Sectional Altcoin Portfolio provides a dynamic and systematic approach to altcoin portfolio management. By employing real-time performance metrics, adaptive scoring, and regime filters, this strategy aims to optimize returns while minimizing exposure to market downturns. The inclusion of out-of-sample forward tests ensures that the system remains robust in live market conditions, making it an ideal tool for crypto traders seeking to enhance their portfolio's performance with a data-driven, momentum-based approach.
Candle Body TableCandle Body Table is a lightweight, easy-to-use indicator that displays a live summary of candle “body strength” across multiple timeframes, along with how much time is left on each candle. Simply choose up to five timeframes (1, 5, 15, 30, and 60 minutes by default), adjust the table’s corner and font size, and you’ll always have a quick, at-a-glance view of:
OC (Body %): The percentage of the candle that’s composed of its body (|open – close| divided by high–low).
Strength: A label (Weak, Balanced, or Strong) based on the body percentage.
Time Left: How many minutes and seconds remain before the current candle closes.
The table updates in real time (using lookahead), coloring each row background green if that timeframe’s current candle is bullish, or red if it’s bearish. That way, you can instantly see which timeframes have strong momentum, which are balanced or weak, and exactly when each candle will finish.
Use Cases
Multi-Timeframe Momentum Check:
If you want to confirm that both your 1m and 5m candles have “Strong” bodies before entering a trade, Candle Body Table shows you that instantly. No more switching back and forth between charts—just glance at the table.
Time-Sensitive Entries/Exits:
Suppose you trade breakouts only at the close of a 5-minute candle. The “Time Left” column counts down so you know exactly when that candle is about to close—down to the second—letting you prepare your order.
Quick Visual Scan:
When markets are choppy, you may want to see which timeframes are weak or balanced rather than diving into each timeframe separately. If the 15m row says “Weak” (small body %), you might avoid taking a trend-following position at that moment.
Session Overlaps & Volatility Windows:
During London/N.Y. overlap or U.S. cash close, traders often check for stronger bodies on higher timeframes (e.g., 30m or 60m). The table immediately highlights if that timeframe’s candle body heats up, indicating increased volatility.
Swing-to-Scalp Transition:
If you typically scalp on 1m but only when the 15m candle is “Strong,” this table gives a green/red cue and a strength label. That makes it easier to wait patiently until multiple timeframes align.
FAQ
Q1. What does “OC” mean, and why is it shown as a percentage?
A1. “OC” stands for Open/Close difference. So it reflects how much of the candle’s total range (high–low) is taken up by its body(open-close). A high OC% means the candle body is large relative to its wick. In other words a strong Bullish/Bearish candle.
Q2. How is “Strength” determined?
A2. The script uses three buckets:
Weak if OC% ≤ 30%
Balanced if 30% < OC% ≤ 55%
Strong if OC% > 55%
This gives you a quick label instead of having to interpret raw percentages every time.
Q3. Why do some rows have a green background and others red?
A3. If close > open (bullish candle), that entire row’s background is shaded green(70%). If close < open (bearish candle), it’s shaded red(70%). If open = close (doji), there’s no background shade. This lets you instantly spot bullish vs. bearish candles across your chosen timeframes.
Q4. Will this repaint?
A4. No. Because each OHLC value is requested with lookahead_on, you see the live developing OHLC. However, once a candle closes, those values are final. The “Time Left” column dynamically changes throughout the bar but does not redraw past values.
eriktrades1995-ORB-opening range breakoutThis TradingView Pine Script indicator is designed to identify and display Opening Range Breakout (ORB) levels and signal potential breakout opportunities. It helps traders visualize the high and low of an initial trading period and then highlights the first instance the price breaks out of this range.
How it Works:
- Defines the Opening Range:
You can choose an ORB period of either 15 minutes or 30 minutes from the script's settings.
The script then monitors the price action during this initial period (e.g., 09:30 - 09:45 ET for a 15-minute ORB, or 09:30 - 10:00 ET for a 30-minute ORB, based on the New York timezone).
Identifies ORB High and Low:
- During the selected ORB period, the script records the highest high and lowest low reached.
Plots ORB Levels:
Once the ORB period is complete, two horizontal black lines are drawn on your chart:
One representing the ORB High.
One representing the ORB Low.
These lines extend for the remainder of the trading day.
- Signals Breakouts:
The script watches for the price to close outside of this established ORB range.
Break Above ORB High: If the price closes above the ORB High for the first time that day (after the ORB period), a small green upward-pointing triangle is plotted below the breakout bar.
Break Below ORB Low: If the price closes below the ORB Low for the first time that day (after the ORB period), a small red downward-pointing triangle is plotted below the breakout bar.
Only the first breakout in each direction is marked for the day.
- Daily Reset:
The ORB levels and breakout signals are automatically reset at the beginning of each new trading day.
Key Features:
Customizable ORB Duration: Choose between 15-minute or 30-minute opening ranges.
Clear Visuals: Easily identifiable ORB high/low lines and distinct breakout signals.
First Breakout Focus: Designed to capture the initial breakout momentum.
Intraday Strategy: Best suited for use on intraday charts (e.g., 1-minute, 5-minute, 15-minute).
New York Timezone Based: The ORB session is calculated based on 'America/New_York' time.
How to Use:
Traders typically use ORB strategies to identify potential continuations or reversals early in the trading session. A break above the ORB high might suggest bullish momentum, while a break below the ORB low might indicate bearish momentum. Always use in conjunction with other analysis and risk management techniques.
Market Maker Zones [VWAP + Liquidity + Stop Hunts]This is a Pine Script indicator for TradingView that identifies market maker zones through VWAP, liquidity zones, and stop hunt levels. Here's what each component does:
VWAP Component:
Calculates Volume Weighted Average Price from a specified anchor time
Uses cumulative volume and price-volume to track institutional interest
Plotted as an orange line that market makers often use as a reference
Liquidity Zones:
Identifies bars with volume exceeding 1.5x the average (configurable)
Highlights these high-volume areas with blue background
These represent zones where large orders were executed
Stop Hunt Zones:
Tracks recent highs and lows over a 20-bar window
Plots horizontal lines at these levels with labels
These are areas where stop losses typically cluster
Key Market Maker Concepts:
The indicator assumes market makers hunt stops at obvious levels (recent highs/lows), accumulate positions in high-volume zones, and use VWAP as a fair value reference. When price approaches these zones, it often indicates potential reversal or continuation points.
Usage Tips:
Watch for price reactions near VWAP line
High-volume zones often act as support/resistance
Stop hunt levels frequently get tested before significant moves
Combine all three elements to identify high-probability trade setups
The script is well-structured with clear input parameters and visual elements that make it easy to spot these institutional footprints on your charts.
Enhanced Seasonality Trade BacktestEnhanced Seasonality Trade Backtest
Overview
A comprehensive Pine Script indicator that backtests seasonal trading strategies by analyzing historical price performance during specific date ranges. The tool provides detailed statistics, visual markers, and election cycle filtering to identify profitable seasonal patterns.
Key Features
📊 Backtesting Engine
Tests up to 50 years of historical data
Configurable entry/exit dates (day/month)
Automatic holiday/weekend date adjustment
Separate analysis for long and short positions
🗳️ Election Cycle Filter
All Years: Test every year in the lookback period
Election Years: US presidential election years only (2024, 2020, 2016...)
Pre-Election Years: Years before elections (2023, 2019, 2015...)
Post-Election Years: Years after elections (2021, 2017, 2013...)
📈 Comprehensive Statistics
Win rate percentage
Total and average returns
Best/worst performing years
Detailed trade-by-trade breakdown
Years tested vs. years filtered
🎯 Visual Indicators
Entry/exit lines for all historical trades
Future trade date projections
Background highlighting during trade periods
Color-coded performance labels
⚙️ Customization Options
Toggle between long/short analysis
Show/hide price and date details
Adjustable table position
Future trade date visualization
Use Cases
Seasonal Trading: Identify recurring profitable periods (e.g., "Sell in May")
Election Cycle Analysis: Test how political cycles affect market performance
Strategy Validation: Backtest specific date-range strategies
Risk Assessment: Analyze worst-case scenarios and drawdowns
Perfect For
Swing traders looking for seasonal edges
Portfolio managers timing market entries/exits
Researchers studying market cyclicality
Anyone wanting to quantify seasonal market behavior
ONLY WORKS IN 1D TIME FRAME
copper/goldThe Copper/Gold ratio is a macroeconomic indicator that reflects the market’s risk appetite and economic expectations.
Copper, often referred to as “Doctor Copper,” is closely tied to industrial growth and construction demand. Gold, on the other hand, is considered a safe-haven asset during times of uncertainty.
When the ratio rises, it suggests optimism about economic expansion. A declining ratio, however, may signal caution, stagnation, or even recessionary concerns.
This ratio is frequently used to confirm macro trends, evaluate inflation expectations, or assess bond yield directions.
time-specific standard devs [keypoems]Time-Specific Net Change Percentage Standard Deviations Extensions
A candlestick is the story of how price moved during a single period: it opens, explores a high and a low, and finally closes.
The indicator asks one question:
“By what percentage did price change from open to close?”
That single percentage value – called the net-change % – is the raw material for everything that follows.
Why net-change % matters
If you collect that percentage for thousands of finished candles (daily candles, 1-hour, 4-hour – whatever you close) you get a probability distribution: most candles move only a little, a few move a lot. When you plot those percentages you get the familiar bell-curve. From any bell-curve you can read two key statistics:
Mean – the “typical” net-change.
Standard Deviation (σ) – how far a candle normally wanders from that mean.
A well-known property of a bell-curve is that ≈68 % of all observations stay between –1 σ and +1 σ, and ≈95 % stay within ±2 σ.
For traders that translates into a probabilistic map of where an unfinished candle is likely to close.
What the indicator draws
Open-anchored levels
Every box is centred on the candle’s open price.
The indicator draws boxes that mark +σ, +½ σ, –½ σ, –σ … as selected in the Inputs.
Time-specific calculation
Instead of mixing all 1-hour candles together, the script isolates only the 09:00-10:00 New-York hour (or any other slot you are at that moment) and builds a bell-curve from that subset.
The result is a set of expectations truly tailored to that exact hour’s behaviour.
Generic and Specific Std Dev Box
Indicator computes both generic levels – the classic “all candles aggregated” standard deviations, and specific levels – the refined, hour-by-hour (or 4-hour-by-4-hour, etc.) deviations.
The indicator shows Boxes that represent both aggregated values and "per period" standard deviation projection levels.
Mirrored levels (optional)
Negative σ levels are drawn automatically so you have symmetrical upside & downside projections.
Math behind the scenes
For each chosen higher-timeframe (HTF):
Collect the last N net-change % values (user-defined look-back, default 5 000 candles).
Compute:
μ = mean(net-change %)
σ = stdev(net-change %)
Project prices:
LevelPrice = Open × (1 + k × σ)
where k is 0 , ±0.5 , ±1 , ±1.5 … as enabled in the inputs.
Because everything is done in percentage space the technique adapts automatically to instruments that trade at very different absolute prices (equities, futures, crypto, FX).
How to read it in real time
When a developing candle races straight into +1 σ with plenty of time left, statistics say “68 % of the time it will finish back inside the box.”
A tag of +2 σ is an even rarer event (~5 % probability) – a natural place to look for exhaustion or take-profit cues.
Conversely, if price refuses to reverse at +1 σ and instead sticks above that edge, it is signalling an unusually strong session and may warrant trend-continuation tactics.
Key Inputs
Higher Timeframe Choose 5m to H8 reference frame
Show levels for last X periods
Look-back length Sample size for σ
StdDev Fibs Fib1 … Fib9 toggles & values: Decide which σ multiples to plot
Mirror levels Draw matching negative projections
Extend boxes Keep boxes visible beyond their candle
Best-practice usage
Combine with structure – treat σ edges as context, not automatic entry.
Mind the sample size – if you choose extremely narrow windows (e.g., Sunday 18:00-19:00 futures open) make sure your look-back still captures hundreds of cases.
Disclaimer
Trading involves risk. The author and this indicator simply display historical probability ranges; they do not assure profits or prevent losses. Always perform your own due diligence and, if necessary, consult a licensed financial professional before dealing in any financial instrument.
Money Risk Management with Trade Tracking
Overview
The Money Risk Management with Trade Tracking indicator is a powerful tool designed for traders on TradingView to simplify trade simulation and risk management. Unlike the TradingView Strategy Tester, which can be complex for beginners, this indicator provides an intuitive, beginner-friendly interface to evaluate trading strategies in a realistic manner, mirroring real-world trading conditions.
Built on the foundation of open-source contributions from LuxAlgo and TCP, this indicator integrates external indicator signals, overlays take-profit (TP) and stop-loss (SL) levels, and provides detailed money management analytics. It empowers traders to visualize potential profits, losses, and risk-reward ratios, making it easier to understand the financial outcomes of their strategies.
Key Features
Signal Integration: Seamlessly integrates with external long and short signals from other indicators, allowing traders to overlay TP/SL levels based on their preferred strategies.
Realistic Trade Simulation: Simulates trades as they would occur in real-world scenarios, accounting for initial capital, risk percentage, leverage, and compounding effects.
Money Management Dashboard: Displays critical metrics such as current capital, unrealized P&L, risk amount, potential profit, risk-reward ratio, and trade status in a customizable, beginner-friendly table.
TP/SL Visualization: Plots TP and SL levels on the chart with customizable styles (solid, dashed, dotted) and colors, along with optional labels for clarity.
Performance Tracking: Tracks total trades, win/loss counts, win rate, and profit factor, providing a clear overview of strategy performance.
Liquidation Risk Alerts: Warns traders if stop-loss levels risk liquidation based on leverage settings, enhancing risk awareness.
Benefits for Traders
Beginner-Friendly: Simplifies the complexities of the TradingView Strategy Tester, offering an intuitive interface for new traders to simulate and evaluate trades without confusion.
Real-World Insights: Helps traders understand the actual profit or loss potential of their strategies by factoring in capital, risk, and leverage, bridging the gap between theoretical backtesting and real-world execution.
Enhanced Decision-Making: Provides clear, real-time analytics on risk-reward ratios, unrealized P&L, and trade performance, enabling informed trading decisions.
Customizable and Flexible: Allows customization of TP/SL settings, table positions, colors, and sizes, catering to individual trader preferences.
Risk Management Focus: Encourages disciplined trading by highlighting risk amounts, potential profits, and liquidation risks, fostering better financial planning.
Why This Indicator Stands Out
Many traders struggle to translate backtested strategy results into real-world outcomes due to the abstract nature of percentage-based profitability metrics. This indicator addresses that challenge by providing a practical, user-friendly tool that simulates trades with real-world parameters like capital, leverage, and compounding. Its open-source nature ensures accessibility, while its integration with other indicators makes it versatile for various trading styles.
How to Use
Add to TradingView: Copy the Pine Script code into TradingView’s Pine Editor and add it to your chart.
Configure Inputs: Set your initial capital, risk percentage, leverage, and TP/SL values in the indicator settings. Select external long/short signal sources if integrating with other indicators.
Monitor Dashboards: Use the Money Management and Target Dashboard tables to track trade performance and risk metrics in real time.
Analyze Results: Review win rates, profit factors, and P&L to refine your trading strategy.
Credits
This indicator builds upon the open-source contributions of LuxAlgo and TCP , whose efforts in sharing their code have made this tool possible. Their dedication to the trading community is deeply appreciated.
Nova SMC Key TimesThe Nova SMC Key Times is a focused TradingView® indicator tailored for futures traders who want clear visual markers at key session transitions. Designed with simplicity in mind, it automatically plots two dashed vertical lines each trading day to highlight the pre-market and official market-open times (adjusted for Micro E-mini S&P 500 and Micro Gold contracts).
Pre-Market Marker: A semi-transparent white dashed line drawn at the start of pre-market activity, helping you observe early liquidity movements and potential order accumulation.
Market-Open Marker: A fully opaque white dashed line at the exact opening bar of the main session, providing a clear reference for breakout attempts and volatility spikes.
Because LSF detects the appropriate timestamps based on the loaded symbol (MES1! or MGC1!), you never need to manually set session times. If applied to other symbols, it remains silent, ensuring that charts stay uncluttered.
You can easily customize line colors to match your visual preferences under the provided style settings. By visually framing these two critical moments each day, Nova LSF helps traders anticipate stop hunts, breakout retests, and initial momentum moves—making it a useful complement to any liquidity-oriented or order-flow strategy.