Hyper Insight MA Strategy [Universal]Hyper Insight MA Strategy ** is a comprehensive trend-following engine designed for traders who require precision and flexibility. Unlike standard indicators that lock you into a single calculation method, this strategy serves as a "Universal Adapter," allowing you to **Mix & Match 13 different Moving Average types** for both the Fast and Slow trend lines independently.
Whether you need the smoothness of T3, the responsiveness of HMA, or the classic reliability of SMA, this script enables you to backtest thousands of combinations to find the perfect edge for your specific asset class.
---
🔬 Deep Dive: Calculation Logic of Included MAs
This strategy includes 13 distinct calculation methods. Understanding the math behind them will help you choose the right tool for your specific market conditions.
#### 1. Standard Averages
* **SMA (Simple Moving Average):** The unweighted mean of the previous $n$ data points.
* *Logic:* Treats every price point in the period with equal importance. Good for identifying long-term macro trends but reacts slowly to recent volatility.
* **WMA (Weighted Moving Average):** A linear weighted average.
* *Logic:* Assigns heavier weight to current data linearly (e.g., $1, 2, 3... n$). It reacts faster than SMA but is still relatively smooth.
* **SWMA (Symmetrically Weighted Moving Average):**
* *Logic:* Uses a fixed-length window (usually 4 bars) with symmetrical weights $ $. It prioritizes the center of the recent data window.
#### 2. Exponential & Lag-Reducing Averages
* **EMA (Exponential Moving Average):**
* *Logic:* Applies an exponential decay weighting factor. Recent prices have significantly more impact on the average than older prices, reducing lag compared to SMA.
* **RMA (Running Moving Average):** Also known as Wilder's Smoothing (used in RSI).
* *Logic:* It is essentially an EMA but with a slower alpha weight of $1/length$. It provides a very smooth, stable line that filters out noise effectively.
* **DEMA (Double Exponential Moving Average):**
* *Logic:* Calculated as $2 \times EMA - EMA(EMA)$. By subtracting the "lag" (the smoothed EMA) from the original EMA, DEMA provides a much faster reaction to price changes with less noise than a standard EMA.
* **TEMA (Triple Exponential Moving Average):**
* *Logic:* Calculated as $3 \times EMA - 3 \times EMA(EMA) + EMA(EMA(EMA))$. This effectively eliminates the lag inherent in single and double EMAs, making it an extremely fast-tracking indicator for scalping.
#### 3. Advanced & Adaptive Averages
* **HMA (Hull Moving Average):**
* *Logic:* A composite formula involving Weighted Moving Averages: ASX:WMA (2 \times Integer(n/2)) - WMA(n)$. The result is then smoothed by a $\sqrt{n}$ WMA.
* *Effect:* It eliminates lag almost entirely while managing to improve curve smoothness, solving the traditional trade-off between speed and noise.
* **ZLEMA (Zero Lag Exponential Moving Average):**
* *Logic:* This calculation attempts to remove lag by modifying the data source before smoothing. It calculates a "lag" value $(length-1)/2$ and applies an EMA to the data: $Source + (Source - Source )$. This creates a projection effect that tracks price tightly.
* **T3 (Tillson T3 Moving Average):**
* *Logic:* A complex smoothing technique that runs an EMA through a filter multiple times using a "Volume Factor" (set to 0.7 in this script).
* *Effect:* It produces a curve that is incredibly smooth and free of "overshoot," making it excellent for filtering out market chop.
* **ALMA (Arnaud Legoux Moving Average):**
* *Logic:* Uses a Gaussian distribution (bell curve) to assign weights. It allows the user to offset the moving average (moving the peak of the weight) to align it perfectly with the price, balancing smoothness and responsiveness.
* **LSMA (Least Squares Moving Average):**
* *Logic:* Calculates the endpoint of a Linear Regression line for the lookback period. It essentially guesses where the price "should" be based on the best-fit line of the recent trend.
* **VWMA (Volume Weighted Moving Average):**
* *Logic:* Weights the closing price by the volume of that bar.
* *Effect:* Prices on high volume days pull the MA harder than prices on low volume days. This is excellent for validating true trend strength (i.e., a breakout on high volume will move the VWMA significantly).
---
### 🛠 Features & Settings
* **Universal Switching:** Change the `Fast MA` and `Slow MA` types instantly via the settings menu.
* **Trend Cloud:** A dynamic background fill (Green/Red) highlights the crossover zone for immediate visual trend identification.
* **Strategy Mode:** Built-in Backtesting logic triggers `LONG` entries when Fast MA crosses over Slow MA, and `EXIT` when Fast MA crosses under.
### ⚠️ Disclaimer
This script is intended for educational and research purposes. The wide variety of MA combinations can produce vastly different results. Past performance is not indicative of future results. Please use proper risk management.
指标和策略
12M Return Strategy This strategy is based on the original Dual Momentum concept presented by Gary Antonacci in his book “Dual Momentum Investing.”
It implements the absolute momentum portion of the framework using a 12-month rate of change, combined with a moving-average filter for trend confirmation.
The script automatically adapts the lookback period depending on chart timeframe, ensuring the return calculation always represents approximately one year, whether you are on daily, weekly, or monthly charts.
How the Strategy Works
1. 12-Month Return Calculation
The core signal is the 12-month price return, computed as:
(Current Price ÷ Price from ~1 year ago) − 1
This return:
Plots as a histogram
Turns green when positive
Turns red when negative
The lookback adjusts automatically:
1D chart → 252 bars
1W chart → 52 bars
1M chart → 12 bars
Other timeframes → estimated to approximate 1 calendar year
2. Trend Filter (Moving Average of Return)
To smooth volatility and avoid noise, the strategy applies a moving average to the 12M return:
Default length: 12 periods
Plotted as a white line on the indicator panel
This becomes the benchmark used for crossovers.
3. Trade Signals (Long / Short / Cash)
Trades are generated using a simple crossover mechanism:
Bullish Signal (Go Long)
When:
12M Return crosses ABOVE its MA
Action:
Close short (if any)
Enter long
Bearish Signal (Go Short or Go Flat)
When:
12M Return crosses BELOW its MA
Action:
If shorting is enabled → Enter short
If shorting is disabled → Exit position and go to cash
Shorting can be enabled or disabled with a single input switch.
4. Position Sizing
The strategy uses:
Percent of Equity position sizing
You can specify the percentage of your portfolio to allocate (default 100%).
No leverage is required, but the strategy supports it if your account settings allow.
5. Visual Signals
To improve clarity, the strategy marks signals directly on the indicator panel:
Green Up Arrows: return > MA
Red Down Arrows: return < MA
A status label shows the current mode:
LONG
SHORT
CASH
6. Backtest-Ready
This script is built as a full TradingView strategy, not just an indicator.
This means you can:
Run complete backtests
View performance metrics
Compare long-only vs long/short behavior
Adjust inputs to tune the system
It provides a clean, rule-driven interpretation of the classic absolute momentum approach.
Inspired By: Gary Antonacci – Dual Momentum Investing
This script reflects the absolute momentum side of Antonacci’s original research:
Uses 12-month momentum (the most statistically validated lookback)
Applies a trend-following overlay to control downside risk
Recreates the classic signal structure used in academic studies
It is a simplified, transparent version intended for practical use and educational clarity.
Disclaimer
This script is for educational and research purposes only.
Historical performance does not guarantee future results.
Always use proper risk management.
W/M Pattern Strategy + MACD/RSI Confirmation V3.0 by ThaungkmitlW/M Pattern Strategy + MACD/RSI Confirmation V3.0
Description Text:
This script is a comprehensive Strategy (backtestable) that combines classical Chart Patterns with momentum indicators to identify high-probability reversal setups. It focuses on detecting "W" Patterns (Double Bottoms/Higher Lows) and "M" Patterns (Double Tops/Lower Highs), filtered by MACD and RSI to reduce false signals.
How It Works
The strategy relies on a "Confluence" of three factors before triggering an entry:
1. Price Action Patterns (W & M)
W Pattern (Bullish): The script detects Pivot Lows. If a new Pivot Low is higher than the previous one (forming a Higher Low structure), it marks a potential "W" pattern.
M Pattern (Bearish): The script detects Pivot Highs. If a new Pivot High is lower than the previous one (forming a Lower High structure), it marks a potential "M" pattern.
2. MACD Confirmation (Zero Line)
Price action alone is not enough. The script waits for the MACD Line to cross the Zero Line:
Buy: MACD crosses UP over 0 (indicating bullish momentum shift).
Sell: MACD crosses DOWN under 0 (indicating bearish momentum shift).
3. RSI Threshold
To ensure the trend has strength, the RSI (Relative Strength Index) acts as a final filter:
Buy Condition: RSI must be above 50.
Sell Condition: RSI must be below 50.
Visual Features
Pivot Labels: Automatically marks Pivot High (Red Triangle) and Pivot Low (Green Triangle).
Pattern Lines: Draws lines connecting the swing points when a potential W or M pattern is detected.
Signals: Displays "BUY" or "SELL" labels with text explaining the setup (e.g., "W+MACD+RSI").
Background: Highlights the chart background (Green/Red) when a valid trade signal occurs.
EMAs: Plots EMA 10 (Blue) and EMA 15 (Red) to help you visualize the immediate trend direction.
Settings
Pivot Left/Right Bars: Adjust the sensitivity of the Swing detection.
MACD Settings: Fast, Slow, and Signal lengths (Standard 12, 26, 9).
RSI Settings: Adjust Length and the Threshold level (Default is 50).
Backtesting
This is a strategy script, meaning you can use the Strategy Tester panel below the chart to see how this logic performs on historical data for your chosen timeframe and asset.
Disclaimer: This tool is for educational purposes. Past performance in backtesting does not guarantee future results.
Fibot X: LDO Hyperliquid (Katōshi) Auto StrategyFibot X v4 – Hyperliquid LDO Edition (Katōshi Connector)
This Fibot X v4 edition is specially optimized for trading LDO on the Hyperliquid DEX, with native Katōshi connector integration for fast, stable automated execution.
The system has been internally tuned to match LDO’s volatility and structural behavior on Hyperliquid while preserving the original Fibot X engine: precise entries, progressive TP management, risk control, and long-term consistency.
⚙️ Operational Requirements
• Mandatory timeframe: 30 minutes
• Fixed leverage: x1 (higher leverage reduces system consistency)
• Each bot must operate with its own dedicated initial capital
Features
• Exclusive internal optimization for LDO
• Full automation through Katōshi
• Logic adapted to decentralized environments
• Structured multi-TP risk-managed system
• Reliable backtesting with a stable performance curve
Designed for algorithmic traders seeking accuracy and consistency in a focused asset.
(For access or subscription details, check my X profile linked here.)
Fibot X: YGG Hyperliquid (Katōshi) Auto StrategyFibot X – Hyperliquid YGG Edition (Katōshi Connector)
This Fibot X v4 edition is specially optimized for trading YGG on the Hyperliquid DEX, with native Katōshi connector integration for fast, stable automated execution.
The system has been internally tuned to match YGG’s volatility and structural behavior on Hyperliquid while preserving the original Fibot X engine: precise entries, progressive TP management, risk control, and long-term consistency.
⚙️ Operational Requirements
• Mandatory timeframe: 30 minutes
• Fixed leverage: x1 (higher leverage reduces system consistency)
• Each bot must operate with its own dedicated initial capital
Features
• Exclusive internal optimization for YGG
• Full automation through Katōshi
• Logic adapted to decentralized environments
• Structured multi-TP risk-managed system
• Reliable backtesting with a stable performance curve
Designed for algorithmic traders seeking accuracy and consistency in a focused asset.
(For access or subscription details, check my X profile linked here.)
Fibot X: CAKE Hyperliquid (Katōshi) Auto StrategyFibot X – Hyperliquid CAKE Edition (Katōshi Connector)
This Fibot X v4 edition is specially optimized for trading CAKE on the Hyperliquid DEX, with native Katōshi connector integration for fast, stable automated execution.
The system has been internally tuned to match CAKE’s volatility and structural behavior on Hyperliquid while preserving the original Fibot X engine: precise entries, progressive TP management, risk control, and long-term consistency.
⚙️ Operational Requirements
• Mandatory timeframe: 30 minutes
• Fixed leverage: x1 (higher leverage reduces system consistency)
• Each bot must operate with its own dedicated initial capital
Features
• Exclusive internal optimization for CAKE
• Full automation through Katōshi
• Logic adapted to decentralized environments
• Structured multi-TP risk-managed system
• Reliable backtesting with a stable performance curve
Designed for algorithmic traders seeking accuracy and consistency in a focused asset.
(For access or subscription details, check my X profile linked here.)
天然氣季節性策略 (假日順延修正版)Strategy Overview:
Period A (Early Injection Season Strategy):
Action: Establishes a long position on April 25 and exits on May 10 by default.
Logic: This captures the price support zone driven by the end of winter, depleted inventories, and rigid restocking demand.
Period B (Winter Premium Strategy):
Action: Establishes a long position on September 1 and exits on October 15 by default.
Logic: This capitalizes on the major uptrend fueled by the peak hurricane season compounded by the winter contract premium.
Trading Parameters:
Initial Capital: 100,000 USD
Position Size per Trade: 1 Contract
Commission per Trade: 2 USD
YCGH Ultimate Stocks Breakout Sniper📈 YCGH Ultimate Stocks Breakout Sniper
Overview
A sophisticated momentum-based breakout strategy designed to capture high-probability directional moves during volatility expansion phases. This system identifies breakout opportunities when price decisively breaks through established ranges, combining multiple technical filters to enhance signal quality and minimize false breakouts.
🎯 Strategy Features
Core Methodology:
Proprietary breakout detection algorithm
Multi-layered confirmation filters for signal validation
Adaptive trailing stops for profit protection
Systematic risk management with daily drawdown controls
Key Components:
✅ Volatility Expansion Filter - Only trades during periods of elevated market volatility to avoid choppy, range-bound conditions
✅ Optional Trend Alignment - Configurable trend filter (EMA/SMA/RMA/WMA) to align entries with broader market direction
✅ ROC Momentum Filter - Daily rate-of-change filter to capture strong momentum days (optional)
✅ Comprehensive Exit Strategy:
Fixed stop-loss (default 2%)
Take-profit targets (default 9%)
Dynamic trailing stops (2% activation, 0.5% offset)
✅ Flexible Direction Trading:
Auto-detect mode: Long+Short for perpetuals, Long-only for spot/equities
Manual override options available
Suitable for both crypto and stock markets
📊 Market Applicability
Optimized for: Cryptocurrency perpetual contracts and equity markets (1H-4H timeframes)
Also effective on: Futures and high-liquidity spot markets
The strategy adapts to different market regimes through configurable volatility and trend filters, making it versatile across various trading instruments and timeframes.
⚙️ Risk Management
Position Sizing: Percentage-based allocation with leverage support
Intraday Loss Limit: Maximum 10% drawdown protection (configurable)
Realistic Cost Modeling: 0.025% commission + 1 tick slippage
No Pyramiding: Single position management for controlled risk exposure
📈 Performance Visualization
Includes a comprehensive monthly returns table displaying:
Year-by-year performance breakdown
Monthly profit/loss percentages
Visual color-coding (green for profits, red for losses)
Clean, modern design with transparent styling
🔐 Access & Pricing
This is a PROTECTED, invite-only strategy.
The source code is not open-source and requires paid access for usage.
How to Get Access:
📧 Email: brijamohanjha@gmail.com
Include in your email:
Your TradingView username
Markets/assets you plan to trade
Preferred timeframe
What You'll Receive:
Full strategy access with invite-only permissions
Complete parameter documentation
Setup and optimization guidance
Implementation support
⚠️ Important Disclosures
Backtesting Parameters:
Commission: 0.025% per trade
Slippage: 1 tick
Results reflect realistic trading conditions
Risk Warning:
Past performance does not guarantee future results. This strategy involves substantial risk and may not be suitable for all investors. Users should thoroughly understand the risks and customize parameters based on their risk tolerance and market conditions.
📞 Contact for Access
Email: brijamohanjha@gmail.com
For questions about functionality, pricing, optimization, or market-specific settings, please reach out via email.
Note: This is a premium, paid strategy. Access is granted manually after consultation and payment confirmation.
Vesel VWAP but not starting until 7 pmThis improvement gets rid of trades that are entered prior to 7 pm before VWAP has even had a chance to set in.
Center and Volume AnalyzerCenter and Volume Analyzer that utilizes the chart's Center of Gravity alongside the Rate of Change with Bollinger Bands with a basis for the midpoint. As always, none of this is investment or financial advice. Please do your own due diligence and research.
YCGH Crypto ultimate Breakout StrategyAdvanced Momentum Breakout Strategy - Optimized for crypto markets, proven effective on equities
Core Features:
Multi-layered signal generation combining volatility expansion and momentum confirmation
Adaptive risk management with dynamic stops, profit targets, and trailing mechanisms
Systematic position sizing with configurable leverage (designed for perpetual/margin trading)
Volatility regime filters to avoid false breakouts during low-momentum periods
Optional trend alignment for directional bias confirmation
Comprehensive backtesting with realistic slippage and commission modeling
Daily drawdown limits for capital preservation
Performance:
Applicable across multiple timeframes (1H, 4H, Daily)
Works on both spot and derivatives markets
Long and short position capability
Interested in using this strategy? This is a paid service. For access to the complete script and implementation support, email: brijamohanjha@gmail.com
Estrategia Trend Following: 52w/26w BreakoutThis is a classic long-term Trend Following strategy, heavily inspired by the Donchian Channel system and the legendary "Turtle Trading" rules. It is designed to capture major market moves (bull runs) while filtering out short-term market noise and volatility.
This script is ideal for investors and swing traders who prefer a "hands-off" approach, looking to catch large trends rather than day-trading small fluctuations.
How it Works:
1. Entry Condition (The Breakout):
52-Week High: The strategy enters a Long position when the price breaks above the highest high of the last 252 trading days (approx. 1 year).
SuperTrend Filter: An additional filter using the SuperTrend indicator ensures that the breakout is supported by positive momentum, helping to reduce false signals during choppy lateral markets.
2. Exit Condition (The Trailing Stop):
26-Week Low: The strategy ignores short-term corrections. It only closes the position if the price closes below the lowest low of the last 126 trading days (approx. 6 months).
This wide stop allows the trade to "breathe" and stay open during significant pullbacks, ensuring you stay in the trend for as long as possible.
Features & Settings:
Customizable Lookback Periods: You can adjust the Entry (default 252 days) and Exit (default 126 days) periods in the settings menu.
Visual Aids:
Blue Line: Represents the 1-Year High (Entry Threshold).
Red Line: Represents the 6-Month Low (Dynamic Stop Loss).
Channel Shading: Visualizes the trading range between the high and low.
Labels: Clearly marks "BUY" and "EXIT" points on the chart.
Recommended Usage:
Timeframe: Daily (1D). This logic is designed for daily candles.
Assets: Works best on assets with strong trending characteristics (e.g., Bitcoin/Crypto, Tech Stocks, Indices like SPX/NDX, and Commodities).
Patience Required: This strategy generates very few signals. It may stay quiet for months and then hold a position for over a year.
Robrechtian Long-Medium Breakout Trend SystemRobrechtian Long–Medium-Term Breakout Trend System
A professional, rule-based trend-following strategy designed to capture large, sustained price movements using pure price action and breakouts.
This system follows long-established trend-following philosophy: no prediction, no volatility targeting, and no profit targets. Only disciplined entries, position additions, and exits driven entirely by trend structure.
Core Principles
Breakout-driven entries: Initial positions are taken only when price breaks above/below the 80-day Donchian channel, confirming a long–medium-term trend shift.
Short-term confirmation: Breakouts must also exceed the 20-day channel, reducing false positives.
Trend-direction filter: A 50-day moving average slope filter ensures alignment with the broader trend.
Explosive bar filter: Entries avoid excessively large, single-candle expansions (>2.5× ATR(20)) to prevent chasing exhaustion spikes.
Pyramiding into strength: Additional units are added only when price makes fresh 20-day breakouts in the direction of the trend. No scaling out. No adding on dips.
Exit only on trend violation: Positions are closed exclusively when price breaks the opposite 80-day channel. This preserves unlimited upside while enforcing disciplined exits.
Pure trend philosophy: No volatility targeting, no smoothing, no discretionary overrides, no optimization for short-term performance.
Intended Use
This system is designed primarily for diversified futures portfolios, where diversification across dozens of globally liquid markets creates robustness and stability. However, it may also be used on individual assets for educational and analytical purposes.
The system embraces the core trend-following logic:
Small losses, big winners, and unlimited upside when trends persist.
⚠️ WARNINGS / DISCLAIMERS
⚠️ Warning 1 — This strategy is not optimized for single stocks
The Robrechtian Trend System is designed for multi-asset futures portfolios, not single equities.
Performance on individual tickers may vary greatly due to lack of diversification.
⚠️ Warning 2 — Trend following includes substantial drawdowns
Deep drawdowns are a normal and expected feature of all long-term trend-following systems.
The strategy does not attempt to smooth returns or manage volatility.
If you seek steady, low-volatility equity curves, this system is not suitable.
⚠️ Warning 3 — No volatility targeting or risk smoothing
This system intentionally avoids volatility-based position sizing.
Trades may experience larger fluctuations than systems using risk parity or vol targeting.
⚠️ Warning 4 — Not financial advice
This script is for educational and research purposes only.
Past performance does not guarantee future results.
Use at your own risk.
⚠️ Warning 5 — TradingView backtests have known limitations
TradingView does not simulate:
futures contract roll logic
slippage
real bid/ask spreads
liquidity conditions
limit-up/limit-down behavior
Results may vary from live market execution.
Triple EMA + RSI + ATRThis comprehensive trading system combines triple EMA alignment, RSI momentum filtering, and dynamic ATR-based risk management. The strategy enters positions only when fast, medium, and slow EMAs align in proper order (bullish or bearish), confirmed by RSI remaining within defined thresholds (not overbought/oversold) and a volume spike above its moving average. Exits are managed intelligently using a multi-tier approach: a fixed stop-loss based on ATR, a first profit target at a predefined risk-reward ratio, and a trailing stop that activates after reaching a second, higher profit tier. Designed for trend-following with built-in momentum and volume confirmation, it features professional order execution with configurable commission and slippage for realistic backtesting. Visual cues including colored backgrounds and signal shapes enhance chart clarity.
BS 1.1This is a simple price action break out strategy.. MT5 bot alerts enabled..
Lot of Filters like ATR/ADX/Volume/Break even etc are added in toggle..
Test with the filters which suits your style of trading..
Works in 5m TF for Gold and BTC with just 3 ATR - TG and TP- 3 ATR rest all the filters are off..
Profit Factor - 1.362
51 - By GoldmanMrBaNNathis script is a multi-timeframe alignment tool designed to help users visually compare the trend direction of a higher timeframe with the movement on a lower timeframe.
The indicator simply displays when both selected timeframes are moving in the same direction based on a customizable trend-detection method (such as moving average alignment).
Its purpose is to provide clarity, structure, and directional alignment for chart analysis.
Users can select:
A higher timeframe
A lower timeframe
Trend calculation method
Visual display options
The tool is made to support analysis only.
It does not execute trades, generate financial advice, or guarantee outcomes.
Always use additional independent research when making decisions.
Nifty 10m Simple ORB TEST harish//@version=5
strategy("Nifty 10m Simple ORB TEST", overlay=true)
// 10m timeframe check
if timeframe.period != "10"
runtime.error("Use this on 10 minute timeframe")
// First 10m candle high/low (no PCR, no opposite logic – just test syntax)
newDay = ta.change(time("D")) != 0
var float dayHigh = na
var float dayLow = na
if newDay
dayHigh := na
dayLow := na
sessStart = 0915
sessEnd = 0925
hhmm = hour * 100 + minute
isFirst = na(dayHigh) and hhmm >= sessStart and hhmm < sessEnd
if isFirst
dayHigh := high
dayLow := low
// Plot first candle range
plot(dayHigh, "First High", color=color.green, style=plot.style_linebr)
plot(dayLow, "First Low", color=color.red, style=plot.style_linebr)
// Simple breakout entries just to test
longCond = not na(dayHigh) and close > dayHigh
shortCond = not na(dayLow) and close < dayLow
if longCond
strategy.entry("LONG", strategy.long)
if shortCond
strategy.entry("SHORT", strategy.short)
HARRISH DADE//@version=5
strategy("Nifty 15m ORB + 20 EMA + Volume - Signals Fixed", overlay=true,
initial_capital=100000, default_qty_type=strategy.percent_of_equity, default_qty_value=25,
process_orders_on_close=true)
// 15-minute timeframe check
if timeframe.period != "15"
runtime.error("Use this strategy on 15 minute timeframe only")
// ORB 9:15–9:30 High/Low
var float orbHigh = na
var float orbLow = na
newDay = ta.change(time("D")) != 0
if newDay
orbHigh := na
orbLow := na
sessStart = 0915
sessEnd = 0930
hhmm = hour * 100 + minute
inORB = hhmm >= sessStart and hhmm < sessEnd
if inORB
orbHigh := na(orbHigh) ? high : math.max(orbHigh, high)
orbLow := na(orbLow) ? low : math.min(orbLow, low)
// Plot ORB levels
plot(orbHigh, "ORB High", color=color.new(color.green, 0), linewidth=2)
plot(orbLow, "ORB Low", color=color.new(color.red, 0), linewidth=2)
// Trend filter - 20 EMA
emaLen = input.int(20, "EMA Length", minval=1)
ema20 = ta.ema(close, emaLen)
upTrend = close > ema20
dnTrend = close < ema20
plot(ema20, "EMA 20", color=color.orange, linewidth=2)
// Volume filter - Adaptive
volLen = input.int(20, "Volume MA Length", minval=1)
avgVol = ta.sma(volume, volLen)
volMult = input.float(1.5, "Volume Multiplier", step=0.1)
enoughVol = volume >= (avgVol * volMult)
// ORB complete check
orbLocked = not na(orbHigh) and not na(orbLow) and not inORB
// Entry conditions (for strategy)
longCond = orbLocked and ta.crossover(close, orbHigh) and upTrend and enoughVol
shortCond = orbLocked and ta.crossunder(close, orbLow) and dnTrend and enoughVol
// Risk Management
targetPts = input.float(40.0, "Target Points", step=1.0)
slPts = input.float(25.0, "Stoploss Points", step=1.0)
// STRATEGY ENTRIES
if longCond and strategy.position_size == 0
strategy.entry("LONG", strategy.long)
if shortCond and strategy.position_size == 0
strategy.entry("SHORT", strategy.short)
// STRATEGY EXITS
if strategy.position_size > 0
strategy.exit("LONG EXIT", from_entry="LONG",
limit=strategy.position_avg_price + targetPts,
stop=strategy.position_avg_price - slPts)
if strategy.position_size < 0
strategy.exit("SHORT EXIT", from_entry="SHORT",
limit=strategy.position_avg_price - targetPts,
stop=strategy.position_avg_price + slPts)
// **FIXED BUY/SELL SIGNALS** - No barstate.isconfirmed, direct conditions
plotshape(longCond, title="BUY", style=shape.triangleup, location=location.belowbar,
color=color.new(color.lime, 0), size=size.large, text="BUY", textcolor=color.white)
plotshape(shortCond, title="SELL", style=shape.triangledown, location=location.abovebar,
color=color.new(color.red, 0), size=size.large, text="SELL", textcolor=color.white)
// Debug table - shows if conditions met
if barstate.islast
var table debugTable = table.new(position.top_right, 2, 6, bgcolor=color.white, border_width=1)
table.cell(debugTable, 0, 0, "Condition", text_color=color.black, bgcolor=color.gray)
table.cell(debugTable, 1, 0, "Status", text_color=color.black, bgcolor=color.gray)
table.cell(debugTable, 0, 1, "ORB Locked", text_color=color.black)
table.cell(debugTable, 1, 1, str.tostring(orbLocked), text_color=orbLocked ? color.green : color.red)
table.cell(debugTable, 0, 2, "UpTrend", text_color=color.black)
table.cell(debugTable, 1, 2, str.tostring(upTrend), text_color=upTrend ? color.green : color.red)
table.cell(debugTable, 0, 3, "Enough Vol", text_color=color.black)
table.cell(debugTable, 1, 3, str.tostring(enoughVol), text_color=enoughVol ? color.green : color.red)
Cat Cushion Position SizingThis strategy is for people who don’t want to guess position size every time.
It looks at how volatile the market is and then tells you how many units to hold so your risk per trade stays roughly the same – whether the chart is calm or crazy.
What it does
Measures how “shaky” the price is day by day (volatility)
Blends recent volatility with a long-term average so it doesn’t overreact to one weird day
Uses your Risk per Trade (%) setting to calculate how big your position should be
Adds a buffer zone so it doesn’t trade every tiny wiggle and burn commissions
Shows a small performance table on the chart:
• Average annual return (from backtest)
• Sharpe ratio
• Average drawdown per trade
• Current position size as % of equity
How it thinks about risk
When the market is calmer → volatility is lower → position size can be bigger
When the market is wild → volatility is higher → position size becomes smaller
You control the “spiciness” with:
• Risk per Trade (%) – how much of your equity you’re willing to risk on each position
• Change Sensitivity (%) – wider buffer = fewer trades, lower costs; tighter buffer = more frequent rebalancing
Good use cases
Index ETFs (e.g. AMEX:SPY , NASDAQ:ACWI ) or other liquid instruments
People who:
• Already have a direction/idea (bullish on the index long term)
• Want the position sizing to adapt automatically with volatility
• Prefer “set the rules, let it run” rather than staring at the screen
Inputs to pay attention to
Risk per Trade (%)
• Conservative: ~1–2%
• Balanced: ~3–4%
• Aggressive: 5%+ (handle with care)
Important notes
This is a position sizing / risk strategy, not a magical “always win” tool
Works best when combined with:
• A clear idea of what you want to trade (e.g. broad index ETFs)
• A realistic risk profile (don’t just max the risk because the backtest looks better)
Backtest results are not a promise of future returns
Educational use only – this is not financial advice. Please test on your own, tweak to your comfort level, and don’t bet the rent money 😉
If you like systematic, “low-drama” investing (and want to spend more time chilling like a cat 🐱), this script helps the math side stay under control in the background.
Relative Outperformance Strategy (Long Only)Relative Strength used to spot entries. Gives good returns overall.






















