All OB + FVG + Overlap Zones + Alerts (v6 safe)//@version=6
indicator(
"All OB + FVG + Overlap Zones + Alerts (v6 safe)",
overlay = true
)
// === USER INPUTS ===
maxBarsBack = input.int(500, "Max Bars Back to Display OB/FVG", minval = 1)
extendBars = input.int(10, "Extend OB/FVG Boxes Forward", minval = 1)
// === COLORS ===
bullOBColor = color.rgb(139, 0, 0) // Deep Red
bearOBColor = color.rgb(75, 0, 130) // Deep Purple
bullFVGColor = color.rgb(0, 100, 0) // Deep Green
bearFVGColor = color.rgb(184, 134, 11) // Deep Yellow
overlapColor = color.rgb(0, 255, 255) // Cyan for OB+FVG overlap
// === HELPER FUNCTION ===
inRange(offset) =>
bar_index - offset >= last_bar_index - maxBarsBack
// === ORDER BLOCK LOGIC ===
bullOB = close < open and close > open
bearOB = close > open and close < open
// === COLOR OB CANDLE ===
barcolor(
bullOB and inRange(1) ? bullOBColor :
bearOB and inRange(1) ? bearOBColor :
na,
offset = -1
)
// === DRAW EXTENDED OB BOXES ===
if bullOB and inRange(1)
box.new(
left = bar_index - 1,
right = bar_index - 1 + extendBars,
top = high ,
bottom = low ,
bgcolor = color.new(bullOBColor, 70),
border_color = bullOBColor
)
if bearOB and inRange(1)
box.new(
left = bar_index - 1,
right = bar_index - 1 + extendBars,
top = high ,
bottom = low ,
bgcolor = color.new(bearOBColor, 70),
border_color = bearOBColor
)
// === FVG LOGIC (3-candle imbalance) ===
bullFVGFormed = low > high
bearFVGFormed = high < low
// === DRAW FVG BOXES AND STORE TOP/BOTTOM ===
var float bullFVGTop = array.new_float()
var float bullFVGBot = array.new_float()
var float bearFVGTop = array.new_float()
var float bearFVGBot = array.new_float()
var box bullFVGBoxes = array.new_box()
var box bearFVGBoxes = array.new_box()
if bullFVGFormed and inRange(2)
fvgBox = box.new(
left = bar_index - 2,
right = bar_index - 2 + extendBars,
top = low,
bottom = high ,
bgcolor = color.new(bullFVGColor, 80),
border_color = bullFVGColor
)
array.push(bullFVGBoxes, fvgBox)
array.push(bullFVGTop, low)
array.push(bullFVGBot, high )
if bearFVGFormed and inRange(2)
fvgBox = box.new(
left = bar_index - 2,
right = bar_index - 2 + extendBars,
top = high,
bottom = low ,
bgcolor = color.new(bearFVGColor, 80),
border_color = bearFVGColor
)
array.push(bearFVGBoxes, fvgBox)
array.push(bearFVGTop, high)
array.push(bearFVGBot, low )
// === CHECK AND HIGHLIGHT OB + FVG OVERLAPS ===
var float overlapLevelsTop = array.new_float()
var float overlapLevelsBot = array.new_float()
if bullOB and inRange(1) and array.size(bullFVGBoxes) > 0
for i = 0 to array.size(bullFVGBoxes) - 1
obTop = high
obBot = low
fvgTop = array.get(bullFVGTop, i)
fvgBot = array.get(bullFVGBot, i)
overlapTop = math.min(obTop, fvgTop)
overlapBot = math.max(obBot, fvgBot)
if overlapTop > overlapBot
box.new(
left = bar_index - 1,
right = bar_index - 1 + extendBars,
top = overlapTop,
bottom = overlapBot,
bgcolor = color.new(overlapColor, 80),
border_color = overlapColor
)
array.push(overlapLevelsTop, overlapTop)
array.push(overlapLevelsBot, overlapBot)
if bearOB and inRange(1) and array.size(bearFVGBoxes) > 0
for i = 0 to array.size(bearFVGBoxes) - 1
obTop = high
obBot = low
fvgTop = array.get(bearFVGTop, i)
fvgBot = array.get(bearFVGBot, i)
overlapTop = math.min(obTop, fvgTop)
overlapBot = math.max(obBot, fvgBot)
if overlapTop > overlapBot
box.new(
left = bar_index - 1,
right = bar_index - 1 + extendBars,
top = overlapTop,
bottom = overlapBot,
bgcolor = color.new(overlapColor, 80),
border_color = overlapColor
)
array.push(overlapLevelsTop, overlapTop)
array.push(overlapLevelsBot, overlapBot)
// === ALERT CONDITIONS ===
overlapAlert = false
for i = 0 to array.size(overlapLevelsTop) - 1
if close <= array.get(overlapLevelsTop, i) and close >= array.get(overlapLevelsBot, i)
overlapAlert := true
// === ALERTCONDITION (v6 compatible) ===
alertcondition(overlapAlert, "OB + FVG Overlap", "⚡ Price entered an OB + FVG overlap zone! ⚡")
alertcondition(bullOB, "Bullish OB Formed", "🔴 Bullish OB formed!")
alertcondition(bearOB, "Bearish OB Formed", "🟣 Bearish OB formed!")
Indicators and strategies
gilgamesh v8A simple strategy indicator ,works based on orb and other confluence ,to be traded at newyork open ,the session is from 9:30 - 11: 15
BUY SIGNAL - Green candle + Green arrow
SELL SIGNAL - Red candle + Red arrow
is momentum and impulse based day trading so tight sl and short targets but feel free to mess around or find your own edge or approach ,during development 20 pips sl , 1: 2 target (40 pips tp) looked good on GBPUSD but yet to backtest, and since it is based on Ny open should work good on indices too
NOTE
candle is always green and red above or below range and arrow always show when there is volume and momentum so taking 1 trade at a time ,adding to winner and all is up to you, its
momentum based so choppy market conditions will to rough bad days but depending on utilization the edge and setup is actually profitable
P/E Ratio (TTM)This indicator plots the trailing P/E ratio (TTM) using GAAP EPS (TTM) sourced directly from TradingView’s fundamental data. It includes valuation‑zone color coding, yearly labels, and a clean, compressed visual layout suitable for most equities.
The goal is to provide a fast, intuitive view of how expensive or cheap a stock is relative to its historical earnings power.
Note:
The indicator caps P/E values around 120 for visual clarity.
Negative P/E ratios are intentionally excluded, since P/E is undefined when EPS is negative.
You can adjust the cap or remove it entirely if you prefer a full‑range view.
This tool is especially useful for identifying periods when a company is trading at historically elevated or discounted valuation levels.
ORB - BO-RT-ENThis script is designed for the Opening Range Breakout (ORB) trader who seeks high-probability entries through price action confirmation. Unlike standard breakout tools that trigger on the first touch, this indicator requires a three-step validation process: Breakout, Retest, and Momentum Confirmation.
High-Level Summary
The script identifies the high and low of the first 5 minutes of the trading session (adjustable via inputs). It then monitors price action to find a confirmed breakout outside this range. To filter out "fakeouts," the script requires the price to return and touch the broken level (the retest) before signaling an entry. If at any point the price closes back inside the opening range before the setup is complete, the trade is invalidated and the sequence resets.
Core Features
Sequential Signal Logic: Tracks the BO → RT → ENTRY process across distinct candles to prevent early entries.
Momentum Confirmation: Entry arrows only trigger after a user-defined candle delay and a close in the trend direction.
Visual Clarity: Plots high-visibility 5-minute range lines that persist until the market close.
Advanced Invalidation: Automatically cancels setups if a "stop-run" or fakeout closes price back within the range.
Scanner Ready: Includes specific alertcondition calls for Breakouts, Retests, and Entries, making it compatible with the TradingView Stock Screener.
How to Use the Script (Steps to Play)
1. Setup the Timeframe
Apply the indicator to a 1-minute chart. While the opening range is calculated based on the first 5 minutes, the entry logic requires the granularity of the 1-minute timeframe to detect precise retests.
2. Define the Range
By default, the script calculates the range from 09:30 to 09:35 EST. If you trade a different market (e.g., London Open or Crypto), adjust the "Opening Range Period" in the settings.
3. Monitor for the Breakout (BO)
Wait for a 1-minute candle to close above the High or below the Low. A label marked "BO" will appear on your chart.
4. The Retest (RT)
After the breakout, look for the price to "wick" or touch the breakout line. A triangle marked "RT" will appear.
Note: If the price closes back inside the range during this phase, the labels will disappear, signaling an invalid setup.
5. Execution (ENTRY)
Once the retest is complete, wait for the "ENTRY" arrow. This triggers when:
The user-defined candle delay (default: 1 bar) has passed since the retest.
The candle closes in the direction of the breakout (Green for Long / Red for Short).
6. Exit Strategy
Following the original strategy parameters, place your Stop Loss at the opposite end of the 5-minute opening range and set your Take Profit at a 2.0 Risk-to-Reward (2R) ratio from your entry price.
Vertical Line Every 5 Minutes (Customizable)Creates a vertical line every 5 minutes on the sub charts
Gap Boxes extended_customizableSimple indicator denoting gaps on the chart, along with option to have labels according to the percentage of the gap up or gap down. Enjoy
Mentor Michael | XAUUSD Short BiasMentor Michael | XAUUSD Market Structure & Short Bias
This indicator is a visual price-action framework designed for traders who analyze Gold (XAUUSD) using institutional concepts rather than lagging indicators.
The script highlights high-probability decision zones by mapping key areas where liquidity, supply, and demand are most likely to influence price behavior. It is intended for educational and discretionary trading, not automated execution.
Core Features
Higher-Timeframe Resistance Zone
Identifies premium pricing areas where selling pressure and profit-taking are statistically likely.
Range & Accumulation Mapping
Visually marks prior consolidation zones to provide context for current market positioning.
Demand Reaction Area
Highlights zones where buyers previously reacted, helping define structural invalidation.
Projected Downside Target
Displays logical price objectives based on range equilibrium and liquidity attraction.
Directional Bias Label
Keeps the trader aligned with the planned market narrative and risk framework.
Trading Philosophy
This indicator is built around:
Market structure
Liquidity behavior
Premium vs. discount pricing
Mean-reversion probability after expansion
It supports traders in identifying where to trade, not when to trade, encouraging patience, confirmation, and proper risk management.
Best Use Case
Top-down analysis (D1 → H4 → H1)
Confluence-based trade planning
Educational chart sharing
Manual execution with confirmation
Important Notice
This tool does not provide buy/sell signals, alerts, or automated trades.
All levels are reference zones, not guarantees. Always apply your own confirmation and risk management.
Vertical Line Every 15 Minutes (Customizable)Draws a vertical line every 15 mins on lower time frame charts
Candle Close CounterThis indicator counts how many candles have closed above, below, or exactly at a user-defined price level
starting from a specified time. It provides real-time statistics to help traders analyze price behavior
around key levels.
HOW IT WORKS:
The indicator begins counting at your chosen start time and tracks each candle's closing price relative
to your specified price level. It maintains running totals of candles that close above, below, and at
the price level, displaying this information both in a chart label and a statistics table.
PRACTICAL APPLICATIONS:
1. CONSOLIDATION ANALYSIS:
Use this tool to identify and measure consolidation patterns by placing the price level at the midpoint
of a trading range. A balanced count of candles closing above and below the midpoint suggests genuine
consolidation with no directional bias.
2. RANGE MIDPOINT MONITORING:
During consolidation phases, set the price level to the 50% retracement of the range midpoint between
the high and low. Monitor how price interacts with this level over time.
3. SUPPORT/RESISTANCE VALIDATION:
Place the price level at a key support or resistance zone and start counting from a significant market
event (news release, session open, etc.). The distribution of closes helps validate whether the level
is holding or weakening.
4. SESSION ANALYSIS:
Set the start time to the beginning of a trading session (e.g., 9:30 AM ET for regular hours) and place
the level at the opening price or previous day's close.
Evil MACD Trading System (Pine Script v6)Indicator Overview
The Evil MACD Trading System is an enhanced version of the classic MACD indicator, optimized for TradingView with Pine Script v6. It integrates trend filtering, volume confirmation, and precision signal positioning to reduce false signals and improve trading decision accuracy—distinguishing itself from the traditional 12/26/9 MACD by focusing on trend-aligned entries and exits.
Core Logic & Features
1. Enhanced MACD Calculation
Departing from the standard MACD parameters, this system uses customizable fast (default:14), slow (default:28), and signal (default:8) periods to adapt to different market volatility and asset types (stocks, futures, cryptos). The core DIF, DEA, and histogram are retained while optimized for better sensitivity to medium-term trends.
2. Trend Filtering Mechanism
A 60-period EMA (adjustable) acts as the primary trend filter, ensuring buy signals only trigger in uptrends (price above EMA) and sell signals in downtrends (price below EMA). This avoids counter-trend trades and minimizes exposure to sideways market noise.
3. Volume Confirmation (Toggleable)
The optional volume filter validates signals by requiring trading volume to exceed 120% of the 20-period average volume. This ensures entries/exits are supported by capital flow, reducing false breakouts/breakdowns.
4. Precision Signal Positioning
Signals are overlaid directly on the price chart (not the subwindow) for intuitive price correlation. Buy signals (green upward triangles + "Buy" label) attach to the bottom of candlesticks, while sell signals (red downward triangles + "Sell" label) align with candlestick highs—adjustable offset parameters let users fine-tune signal proximity to price.
Usage Guidelines
- Buy Signal: Triggered when DIF crosses above DEA, price stays above the 60-period EMA, and volume (if enabled) meets the 120% threshold.
- Sell Signal: Triggered when DIF crosses below DEA, price stays below the 60-period EMA, and volume (if enabled) meets the 120% threshold.
- Customization: Adjust MACD periods, trend filter length, volume sensitivity, and signal offset to match your trading style (scalping, swing trading) and target assets.
Compatibility & Notes
Built for Pine Script v6 (latest TradingView version) with no syntax errors. The indicator supports all timeframes and asset classes. For best results, combine with additional technical tools (support/resistance, RSI) for multi-factor confirmation. Disable the volume filter in low-liquidity markets to avoid missing valid signals.
Volume Delta Highlighted (Pane)A simple volume delta indicator that highlights blue when the bar has no wicks and white with it has only opposite end wicks ,a good confluence and visual
note :
not as accurate as the paid tradingview indicator since it uses chart data
Punchak Levels1. Enter the start date/time and end date/time of Punchak.
2. Enter the multipler of punchak range (default is 0.25).
3. Enter how many levels you want to plot.
Time Zones PROGeopbytech – Time Zones PRO (v6)
Geopbytech – Time Zones PRO is a professional market session indicator designed for intraday, scalping, and Smart Money Concepts (SMC) traders who want precise market timing and clean chart context.
This indicator allows you to visualize up to 5 configurable market sessions in a single script, fully adaptable to any timezone and trading style.
5 independent sessions (ON / OFF per session)
Custom session time ranges
Editable timezone (IANA format: America/New_York, Europe/London, UTC, etc.)
Soft and clean background shading
Session start flag (🚩) printed at the exact opening candle
Works on Forex, Indices, Gold, and Crypto
Built with Pine Script v6 (latest version)
Common Use Cases
London Session – Early liquidity grabs and manipulation
New York Killzone – High-probability SMC entries
Asia Range – Range building and target mapping
Custom sessions based on your local timezone
Easy Configuration
All settings are accessible from the indicator panel:
Enable or disable each session
Edit session names and time ranges
Adjust background colors
Select your real local timezone
Toggle session start flags on or off
No need to load multiple indicators — everything is centralized into one professional tool.
Indicator Philosophy
This indicator does NOT provide buy or sell signals.
Its purpose is to provide market context, timing, and structure , helping traders focus only on periods where institutional liquidity is active.
Perfectly compatible with:
Smart Money Concepts (SMC)
Order Blocks
Fair Value Gaps (FVG)
Market Structure
Liquidity Sweeps
Author
Geopbytech – Juan Delgado
Disclaimer
This indicator is for educational purposes only.
It does not constitute financial advice.
Always trade with proper risk management.
LT - Vertical Line Every Minute (Customizable)Prints a vertical line every minute on the sub-minute charts
NQ Top 2025 Stocks Screener by ProjectSyndicate📊 NQ Top 2025 Stocks Screener (TradingView) — by ProjectSyndicate
Executive Summary
This document provides comprehensive documentation for the NQ TOP 2025 Stocks Screener, a powerful Pine Script™ indicator for TradingView.
The screener is designed to give traders and investors a high-level overview of performance and advanced risk metrics for a curated list of 40 top-performing Nasdaq stocks in 2025. By presenting rich data in a clean, customizable dashboard, users can quickly:
• Identify market leaders
• Assess risk-adjusted returns
• Make more informed trading decisions
The script includes performance metrics across multiple timeframes, plus sophisticated risk and volatility parameters—such as the Kelly Criterion, Sharpe Ratio, and Z-Score—often found in professional-grade institutional tools.
________________________________________
⭐ Top 10 Key Features
# Feature Description
1 Curated Stock List Monitors a list of 40 hand-picked, high-performing Nasdaq stocks.
2 Multi-Timeframe Performance Tracks performance across 6 timeframes: Week, Month, Quarter, 6 Months, 12 Months, and YTD.
3 Advanced Risk Metrics Includes institutional-grade metrics: Beta, Sharpe, Sortino, Omega, Z-Score, Kelly%.
4 Dynamic Sorting Sort the dashboard by any of the 6 performance metrics to instantly find top movers.
5 Customizable Dashboard Control table position (Top/Middle/Bottom + Left/Center/Right) and text size (Small/Normal/Large).
6 Color-Coded Performance Uses a 7-level gradient (bright green → bright red) for quick strength/weakness scanning.
7 Merged Title Heading Full-width title at the top for a clean, professional dashboard look.
8 Daily Timeframe Lock Detects non-daily timeframes and prompts a switch to ensure calculation accuracy.
9 Clean & Readable Code Well-organized and commented for easier understanding and modification.
10 Lightweight & Efficient Optimized to run smoothly on TradingView with minimal lag.
________________________________________
📖 Overview
The NQ TOP 2025 Stocks Screener brings institutional-style market analysis to everyday traders.
Instead of reviewing dozens of individual charts, it consolidates the most important data points for 40 Nasdaq stocks into a single, elegant dashboard—helping users save time and quickly spot opportunities while staying aware of risk.
________________________________________
🛠️ Installation
1. Open TradingView and navigate to any chart.
2. Open the Pine Editor tab at the bottom of the screen.
3. Copy the entire script from NQ_TOP_2025_Stocks_Screener.pine.
4. Paste it into the Pine Editor (replacing any existing text).
5. Click Add to Chart.
✅ The dashboard will appear on your chart.
📌 Recommended timeframe: Daily (for accurate calculations).
________________________________________
📊 Dashboard Layout (16 Columns)
# Header Description
1 No. Rank of the stock based on the current sort order.
2 Ticker Stock ticker symbol.
3 Stock Name Company name.
4 Week% % price change over the last week.
5 Mnt% % price change over the last month.
6 Quarter% % price change over the current quarter.
7 6Mnt% % price change over the current 6 months.
8 12Mnt% % price change over the current 12 months.
9 YTD% % price change from the start of the current year.
10 Wk Vol Annualized weekly volatility.
11 Beta Volatility relative to Nasdaq-100 (QQQ).
12 Sharpe Sharpe Ratio (risk-adjusted return).
13 Sortino Sortino Ratio (downside-risk focused).
14 Omega Omega Ratio (probability of gains vs losses).
15 Z-Score Distance from mean in standard deviations.
16 Kelly% Kelly Criterion (theoretical optimal position sizing).
________________________________________
🔬 Advanced Risk & Volatility Parameters
This screener goes beyond basic performance to provide deeper risk insight.
Parameter Description
Wk Vol (Weekly Volatility) Annualized standard deviation of weekly returns. Higher = larger price swings.
Beta Volatility vs Nasdaq-100 (QQQ). Beta > 1 = more volatile than index; Beta < 1 = less volatile.
Sharpe Ratio Excess return per unit of total volatility. Higher = better risk-adjusted return.
Sortino Ratio Like Sharpe, but only uses downside volatility (penalizes harmful volatility).
Omega Ratio Probability-weighted gains vs losses relative to a threshold. Higher = more favorable return distribution.
Z-Score How far a value is from its mean (in standard deviations); helps detect extremes vs average behavior.
Kelly% (Kelly Criterion) Suggests an optimal allocation % based on performance and variance (theoretical position sizing).
________________________________________
⚙️ Customization (Settings Menu)
You can customize the dashboard appearance and behavior via the script settings:
• Table Position: Choose vertical (Top/Middle/Bottom) and horizontal (Left/Center/Right) placement
• Text Size: Small / Normal / Large
• Sort By: Select the primary sorting column from any of the 6 performance metrics
________________________________________
📋 Stock List (40 Nasdaq Stocks)
The screener includes the following top-performing Nasdaq stocks in 2025:
HYMC, CELC, TERN, AUGO, ONDS, ERAS, ASTS, GRAL, SATS, WDC, COGT, ATRO, OPEN, VSAT, APLD, LASR, PRAX, ALMS, MU, TTMI, ARWR, LITE, CIFR, SSRM, FTAI, MLYS, KTOS, GPCR, RKLB, STX, NVTS, VISN, EOSE, RVMD, LQDA, PPTA, WBD, INDV, ACMR, BLTE
x5-smooth-ema[t90]Overview
The x5 Smoothed EMA Flow is a trend-visualization tool designed to filter out market "noise" by applying a secondary smoothing layer to a base Exponential Moving Average (EMA).
How to Use
Trend Filtering: The "Flow" helps identify the true trend. When the ribbon is expanding and colored for a bullish trend, it signals strong, sustained momentum.
Noise Reduction: Unlike a standard EMA which can "whipsaw" during consolidation, the double-smoothed layers stay smoother for longer, helping traders stay in a position during minor pullbacks.
Trend Confirmation: Use the alignment of all smoothing layers to confirm a trend. When all layers transition to the same color, it indicates a high-probability trend shift.
Dynamic Support/Resistance: The ribbon acts as a depth-based support or resistance zone. Price often reacts to the "core" of the flow before continuing its primary move.
Settings
Source: Choose the price source (Close, HL2, etc.) for the initial calculation.
Base Length: Adjust the sensitivity. Shorter lengths are better for scalping; longer lengths are optimized for swing trading.
Color Settings: Fully customizable Bull and Bear colors to match your chart theme.
Disclaimer: This indicator is for educational purposes only. Moving averages are lagging indicators and should be used in conjunction with other forms of analysis. Past performance is not indicative of future results.
The Bitterroot Trader Checklist//@version=5
indicator("Syntax-Safe Confluence Gauge", overlay=true)
// --- 1. INPUTS ---
col_ema9 = input.color(#00bcd4, "9 EMA Color")
col_ema20 = input.color(#ff9800, "20 EMA Color")
col_ema60 = input.color(#f44336, "60 EMA Color")
col_vwap = input.color(color.gray, "VWAP Color")
// --- 2. 48-HOUR DATA ---
h48 = ta.highest(high, 100)
l48 = ta.lowest(low, 100)
v48_avg = ta.sma(volume, 100)
// --- 3. CALCULATIONS ---
= ta.macd(close, 12, 26, 9)
e9 = ta.ema(close, 9), e20 = ta.ema(close, 20), e60 = ta.ema(close, 60)
v_wap = ta.vwap(close)
// --- 4. SCORING & CHECKLIST LOGIC ---
bool c1 = macdLine > signalLine
bool c2_bull = (volume > v48_avg and close > open)
bool c2_bear = (volume > v48_avg and close < open)
bool c3 = (e9 > e20 and e20 > e60)
bool c4_bull = close > h48
bool c4_bear = close < l48
bool c5 = close > v_wap
// Final Scoring
float s2 = c2_bull ? 1.0 : c2_bear ? -1.0 : 0.0
float s4 = c4_bull ? 1.0 : c4_bear ? -1.0 : 0.0
float live_mean = ((c1 ? 1 : -1) + s2 + (c3 ? 1 : -1) + s4 + (c5 ? 1 : -1)) / 5.0
// Count active checks for Alerts
int bull_checks = (c1 ? 1 : 0) + (c2_bull ? 1 : 0) + (c3 ? 1 : 0) + (c4_bull ? 1 : 0) + (c5 ? 1 : 0)
int bear_checks = (macdLine < signalLine ? 1 : 0) + (c2_bear ? 1 : 0) + (e9 < e20 and e20 < e60 ? 1 : 0) + (c4_bear ? 1 : 0) + (close < v_wap ? 1 : 0)
// --- 5. ALERTS ---
alertcondition(bull_checks >= 4, title="Strong Bullish Confluence", message="4+ Bullish Checks Aligned!")
alertcondition(bear_checks >= 4, title="Strong Bearish Confluence", message="4+ Bearish Checks Aligned!")
// --- 6. COLOR ENGINE ---
bool macd_curling_up = hist > hist
bool macd_curling_down = hist < hist
color final_c = #808080
if live_mean <= -0.1
final_c := (live_mean <= -0.8) ? #ff0000 : #8b0000
if macd_curling_up
final_c := #d84315
else if live_mean >= 0.1
final_c := (live_mean >= 0.8) ? #00ff00 : #006400
if macd_curling_down
final_c := #9e9d24
else
final_c := #808080
// --- 7. REWRITTEN NEEDLE LOGIC (Fixes the Mismatched Input Error) ---
string needle = switch
live_mean <= -1.0 => "┃ "
live_mean <= -0.6 => " ┃ "
live_mean <= -0.2 => " ┃ "
live_mean == 0.0 => " ┃ "
live_mean <= 0.4 => " ┃ "
live_mean <= 0.8 => " ┃ "
=> " ┃"
// --- 8. TABLE DISPLAY ---
var table gauge = table.new(position.top_right, 1, 1)
if barstate.islast
string check1 = "MACD: " + (c1 ? "✅" : "❌")
string check2 = "VOL: " + (s2 > 0 ? "✅" : s2 < 0 ? "❌" : "➖")
string check3 = "EMA: " + (c3 ? "✅" : "❌")
string check4 = "48H: " + (s4 > 0 ? "✅" : s4 < 0 ? "❌" : "➖")
string check5 = "VWAP: " + (c5 ? "✅" : "❌")
string display_text = "48H MEAN: " + str.tostring(live_mean, "#.#") + " " +
" " +
" " + needle + " " +
"------------------ " +
check1 + " | " + check2 + " " +
check3 + " | " + check4 + " " +
check5 + " | CURL: " + (macd_curling_up ? "UP" : "DN")
table.cell(gauge, 0, 0, display_text, bgcolor=color.new(final_c, 85), text_color=final_c, text_size=size.large)
// --- 9. PLOTS ---
plot(h48, "48H High", color=color.new(#00ff00, 50), style=plot.style_stepline)
plot(l48, "48H Low", color=color.new(#ff0000, 50), style=plot.style_stepline)
EMA with RSI Color (Custom Lengths)本指标将指数移动平均线(EMA)与相对强弱指标(RSI)相结合,用于辅助判断市场的趋势方向与超买 / 超卖状态。
用户可自定义 EMA 的长度(如 20 / 60 / 120),并灵活选择 EMA 的计算周期:
(1) 使用当前图表周期,或
(2) 使用指定的高 / 低周期(如 1m、5m、1h、4h、1D、1W)
RSI 默认采用 14 周期,并支持自定义超买与超卖阈值:
(1) 当 RSI 低于超卖阈值(如 30)时,对应时间段内的 EMA 将自动变为绿色,提示可能存在超卖反弹机会;
(2) 当 RSI 高于超买阈值(如 70)时,对应时间段内的 EMA 将自动变为红色,提示可能存在超买回调风险;
(3) 当 RSI 处于中性区间时,EMA 显示为用户设定的默认颜色。
此外,RSI 的计算周期也可选择:
(1) 与 EMA 使用相同的周期(用于多周期趋势确认),或
(2) 使用当前图表周期(用于短周期动量判断)。
This indicator combines Exponential Moving Averages (EMA) with the Relative Strength Index (RSI) to assist in identifying trend direction and overbought/oversold conditions.
Users can define custom EMA lengths (e.g., 20 / 60 / 120) and flexibly choose the EMA calculation timeframe:
(1) Use the current chart timeframe, or
(2) Use a specified higher or lower timeframe (e.g., 1m, 5m, 1h, 4h, 1D, 1W).
The RSI uses a default 14-period setting, with customizable overbought and oversold levels:
(1) When RSI falls below the oversold threshold (e.g., 30), the EMA segments corresponding to that period are automatically colored green, indicating potential oversold rebound opportunities;
(2) When RSI rises above the overbought threshold (e.g., 70), the EMA segments turn red, signaling potential overbought pullback risk;
(3) When RSI remains within the neutral zone, EMA lines retain their user-defined default colors.
The RSI calculation timeframe can also be selected:
(1) The same timeframe as EMA (for multi-timeframe trend confirmation), or
(2) The current chart timeframe (for short-term momentum analysis).
N Option Selling 2
---
## 📌 Script Description
**NIFTY Weekly Option Seller – Regime-Based Risk-Controlled System**
This indicator is designed for **systematic weekly option selling on NIFTY**, using a **rule-based regime and scoring framework** to decide **what to sell, how aggressively to sell, and when to defend or harvest**.
The script does **not generate buy/sell signals**.
Instead, it acts as a **decision and risk-management engine** for option sellers.
---
## 🔹 Core Idea
The market is always in one of three regimes:
1. **Iron Condor (IC)** → Range / mean-reverting market
2. **Put Credit Spread (PCS)** → Bullish trending market
3. **Call Credit Spread (CCS)** → Bearish trending market
This script **scores all three regimes (0–5)** on the current chart timeframe and automatically selects the **dominant regime**.
---
## 🔹 How Scoring Works (High Level)
Each regime score is built using **price structure + volatility + momentum context**:
### PCS (Bullish bias)
* EMA alignment (8 > 13 > 34)
* ADX trend strength
* Price above VWAP
* CPR breakout
* RSI sanity checks (size is reduced in extremes)
* Daily trend confirmation
### CCS (Bearish bias)
* EMA alignment (8 < 13 < 34)
* ADX trend strength
* Price below VWAP
* CPR breakdown
* RSI sanity checks (size is reduced in extremes)
* Daily trend confirmation
### IC (Range bias)
* Low ADX (both intraday & daily)
* Price inside CPR
* Price near VWAP
* Price inside Camarilla H3–L3
* RSI near equilibrium (45–55)
A **cross-penalty system** ensures that strong trends suppress IC scores and vice-versa, preventing conflicting signals.
Scores are **smoothed** to reduce noise and avoid over-trading.
---
## 🔹 Regime Selection Logic
* The regime with the **highest score** is selected.
* If scores tie:
* **Trending markets → PCS / CCS**
* **Non-trending markets → IC**
This ensures **trend takes priority over range** when volatility expands.
---
## 🔹 Strike Selection (ATR-Based)
The script suggests **volatility-adjusted strike distances** using ATR:
* **Iron Condor:** ±1.0 × ATR
* **PCS / CCS:** ±1.25 × ATR
This adapts automatically to changing volatility instead of using fixed point distances.
---
## 🔹 Risk-First Trade Management
The script provides **three actionable alerts only**:
### 🔴 DEFEND
Triggered when:
* Price approaches short strike
* Trend breaks beyond Camarilla levels
* Volatility expansion threatens the position
→ Signals the need to **roll, widen, or convert**
### 🟢 HARVEST
Triggered when:
* Adequate price cushion exists
* Market remains range-bound or stable
→ Signals opportunity to **book profits or roll closer**
### 🔵 REGIME CHANGE
Triggered when:
* Market structure flips decisively
→ Signals need to **switch strategy bias**
A **cooldown system** prevents alert spam.
---
## 🔹 Position Sizing Philosophy
* Scores determine **directional conviction**
* RSI-based **size multiplier** automatically reduces exposure in extreme momentum conditions
* Optional **minimum lot floor** ensures participation without over-risking
* Designed to support **Risk:Reward frameworks (1:2 or 1:3)** through premium-based stop discipline
---
## 🔹 Visual & UX Features
* Background color reflects active regime and conviction
* On-chart panel displays:
* Active strategy
* Scores (IC / PCS / CCS)
* ADX & RSI
* VWAP, CPR, Camarilla levels
* Clean, non-repainting levels (previous day data)
---
## 🔹 Intended Use
* Weekly option selling (IC / PCS / CCS)
* Works best on **30m–1h charts**
* Designed for **rule-based traders**, not discretionary scalpers
* Focused on **capital preservation, consistency, and disciplined adjustments**
---
## ⚠️ Disclaimer
This script is **not financial advice**.
It is a **decision-support and risk-management tool** for experienced option sellers who already understand spreads, adjustments, and margin dynamics.
Universal Auto CPR + R1-R5 S1-S5 +Smoothed Heikin AshiWhat this script is doing :
✅ Part A: Smoothed Heikin Ashi candles (visual overlay)
It calculates Heikin Ashi OHLC
Then applies EMA smoothing to HA values (shaLen)
Finally plots the HA candles using plotcandle()
👉 Important: This HA overlay is ONLY for view.
It does not change CPR / pivot levels,
✅ Part B : Auto CPR timeframe selection
It automatically decides which higher timeframe to use for CPR based on chart timeframe:
Rule inside autoTF:
Chart timeframe CPR timeframe used
seconds or minutes < 60 Daily (D)
minutes ≥ 60 Weekly (W)
daily Monthly (M)
weekly/monthly Yearly (12M)
✅ Recommendation : Add colors + widths to make CPR readable
Currently all plots are default color.
You can set:
Pivot as yellow
TC/BC as blue
R levels red
S levels green
Midlines faded
(only visual improvement)
Happy trading
FVG Toolkit V2 (MTF + Backtest)FVG Toolkit V2 is a clean, multi-timeframe Fair Value Gap (FVG) indicator built for discretionary traders who want clarity, flexibility, and the ability to properly backtest.
This tool was designed specifically to solve common issues with FVG indicators—limited history, lack of timeframe control, and excessive chart clutter—while staying true to how institutional-style traders analyze price.
Key Features:
Multi-Timeframe Fair Value Gaps
Display FVGs from multiple timeframes on a single chart
Supports 5m, 15m, 30m, 1H, 4H, and Daily
Each timeframe can be turned on or off independently
Adjustable Backtesting Lookback
Choose how far back FVGs are displayed (in days)
Default set to 30 days for meaningful backtesting
Helps traders study historical reactions without overwhelming the chart
Custom Timeframe Labels
Each FVG is labeled directly on the chart
Rename timeframe labels in settings (e.g., “30m Bias”, “HTF Daily”, “5m Execution”)
Makes multi-timeframe analysis clear and intuitive
Unfilled & Inverted FVG Logic
Optional setting to show only unfilled FVGs
Optional inverted FVGs once a gap is fully filled
Helps identify potential support/resistance flips and reaction zones
Chart-Timeframe Visualization
All FVGs are drawn on the active chart timeframe
Ideal for execution on 1m, 5m, and 15m charts
Keeps higher-timeframe context visible without switching charts
Who This Indicator Is For:
Traders using Fair Value Gaps as reaction zones
ICT-style and price-action traders
Forex, Futures, and Indices traders
Traders who want clean charts and real backtesting, not repainting signals
Best Use Cases:
Higher-timeframe bias with 30m, 1H, 4H, or Daily FVGs
Execution on 5m or 15m charts
Studying which timeframes’ FVGs are respected by specific instruments
Backtesting FVG behavior across different markets (e.g., USDJPY vs Gold)
HTF Candle Hourly Display**IMPORTANT:** For best visual results, move the indicator to the FIRST position in Object Tree:
- Right-click on chart → Object Tree
- Drag "Hour Display" to the top (first position above candles)
- This ensures hour labels display cleanly behind candlesticks
HOW TO USE:
1. Add to your H1 or higher timeframe chart
2. Adjust UTC offset to match current time (use 0 or 1 - try both to see which matches)
3. Customize text colors for bullish/bearish candles as needed
4. Enable/disable daily separator at 18:00 based on preference
SETTINGS:
• UTC Offset: Use 0 or 1 to match your current time. The correct value changes throughout the year due to daylight saving time (e.g., January may need 1, July may need 0). Simply try both values and use the one that displays correctly.
• Bullish Candle Text Color: Color for labels on up candles (default: black)
• Bearish Candle Text Color: Color for labels on down candles (default: white)
• Show Daily Separator: Toggle 18:00 vertical line on/off
• Daily Separator Color: Customize separator line color
IMPORTANT: This indicator only works on H1 (1-hour) and higher timeframes. A warning will display if used on lower timeframes.






















