GreenyyP Leverage Vortex v6Function Summary of “GreenyyP Leverage Vortex v6”
General Settings
Input fields for long and short base prices
Configurable leverage factor
Adjustable line length and label offset
Toggles for chart labels and scale display
Separate switch to show/hide base-price lines
Individually Toggleable Levels
Each level can be turned on or off independently under the Long/Short groups:
L1, L2, L3 (percentage deviations from the entry price)
TP (Take Profit)
SL (Stop Loss)
Automatic Stop-Loss Correction
SL percentages are processed with math.abs()
Ensures SL lines always plot below (for Long) or above (for Short) the base price regardless of input sign
Drawing Logic
All lines and labels redraw every 10 bars to keep the chart clean
Previous labels are deleted before drawing new ones
Lines are drawn with a width of 2 for clear visibility
Base-Price Lines & Labeling
Optional solid lines for Long and Short base prices
White price labels for each base line
Percentage or short text labels (e.g. “L1: 5%”, “TP: 20%”, “SL: 5%”) with configurable transparency
With these features, you get fully customizable level-plotting, automatic SL handling, and clear visual cues directly on your chart.
Options
CBC scalping indicator SonGohanscript using the cbc flip scalping method.
this is best used on the shorten timeframes (like 2, 5, 10 minutes)
Buy Price Marker
This indicator allows you to set a custom buy price level on the chart. It draws a green horizontal line at the specified buy price and places a label showing the exact buy price value. The line extends to the right, providing a clear visual reference for your entry price as the chart progresses. The label dynamically updates with the current bar index, ensuring the buy price annotation stays aligned with the latest data.
Institutional Order Block Indicator [IOB] + Buy/Sell Signals✅ Institutional Order Block detection
✅ Buy/Sell EMA crossover indicator
✅ Combined visuals (order block boxes + BUY/SELL labels)
✅ Alerts for both order blocks and signals
🔁 QuantSignals | AI Reversal Signal🔁 QuantSignals | AI Reversal Signal
A Free Visual Indicator That Promotes Better Entries
🧠 Built to help traders spot reversal setups + discover the QuantSignals.ai edge.
🎯 What It Does:
This clean, powerful indicator uses a momentum-based reversal logic (RSI crossovers) to highlight potential turning points in any chart — stocks, indices, crypto, or ETFs. Ideal for new and intermediate traders who want simple Buy/Sell guidance with zero clutter.
⚙️ How It Works:
✅ Buy Signal: Triggered when RSI crosses above oversold (default 30)
✅ Sell Signal: Triggered when RSI crosses below overbought (default 70)
✅ Signal Labels: “QS 🔼” and “QS 🔽” on the chart for easy entries
✅ Promo Overlay: Subtle, non-intrusive labels remind traders to check out QuantSignals.ai
✅ Auto Background Tint: Light green/red shading on signals for instant visual confirmation
🌐 Why QuantSignals?
QuantSignals.ai is a next-gen platform for:
🕓 0DTE trading signals
📅 Post-earnings setups
📉 IV flush fades
💡 AI-backed reversal strategies
Trusted by over 1,000 active traders who want real edge — not noise.
🚀 How to Use:
Add to any chart (works on 1m–1D)
Combine with your support/resistance zones
Use as entry timing tool, not standalone system
Check out real trade ideas at QuantSignals.ai
🔗 Call to Action:
📲 Want real-time setups?
👉 Visit www.QuantSignals.xyz
🧠 Learn the full strategy + join the QS community.
📊 Bonus Use Case:
Use this indicator with S&P500 tech stocks post-earnings
Pair with your own watchlist of high-liquidity names
Perfect for small account traders looking to time better entries
💬 Final Words:
“Not every signal is a trade — but every trade should start with a signal.”
— The QuantSignals Team
S&P 500 Smart Trading SetupA custom multi-indicator tool combining EMA 50/200, MACD, RSI, Stochastic RSI, and ATR to help identify trend, momentum, and entry/exit signals for the S&P 500.
NSE/BSE Straddle/Strangle Candle ChartStraddle Candlestick Strategy Indicator
This custom Pine Script indicator is designed to visualize the price action of options using a candlestick chart for Nifty, BankNifty, FINNIFTY, and Midcap indices. It combines Call and Put options for multiple strikes around the underlying asset, creating a detailed view of market movement in a straddle strategy.
Key Features:
Candlestick Visualization: The indicator plots candlestick charts based on the combined price action of both Call and Put options, helping traders analyze price trends for different strikes.
Multi-Strike Options Analysis: It dynamically calculates and plots strike prices above and below the At-the-Money (ATM) strike, offering a comprehensive look at potential price movement across various strike levels.
Customizable Inputs: Users can adjust the strike interval, choose between different index symbols, and customize the appearance of the indicator (e.g., font size, table layout, and color themes).
User-Friendly Dashboard: A clear, customizable dashboard presents the strike price data, along with essential candlestick details, to help users understand the overall market trends at a glance.
Use Case:
This indicator is ideal for traders using straddle strategies on NSE options. It gives users a clear and intuitive visual representation of price action around the ATM strike, helping traders make informed decisions based on the options' movement.
Notes:
The VWAP (Volume-Weighted Average Price) is included for added insight, allowing traders to identify market direction and trends more effectively.
Focused on candlestick price action analysis, without including unnecessary indicators like RSI, Supertrend, or MA.
Perfect for options traders seeking clarity in price movement for better trade execution.
Asia Session Mechanical EntryThis is a fully mechanical trading tool designed to execute trades at the open of the Asia session (starting at 20:00 Argentina time).
It automatically evaluates the directional behavior of the previous two days using simple logic:
📉 If both days were bullish → It sells at the session open (mean-reversion).
📈 If both days were bearish → It buys at the session open.
↔ If one day was up and the other down → It continues the most recent trend.
Once the direction is determined, it:
Sets the entry at the exact time you configure (default is 20:00).
Calculates SL based on nearest swing + ATR buffer.
Calculates TP using a configurable Risk/Reward ratio.
Features:
📅 Works on H1 only (strictly mechanical logic).
🔁 Updates day-by-day automatically.
🎯 Lets you delay the entry by X candles into the session.
🛠 Manual override for SL/TP levels.
🔎 Designed for quick visual backtesting and execution without discretion.
Based on a classic session-based reversion model, this version has been significantly enhanced through ATR filters, manual overrides, and time flexibility to become a robust execution framework for systematic traders.
💡 Ideal for traders looking to reduce emotional bias and follow a fixed daily logic.
Custom GEX Level PlottingPlot your support and resistance levels for SPX along with length of bar to indicate strength of level. Intended for plotting options related levels like GEX and OI on SPX, but works for anything.
Debit Spread POMDP‑Inspired StrategyComprehensive Strategy for TradingView-Based Call and Put Debit Spread Options Using POMDP for Signal Generation
Debit spreads limit risk to the net premium paid while capping potential profit, ideal for moderate price predictions.
Pine Script in TradingView enables custom indicator integration and strategy automation for options trading.
Partially Observable Markov Decision Processes (POMDPs) optimize decision-making under market uncertainty by modeling states, actions, and observations.
Training a POMDP policy involves defining market states, actions, and observations from technical indicators, then simulating and refining the policy.
Automating the strategy via agents or TradingView alerts can execute trades when conditions align with the POMDP-generated signals.
🔄 QuantSignals AI Reversal Pro🔄 QuantSignals AI Reversal Pro — 78%+ Win Rate Reversal Detection
🚀 Catch Market Tops & Bottoms with AI-Powered Precision!
This powerful script brings you professional-grade reversal signals—built on cutting-edge AI, smart confluence logic, and rigorous backtesting.
Whether you’re swing trading, scalping, or position trading, this tool is your new edge.
🎯 Why Traders Love QS AI Reversal Pro:
✅ 78%+ Win Rate on major timeframes (tested on S&P 500, tech stocks, crypto)
🔄 AI-powered oversold/overbought reversal detection
📊 Built-in divergence detection engine (RSI, price, volume)
⚖️ Mean reversion zones + VWAP extremes + Bollinger Band signals
💎 High-Probability Mode: Filters only A+ setups for premium entries
🧠 Confluence Engine: Assigns quality scores to each reversal
🔔 Smart Alerts: Reversal alerts + divergence + premium triggers
🏆 Live Win Rate Tracker on your chart with quality % dashboard
🧠 Powered by QuantSignals AI Engine
This is a limited free version of our proprietary 85%+ win rate reversal algorithm—join our Discord to unlock:
🔐 Institutional-level AI reversal strategy
📈 Real-time confluence dashboards across timeframes
🎯 Custom reversal alerts with entry/exit/stop targets
💬 Live strategy signals, backtests & expert community
💥 Perfect For:
🔁 Reversal traders (crypto, stocks, futures)
⏱ Scalpers & 15m–4H swing traders
📊 Mean reversion systems
🧪 Traders who want data-driven signal confidence
📌 How It Works:
Every signal is based on multi-layer confluence:
Oversold/Overbought + Divergence + VWAP/BB + Volume Surge
Optional: Only show signals with minimum Risk:Reward (e.g. 1:2.5)
Each signal is scored, and you’ll see real-time win rate on-screen
Reversal zones highlighted via color-coded backgrounds
📺 On-Chart Display:
🔄 BUY / SELL Reversal Labels (color-coded for high-probability)
📉 Divergence Lines (bullish & bearish)
🧮 Signal Quality % + Live Win Rate
⚠️ Alerts on all major events (standard + high-prob + divergence)
🔓 Upgrade to Premium (in Discord):
✅ Access full 85%+ win rate reversal model
🧠 AI pattern recognition engine
🔍 Multi-timeframe signal agreement
💡 Institutional order-flow reversal tracking
📊 Backtests + optimization support
🚨 Advanced alerts + automation-ready signals
📲 Join Our 1,800+ Member Community:
🌐 Website: quantsignals.xyz
💬 Discord: discord.gg/quantsignals
🎓 Learn the reversal strategies that top traders use
🔄 Start catching market reversals like a pro—install QS AI Reversal Pro today!
Note: This script is a visual indicator and not a strategy tester. For full backtest-ready premium strategy, please contact us on Discord.
⚡ QuantSignals Post-Earnings IV Flush Strategy⚡ QuantSignals IV Flush Strategy – Post-Earnings Edge
Script Name: ⚡ QS Post-Earnings IV Flush
By: QuantSignals | quantsignals.xyz | Discord: /quantsignals
🎯 Overview
The QS IV Flush Strategy is a professional-grade post-earnings trading system designed to capitalize on volatility collapses ("IV flushes") and early morning price inefficiencies. Built specifically for S&P 500 and tech stocks, this system detects powerful earnings reactions, then systematically executes a two-stage trading plan:
🔄 Reversal Entry @ 6:30 AM PT – Fade early overreaction
🚀 Momentum Follow @ 6:50 AM PT – Ride the second wave
⚙️ Key Features
📊 Smart Earnings Detection: Analyzes gap %, volume spikes, ATR surges
🔥 IV Flush Engine: Detects volatility crushes post-earnings
💼 Dual Strategy Mode: Reversal + Momentum with optional handoff
🛡️ Risk Controls: Dynamic SL/TP per mode with capital-based sizing
📈 Performance Dashboard: Win rate, trade count, drawdown, P&L
📍 Visual Markers: Earnings signals, entries, premarket S/R levels
🔔 Alerts: Entry signals, earnings events, and trade execution
✅ Ideal For
Earnings traders seeking systematic IV edge
Options traders exploiting premium decay post-event
Quant traders needing precise time-based entries
🧠 Strategy Logic
Uses earnings gap size + volume + ATR expansion to detect valid plays
Applies time-filtered logic to isolate early-session edge (ET hours)
Enters size-controlled trades with optional full auto-close by EOD
Fully backtestable on intraday charts (5–15m)
📊 Strategy Settings
Customizable position sizes for both stages
Configurable stop loss / take profit levels
Flexible earnings detection sensitivity (gap %, volume, volatility)
Built-in dashboard shows live stats: trades, win rate, DD, P&L
🧠 Developed by professional traders at QuantSignals
💬 Get strategy support in our Discord: /quantsignals
🌐 Learn more at quantsignals.xyz
TOC MetricsDisplays Market Cap, Float, Float%, ADR%, ATR,LoD Dist and distance from the 8, 21 and 50ema. Can change color, position, and periods for your needs.
⚡ QuantSignals 0DTE Pro⚡ QuantSignals 0DTE Pro – Free Version
Scalp. Squeeze. Strike.
Professional 0DTE Signals Powered by AI
🔍 What is it?
⚡ QuantSignals 0DTE Pro is the ultimate AI-powered TradingView indicator tailored for 0 Days to Expiration (0DTE) options traders.
Developed by the #1 AI trading community – QuantSignals – this script offers a sneak peek into our premium signal engine used by top 0DTE scalpers around the world.
✨ Features (Free Version)
🚀 Momentum Detection (RSI-based + volume confirmation)
⚡ Scalp Buy/Sell Triggers using VWAP & price action
🔥 Gamma Squeeze Alerts (simplified logic)
📊 Volume Spike & Volatility Analysis
📈 Support, Resistance & VWAP Visualization
💎 0DTE Dashboard Overlay showing momentum, VWAP, volume status, expiry timing, and more
🔔 Built-in Smart Alerts for instant trading signals
💼 Used By:
Retail scalpers, professional prop traders, and option flow hunters — especially on SPX, SPY, and QQQ — looking to capitalize on intraday volatility and expiry mechanics.
🧠 Built With:
Multi-timeframe RSI
Custom VWAP deviation logic
Volume spike & range expansion triggers
EMA trend confirmation
Support/resistance bounce detection
Simplified gamma squeeze logic
Full UI dashboard with real-time signal display
📊 Visuals You'll Love:
Green/Red Buy & Sell Signals on Chart
Orange Gamma Alerts
Clean VWAP, EMA, and S/R lines
Compact 0DTE Dashboard: Momentum, Volume %, VWAP distance, Expiry Status, Signal Live Feed
🚨 Smart Alerts Included:
⚡ 0DTE Buy/Sell Signals
🚀 Momentum Shifts
🔥 Gamma Squeeze Detected
📉 Resistance Rejection / 📈 Support Bounce
⚡ Quick Scalping Triggers
📊 Volume Explosions
Never miss a high-probability 0DTE setup again.
💎 Want the FULL version?
This is a limited free release.
Join QuantSignals Discord for:
Real-time options flow & gamma exposure
Institutional-level signal engines
Auto-execution bots
Advanced hedging + delta strategies
SPX/SPY/NQ specialist scalping tools
Premium TradingView scripts with source code
Private trader chat & live sessions
📱 Join the Community
🌐 Website: quantsignals.xyz
💬 Discord: discord.gg
⚡ Trade 0DTE like the pros. Powered by QuantSignals AI.
🎯 QuantSignals AI VWAP Pro🎯 QuantSignals AI VWAP Pro — Trade Like Institutions with AI Precision
📌 Description:
QuantSignals AI VWAP Pro is your edge in the markets — a professional-grade VWAP toolkit enhanced with AI signal generation, dynamic volume analysis, institutional band tracking, and real-time dashboards.
Built for day traders, swing traders, and institutions, this limited free version delivers intelligent entries & exits with AI-enhanced VWAP signals.
🚨 Want more? Full source code, premium indicators, and hedge-fund-grade VWAP tools are available in the QuantSignals Discord community!
🌟 Key Features:
✅ AI-Powered VWAP Signals
→ High-probability BUY/SELL alerts based on smart volume + trend filters.
✅ Dynamic VWAP Bands
→ Adaptive upper/lower bands based on real-time volatility & institutional volume.
✅ Multi-Timeframe VWAP (MTF)
→ View weekly & monthly VWAP levels used by pros (toggleable).
✅ Live QS Dashboard
→ Displays signal strength, VWAP distance %, volume context & price stats.
✅ Smart Alerts System
→ Instantly alerts for VWAP crossovers, band breaks, and institutional moves.
✅ Polished Chart Experience
→ Minimal clutter, modern visuals, premium color scheme, optimized UX.
🔐 Limited Free Version Includes:
AI Signal Engine (basic version)
Institutional Band Levels
Live Dashboard
3 Types of VWAP Alerts
Clean Entry/Exit Plots
💎 Premium Version (in Discord):
Full Source Code
Institutional VWAP Models
Real-Time Volume Sentiment Engine
Multi-Asset VWAP Correlation
Automated Strategy Support
Pro Backtesting Templates
Full QS Indicator Suite
Discord Trade Rooms + Coaching
💬 Who Uses This?
QuantSignals VWAP tools are used by hedge funds, quant traders, and pro retail traders worldwide.
🔗 Join the #1 AI Trading Community:
🌐 Website: quantsignals.xyz
💬 Discord: discord.gg
📢 Setup Instructions:
Add to chart ✅
Toggle on signals, bands, and dashboard 📈
Set alert conditions for key events 🔔
Use with volume + price action context
Want the full suite? Join us in Discord 💎
🚀 Trade Smarter. Trade Faster. Trade with AI.
"Retail uses moving averages. Institutions use VWAP. We use AI + VWAP."
🚀 QuantSignals AI Trend Strategy 15M🚀 QuantSignals AI Trend Strategy 15M — Dominate Intraday Trends with AI Power
🔒 Protected Source | 📈 Verified Performance | ⏱ Optimized for 15M Charts
🔥 Overview
Welcome to the QuantSignals AI Trend Strategy — an institutional-grade, AI-powered trend-following algorithm built for traders who demand performance, clarity, and edge.
Engineered for 15-minute charts, this strategy is the result of advanced AI research, trading expertise, and real-world backtesting. It delivers high-quality trend entries, dynamic risk management, and a fully visual performance dashboard — all in a clean, no-nonsense package.
🔑 Perfect for crypto, forex, and major indices.
💡 Key Features
✅ AI-Driven Signal Engine
Detects strong momentum shifts & breakouts
Smart filtering reduces false signals
Sensitivity control to match your style
✅ Institutional-Level Risk Management
Dynamic stop loss, take profit, and trailing stop
% equity risk-based position sizing
Full exit logic for both long and short positions
✅ Smart Support & Resistance
Auto-calculated pivot levels
Visual zones for reversals and breakouts
✅ Visual Performance Dashboard
Net profit, win rate, profit factor
Current trend strength and market condition
Real-time signal status & open position
✅ Multi-Timeframe Sync (Premium Logic)
Smart confirmation from higher timeframes
Unlock full power inside the Discord community
📊 Why Traders Love It
🔹 Beginner-Friendly: Visual signals, easy inputs, auto-risk calc
🔹 Backtested & Proven: Built-in strategy tester integration
🔹 Customizable: Tweak signal sensitivity, filter strength, session hours
🔹 Premium Upgrade Ready: This free version is just the beginning...
🎁 What You Get
🔓 Protected script (source hidden)
🎯 Full visual trade entries & exits
⚡ Real-time alerts (BUY / SELL / FLAT)
💰 Built-in dashboard to track live P&L
📚 In-code guidance and intuitive parameters
💎 Premium Version Includes:
Full source code access
Advanced AI signal layers (order flow, sentiment, etc.)
Multi-asset correlation
Higher timeframe confirmation
Exclusive premium strategies (85%+ win rate)
Live alerts across assets (crypto, stocks, forex)
➡️ Join Our Community: 🌐 quantsignals.xyz
➡️ Discord Access: 📱 /quantsignals
📸 Screenshots (Suggested Uploads for Listing)
Full-chart view with QS trend lines, support/resistance
Close-up of BUY/SELL signals
Strategy Tester tab showing win rate, net profit
Dashboard with signal quality, trend status, and profit factor
Visual of dashboard in corner with active position info
🧠 Ideal For:
Day traders seeking high-probability signals
Quant traders needing trend logic for automation
Crypto & forex traders focused on short-term moves
Anyone ready to upgrade their edge with AI-based systems
✅ TradingView Requirements
Strategy script, not indicator
Works on any 15-minute chart
Protected source (no code exposed)
🚨 Risk Disclaimer
All trading involves risk. Historical performance is not indicative of future results. This script is a tool — use it with proper risk management and discretion.
FLOWGuard By SASFlowGuard – Just flow. No forecast
Description:
FlowGuard is a custom indicator designed to monitor and react to the true flow of the market by combining trend direction, volatility expansion/contraction, and momentum confirmation. It acts like a sentry that constantly watches for changes in market regime, filtering out noise while staying adaptive to real-time conditions.
Use Case: Ideal for directional index option trades, swing trades, Designed for precision entries, disciplined exits, and clarity in trend flow.
Implied Volatility based on Option PricesImplied Volatility Calculator for All Indices and F&O Symbols based on Option Prices
This Pine Script indicator calculates the Implied Volatility (IV) for any Futures & Options (F&O) contract traded on the NSE or BSE (only Sensex and Bankex), using the Black-Scholes model. It is designed to work directly on option charts by automatically parsing the symbol (e.g., "NIFTY250718C24500") to extract the underlying asset, expiry date, strike price, and option type (Call or Put). No manual input of the symbol is required—simply add the indicator to an option chart, and it will compute the IV based on the current market price of the option.
Key Features:
Automatic Symbol Parsing: Detects the underlying code (e.g., "NIFTY", "BANKNIFTY", or any supported F&O stock/index), expiry in YYMMDD format, Call/Put identifier, and strike price.
Underlying Mapper: Includes a comprehensive coverage of over 200 F&O symbols. This ensures compatibility with indices like NIFTY, BANKNIFTY, SENSEX, and stocks such as RELIANCE, HDFCBANK, TATAMOTORS, etc. If a symbol isn't mapped, it returns NA.
Incase of any missed F&O symbol, please reach out to me or comment below.
Time to Expiry Calculation: Computes days to expiry using the parsed expiry date (assuming 3:30 PM IST expiry) and the current chart time, converting it to years for the Black-Scholes formula.
Inputs:
- Risk Free Rate (%): Default 7.0% (e.g., government bond yield).
- Dividend Yield (%): Default 0.0% (adjust for dividend-paying stocks).
Plots:
- Implied Volatility (%): Main plot in blue, showing IV as a percentage.
Disclaimer:
This indicator is provided for educational and informational purposes only and is not intended as financial advice, investment recommendation, or trading signal. Options trading involves significant risk of loss and is not suitable for all investors. The calculations rely on the Black-Scholes model, which assumes constant volatility, no dividends (unless specified), and other simplifications that may not reflect real market conditions. Always verify data accuracy, consult a financial advisor, and use at your own risk. The author assumes no liability for any losses incurred.
Macro Tracker° TONY|TPT (Open-Source) by tonyTPT📊 Macro Tracker° TONY|TPT (Open-Source)
by tonyTPT
Macro Tracker° is a custom-built indicator designed for traders who want to see the bigger picture of the market — clearly, simply, and reliably. It leverages higher time frame structures to help users identify the dominant macro trend and avoid impulsive decisions based on short-term noise.
🔍 What Macro Tracker° Offers:
Clean and visual analysis of macro time frame trends
Filters out lower time frame noise
Supports informed swing and position trading decisions
Open-source — built with transparency, for the community
💡 Ideal for:
Traders looking to align their strategies with the long-term direction of the market — whether in crypto, forex, or stocks.
🚀 Explore the code, customize it to your style, and build upon it.
📁 Open-source. Built with purpose. Shared with passion.
PM + BOS + FVG Indicator & AlertsHey team it's Tanner, I have created Nitros strategy into a custom indicator, it's only the PM BOS FVG model, I will add a HOD/LOD BOS FVG custom indicator eventually, this indicator is setup to give you alerts as well. or if you just want a clean FVG indicator and or PM level indicator this works too. mess with the settings to your liking and DM me on circle or discord if you have feedback or questions, thanks team.
GAMMAPOINTS2.0
This indicator provides insights into key Gamma Exposure (GEX) levels within the market. By analyzing the Open Interest and the gamma of each option, it calculates the total GEX per price level, highlighting regions where market makers have significant gamma exposure and may need to hedge accordingly.
Our approach identifies and plots 'Gamma Levels'—critical price regions that reflect market sentiment and the behavior of Market Participants and Market Makers. These levels often serve as pivotal support and resistance zones throughout the trading day.
You can view these influential Gamma Levels as lines on your chart, allowing for a clear visualization of price zones with high gamma concentration.
Hybrid Strategy with Position Control & Breakout Filter//@version=6
indicator('Hybrid Strategy with Position Control & Breakout Filter', overlay=true)
// === INPUTS ===
emaFastLen = input.int(8, 'Fast EMA')
emaSlowLen = input.int(21, 'Slow EMA')
rsiLen = input.int(14, 'RSI Length')
rsiOverbought = input.int(70, 'RSI Overbought')
rsiOversold = input.int(30, 'RSI Oversold')
macdFast = input.int(12, 'MACD Fast')
macdSlow = input.int(26, 'MACD Slow')
macdSignal = input.int(9, 'MACD Signal')
volatilityMultiplier = input.float(1.0, 'ATR Multiplier for Volatility Filter')
// === CALCULATIONS ===
emaFast = ta.ema(close, emaFastLen)
emaSlow = ta.ema(close, emaSlowLen)
rsi = ta.rsi(close, rsiLen)
= ta.macd(close, macdFast, macdSlow, macdSignal)
atr = ta.atr(14)
// === VOLATILITY FILTER ===
volatilityThreshold = ta.sma(atr, 14) * volatilityMultiplier
isVolatile = atr > volatilityThreshold
// === OPENING SPIKE LOGIC (first 15 mins of session only) ===
sessionStart = timestamp("America/New_York", year, month, dayofmonth, 9, 30)
first15Min = time >= sessionStart and time < sessionStart + 15 * 60 * 1000
openingBreakout = first15Min and close > open and ta.change(close) > atr * 1.5
// === POSITION TRACKING ===
var int position = 0 // 0 = no position, 1 = long, -1 = short
// === ENTRY CONDITIONS ===
longCondition = ((ta.crossover(emaFast, emaSlow) and rsi < rsiOverbought and macdLine > signalLine and isVolatile) or openingBreakout) and position != 1
shortCondition = ta.crossunder(emaFast, emaSlow) and rsi > rsiOversold and macdLine < signalLine and isVolatile and position != -1
// === EXIT CONDITIONS ===
exitLong = ta.crossunder(emaFast, emaSlow)
exitShort = ta.crossover(emaFast, emaSlow)
// === SIGNAL PLOTS ===
buySignal = longCondition
sellSignal = shortCondition
plotshape(buySignal, title='Buy Signal', location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small, text='BUY')
plotshape(sellSignal, title='Sell Signal', location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small, text='SELL')
// === STATE MANAGEMENT ===
if (longCondition)
position := 1
if (shortCondition)
position := -1
if (exitLong and position == 1)
position := 0
if (exitShort and position == -1)
position := 0
// === PLOT EMAs ===
plot(emaFast, color=color.orange, title='Fast EMA')
plot(emaSlow, color=color.blue, title='Slow EMA')
Hybrid Strategy with Position Control//@version=6
indicator('Hybrid Strategy with Position Control', overlay=true)
// === INPUTS ===
emaFastLen = input.int(8, 'Fast EMA')
emaSlowLen = input.int(21, 'Slow EMA')
rsiLen = input.int(14, 'RSI Length')
rsiOverbought = input.int(70, 'RSI Overbought')
rsiOversold = input.int(30, 'RSI Oversold')
macdFast = input.int(12, 'MACD Fast')
macdSlow = input.int(26, 'MACD Slow')
macdSignal = input.int(9, 'MACD Signal')
// === CALCULATIONS ===
emaFast = ta.ema(close, emaFastLen)
emaSlow = ta.ema(close, emaSlowLen)
rsi = ta.rsi(close, rsiLen)
= ta.macd(close, macdFast, macdSlow, macdSignal)
// === POSITION TRACKING ===
var int position = 0 // 0 = no position, 1 = long, -1 = short
// === ENTRY CONDITIONS ===
longCondition = ta.crossover(emaFast, emaSlow) and rsi < rsiOverbought and macdLine > signalLine and position != 1
shortCondition = ta.crossunder(emaFast, emaSlow) and rsi > rsiOversold and macdLine < signalLine and position != -1
// === EXIT CONDITIONS (Optional logic for reset) ===
exitLong = ta.crossunder(emaFast, emaSlow)
exitShort = ta.crossover(emaFast, emaSlow)
// === SIGNAL PLOTS ===
buySignal = longCondition
sellSignal = shortCondition
plotshape(buySignal, title='Buy Signal', location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small, text='BUY')
plotshape(sellSignal, title='Sell Signal', location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small, text='SELL')
// === STATE MANAGEMENT ===
if (longCondition)
position := 1
if (shortCondition)
position := -1
// Reset position if trend reverses
if (exitLong and position == 1)
position := 0
if (exitShort and position == -1)
position := 0
// === PLOT EMAs ===
plot(emaFast, color=color.orange, title='Fast EMA')
plot(emaSlow, color=color.blue, title='Slow EMA')