Frahm Factor Position Size CalculatorThe Frahm Factor Position Size Calculator is a powerful evolution of the original Frahm Factor script, leveraging its volatility analysis to dynamically adjust trading risk. This Pine Script for TradingView uses the Frahm Factor’s volatility score (1-10) to set risk percentages (1.75% to 5%) for both Margin-Based and Equity-Based position sizing. A compact table on the main chart displays Risk per Trade, Frahm Factor, and Average Candle Size, making it an essential tool for traders aligning risk with market conditions.
Calculates a volatility score (1-10) using true range percentile rank over a customizable look-back window (default 24 hours).
Dynamically sets risk percentage based on volatility:
Low volatility (score ≤ 3): 5% risk for bolder trades.
High volatility (score ≥ 8): 1.75% risk for caution.
Medium volatility (score 4-7): Smoothly interpolated (e.g., 4 → 4.3%, 5 → 3.6%).
Adjustable sensitivity via Frahm Scale Multiplier (default 9) for tailored volatility response.
Position Sizing:
Margin-Based: Risk as a percentage of total margin (e.g., $175 for 1.75% of $10,000 at high volatility).
Equity-Based: Risk as a percentage of (equity - minimum balance) (e.g., $175 for 1.75% of ($15,000 - $5,000)).
Compact 1-3 row table shows:
Risk per Trade with Frahm score (e.g., “$175.00 (Frahm: 8)”).
Frahm Factor (e.g., “Frahm Factor: 8”).
Average Candle Size (e.g., “Avg Candle: 50 t”).
Toggles to show/hide Frahm Factor and Average Candle Size rows, with no empty backgrounds.
Four sizes: XL (18x7, large text), L (13x6, normal), M (9x5, small, default), S (8x4, tiny).
Repositionable (9 positions, default: top-right).
Customizable cell color, text color, and transparency.
Set Frahm Factor:
Frahm Window (hrs): Pick how far back to measure volatility (e.g., 24 hours). Shorter for fast markets, longer for chill ones.
Frahm Scale Multiplier: Set sensitivity (1-10, default 9). Higher makes the score jumpier; lower smooths it out.
Set Margin-Based:
Total Margin: Enter your account balance (e.g., $10,000). Risk auto-adjusts via Frahm Factor.
Set Equity-Based:
Total Equity: Enter your total account balance (e.g., $15,000).
Minimum Balance: Set to the lowest your account can go before liquidation (e.g., $5,000). Risk is based on the difference, auto-adjusted by Frahm Factor.
Customize Display:
Calculation Method: Pick Margin-Based or Equity-Based.
Table Position: Choose where the table sits (e.g., top_right).
Table Size: Select XL, L, M, or S (default M, small text).
Table Cell Color: Set background color (default blue).
Table Text Color: Set text color (default white).
Table Cell Transparency: Adjust transparency (0 = solid, 100 = invisible, default 80).
Show Frahm Factor & Show Avg Candle Size: Check to show these rows, uncheck to hide (default on).
Trend Analizi
GER40 Opening Range Breakout (Advanced)🔥 GER40 (DAX40) Opening Range Breakout Strategy
📌 Overview:
This strategy takes advantage of the high volatility and liquidity during the Frankfurt and London session openings (8:00–10:00 CET). It’s especially suitable for day traders who want to capitalize on early momentum.
✅ Strategy Steps:
1. Mark the Opening Range (08:00–08:15 CET)
Wait for the first 15 minutes after the Frankfurt open (08:00 CET).
Draw horizontal lines at the high and low of this range.
2. Entry Rules:
Buy when price breaks above the opening range high with strong volume.
Sell (short) when price breaks below the opening range low with strong volume.
3. Confirmation (optional but helpful):
Use a momentum indicator like RSI (above 50 for long, below 50 for short) or MACD crossing above/below the signal line.
Look for volume spike at breakout for validation.
4. Stop-Loss:
Set just below the range low (for long) or above the range high (for short).
Or use a fixed pip/point stop-loss like 15–25 points depending on current volatility.
5. Take Profit / Exit:
1:1.5 to 1:2 Risk/Reward Ratio.
Or scale out at fixed points (e.g., +20, +40).
Or trail stop after price moves in favor by +20 points.
📊 Additional Filters to Improve Accuracy:
Check macroeconomic calendar (avoid entering during red news like ECB, German CPI, etc.).
Use VWAP as a dynamic support/resistance for bias direction.
Use 5-min or 15-min charts for better signal clarity.
📈 Example:
Let’s say the DAX opens at 08:00 CET, and by 08:15, the high is 18,000 and the low is 17,950.
If price breaks above 18,000 with volume and RSI > 50, enter long.
Place stop at 17,950 or slightly below.
Take profit at 18,030–18,050 or trail stop.
🧠 Pro Tips:
GER40 is highly volatile, so ensure your risk per trade is small (e.g., 1% or less).
Avoid trading around major news (ECB rate decisions, German GDP, etc.).
Best sessions for GER40: Frankfurt Open (08:00 CET) and London Open (09:00 CET).
Pivot Swings w Table Pivot Swings w Table — Intraday Structure & Range Analyzer
This indicator identifies key pivot highs and lows on the chart and highlights market structure shifts using a real-time table display. It helps traders visually confirm potential trade setups by tracking unbroken swing points and measuring the range between the most recent pivots.
🔍 Features:
🔹 Automatic Pivot Detection using configurable left/right bar logic.
🔹 Unbroken Pivot Filtering — only pivots that haven't been invalidated by price are displayed.
🔹 Dynamic Range Table with:
Latest valid Pivot High and Pivot Low
Total Range Width
Upper & Lower 25% range thresholds (useful for value/imbalance analysis)
🔹 Trend-Based Color Coding — the table background changes based on which pivot (high or low) occurred more recently:
🟥 Red: Downward bias (last pivot was a lower high)
🟩 Green: Upward bias (last pivot was a higher low)
🔹 Optional extension of pivot levels to the right of the chart for support/resistance confluence.
⚙️ How to Use:
Adjust the Left Bars and Right Bars inputs to fine-tune how swings are defined.
Look for price reacting near the Upper or Lower 25% zones to anticipate mean reversion or breakout setups.
Use the trend color of the table to confirm directional bias, especially useful during consolidation or retracement periods.
💡 Best For:
Intraday or short-term swing traders
Traders who use market structure, support/resistance, or trend-based strategies
Those looking to avoid low-quality trades in tight ranges
✅ Built for overlay use on price charts
📈 Works on all symbols and timeframes
🧠 No repainting — pivots are confirmed with completed bars
fadi ffa This script is for educational purposes only. It draws historical pivot points and labels them on the chart to help users visualize price levels. It does not provide trading signals, recommendations, or any financial advice. Use at your own risk. The author is not responsible for any decisions made based on this script.
Multi-Timeframe PivotDescription:
This script provides an advanced tool for multi-timeframe pivot point
analysis. It identifies swing points based on a candle's relationship to
its neighbors. The default strength settings of 1 align with the Inner
Circle Trader (ICT) concept of market structure.
The ICT concept defines a swing point based on a simple 3-candle pattern:
- A swing high is a candle where the candles to the immediate left and right
both have lower highs.
- A swing low is a candle where the candles to the immediate left and right
both have higher lows.
A key feature is its ability to accurately calculate and translate pivot
points from up to five higher timeframes (HTFs) and display them
precisely on a lower timeframe (LTF) chart.
NOTE: This indicator is designed to show HTF data on an LTF chart.
If you select a timeframe in the settings that is lower than your
current chart's timeframe, it will show pivots for the chart's
timeframe instead.
Core Features:
- Up to five independent higher timeframes.
- Per-timeframe customization for pivot strength (left/right bars) and color.
- Optional "Watchlines" that project the price of each pivot forward,
complete with a text label identifying the timeframe.
- An optional "Alignment Model" that colors the background when price is
aligned across all active timeframes (requires at least 2 TFs to be enabled).
Default State:
For a clean initial application, the Watchlines and Alignment Model features
are disabled by default but can be enabled in the settings.
GER40 Opening Range Breakout (Simple)✅ GER40 Opening Range Breakout Strategy — Trading Plan
🎯 Objective:
Capture early momentum after the Frankfurt open by trading breakouts of the initial 15-minute range.
📌 Rules Summary:
Instrument: GER40 (DAX40)
Timeframe: 5-minute or 15-minute chart
Session Focus: 08:00–10:00 CET
Opening Range: 08:00–08:15 CET
🛠 Entry Conditions:
Long entry: Price breaks above the 08:00–08:15 high with volume confirmation.
Short entry: Price breaks below the 08:00–08:15 low with volume confirmation.
Optional confirmation: RSI > 50 for long, RSI < 50 for short.
Entry Signal: Low X% Lower Than OpenFires off a signal whenever the Low of the candle is below a certain percentage threshold compared to the open
My Strategy: Uptrend Pullback ScreenerUptrend Pullback Screener. this will filter the stock who is in uptrend and ready to pullback from support.
Tsallis Entropy Market RiskTsallis Entropy Market Risk Indicator
What Is It?
The Tsallis Entropy Market Risk Indicator is a market analysis tool that measures the degree of randomness or disorder in price movements. Unlike traditional technical indicators that focus on price patterns or momentum, this indicator takes a statistical physics approach to market analysis.
Scientific Foundation
The indicator is based on Tsallis entropy, a generalization of traditional Shannon entropy developed by physicist Constantino Tsallis. The Tsallis entropy is particularly effective at analyzing complex systems with long-range correlations and memory effects—precisely the characteristics found in crypto and stock markets.
The indicator also borrows from Log-Periodic Power Law (LPPL).
Core Concepts
1. Entropy Deficit
The primary measurement is the "entropy deficit," which represents how far the market is from a state of maximum randomness:
Low Entropy Deficit (0-0.3): The market exhibits random, uncorrelated price movements typical of efficient markets
Medium Entropy Deficit (0.3-0.5): Some patterns emerging, moderate deviation from randomness
High Entropy Deficit (0.5-0.7): Strong correlation patterns, potentially indicating herding behavior
Extreme Entropy Deficit (0.7-1.0): Highly ordered price movements, often seen before significant market events
2. Multi-Scale Analysis
The indicator calculates entropy across different timeframes:
Short-term Entropy (blue line): Captures recent market behavior (20-day window)
Long-term Entropy (green line): Captures structural market behavior (120-day window)
Main Entropy (purple line): Primary measurement (60-day window)
3. Scale Ratio
This measures the relationship between long-term and short-term entropy. A healthy market typically has a scale ratio above 0.85. When this ratio drops below 0.85, it suggests abnormal relationships between timeframes that often precede market dislocations.
How It Works
Data Collection: The indicator samples price returns over specific lookback periods
Probability Distribution Estimation: It creates a histogram of these returns to estimate their probability distribution
Entropy Calculation: Using the Tsallis q-parameter (typically 1.5), it calculates how far this distribution is from maximum entropy
Normalization: Results are normalized against theoretical maximum entropy to create the entropy deficit measure
Risk Assessment: Multiple factors are combined to generate a composite risk score and classification
Market Interpretation
Low Risk Environments (Risk Score < 25)
Market is functioning efficiently with reasonable randomness
Price discovery is likely effective
Normal trading and investment approaches appropriate
Medium Risk Environments (Risk Score 25-50)
Increasing correlation in price movements
Beginning of trend formation or momentum
Time to monitor positions more closely
High Risk Environments (Risk Score 50-75)
Strong herding behavior present
Market potentially becoming one-sided
Consider reducing position sizes or implementing hedges
Extreme Risk Environments (Risk Score > 75)
Highly ordered market behavior
Significant imbalance between buyers and sellers
Heightened probability of sharp reversals or corrections
Practical Application Examples
Market Tops: Often characterized by gradually increasing entropy deficit as momentum builds, followed by extreme readings near the actual top
Market Bottoms: Can show high entropy deficit during capitulation, followed by normalization
Range-Bound Markets: Typically display low and stable entropy deficit measurements
Trending Markets: Often show moderate entropy deficit that remains relatively consistent
Advantages Over Traditional Indicators
Forward-Looking: Identifies changing market structure before price action confirms it
Statistical Foundation: Based on robust mathematical principles rather than empirical patterns
Adaptability: Functions across different market regimes and asset classes
Noise Filtering: Focuses on meaningful structural changes rather than price fluctuations
Limitations
Not a Timing Tool: Signals market risk conditions, not precise entry/exit points
Parameter Sensitivity: Results can vary based on the chosen parameters
Historical Context: Requires some historical perspective to interpret effectively
Complementary Tool: Works best alongside other analysis methods
Enjoy :)
ATR Stop-Loss with Fibonacci Take-Profit [jpkxyz]ATR Stop-Loss with Fibonacci Take-Profit Indicator
This comprehensive indicator combines Average True Range (ATR) volatility analysis with Fibonacci extensions to create dynamic stop-loss and take-profit levels. It's designed to help traders set precise risk management levels and profit targets based on market volatility and mathematical ratios.
Two Operating Modes
Default Mode (Rolling Levels)
In default mode, the indicator continuously plots evolving stop-loss and take-profit levels based on real-time price action. These levels update dynamically as new bars form, creating rolling horizontal lines across the chart. I use this mode primarily to plot the rolling ATR-Level which I use to trail my Stop-Loss into profit.
Characteristics:
Levels recalculate with each new bar
All selected Fibonacci levels display simultaneously
Uses plot() functions with trackprice=true for price tracking
Custom Anchor Mode (Fixed Levels)
This is the primary mode for precision trading. You select a specific timestamp (typically your entry bar), and the indicator locks all calculations to that exact moment, creating fixed horizontal lines that represent your actual trade levels.
Characteristics:
Entry line (blue) marks your anchor point
Stop-loss calculated using ATR from the anchor bar
Fibonacci levels projected from entry-to-stop distance
Lines terminate when price breaks through them
Includes comprehensive alert system
Core Calculation Logic
ATR Stop-Loss Calculation:
Stop Loss = Entry Price ± (ATR × Multiplier)
Long positions: SL = Entry - (ATR × Multiplier)
Short positions: SL = Entry + (ATR × Multiplier)
ATR uses your chosen smoothing method (RMA, SMA, EMA, or WMA)
Default multiplier is 1.5, adjustable to your risk tolerance
Fibonacci Take-Profit Projection:
The distance from entry to stop-loss becomes the base unit (1.0) for Fibonacci extensions:
TP Level = Entry + (Entry-to-SL Distance × Fibonacci Ratio)
Available Fibonacci Levels:
Conservative: 0.618, 1.0, 1.618
Extended: 2.618, 3.618, 4.618
Complete range: 0.0 to 4.764 (23 levels total)
Multi-Timeframe Functionality
One of the indicator's most powerful features is timeframe flexibility. You can analyze on one timeframe while using stop-loss and take-profit calculations from another.
Best Practices:
Identify your entry point on execution timeframe
Enable "Custom Anchor" mode
Set anchor timestamp to your entry bar
Select appropriate analysis timeframe
Choose relevant Fibonacci levels
Enable alerts for automated notifications
Example Scenario:
Analyse trend on 4-hour chart
Execute entry on 5-minute chart for precision
Set custom anchor to your 5-minute entry bar
Configure timeframe setting to "4h" for swing-level targets
Select appropriate Fibonacci Extension levels
Result: Precise entry with larger timeframe risk management
Visual Intelligence System
Line Behaviour in Custom Anchor Mode:
Active levels: Lines extend to the right edge
Hit levels: Lines terminate at the breaking bar
Entry line: Always visible in blue
Stop-loss: Red line, terminates when hit
Take-profits: Green lines (1.618 level in gold for emphasis)
Customisation Options:
Line width (1-4 pixels)
Show/hide individual Fibonacci levels
ATR length and smoothing method
ATR multiplier for stop-loss distance
MACD + MA 2-Min Binary Options Strategy (Strategy Mode)📈 "MACD + MA Crossover Momentum Strategy" (2-Minute Expiry)
✅ Objective:
Catch short-term momentum in the direction of the trend confirmed by MACD crossover and MA alignment.
🧰 Strategy Setup
🕒 Chart Timeframe:
15-second or 30-second candles
(2-minute expiry = 4–8 candles ahead)
📊 Indicators:
EMA 5 (fast)
EMA 13 (slow)
MACD (12, 26, 9) – Standard settings
(Optional): Support/Resistance zones (manual or indicator)
🟩 Call (Buy) Conditions:
EMA 5 crosses above EMA 13
MACD Line crosses above the Signal Line (MACD crossover happens after or at the same time as EMA cross)
MACD histogram is increasing (momentum rising)
Price is above both EMAs, confirming trend strength
No major resistance or news in the next 2 minutes
🟨 Enter on the close of the confirmation candle. Set expiry: 2 minutes from entry.
🟥 Put (Sell) Conditions:
EMA 5 crosses below EMA 13
MACD Line crosses below Signal Line
MACD histogram is decreasing
Price is below both EMAs
No support zone or news in next 2 minutes
✅ Additional Entry Filters
Only trade in the direction of the higher timeframe trend (check 5-minute chart to confirm)
Avoid trading during low volume (e.g., lunch hours, between sessions)
Avoid entry right after a MACD crossover has been running for several candles (too late)
Use price action candles to confirm (e.g., engulfing, strong momentum bars)
🧠 Example Workflow (Call Trade):
You're watching GBP/USD on 30-sec candles.
EMA 5 just crosses above EMA 13.
MACD line crosses above signal, histogram increases.
Price is above both EMAs, showing strength.
Candle closes strong bullish.
➡️ Enter CALL with 2-minute expiry.
RSI-Adaptive T3 + Squeeze Momentum Strategy✅ Strategy Guide: RSI-Adaptive T3 + Squeeze Momentum Strategy
📌 Overview
The RSI-Adaptive T3 + Squeeze Momentum Strategy is a dynamic trend-following strategy based on an RSI-responsive T3 moving average and Squeeze Momentum detection .
It adapts in real-time to market volatility to enhance entry precision and optimize risk.
⚠️ This strategy is provided for educational and research purposes only.
Past performance does not guarantee future results.
🎯 Strategy Objectives
The main objective of this strategy is to catch the early phase of a trend and generate consistent entry signals.
Designed to be intuitive and accessible for traders from beginner to advanced levels.
✨ Key Features
RSI-Responsive T3: T3 length dynamically adjusts according to RSI values for adaptive trend detection
Squeeze Momentum: Combines Bollinger Bands and Keltner Channels to identify trend buildup phases
Visual Triggers: Entry signals are generated from T3 crossovers and momentum strength after squeeze release
📊 Trading Rules
Long Entry:
When T3 crosses upward, momentum is positive, and the squeeze has just been released.
Short Entry:
When T3 crosses downward, momentum is negative, and the squeeze has just been released.
Exit (Reversal):
When the opposite condition to the entry is triggered, the position is reversed.
💰 Risk Management Parameters
Pair & Timeframe: BTC/USD (30-minute chart)
Capital (simulated): $30,00
Order size: `$100` per trade (realistic, low-risk sizing)
Commission: 0.02%
Slippage: 2 pips
Risk per Trade: 5%
Number of Trades (backtest period): 181
📊 Performance Overview
Symbol: BTC/USD
Timeframe: 30-minute chart
Date Range: January 1, 2024 – July 3, 2025
Win Rate: 47.8%
Profit Factor: 2.01
Net Profit: 173.16 (units not specified)
Max Drawdown: 5.77% or 24.91 (0.79%)
⚙️ Indicator Parameters
Indicator Name: RSI-Adaptive T3 + Squeeze Momentum
RSI Length: 14
T3 Min Length: 5
T3 Max Length: 50
T3 Volume Factor: 0.7
BB Length: 27 (Multiplier: 2.0)
KC Length: 20 (Multiplier: 1.5, TrueRange enabled)
🖼 Visual Support
T3 slope direction, squeeze status, and momentum bars are visually plotted on the chart,
providing high clarity for quick trend analysis and execution.
🔧 Strategy Improvements & Uniqueness
Inspired by the RSI Adaptive T3 by ChartPrime and Squeeze Momentum Indicator by LazyBear ,
this strategy fuses both into a hybrid trend-reversal and momentum breakout detection system .
Compared to traditional trend-following methods, it excels at capturing early trend signals with greater sensitivity .
✅ Summary
The RSI-Adaptive T3 + Squeeze Momentum Strategy combines momentum detection with volatility-responsive risk management.
With a strong balance between visual clarity and practicality, it serves as a powerful tool for traders seeking high repeatability.
⚠️ This strategy is based on historical data and does not guarantee future profits.
Always use appropriate risk management when applying it.
Market Maker Trap Reversal V1Market Maker Trap Reversal V1 is a lightweight, precision-focused tool designed to detect the same liquidity manipulation tactics used by institutional players and market makers.
This script identifies key liquidity sweeps of prior swing highs/lows and confirms trap reversals when price closes back inside the swept range — a signature move of smart money designed to trap retail breakout traders.
Built for disciplined execution, this tool includes:
✅ Sweep detection using custom swing lookbacks
✅ Convincing trap confirmation (strong candle body)
✅ Optional NY session filter for optimal timing
✅ Clean long/short alerts for seamless automation
✅ No indicators — just raw price action and intent
Use this strategy to mirror market maker logic, avoid false breakouts, and trade with real conviction around liquidity events.
**Coded with the help of Zero"
Victor Osimhen Galatasaray⚽ Victor Osimhen Strategy – Ride the Momentum, Rule the Market!
Hello dear trader! 👋
We’re proud to introduce a strategy designed for crypto markets, built to be fast, smart, and resilient — just like its namesake:
📈 The Victor Osimhen Strategy ⚽
Much like the unstoppable striker himself, this strategy:
Kicks off early
Strikes at the right moment
Knows exactly when to exit the field
🧠 What Powers the Strategy?
Victor Osimhen is based on three proven elements:
WaveTrend – A powerful momentum signal for entry
Volatility Stop (VStop) – A trend direction filter
Advanced Trailing Stop – A smart exit that adapts to price action
With full Multi-Timeframe (MTF) support, it tracks the bigger picture while reacting to finer movements:
For example: While viewing the 4H chart, it listens to signals from the 2H timeframe, offering early and more accurate entries/exits.
🪙 Why Does It Work Better in Crypto?
✅ It’s built for the high volatility and 24/7 nature of crypto markets
✅ It reacts fast to momentum shifts
✅ It filters out noise using trend confirmation
✅ And it adapts dynamically with its advanced trailing exit logic
🎁 A Friendly Request
If this strategy brings you profits — and if you feel like sharing the joy —
we’d be truly happy if you considered donating a portion to Galatasaray Sports Club 💛❤️
(Of course, this is entirely voluntary and from the heart!)
🔒 Final Reminder
This strategy isn’t magic — but when used with discipline, patience, and risk control, it can be a game-changer.
Please test it in demo mode first, and only go live when you're ready.
🏁 Good Luck!
With the Victor Osimhen Strategy, you're now equipped to:
✅ Catch early momentum
✅ Stay aligned with the trend
✅ Protect your profits with style
Wishing you strong signals and solid trades!
Price Change Rate with Pivot Labels (%)Bull/Bear labels to show the exact price change percentage at the pivot.
1. Calculates Price Change %
Measures the percentage change in closing price over a user-defined number of bars.
2. Identifies Pivot Points
Finds local highs (pivot highs) and lows (pivot lows) using configurable left/right bar settings.
3. Labels Bullish/Bearish Trends
Bull label: Appears at pivot lows if price is rising and forming higher lows.
Bear label: Appears at pivot highs if price is falling and forming lower highs.
4. Displays % on Labels
Each label includes the current price change percentage, e.g.,
"Bull +2.34%"
"Bear -1.78%"
5. Optional Visuals
Pivot shapes (triangles) are plotted for clarity.
Indicador Strong Buy + Volume
Association of several bullish indicators with a trigger on a sudden increase in volume
RSI + Divergence + Stochastic RSIsimple indicator combining RSI and STOCH
RSI indicator (with divergence detection, smoothing, and optional Bollinger Bands)
Stochastic RSI indicator (with %K and %D lines, bands, and background fill)
Gabriel's MPT Moving Average RibbonGabriel's MPT Moving Average Ribbon is a cutting-edge, risk-adjusted technical analysis tool that fuses Modern Portfolio Theory (MPT) with adaptive moving average logic to dynamically guide market participants through bullish and bearish conditions.
This ribbon is not a simple MA crossover — it leverages Sharpe Ratio, Sortino Ratio, Omega Ratio, and Value at Risk (VaR) to scale and smooth each moving average using real-time probabilistic efficiency metrics. Combined, these elements create a volatility-weighted, risk-optimized visualization of market structure.
🔍 Core Features:
Multi-Ratio Adaptive Scaling: Moving averages are dynamically weighted by Omega Ratio, Sortino Stdev, Sharpe Winrate, and VaR conditions for smarter price tracking.
Volatility Engine: Supports multiple return models:
Close-to-Close
Parkinson
Garman-Klass
Rogers–Satchell
Yang–Zhang (default for highest accuracy)
Smart Ribbon Construction:
Blends 3 different MA types per ribbon (e.g., SMA, EMA, WMA) for each of the 4 ribbons
Supports WMA-style dynamic weighting using MPT-derived ratios
Sharpe Winrate Estimation: Uses CDF logic to project the probability of success given current Sharpe ratio.
Dynamic Risk Phase Detection (VaR):
Identifies Risk On, Risk Off, or Neutral states using a triple-model composite VaR framework.
🛎️ Alerts Included:
📈 Bullish Crossover Alert: MA #1 crossing above MA #2 with all ribbons aligned upward.
📉 Bearish Crossunder Alert: MA #1 crossing below MA #2 with all ribbons aligned downward.
📊 Omega Ratio Alert: Triggered when Omega exceeds 1 (profitable risk-adjusted reward).
⚠️ Omega Caution Alert: Triggered when Omega drops below 1.
🟢 Risk On Alert: Market enters a favorable, low-risk zone. Deep Value Zone for Long-Term Investing.
🔴 Risk Off Alert: Market enters a cautionary, high-risk phase.
🎯 Use Cases:
Trend Identification: MA ribbon alignment indicates momentum phases.
Risk-Tuned Entries/Exits: Combine ribbon crossovers with VaR/Ratio signals for confirmation.
Institutional Strategy Overlay: Ideal for portfolio managers integrating risk-adjusted technical overlays.
🧠 Pro Tips:
Use "Complete" mode for the most robust risk signal, as it blends Historical, EWMA, and Variance-Covariance ratios.
Customize each MA’s type and length to match your trading horizon (e.g., intraday, swing).
Toggle Ratios Weighted MA for adaptive weighting when market risk fluctuates.
It's set to the settings I use to trade, from MA settings to MPT table. It goes in order: Sharpe Est. Winrate, Deviation of Sortino, Omega Ratio (1 Year), and the Ideal position size according to VaR.
SQZMOM Breakout Strategy📌 SQZMOM Breakout Strategy – Optimized for 15-Minute Intraday Trading
SQZMOM Breakout Strategy is a momentum and volatility-based algorithmic trading system, primarily built around the Squeeze Momentum (SQZMOM) indicator. It is specifically optimized for 15-minute timeframes to exploit intraday breakouts and trend continuations.
📊 Key Features:
✅ Breakout signals based on the Squeeze Momentum indicator
✅ Trend filter using 200-period WMA (visual only, not affecting entries)
✅ RSI filter to avoid trades in overbought/oversold zones
✅ Volume and ATR filters to confirm breakout quality
✅ Position sizing dynamically scales from 5% to 20% based on signal strength
✅ Trailing Stop Loss based on user-adjustable ATR multiple (default: 2.0 ATR)
✅ No fixed Take Profit: trades ride the trend using trailing stops
⚙️ Configurable Inputs:
Bollinger Band & Keltner Channel parameters
RSI thresholds (fixed at 40 to avoid early entries against momentum)
Trailing Stop distance defined by ATR Multiplier for Trailing Stop
All parameters are user-tunable for further optimization
🟢 When Does It Enter a Trade?
Long Entry:
SQZMOM fires bullish breakout + momentum increases + price above WMA200 + sufficient volume & ATR + RSI > 40
Short Entry:
SQZMOM fires bearish breakout + momentum decreases + price below WMA200 + sufficient volume & ATR + RSI < 40
Signal entries are deferred until all filters (especially RSI) align — no crossover logic is used
🎯 Trade Management:
Position Sizing: Adjusted according to momentum strength (val), from 5% to 20%
Exit Strategy: Trailing Stop only, no hard TP — lets profits run
TP/SL logic: Trailing SL moves dynamically with price, distance = ATR × multiplier
📚 Scientific & Practical Foundations:
The model is inspired by John Carter’s “TTM Squeeze” principle: volatility contraction followed by explosive momentum
Position sizing and ATR-based trailing logic follow Ernie Chan’s adaptive risk framework in Algorithmic Trading (2013)
RSI as a trend-quality gate is consistent with classic momentum confirmation rules
Mean Amplitude (300 candles)Displays the average candle amplitude (volatility) as % over a selected period. Useful for gauging market activity compression or expansion.
SupertrendWill generate Good Signals but be remembered that you can only use when Breakout market is there
All SMAs Bullish/Bearish Screener (Enhanced)All SMAs Bullish/Bearish Screener Enhanced: Uncover High-Conviction Trend Alignments with Confidence
Description:
Are you ready to elevate your trading from mere guesswork to precise, data-driven decisions? The "All SMAs Bullish/Bearish Screener Enhanced" is not just another indicator; it's a sophisticated, yet user-friendly, trend-following powerhouse designed to cut through market noise and pinpoint high-probability trading opportunities. Built on the foundational strength of comprehensive Moving Average confluence and fortified with critical confirmation signals from Momentum, Volume, and Relative Strength, this script empowers you to identify truly robust trends and manage your trades with unparalleled clarity.
The Power of Multi-Factor Confluence: Beyond Simple Averages
In the unpredictable world of financial markets, true strength or weakness is rarely an isolated event. It's the harmonious alignment of multiple technical factors that signals a high-conviction move. While our original "All SMAs Bullish/Bearish Screener" intelligently identified stocks where price was consistently above or below a full spectrum of Simple Moving Averages (5, 10, 20, 50, 100, 200), this Enhanced version takes it a crucial step further.
We've integrated a powerful three-pronged confirmation system to filter out weaker signals and highlight only the most compelling setups:
Momentum (Rate of Change - ROC): A strong trend isn't just about price direction; it's about the speed and intensity of that movement. Positive momentum confirms that buyers are still aggressively pushing price higher (for bullish signals), while negative momentum validates selling pressure (for bearish signals).
Volume: No trend is truly trustworthy without the backing of smart money. Above-average volume accompanying an "All SMAs" alignment signifies strong institutional participation and conviction behind the move. It separates genuine trend starts from speculative whims.
Relative Strength Index (RSI): This versatile oscillator ensures the trend isn't just "there," but that it's developing healthily. We use RSI to confirm a bullish bias (above 50) or a bearish bias (below 50), adding another layer of confidence to the direction.
When the price aligns above ALL six critical SMAs, and is simultaneously confirmed by robust positive momentum, healthy volume, and a bullish RSI bias, you have an exceptionally strong "STRONGLY BULLISH" signal. This confluence often precedes sustained upward moves, signaling prime accumulation phases. Conversely, a "STRONGLY BEARISH" signal, where price is below ALL SMAs with negative momentum, confirming volume, and a bearish RSI bias, indicates powerful distribution and potential for significant downside.
How to Use This Enhanced Screener:
Add to Chart: Go to TradingView's Pine Editor, paste the script, and click "Add to Chart."
Customize Parameters: Fine-tune the lengths of your SMAs, RSI, Momentum, and Volume averages via the indicator's settings. Experiment to find what best suits your trading style and the assets you trade.
Choose Your Timeframe Wisely:
Daily (1D) and 4-Hour (240 min) are highly recommended. These timeframes cut through intraday noise and provide more reliable, actionable signals for swing and position trading.
Shorter timeframes (e.g., 15min, 60min) can be used by advanced day traders for very short-term entries, but be aware of increased volatility and noise.
Visual Confirmation:
Green/Red Triangles: Appear on your chart, indicating confirmed bullish or bearish signals.
Background Color: The chart background will subtly turn lime green for "STRONGLY BULLISH" and red for "STRONGLY BEARISH" conditions.
On-Chart Status Table: A clear table displays the current signal status ("STRONGLY BULLISH/BEARISH," or "SMAs Mixed") for immediate feedback.
Set Up Alerts (Your Primary Screener Tool): This is the game-changer! Create custom alerts on TradingView based on the "Confirmed Bullish Trade" and "Confirmed Bearish Trade" conditions. Receive instant notifications (email, pop-up, mobile) for any stock in your watchlist that meets these stringent criteria. This allows you to scan the entire market effortlessly and act decisively.
Strategic Stop-Loss Placement: The Trader's Lifeline
Even the most robust signals can fail. Protecting your capital is paramount. For this trend-following strategy, your stop-loss should be placed where the underlying trend structure is broken.
For a "STRONGLY BULLISH" Trade: Place your stop-loss just below the most recent significant swing low (higher low). This is the last point where buyers stepped in to support the price. If price breaks below this, your bullish thesis is invalidated.
For a "STRONGLY BEARISH" Trade: Place your stop-loss just above the most recent significant swing high (lower high). If price breaks above this, your bearish thesis is invalidated.
Alternatively, consider placing your stop-loss just below the 20-period SMA (for bullish trades) or above the 20-period SMA (for bearish trades). A significant close beyond this intermediate-term average often indicates a critical shift in momentum. Always ensure your chosen stop-loss adheres to your pre-defined risk per trade (e.g., 1-2% of capital).
Disciplined Profit Booking: Maximizing Gains
Just as important as knowing when you're wrong is knowing when to take profits.
Trailing Stop-Loss: As your trade moves into profit, trail your stop-loss upwards (for longs) or downwards (for shorts). You can trail it using:
Previous Swing Lows/Highs: Move your stop to just below each new higher low (for longs) or just above each new lower high (for shorts).
A Moving Average (e.g., 10-period or 20-period SMA): If price closes below your chosen trailing SMA, exit. This allows you to ride the trend while protecting accumulated profits.
Target Levels: Identify potential resistance levels (for longs) or support levels (for shorts) using pivot points, previous highs/lows, or Fibonacci extensions. Consider taking partial profits at these levels and letting the rest run with a trailing stop.
Loss of Confluence: If the "STRONGLY BULLISH/BEARISH" condition ceases to be met (e.g., RSI crosses below 50, or volume drops significantly), this can be a signal to reduce or exit your position, even if your stop-loss hasn't been hit.
The "All SMAs Bullish/Bearish Screener Enhanced" is your comprehensive partner in navigating the markets. By combining robust trend identification with critical confirmation signals and disciplined risk management, you're equipped to make smarter, more confident trading decisions. Add it to your favorites and unlock a new level of precision in your trading journey!
#PineScript #TradingView #SMA #MovingAverage #TrendFollowing #StockScreener #TechnicalAnalysis #Bullish #Bearish #QQQ #Momentum #Volume #RSI #SPY #TradingStrategy #Enhanced #Signals #Analysis #DayTrading #SwingTrading