Zero Lag Trend Signals (MTF) [Quant Trading] V7Overview
The Zero Lag Trend Signals (MTF) V7 is a comprehensive trend-following strategy that combines Zero Lag Exponential Moving Average (ZLEMA) with volatility-based bands to identify high-probability trade entries and exits. This strategy is designed to reduce lag inherent in traditional moving averages while incorporating dynamic risk management through ATR-based stops and multiple exit mechanisms.
This is a longer term horizon strategy that takes limited trades. It is not a high frequency trading and therefore will also have limited data and not > 100 trades.
How It Works
Core Signal Generation:
The strategy uses a Zero Lag EMA (ZLEMA) calculated by applying an EMA to price data that has been adjusted for lag:
Calculate lag period: floor((length - 1) / 2)
Apply lag correction: src + (src - src )
Calculate ZLEMA: EMA of lag-corrected price
Volatility bands are created using the highest ATR over a lookback period multiplied by a band multiplier. These bands are added to and subtracted from the ZLEMA line to create upper and lower boundaries.
Trend Detection:
The strategy maintains a trend variable that switches between bullish (1) and bearish (-1):
Long Signal: Triggers when price crosses above ZLEMA + volatility band
Short Signal: Triggers when price crosses below ZLEMA - volatility band
Optional ZLEMA Trend Confirmation:
When enabled, this filter requires ZLEMA to show directional momentum before entry:
Bullish Confirmation: ZLEMA must increase for 4 consecutive bars
Bearish Confirmation: ZLEMA must decrease for 4 consecutive bars
This additional filter helps avoid false signals in choppy or ranging markets.
Risk Management Features:
The strategy includes multiple stop-loss and take-profit mechanisms:
Volatility-Based Stops: Default stop-loss is placed at ZLEMA ± volatility band
ATR-Based Stops: Dynamic stop-loss calculated as entry price ± (ATR × multiplier)
ATR Trailing Stop: Ratcheting stop-loss that follows price but never moves against position
Risk-Reward Profit Target: Take-profit level set as a multiple of stop distance
Break-Even Stop: Moves stop to entry price after reaching specified R:R ratio
Trend-Based Exit: Closes position when price crosses EMA in opposite direction
Performance Tracking:
The strategy includes optional features for monitoring and analyzing trades:
Floating Statistics Table: Displays key metrics including win rate, GOA (Gain on Account), net P&L, and max drawdown
Trade Log Labels: Shows entry/exit prices, P&L, bars held, and exit reason for each closed trade
CSV Export Fields: Outputs trade data for external analysis
Default Strategy Settings
Commission & Slippage:
Commission: 0.1% per trade
Slippage: 3 ticks
Initial Capital: $1,000
Position Size: 100% of equity per trade
Main Calculation Parameters:
Length: 70 (range: 70-7000) - Controls ZLEMA calculation period
Band Multiplier: 1.2 - Adjusts width of volatility bands
Entry Conditions (All Disabled by Default):
Use ZLEMA Trend Confirmation: OFF - Requires ZLEMA directional momentum
Re-Enter on Long Trend: OFF - Allows multiple entries during sustained trends
Short Trades:
Allow Short Trades: OFF - Strategy is long-only by default
Performance Settings (All Disabled by Default):
Use Profit Target: OFF
Profit Target Risk-Reward Ratio: 2.0 (when enabled)
Dynamic TP/SL (All Disabled by Default):
Use ATR-Based Stop-Loss & Take-Profit: OFF
ATR Length: 14
Stop-Loss ATR Multiplier: 1.5
Profit Target ATR Multiplier: 2.5
Use ATR Trailing Stop: OFF
Trailing Stop ATR Multiplier: 1.5
Use Break-Even Stop-Loss: OFF
Move SL to Break-Even After RR: 1.5
Use Trend-Based Take Profit: OFF
EMA Exit Length: 9
Trade Data Display (All Disabled by Default):
Show Floating Stats Table: OFF
Show Trade Log Labels: OFF
Enable CSV Export: OFF
Trade Label Vertical Offset: 0.5
Backtesting Date Range:
Start Date: January 1, 2018
End Date: December 31, 2069
Important Usage Notes
Default Configuration: The strategy operates in its most basic form with default settings - using only ZLEMA crossovers with volatility bands and volatility-based stop-losses. All advanced features must be manually enabled.
Stop-Loss Priority: If multiple stop-loss methods are enabled simultaneously, the strategy will use whichever condition is hit first. ATR-based stops override volatility-based stops when enabled.
Long-Only by Default: Short trading is disabled by default. Enable "Allow Short Trades" to trade both directions.
Performance Monitoring: Enable the floating stats table and trade log labels to visualize strategy performance during backtesting.
Exit Mechanisms: The strategy can exit trades through multiple methods: stop-loss hit, take-profit reached, trend reversal, or trailing stop activation. The trade log identifies which exit method was used.
Re-Entry Logic: When "Re-Enter on Long Trend" is enabled with ZLEMA trend confirmation, the strategy can take multiple long positions during extended uptrends as long as all entry conditions remain valid.
Capital Efficiency: Default setting uses 100% of equity per trade. Adjust "default_qty_value" to manage position sizing based on risk tolerance.
Realistic Backtesting: Strategy includes commission (0.1%) and slippage (3 ticks) to provide realistic performance expectations. These values should be adjusted based on your broker and market conditions.
Recommended Use Cases
Trending Markets: Best suited for markets with clear directional moves where trend-following strategies excel
Medium to Long-Term Trading: The default length of 70 makes this strategy more appropriate for swing trading rather than scalping
Risk-Conscious Traders: Multiple stop-loss options allow traders to customize risk management to their comfort level
Backtesting & Optimization: Comprehensive performance tracking features make this strategy ideal for testing different parameter combinations
Limitations & Considerations
Like all trend-following strategies, performance may suffer in choppy or ranging markets
Default 100% position sizing means full capital exposure per trade - consider reducing for conservative risk management
Higher length values (70+) reduce signal frequency but may improve signal quality
Multiple simultaneous risk management features may create conflicting exit signals
Past performance shown in backtests does not guarantee future results
Customization Tips
For more aggressive trading:
Reduce length parameter (minimum 70)
Decrease band multiplier for tighter bands
Enable short trades
Use lower profit target R:R ratios
For more conservative trading:
Increase length parameter
Enable ZLEMA trend confirmation
Use wider ATR stop-loss multipliers
Enable break-even stop-loss
Reduce position size from 100% default
For optimal choppy market performance:
Enable ZLEMA trend confirmation
Increase band multiplier
Use tighter profit targets
Avoid re-entry on trend continuation
Visual Elements
The strategy plots several elements on the chart:
ZLEMA line (color-coded by trend direction)
Upper and lower volatility bands
Long entry markers (green triangles)
Short entry markers (red triangles, when enabled)
Stop-loss levels (when positions are open)
Take-profit levels (when enabled and positions are open)
Trailing stop lines (when enabled and positions are open)
Optional ZLEMA trend markers (triangles at highs/lows)
Optional trade log labels showing complete trade information
Exit Reason Codes (for CSV Export)
When CSV export is enabled, exit reasons are coded as:
0 = Manual/Other
1 = Trailing Stop-Loss
2 = Profit Target
3 = ATR Stop-Loss
4 = Trend Change
Conclusion
Zero Lag Trend Signals V7 provides a robust framework for trend-following with extensive customization options. The strategy balances simplicity in its core logic with sophisticated risk management features, making it suitable for both beginner and advanced traders. By reducing moving average lag while incorporating volatility-based signals, it aims to capture trends earlier while managing risk through multiple configurable exit mechanisms.
The modular design allows traders to start with basic trend-following and progressively add complexity through ZLEMA confirmation, multiple stop-loss methods, and advanced exit strategies. Comprehensive performance tracking and export capabilities make this strategy an excellent tool for systematic testing and optimization.
Note: This strategy is provided for educational and backtesting purposes. All trading involves risk. Past performance does not guarantee future results. Always test thoroughly with paper trading before risking real capital, and adjust position sizing and risk parameters according to your risk tolerance and account size.
================================================================================
TAGS:
================================================================================
trend following, ZLEMA, zero lag, volatility bands, ATR stops, risk management, swing trading, momentum, trend confirmation, backtesting
================================================================================
CATEGORY:
================================================================================
Strategies
================================================================================
CHART SETUP RECOMMENDATIONS:
================================================================================
For optimal visualization when publishing:
Use a clean chart with no other indicators overlaid
Select a timeframe that shows multiple trade signals (4H or Daily recommended)
Choose a trending asset (crypto, forex major pairs, or trending stocks work well)
Show at least 6-12 months of data to demonstrate strategy across different market conditions
Enable the floating stats table to display key performance metrics
Ensure all indicator lines (ZLEMA, bands, stops) are clearly visible
Use the default chart type (candlesticks) - avoid Heikin Ashi, Renko, etc.
Make sure symbol information and timeframe are clearly visible
================================================================================
COMPLIANCE NOTES:
================================================================================
✅ Open-source publication with complete code visibility
✅ English-only title and description
✅ Detailed explanation of methodology and calculations
✅ Realistic commission (0.1%) and slippage (3 ticks) included
✅ All default parameters clearly documented
✅ Performance limitations and risks disclosed
✅ No unrealistic claims about performance
✅ No guaranteed results promised
✅ Appropriate for public library (original trend-following implementation with ZLEMA)
✅ Educational disclaimers included
✅ All features explained in detail
================================================================================
指標和策略
Turtle Donchian Screener — with signalsTurtle strategy for Pine screener. Signals for buy and sell long positions.
Liquidity Sweeps & Swings (SMC/ICT)Liquidity Sweeps & Swings (SMC/ICT) — TradingATH
Precision. Clarity. Structure.
This refined indicator automatically detects and displays Liquidity Sweeps and Liquidity Swings , highlighting the precise points where liquidity is taken and where structure shifts occur within price action.
Designed for traders applying Smart Money Concepts (SMC/ICT) , it offers a clear, data-driven visualization of market dynamics — providing structural context with professional accuracy and visual balance.
What You’ll See
Liquidity Sweeps represented as compact shaded zones, green for bullish sweeps and red for bearish ones, fading automatically once mitigated.
Liquidity Swings precisely labeled “ Swing High ” and “ Swing Low ” at major pivot points, cleanly positioned within structure.
Controlled-length zones that extend for a defined number of bars or dynamically until mitigation.
Optional real-time alerts when a new sweep forms or price re-enters an active zone.
Features
Sweep Detection Logic : Identifies liquidity grabs using Wick, Close, or Wick + Close validation for flexible precision across different market conditions.
Smart Mitigation : Zones dynamically fade or are removed once price mitigates the area, keeping your chart clean and relevant.
Swing Mapping : Highlights key pivot points to outline market structure shifts with precise and minimal labeling.
ATR Filtering : Optional volatility-based filter removes minor or insignificant sweeps to maintain clarity.
Elegant Design : Subtle colors, refined typography, and balanced spacing ensure a professional, unobtrusive presentation.
Alerts and Updates : Automated alerts for new sweep formations and live interaction with active zones.
Professional Architecture : Efficient execution, size-safe arrays, and optimized plotting for smooth performance on any timeframe.
ICT/SMC Ready : Fully compatible with advanced institutional concepts such as Fair Value Gaps, Order Blocks, and Market Structure Shifts.
Perfect For
Traders applying ICT or Smart Money Concepts methodologies to identify liquidity grabs and structural intent.
Intraday Traders seeking precise, uncluttered sweep and swing identification on volatile charts.
Swing Traders filtering high-probability setups based on liquidity structure and mitigation behavior.
Analysts requiring clarity, reliability, and technical precision in their liquidity mapping tools.
Recommended Settings
Pivot Lookback : 14 (balanced structural sensitivity).
Sweep Validation : Wick + Close (adaptive precision).
Zone Length : 150 bars (controlled visual reach).
ATR Filter : Minimum 0.25×, Maximum 3× (clean sweep selection).
Swing Labels : Enabled (for structural clarity).
In Short
Clean logic. Institutional precision. Professional clarity.
Liquidity Sweeps & Swings (SMC/ICT) delivers a disciplined and refined visualization of liquidity flow and structural shifts — crafted for traders who demand both analytical accuracy and visual sophistication.
Created by: TradingATH
10 EMA10 ema + color change
35
70
140
420
840
1400
2100
2940
3150
4725
I created this script for use in different chart layouts. I modified it to use the colors and EMA numbers I'm currently using.
Inside Bar + Harami ComboThis indicator visually highlights Inside Bars, Outside Bars, and Harami candlestick patterns directly on your chart using clean color-coded candles — no labels, no shapes, just visual clarity.
It helps traders quickly identify potential reversal and continuation setups by coloring candles according to the detected pattern type.
🔍 Patterns Detected
🟨 Inside Bar — Current candle’s range is completely inside the previous candle’s range.
Often signals price contraction before a breakout.
💗 Outside Bar — Current candle’s high and low exceed the previous candle’s range.
Indicates volatility expansion and possible trend continuation.
🟩 Bullish Harami — A small bullish candle within the body of a prior bearish candle.
Suggests potential reversal to the upside.
🟥 Bearish Harami — A small bearish candle within the body of a prior bullish candle.
Suggests potential reversal to the downside.
⚙️ Features
Customizable colors for each pattern type.
Simple overlay visualization — no shapes, no labels, just colored candles.
Harami colors automatically override Inside/Outside colors when both occur on the same bar.
Lightweight logic for smooth performance on any timeframe or symbol.
💡 How to Use
Apply the indicator to your chart.
Configure colors in the settings panel if desired.
Watch for highlighted candles:
Inside Bars often precede breakouts.
Harami patterns can mark reversal zones.
Combine with trend tools (like moving averages) to confirm setups.
⚠️ Note
This indicator is for visual pattern detection and educational use only.
Always combine candlestick signals with broader technical or market context before trading decisions.
Volume + MA5 & MA10This Volume + MA5 & MA10 (Technical Volume Trend Analysis)
The Volume + MA5 & MA10 indicator provides a precise view of market participation and volume momentum by combining raw volume data with two moving averages (MA5 and MA10). It’s designed for traders who rely on volume-based confirmation to validate price movements, breakouts, and trend reversals.
🔍 Overview
This indicator displays volume bars alongside two smooth volume averages — MA5 (short-term) and MA10 (medium-term) — making it easier to detect shifts in market activity.
When the short-term average crosses above or below the long-term average, it signals a potential change in trading intensity or market sentiment.
⚙️ Key Features
Dual Volume Moving Averages (MA5 & MA10) for short- and medium-term analysis.
Dynamic Bar Coloring based on whether current volume exceeds MA5 or MA10.
Crossover Detection with visual markers for MA5/MA10 intersections.
Alert Conditions to notify you of significant volume trend shifts.
Fully customizable appearance and smoothing options.
📊 How to Interpret
MA5 > MA10 → Increasing short-term volume activity (strengthening momentum).
MA5 < MA10 → Decreasing short-term volume (weakening participation).
Rising volume with price → Confirms trend strength.
Falling volume with rising/falling price → Suggests potential reversal or reduced conviction.
💡 Applications
Confirm breakouts and trend continuations.
Identify momentum divergences between price and volume.
Filter out low-volume or weak-trend setups.
Combine with RSI, MACD, or moving averages for enhanced signal validation.
✅ Advantages
Simple yet powerful structure for clean visual analysis.
Works across all timeframes and markets (crypto, stocks, forex, indices).
No repainting — reliable for both live and historical backtesting.
Use Volume + MA5 & MA10 to strengthen your technical analysis and gain a deeper understanding of how market participation drives price trends.
OBV (Delta or regular)This is a quite simple script to apply some choices to OBV.
You can choose to use regular OBV values or you can choose to use delta OBV values.
Delta OBV values calculates the delta between selling volume and buying volume per bar to find discrepancies.
You can make the OBV a smoothed line or just keep the normal rigid line. Rigid line is default.
A secondary smoothed OBV line is added automatically with color change if the OBV is above or below the smoothed line.
You can set your desired MA from SMA, EMA, VWMA and WMA, The same will be applied to both lines if chosen to smooth them both.
Both lines are editable from the styles tab (visibility, color and line type)
If you for some reason don't want color change on the secondary line, chose the same color for both color 1 and 2.
Simple delta OBV example:
If a red bar has a long lower wick, OBV will calculate the entire bar towards bearish volume, while the delta will check if there's more buying or selling happening in total. Some times you'll be able to catch divergences in the volume which implies a reversal might be in the making.
For instance more selling on a green candle making the OBV drop instead of increasing or vise versa.
Hopefully someone finds is useful.
EMA 9 + VWAP Bands Crossover With Buy Sell SignalsEMA 9 + VWAP Bands Crossover With Buy Sell Signal. Includes alerts
Holt Damped Forecast [CHE]A Friendly Note on These Pine Script Scripts
Hey there! Just wanted to share a quick, heartfelt heads-up: All these Pine Script examples come straight from my own self-study adventures as a total autodidact—think late nights tinkering and learning on my own. They're purely for educational vibes, helping me (and hopefully you!) get the hang of Pine Script basics, cool indicators, and building simple strategies.
That said, please know this isn't any kind of financial advice, investment nudge, or pro-level trading blueprint. I'd love for you to dive in with your own research, run those backtests like a champ, and maybe bounce ideas off a qualified expert before trying anything in a real trading setup. No guarantees here on performance or spot-on accuracy—trading's got its risks, and those are totally on each of us.
Let's keep it fun and educational—happy coding! 😊
Holt Damped Forecast — Damped trend forecasts with fan bands for uncertainty visualization and momentum integration
Summary
This indicator applies damped exponential smoothing to generate forward price forecasts, displaying them as probabilistic fan bands to highlight potential ranges rather than point estimates. It incorporates residual-based uncertainty to make projections more reliable in varying market conditions, reducing overconfidence in strong trends. Momentum from the trend component is shown in an optional label alongside signals, aiding quick assessment of direction and strength without relying on lagging oscillators.
Motivation: Why this design?
Standard exponential smoothing often extrapolates trends indefinitely, leading to unrealistic forecasts during mean reversion or weakening momentum. This design uses damping to gradually flatten long-term projections, better suiting real markets where trends fade. It addresses the need for visual uncertainty in forecasts, helping traders avoid entries based on overly optimistic point predictions.
What’s different vs. standard approaches?
- Reference baseline: Diverges from basic Holt's linear exponential smoothing, which assumes persistent trends without decay.
- Architecture differences:
- Adds damping to the trend extrapolation for finite-horizon realism.
- Builds fan bands from historical residuals for probabilistic ranges at multiple confidence levels.
- Integrates a dynamic label combining forecast details, scaled momentum, and directional signals.
- Applies tail background coloring to recent bars based on forecast direction for immediate visual cues.
- Practical effect: Charts show converging forecast bands over time, emphasizing shorter horizons where accuracy is higher. This visibly tempers aggressive projections in trends, making it easier to spot when uncertainty widens, which signals potential reversals or consolidation.
How it works (technical)
The indicator maintains two persistent components: a level tracking the current price baseline and a trend capturing directional slope. On each bar, the level updates by blending the current source price with a one-step-ahead expectation from the prior level and damped trend. The trend then adjusts by weighting the change in level against the prior damped trend. Forecasts extend this forward over a user-defined number of steps, with damping ensuring the trend influence diminishes over distance.
Uncertainty derives from the standard deviation of historical residuals—the differences between actual prices and one-step expectations—scaled by the damping structure for the forecast horizon. Bands form around the median forecast at specified confidence intervals using these scaled errors. Initialization seeds the level to the first bar's price and trend to zero, with persistence handling subsequent updates. A security call fetches the last bar index for tail logic, using lookahead to align with realtime but introducing minor repaint on unconfirmed bars.
Parameter Guide
The Source parameter selects the price input for level and residual calculations, defaulting to close; consider using high or low for assets sensitive to volatility, as close works well for most trend-following setups. Forecast Steps (h) defines the number of bars ahead for projections, defaulting to 4—shorter values like 1 to 5 suit intraday trading, while longer ones may widen bands excessively in choppy conditions. The Color Scheme (2025 Trends) option sets the base, up, and down colors for bands, labels, and backgrounds, starting with Ruby Dawn; opt for serene schemes on clean charts or vibrant ones to stand out in dark themes.
Level Smoothing α controls the responsiveness of the price baseline, defaulting to 0.3—values above 0.5 enhance tracking in fast markets but may amplify noise, whereas lower settings filter disturbances better. Trend Smoothing β adjusts sensitivity to slope changes, at 0.1 by default; increasing to 0.2 helps detect emerging shifts quicker, but keeping it low prevents whipsaws in sideways action. Damping φ (0..1) governs trend persistence, defaulting to 0.8—near 0.9 preserves carryover in sustained moves, while closer to 0.5 curbs overextensions more aggressively.
Show Fan Bands (50/75/95) toggles the probabilistic range display, enabled by default; disable it in oscillator panes to reduce clutter, but it's key for overlay forecasts. Residual Window (Bars) sets the length for deviation estimates, at 400 bars initially—100 to 200 works for short timeframes, and 500 or more adds stability over extended histories. Line Width determines the thickness of band and median lines, defaulting to 2; go thicker at 3 to 5 for emphasis on higher timeframes or thinner for layered indicators.
Show Median/Forecast Line reveals the central projection, on by default—hide if bands provide enough detail, or keep for pinpoint entry references. Show Integrated Label activates the combined view of forecast, momentum, and signal, defaulting to true; it's right-aligned for convenience, so turn it off on smaller screens to save space. Show Tail Background colors the last few bars by forecast direction, enabled initially; pair low transparency for subtle hints or higher for bolder emphasis.
Tail Length (Bars) specifies bars to color backward from the current one, at 3 by default—1 to 2 fits scalping, while 5 or more underscores building momentum. Tail Transparency (%) fades the background intensity, starting at 80; 50 to 70 delivers strong signals, and 90 or above allows seamless blending. Include Momentum in Label adds the scaled trend value, defaulting to true—ATR% scaling here offers relative strength context across assets.
Include Long/Short/Neutral Signal in Label displays direction from the trend sign, on by default; neutral helps in ranging markets, though it can be overlooked during strong trends. Scaling normalizes momentum output (raw, ATR-relative, or level-relative), set to ATR% initially—ATR% ensures cross-asset comparability, while %Level provides percentage perspectives. ATR Length defines the period for true range averaging in scaling, at 14; align it with your chart timeframe or shorten for quicker volatility responses.
Decimals sets precision in the momentum label, defaulting to 2—0 to 1 yields clean integers, and 3 or more suits detailed forex views. Show Zero-Cross Markers places arrows at direction changes, enabled by default; keep size small to minimize clutter, with text labels for fast scanning.
Reading & Interpretation
Fan bands expand outward from the current bar, with the median line as the central forecast—narrower bands indicate lower uncertainty, wider suggest caution. Colors tint up (positive forecast vs. prior level) in the scheme's up hue and down otherwise. The optional label lists the horizon, median, and range brackets at 50%, 75%, and 95% levels, followed by momentum (scaled per mode) and signal (Long if positive trend, Short if negative, Neutral if zero). Zero-cross arrows mark trend flips: upward triangle below bar for bullish cross, downward above for bearish. Tail background reinforces the forecast direction on recent bars.
Practical Workflows & Combinations
- Trend following: Enter long on upward zero-cross if median forecast rises above price and bands contain it; confirm with higher highs/lows. Short on downward cross with falling median.
- Exits/Stops: Trail stops below 50% lower band in longs; exit if momentum drifts negative or signal turns neutral. Use wider bands (75/95%) for conservative holds in volatile regimes.
- Multi-asset/Multi-TF: Defaults work across stocks, forex, crypto on 5m-1D; scale steps by TF (e.g., 10+ on daily). Layer with volume or structure tools—avoid over-reliance on isolated crosses.
Behavior, Constraints & Performance
Closed-bar logic ensures stable historical plots, but realtime updates via security lookahead may shift forecasts until bar confirmation, introducing minor repaint on the last bar. No explicit HTF calls beyond bar index fetch, minimizing gaps but watch for low-liquidity assets. Resources include a 2000-bar lookback for residuals and up to 500 labels, with no loops—efficient for most charts. Known limits: Early bars show wide bands due to sparse residuals; assumes stationary errors, so gaps or regime shifts widen inaccuracies.
Sensible Defaults & Quick Tuning
Start with defaults for balanced smoothing on 15m-4H charts. For choppy conditions (too many crosses), lower β to 0.05 and raise residual window to 600 for stability. In trending markets (sluggish signals), increase α/β to 0.4/0.2 and shorten steps to 2. If bands overexpand, boost φ toward 0.95 to preserve trend carry. Tune colors for theme fit without altering logic.
What this indicator is—and isn’t
This is a visualization and signal layer for damped forecasts and momentum, complementing price action analysis. It isn’t a standalone system—pair with risk rules and broader context. Not predictive beyond the horizon; use for confirmation, not blind entries.
Disclaimer
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Do not use this indicator on Heikin-Ashi, Renko, Kagi, Point-and-Figure, or Range charts, as these chart types can produce unrealistic results for signal markers and alerts.
Best regards and happy trading
Chervolino
Turtle Donchian Screener — with signalsTurtle strategy for Pine screener — with signals for buy and sell (long positions).
Kalman Exponential SuperTrendThe Kalman Exponential SuperTrend is a new, smoother & superior version of the famous "SuperTrend". Using Kalman smoothing, a concept from the EMA (Exponential Moving Average), this script leverages the best out of each and combines it into a single indicator.
How does it work?
First, we need to calculate the Kalman smoothed source. This is a kind of complex calculation, so you need to study it if you want to know how it works precisely. It smooths the source of the SuperTrend, which helps us smooth the SuperTrend.
Then, we calculate "a" where:
n = user defined ATR length
a = 2/(n+1)
Now we calculate the ATR over "n" period. Classical calculation, nothing changed here.
Now we calculate the SuperTrend using the Kalman smoothed source & ATR where:
kalman = kalman smoothed source
ATR = Average True Range
m = Factor chosen by user.
Upper Band = kalman + ATR * m
Lower Band = kalman - ATR * m
Now we just smooth it a bit further using the "a" and a concept from the EMA.
u1 = Upper Band a bar ago
l1 = Lower Band a bar ago
u = Upper Band
l = Lower Band
Upper = u1 * (1-a) + u * a
Lower = l1 * (1-a) + u * a
When the classical (not Kalman) source crosses above the Upper, it indicates an uptrend. When it crosses below the Lower, it indicates a downtrend.
Methodology & Concepts
When I took a look at the classical SuperTrend => It was just far too slow, and if I made it faster it was noisy as hell. So I decided I would try to make up for it.
I tried the gaussian, bilateral filter, but then I tried kalman and that worked the best, so I added it. Now it was still too noisy and unconsistent, so I revisited my knowledge of concepts and picked the one from the EMA, and it kinda solved it.
In the core of the indicator, all it does is combine them in a really simple way, but if you go more deeply you see how it fits the puzzlé really well.
It is not about trying out random things´=> but about seeking what it is missing and trying to lessen its bad side.
That is the entire point of this indicator => Offer a unique approach to the SuperTrend type, that lessen the bad sides of it.
I also added different plotting types, this is so everyone can find their favorite
Enjoy Gs!
Simple VWAP + BandsSimple VWAP + Bands
A clean and customizable VWAP (Volume Weighted Average Price) indicator with standard deviation bands and RTH (Regular Trading Hours) session support.
Features:
- VWAP Line: Volume-weighted average price calculation
- Three Standard Deviation Bands: Configurable bands at 1σ, 2σ, and 3σ levels (above and below VWAP)
- RTH Session Support: Option to calculate VWAP only during regular trading hours
- Customizable Session Times: Configure your own trading session hours and timezone
- Clean Visualization: Line breaks between sessions prevent messy connections across non-trading periods
- Toggle Bands: Show/hide individual standard deviation bands as needed
Use Cases:
- Identify overbought/oversold conditions relative to volume-weighted price
- Track price deviation from VWAP during trading sessions
- Support and resistance levels based on standard deviations
- Mean reversion trading strategies
RBLR - GSK Vizag AP IndiaThis indicator identifies the Opening Range High (ORH) and Low (ORL) based on the first 15 minutes of the Indian equity market session (9:15 AM to 9:30 AM IST). It draws horizontal lines extending these levels until market close (3:30 PM IST) and generates visual signals for price breakouts above ORH or below ORL, as well as reversals back into the range.
Key features:
- **Range Calculation**: Captures the high and low during the opening period using real-time bar data.
- **Line Extension**: Lines are dynamically extended bar-by-bar within the session for clear visualization.
- **Signals**:
- Green triangle up: Crossover above ORH (potential bullish breakout).
- Red triangle down: Crossunder below ORL (potential bearish breakout).
- Yellow labels: Reversals from breakout levels back into the range.
- **Labels**: "RAM BAAN" marks the ORH (inspired by a precise arrow from the Ramayana), and "LAKSHMAN REKHA" marks the ORL (inspired by a protective boundary line from the same epic).
- **Customization**: Toggle signals on/off and select line styles (Dotted, Dashed, Solid, or Smoothed, with transparency for Smoothed).
The state-tracking logic prevents redundant signals by monitoring if price remains outside the range after a breakout. This helps users observe range-bound behavior or directional moves without built-in alerts. This indicator is particularly useful for day trading on longer intraday timeframes (e.g., 15-minute charts) to identify session-wide trends and avoid noise in shorter frames. For best results, apply on intraday timeframes on NSE/BSE symbols. Note that lines and labels are limited to the script's max counts to avoid performance issues on long histories.
**Disclaimer**: This indicator is for educational and informational purposes only and does not constitute financial, investment, or trading advice. Trading in financial markets involves significant risk of loss and is not suitable for all investors. Past performance is not indicative of future results. Users should conduct their own research, consider their financial situation, and consult with qualified professionals before making any investment decisions. The author and TradingView assume no liability for any losses incurred from its use.
EMA 9 + VWAP Bands Crossover With Buy Sell SignalsEMA 9 + VWAP Bands Crossover With Buy Sell Signals
Liquidity Stress Index (SOFR - IORB)How to use:
> +10 bps — TIGHT
−5 +10 bps — NEUTRAL
< −5 bps — LOOSE
Grok's xAI Signal (GXS) Indicator for BTC V6Grok's xAI Signal (GXS) Indicator: A Simple Guide
Imagine trying to decide if Bitcoin is a "buy," "sell," or "wait" without staring at 10 different charts. The GXS Indicator does that for you—it's like a smart dashboard for BTC traders, overlaying signals right on your price chart. It boils down complex market clues into one easy score (from -1 "super bearish" to +1 "super bullish") and flashes green/red arrows or shaded zones when action's needed. No fancy math overload; just clear visuals like tiny triangles for trades, colored clouds for trends, and a bottom "mood bar" (green=up vibe, red=down, gray=meh).
At its core, GXS mixes three big-picture checks:
Price Momentum (50% weight): Quick scans of RSI (overbought/oversold vibes), MACD (speed of ups/downs), EMAs (is price riding the trend wave?), and Bollinger Bands (is the market squeezing for a breakout?). This catches short-term "hot or not" energy.
Network Health (30% weight): A simple "NVT" hack using trading volume vs. price to spot if BTC feels undervalued (buy hint) or overhyped (sell warning). It's like checking if the crowd's too excited or chill.
Trend Strength (20% weight): ADX filter ensures signals only fire in "trending" markets (not choppy sideways noise), plus a MACD boost for extra momentum nudge.
Why this approach? BTC's wild—pure price charts give false alarms in flat times, while ignoring volume/network ignores the "why" behind moves. GXS blends old-school TA (reliable for patterns) with on-chain smarts (crypto-specific "under the hood" data) and a trend gate (skips 70% of bad trades). It's conservative: Signals need the score to cross ±0.08 and a strong trend, reducing noise for swing/position traders. Result? Fewer emotional guesses, more "wait for confirmation" patience—perfect for volatile assets like BTC where hype kills.
Quick Tips to Tweak for Better Results
Start with defaults, then experiment on historical charts (backtest via TradingView's strategy tester if pairing with one):
Fewer False Signals: Bump thresholds to ±0.15 (buy/sell)—trades only on stronger conviction, cutting whipsaws by 20-30% in choppy markets. Or raise ADX thresh to 28 for "only big trends."
Faster/Slower Response: Shorten EMAs (e.g., 5/21) or RSI (10) for quicker scalps; lengthen (12/50) for swing holds. Test on 4H/daily BTC.
Volume Sensitivity: If NVT flips too often, extend its length to 20—smooths on-chain noise in bull runs.
Visual Polish: Crank cloud opacity to 80% for subtler fills; toggle off EMAs if they clutter. Enable table for score breakdowns during live trades.
Risk Tip: Always pair with stops (e.g., 2-3% below signals). On BTC, tweak in bull markets (looser thresh) vs. bears (tighter).
In short, GXS is your BTC "sixth sense"—balanced, not black-box. Tweak small, track win rate, and let trends lead. Happy trading!
J.P. Morgan Efficiente 5 IndexJ.P. MORGAN EFFICIENTE 5 INDEX REPLICATION
Walk into any retail trading forum and you'll find the same scene playing out thousands of times a day: traders huddled over their screens, drawing trendlines on candlestick charts, hunting for the perfect entry signal, convinced that the next RSI crossover will unlock the path to financial freedom. Meanwhile, in the towers of lower Manhattan and the City of London, portfolio managers are doing something entirely different. They're not drawing lines. They're not hunting patterns. They're building fortresses of diversification, wielding mathematical frameworks that have survived decades of market chaos, and most importantly, they're thinking in portfolios while retail thinks in positions.
This divide is not just philosophical. It's structural, mathematical, and ultimately, profitable. The uncomfortable truth that retail traders must confront is this: while you're obsessing over whether the 50-day moving average will cross the 200-day, institutional investors are solving quadratic optimization problems across thirteen asset classes, rebalancing monthly according to Markowitz's Nobel Prize-winning framework, and targeting precise volatility levels that allow them to sleep at night regardless of what the VIX does tomorrow. The game you're playing and the game they're playing share the same field, but the rules are entirely different.
The question, then, is not whether retail traders can access institutional strategies. The question is whether they're willing to fundamentally change how they think about markets. Are you ready to stop painting lines and start building portfolios?
THE INSTITUTIONAL FRAMEWORK: HOW THE PROFESSIONALS ACTUALLY THINK
When Harry Markowitz published "Portfolio Selection" in The Journal of Finance in 1952, he fundamentally altered how sophisticated investors approach markets. His insight was deceptively simple: returns alone mean nothing. Risk-adjusted returns mean everything. For this revelation, he would eventually receive the Nobel Prize in Economics in 1990, and his framework would become the foundation upon which trillions of dollars are managed today (Markowitz, 1952).
Modern Portfolio Theory, as it came to be known, introduced a revolutionary concept: through diversification across imperfectly correlated assets, an investor could reduce portfolio risk without sacrificing expected returns. This wasn't about finding the single best asset. It was about constructing the optimal combination of assets. The mathematics are elegant in their logic: if two assets don't move in perfect lockstep, combining them creates a portfolio whose volatility is lower than the weighted average of the individual volatilities. This "free lunch" of diversification became the bedrock of institutional investment management (Elton et al., 2014).
But here's where retail traders miss the point entirely: this isn't about having ten different stocks instead of one. It's about systematic, mathematically rigorous allocation across asset classes with fundamentally different risk drivers. When equity markets crash, high-quality government bonds often rally. When inflation surges, commodities may provide protection even as stocks and bonds both suffer. When emerging markets are in vogue, developed markets may lag. The professional investor doesn't predict which scenario will unfold. Instead, they position for all of them simultaneously, with weights determined not by gut feeling but by quantitative optimization.
This is what J.P. Morgan Asset Management embedded into their Efficiente Index series. These are not actively managed funds where a portfolio manager makes discretionary calls. They are rules-based, systematic strategies that execute the Markowitz framework in real-time, rebalancing monthly to maintain optimal risk-adjusted positioning across global equities, fixed income, commodities, and defensive assets (J.P. Morgan Asset Management, 2016).
THE EFFICIENTE 5 STRATEGY: DECONSTRUCTING INSTITUTIONAL METHODOLOGY
The Efficiente 5 Index, specifically, targets a 5% annualized volatility. Let that sink in for a moment. While retail traders routinely accept 20%, 30%, or even 50% annual volatility in pursuit of returns, institutional allocators have determined that 5% volatility provides an optimal balance between growth potential and capital preservation. This isn't timidity. It's mathematics. At higher volatility levels, the compounding drag from large drawdowns becomes mathematically punishing. A 50% loss requires a 100% gain just to break even. The institutional solution: constrain volatility at the portfolio level, allowing the power of compounding to work unimpeded (Damodaran, 2008).
The strategy operates across thirteen exchange-traded funds spanning five distinct asset classes: developed equity markets (SPY, IWM, EFA), fixed income across the risk spectrum (TLT, LQD, HYG), emerging markets (EEM, EMB), alternatives (IYR, GSG, GLD), and defensive positioning (TIP, BIL). These aren't arbitrary choices. Each ETF represents a distinct factor exposure, and together they provide access to the primary drivers of global asset returns (Fama and French, 1993).
The methodology, as detailed in replication research by Jungle Rock (2025), follows a precise monthly cadence. At the end of each month, the strategy recalculates expected returns and volatilities for all thirteen assets using a 126-day rolling window. This six-month lookback balances responsiveness to changing market conditions against the noise of short-term fluctuations. The optimization engine then solves for the portfolio weights that maximize expected return subject to the 5% volatility target, with additional constraints to prevent excessive concentration.
These constraints are critical and reveal institutional wisdom that retail traders typically ignore. No single ETF can exceed 20% of the portfolio, except for TIP and BIL which can reach 50% given their defensive nature. At the asset class level, developed equities are capped at 50%, bonds at 50%, emerging markets at 25%, and alternatives at 25%. These aren't arbitrary limits. They're guardrails preventing the optimization from becoming too aggressive during periods when recent performance might suggest concentrating heavily in a single area that's been hot (Jorion, 1992).
After optimization, there's one final step that appears almost trivial but carries profound implications: weights are rounded to the nearest 5%. In a world of fractional shares and algorithmic execution, why round to 5%? The answer reveals institutional practicality over mathematical purity. A portfolio weight of 13.7% and 15.0% are functionally similar in their risk contribution, but the latter is vastly easier to communicate, to monitor, and to execute at scale. When you're managing billions, parsimony matters.
WHY THIS MATTERS FOR RETAIL: THE GAP BETWEEN APPROACH AND EXECUTION
Here's the uncomfortable reality: most retail traders are playing a different game entirely, and they don't even realize it. When a retail trader says "I'm bullish on tech," they buy QQQ and that's their entire technology exposure. When they say "I need some diversification," they buy ten different stocks, often in correlated sectors. This isn't diversification in the Markowitzian sense. It's concentration with extra steps.
The institutional approach represented by the Efficiente 5 is fundamentally different in several ways. First, it's systematic. Emotions don't drive the allocation. The mathematics do. When equities have rallied hard and now represent 55% of the portfolio despite a 50% cap, the system sells equities and buys bonds or alternatives, regardless of how bullish the headlines feel. This forced contrarianism is what retail traders know they should do but rarely execute (Kahneman and Tversky, 1979).
Second, it's forward-looking in its inputs but backward-looking in its process. The strategy doesn't try to predict the next crisis or the next boom. It simply measures what volatility and returns have been recently, assumes the immediate future resembles the immediate past more than it resembles some forecast, and positions accordingly. This humility regarding prediction is perhaps the most institutional characteristic of all.
Third, and most critically, it treats the portfolio as a single organism. Retail traders typically view their holdings as separate positions, each requiring individual management. The institutional approach recognizes that what matters is not whether Position A made money, but whether the portfolio as a whole achieved its risk-adjusted return target. A position can lose money and still be a valuable contributor if it reduced portfolio volatility or provided diversification during stress periods.
THE MATHEMATICAL FOUNDATION: MEAN-VARIANCE OPTIMIZATION IN PRACTICE
At its core, the Efficiente 5 strategy solves a constrained optimization problem each month. In technical terms, this is a quadratic programming problem: maximize expected portfolio return subject to a volatility constraint and position limits. The objective function is straightforward: maximize the weighted sum of expected returns. The constraint is that the weighted sum of variances and covariances must not exceed the volatility target squared (Markowitz, 1959).
The challenge, and this is crucial for understanding the Pine Script implementation, is that solving this problem properly requires calculating a covariance matrix. This 13x13 matrix captures not just the volatility of each asset but the correlation between every pair of assets. Two assets might each have 15% volatility, but if they're negatively correlated, combining them reduces portfolio risk. If they're positively correlated, it doesn't. The covariance matrix encodes these relationships.
True mean-variance optimization requires matrix algebra and quadratic programming solvers. Pine Script, by design, lacks these capabilities. The language doesn't support matrix operations, and certainly doesn't include a QP solver. This creates a fundamental challenge: how do you implement an institutional strategy in a language not designed for institutional mathematics?
The solution implemented here uses a pragmatic approximation. Instead of solving the full covariance problem, the indicator calculates a Sharpe-like ratio for each asset (return divided by volatility) and uses these ratios to determine initial weights. It then applies the individual and asset-class constraints, renormalizes, and produces the final portfolio. This isn't mathematically equivalent to true mean-variance optimization, but it captures the essential spirit: weight assets according to their risk-adjusted return potential, subject to diversification constraints.
For retail implementation, this approximation is likely sufficient. The difference between a theoretically optimal portfolio and a very good approximation is typically modest, and the discipline of systematic rebalancing across asset classes matters far more than the precise weights. Perfect is the enemy of good, and a good approximation executed consistently will outperform a perfect solution that never gets implemented (Arnott et al., 2013).
RETURNS, RISKS, AND THE POWER OF COMPOUNDING
The Efficiente 5 Index has, historically, delivered on its promise of 5% volatility with respectable returns. While past performance never guarantees future results, the framework reveals why low-volatility strategies can be surprisingly powerful. Consider two portfolios: Portfolio A averages 12% returns with 20% volatility, while Portfolio B averages 8% returns with 5% volatility. Which performs better over time?
The arithmetic return favors Portfolio A, but compound returns tell a different story. Portfolio A will experience occasional 20-30% drawdowns. Portfolio B rarely draws down more than 10%. Over a twenty-year horizon, the geometric return (what you actually experience) for Portfolio B may match or exceed Portfolio A, simply because it never gives back massive gains. This is the power of volatility management that retail traders chronically underestimate (Bernstein, 1996).
Moreover, low volatility enables behavioral advantages. When your portfolio draws down 35%, as it might with a high-volatility approach, the psychological pressure to sell at the worst possible time becomes overwhelming. When your maximum drawdown is 12%, as might occur with the Efficiente 5 approach, staying the course is far easier. Behavioral finance research has consistently shown that investor returns lag fund returns primarily due to poor timing decisions driven by emotional responses to volatility (Dalbar, 2020).
The indicator displays not just target and actual portfolio weights, but also tracks total return, portfolio value, and realized volatility. This isn't just data. It's feedback. Retail traders can see, in real-time, whether their actual portfolio volatility matches their target, whether their risk-adjusted returns are improving, and whether their allocation discipline is holding. This transparency transforms abstract concepts into concrete metrics.
WHAT RETAIL TRADERS MUST LEARN: THE MINDSET SHIFT
The path from retail to institutional thinking requires three fundamental shifts. First, stop thinking in positions and start thinking in portfolios. Your question should never be "Should I buy this stock?" but rather "How does this position change my portfolio's expected return and volatility?" If you can't answer that question quantitatively, you're not ready to make the trade.
Second, embrace systematic rebalancing even when it feels wrong. Perhaps especially when it feels wrong. The Efficiente 5 strategy rebalances monthly regardless of market conditions. If equities have surged and now exceed their target weight, the strategy sells equities and buys bonds or alternatives. Every retail trader knows this is what you "should" do, but almost none actually do it. The institutional edge isn't in having better information. It's in having better discipline (Swensen, 2009).
Third, accept that volatility is not your friend. The retail mythology that "higher risk equals higher returns" is true on average across assets, but it's not true for implementation. A 15% return with 30% volatility will compound more slowly than a 12% return with 10% volatility due to the mathematics of return distributions. Institutions figured this out decades ago. Retail is still learning.
The Efficiente 5 replication indicator provides a bridge. It won't solve the problem of prediction no indicator can. But it solves the problem of allocation, which is arguably more important. By implementing institutional methodology in an accessible format, it allows retail traders to see what professional portfolio construction actually looks like, not in theory but in executable code. The the colorful lines that retail traders love to draw, don't disappear. They simply become less central to the process. The portfolio becomes central instead.
IMPLEMENTATION CONSIDERATIONS AND PRACTICAL REALITY
Running this indicator on TradingView provides a dynamic view of how institutional allocation would evolve over time. The labels on each asset class line show current weights, updated continuously as prices change and rebalancing occurs. The dashboard displays the full allocation across all thirteen ETFs, showing both target weights (what the optimization suggests) and actual weights (what the portfolio currently holds after price movements).
Several key insights emerge from watching this process unfold. First, the strategy is not static. Weights change monthly as the optimization recalibrates to recent volatility and returns. What worked last month may not be optimal this month. Second, the strategy is not market-timing. It doesn't try to predict whether stocks will rise or fall. It simply measures recent behavior and positions accordingly. If volatility has risen, the strategy shifts toward defensive assets. If correlations have changed, the diversification benefits adjust.
Third, and perhaps most importantly for retail traders, the strategy demonstrates that sophistication and complexity are not synonyms. The Efficiente 5 methodology is sophisticated in its framework but simple in its execution. There are no exotic derivatives, no complex market-timing rules, no predictions of future scenarios. Just systematic optimization, monthly rebalancing, and discipline. This simplicity is a feature, not a bug.
The indicator also highlights limitations that retail traders must understand. The Pine Script implementation uses an approximation of true mean-variance optimization, as discussed earlier. Transaction costs are not modeled. Slippage is ignored. Tax implications are not considered. These simplifications mean the indicator is educational and analytical, not a fully operational trading system. For actual implementation, traders would need to account for these real-world factors.
Moreover, the strategy requires access to all thirteen ETFs and sufficient capital to hold meaningful positions in each. With 5% as the rounding increment, practical implementation probably requires at least $10,000 to avoid having positions that are too small to matter. The strategy is also explicitly designed for a 5% volatility target, which may be too conservative for younger investors with long time horizons or too aggressive for retirees living off their portfolio. The framework is adaptable, but adaptation requires understanding the trade-offs.
CAN RETAIL TRULY COMPETE WITH INSTITUTIONS?
The honest answer is nuanced. Retail traders will never have the same resources as institutions. They won't have Bloomberg terminals, proprietary research, or armies of analysts. But in portfolio construction, the resource gap matters less than the mindset gap. The mathematics of Markowitz are available to everyone. ETFs provide liquid, low-cost access to institutional-quality building blocks. Computing power is essentially free. The barriers are not technological or financial. They're conceptual.
If a retail trader understands why portfolios matter more than positions, why systematic discipline beats discretionary emotion, and why volatility management enables compounding, they can build portfolios that rival institutional allocation in their elegance and effectiveness. Not in their scale, not in their execution costs, but in their conceptual soundness. The Efficiente 5 framework proves this is possible.
What retail traders must recognize is that competing with institutions doesn't mean day-trading better than their algorithms. It means portfolio-building better than their average client. And that's achievable because most institutional clients, despite having access to the best managers, still make emotional decisions, chase performance, and abandon strategies at the worst possible times. The retail edge isn't in outsmarting professionals. It's in out-disciplining amateurs who happen to have more money.
The J.P. Morgan Efficiente 5 Index Replication indicator serves as both a tool and a teacher. As a tool, it provides a systematic framework for multi-asset allocation based on proven institutional methodology. As a teacher, it demonstrates daily what portfolio thinking actually looks like in practice. The colorful lines remain on the chart, but they're no longer the focus. The portfolio is the focus. The risk-adjusted return is the focus. The systematic discipline is the focus.
Stop painting lines. Start building portfolios. The institutions have been doing it for seventy years. It's time retail caught up.
REFERENCES
Arnott, R. D., Hsu, J., & Moore, P. (2013). Fundamental Indexation. Financial Analysts Journal, 61(2), 83-99.
Bernstein, W. J. (1996). The Intelligent Asset Allocator. New York: McGraw-Hill.
Dalbar, Inc. (2020). Quantitative Analysis of Investor Behavior. Boston: Dalbar.
Damodaran, A. (2008). Strategic Risk Taking: A Framework for Risk Management. Upper Saddle River: Pearson Education.
Elton, E. J., Gruber, M. J., Brown, S. J., & Goetzmann, W. N. (2014). Modern Portfolio Theory and Investment Analysis (9th ed.). Hoboken: John Wiley & Sons.
Fama, E. F., & French, K. R. (1993). Common risk factors in the returns on stocks and bonds. Journal of Financial Economics, 33(1), 3-56.
Jorion, P. (1992). Portfolio optimization in practice. Financial Analysts Journal, 48(1), 68-74.
J.P. Morgan Asset Management. (2016). Guide to the Markets. New York: J.P. Morgan.
Jungle Rock. (2025). Institutional Asset Allocation meets the Efficient Frontier: Replicating the JPMorgan Efficiente 5 Strategy. Working Paper.
Kahneman, D., & Tversky, A. (1979). Prospect Theory: An Analysis of Decision under Risk. Econometrica, 47(2), 263-291.
Markowitz, H. (1952). Portfolio Selection. The Journal of Finance, 7(1), 77-91.
Markowitz, H. (1959). Portfolio Selection: Efficient Diversification of Investments. New York: John Wiley & Sons.
Swensen, D. F. (2009). Pioneering Portfolio Management: An Unconventional Approach to Institutional Investment. New York: Free Press.
PG ATM Strike Line with Call & Put PremiumsPine Script: ATM Strike Line with Call & Put Premiums (Simplified)This Pine Script for TradingView displays the At-The-Money (ATM) strike price, futures price, call/put premiums (time value), and two ratios—Premium Ratio (PR) and Volume Ratio (VR)—for a user-selected underlying asset (e.g., NIFTY, BANKNIFTY, or stocks). It helps traders gauge near-term market direction using options data.How the Script WorksInputs:Expiry: Select year (e.g., '25), month (01–12), day (01–31) for option expiry (e.g., '251028').
Timeframe: Choose data timeframe (e.g., Daily, 15-min).
Symbol: Auto-detects chart symbol or select from Indian indices/stocks.
Strike: Auto-ATM (based on futures) or manual strike input.
Interval: Auto (e.g., 100 for NIFTY) or custom strike interval.
Colors: Customizable for ATM line, labels (Futures Price, CPR, PPR, VR, PR).
Calculations:Futures Price (FP): Fetches front-month futures price (e.g., NSE:NIFTY1!).
ATM Strike: Rounds futures price to nearest strike interval.
Option Data: Retrieves Last Traded Price (LTP) and volume for ATM call/put options (e.g., NSE:NIFTY251028C24200).
Call Premium (CPR): Call LTP minus intrinsic value (max(0, FP - Strike)).
Put Premium (PPR): Put LTP minus intrinsic value (max(0, Strike - FP)).
Premium Ratio (PR): PPR / CPR.
Volume Ratio (VR): Put Volume / Call Volume.
Visuals:Draws ATM strike line on chart.
Displays labels: FP (futures price), CPR (call premium), PPR (put premium), VR, PR.
VR/PR labels: Red (≥ 1.25, bearish), Green (≤ 0.75, bullish), Gray (0.75–1.25, neutral).
Updates on last confirmed bar to avoid redraws.
Using PR and VR for Market DirectionPremium Ratio (PR):PR ≥ 1.25 (Red): High put premiums suggest bearish sentiment (expect price drop).
PR ≤ 0.75 (Green): High call premiums suggest bullish sentiment (expect price rise).
0.75 < PR < 1.25 (Gray): Neutral, no clear direction.
Use: High PR favors bearish trades (e.g., buy puts); low PR favors bullish trades (e.g., buy calls).
Volume Ratio (VR):VR ≥ 1.25 (Red): High put volume indicates bearish activity.
VR ≤ 0.75 (Green): High call volume indicates bullish activity.
0.75 < VR < 1.25 (Gray): Neutral trading activity.
Use: High VR suggests bearish moves; low VR suggests bullish moves.
Combined Signals:High PR & VR: Strong bearish signal; consider put buying or call selling.
Low PR & VR: Strong bullish signal; consider call buying or put selling.
Mixed/Neutral: Use price action or support/resistance for confirmation.
Tips:Combine with technical analysis (e.g., trends, levels).
Match timeframe to trading horizon (e.g., 15-min for intraday).
Monitor FP for context; check volatility or news for accuracy.
ExampleNIFTY: FP = 24,237.50, ATM = 24,200, CPR = 120.25, PPR = 180.50, PR = 1.50 (Red), VR = 1.30 (Red).
Insight: High PR/VR suggests bearish bias; consider bearish trades if price nears resistance.
Action: Buy puts or exit longs, confirm with price action.
Conclusion: This script provides a concise tool for options traders, showing ATM strike, premiums, and PR/VR ratios. High PR/VR (≥ 1.25) signals bearish sentiment, low PR/VR (≤ 0.75) signals bullish sentiment, and neutral (0.75–1.25) suggests indecision. Combine with technical analysis for robust trading decisions in the Indian options market.
Turtle/Donchian Screener — Recency & CloseAtBuyTurtle strategy with buy and sellsignals. Donchian channels. For Pine screener.






















