ZYTX GKDDThe ZYTX High-Sell Low-Buy Indicator Strategy is a trend-following indicator that integrates multiple indicator resonances. It demonstrates the perfect performance of an automated trading robot, truly achieving the high-sell low-buy strategy in trading.
Candlestick analysis
古诗2-4小时主流通用This Pine Script code defines a highly configurable trading strategy built around a custom, normalized linear regression oscillator. Its core design focuses on providing two distinct trading models—Trend Following and Mean Reversion—while incorporating a comprehensive and flexible risk management system.
JAN - OCT [old] Engulfing Pattern Strategyold engulfing that is bad and shouldnt be used and if you do use it, then proceed at your own pearl. and i have to keep making this description longer other it wont publish which is annoying so this is just words to make the description longer so i can publish
Az's EMA Scalper with Trend Confirmation (Fast TF)Az's EMA Scalper with Trend Confirmation combines fast-moving average signals with multi-timeframe trend analysis for precision intraday trading. The strategy uses a customizable moving average (7 types including EMA, HMA, ALMA) applied to Heikin-Ashi or regular candles on user-defined timeframes.
Core Mechanics:
Trend Identification:
Calculates MA values for open/close/high/low prices
Determines trend direction Bullish (green) and bearish (red)
Entry Signals:
Long entries when MA_close crosses above MA_open
Short entries when MA_close crosses below MA_open
Trade filters: LONG/SHORT/BOTH/NONE
Risk Management:
Fixed stop loss (points)
Fixed take profit (points)
Auto-position closing for directional modes
Visual Features:
Colored trend cloud (bullish/bearish)
Optional MA plots for close/high/low
Customizable colors and transparency
Optimized For:
Fast timeframes (1-15min charts)
Configurable trend confirmation (any higher timeframe)
Backtesting window control
The strategy simplifies price action into clear visual trends while maintaining flexibility through 15+ input parameters. Trades align with the dominant trend direction shown by the colored MA cloud, with exits triggered by profit targets, stop losses, or counter-trend MA crosses.
EMA 50/75/120 Golden & Death Cross Strategyuy: When all EMAs are aligned in golden cross order.
Sell: When all EMAs are aligned in death cross order.
Color Coding:
Green: All EMAs rising
Red: All EMAs falling
Gray: Mixed movement
Volume Exhaustion RSI Reversal StrategyKey Features:
Volume Logic:
1. Identifies two consecutive red bars (down periods) or green bars (up periods)
2. First down or up bars has the highest volume of the three
3. Volume decreases on the second down or up bars
4. Current (third) bar is green for up Reversal or red for down Reversal with higher volume than second bar
RSI Logic:
Uses standard 14-period RSI
Detects "V" shape pattern (decline, trough, rise)
Requires trough value <= 30 (oversold condition) or <= 70 (overbought condition)
Current bar shows RSI rising from trough
Execution:
Enters long/Short position when both volume and RSI conditions are met
Plots green "BUY/SELL" labels below the trigger candle
Visualization:
Green "BUY/SELL" labels appear below qualifying candles
Strategy positions shown in the strategy tester
How To Use:
Apply to any timeframe (works best on 5M-15M charts)
Combine with price action confirmation for example when candle 3 closes above candle 2 for "BUY" Or when Closes below for "SELL"
Ideal for oversold reversals in downtrends
Works best with volume-based assets
Note: The strategy enters at the close of the trigger candle. Always backtest before live trading and consider adding stop-loss protection.
Turtle Strategy Pullback EntryThis strategy, titled “Turtle Strategy Pullback Entry”, is a trend-following system designed to capture breakouts more efficiently by entering after a slight pullback. Instead of buying immediately when the price breaks the 20-day high, the strategy waits for the price to pull back by 1% below that high, offering a better entry point and reducing the chances of false breakouts. Once the pullback level is reached, a long position is initiated. The trade is then managed using three exit conditions: it will close if the price drops 1.4% below the entry (acting as a stop loss), if the price rises 1.8% above the entry (taking profit), or if the price closes below the 20-day low, which serves as a trend invalidation signal. The position size is based on 100% of the equity by default, and the chart visually shows the 20-day high, low, and pullback level along with a green background when a position is active. This approach helps traders ride strong trends while avoiding premature entries, making it suitable for swing or position trading across stocks, forex, or crypto markets.
FS JIMENEZ)FS JIMENEZ is a tactical breakout-retest strategy optimized for volatile price action and disciplined entries. It features:
• Swing structure validation
• Smart cooldown and price spacing logic
• SL compression after 3 bars
• Dynamic TP targeting based on candle strength and ATR
• Optional trailing SL via buffer multiplier
Built for traders seeking precision and controlled exposure across volati
MNQ1! 15min NW Strategy V2.0This strategy is built specifically for the MNQ1! futures contract on the 15-minute timeframe. It identifies and trades a specific price action setup where candles have little to no wick (either top or bottom), indicating potential momentum continuation. The system places pending limit orders with defined stop-loss and take-profit levels based on ATR volatility.
🔍 Key Features:
Only runs on MNQ1! and the 15-minute chart (errors otherwise to prevent misuse).
Detects "no-wick" candles based on configurable wick and body size filters.
Supports session-based trading (default: 02:00–16:00 NY time).
Executes limit-style entries placed a set number of points away from candle levels.
Uses ATR-based stop-loss and take-profit calculations for adaptive risk control.
Cancels orders automatically after a configurable number of bars if not filled.
Built-in performance statistics table shows live metrics on strategy results.
Trade signals and SL/TP levels are plotted directly on the chart for easy visualization.
⚙️ User Inputs Include:
Candle Settings: Wick percentage, min/max body size
Risk Settings: ATR multiplier, risk/reward (TP), contract size
Strategy Settings: Session time, entry offset distance, cancel-after bars
Performance Table: Toggle visibility, starting balance for display calculations
📈 Performance Table Metrics:
Total trades
Starting and ending balance
Net return in $ and %
Win rate
Maximum drawdown (in $ and %)
⚠️ Notes:
This strategy does not repaint.
Meant for educational and research purposes only — it is not financial advice.
Results may vary based on market conditions, latency, and broker execution. Always forward-test before using in live trading.
Simple EMA Trend Strategy (No Filters)The Simple EMA Trend Indicator identifies bullish and bearish market trends using two exponential moving averages (EMAs) and a confirmation period. When a bullish trend is detected, it highlights candles in blue and prints a "BUY" signal. When the trend reverses to bearish, candles turn purple and a "SELL" signal is printed.
The trend direction remains active until a confirmed reversal is detected, helping traders stay in position during extended moves while reducing noise from short-term fluctuations. It’s optimized for clarity and simplicity—ideal for trend-following strategies.
⚙️ Key Features:
EMA Crossover Trend Detection
Buy/Sell Signals on Trend Reversals
Color-coded Candles: Blue for bullish, purple for bearish
Signal Persistence: Buy/sell remains active until trend reverses
Adjustable settings for EMAs and trend confirmation sensitivity
VolatilityGuard Scalper (Sin Restricciones Horarias)(Trend Reversals)
Description:
VolatilityGuard Scalper is a scalping strategy designed to capture retracements in strong trends, optimized for volatile markets such as cryptocurrencies (BTC, ETH), gold (XAU/USD), S&P 500 and DAX 40 futures. It uses a 30-period EMA to identify the trend, retracement zones based on price action, and volume filters (1.2x 30-bar SMA) and spread (maximum 15 pips) to trade only in optimal conditions. With a robust risk management (stop-loss 2x ATR, take-profit 1.8x ATR, trailing stop), it is ideal for intraday traders without time restrictions.
Main Features:
Indicators:
30-period EMA to define up/down trends.
Recoil zones calculated with maximum/minimum of 3 bars.
Above average volume (1.2x 30-bar SMA).
ATR (14) for stop-loss, take-profit and trailing stop.
Maximum spread filter (15 pips).
Tickets:
Buy: Uptrend (price > EMA, EMA going up), price in retracement zone, high volume, acceptable spread.
Sell: Downtrend (price < EMA, EMA going down), price in retracement zone, high volume, acceptable spread.
Risk Management:
Stop-loss: 2x ATR from the entry price.
Take-profit: 1.8x ATR from the entry price.
Trailing stop: 1x ATR with 0.5x ATR offset.
Risk per operation: 0.5% of the capital (adjustable).
Dynamic position size based on ATR and spread.
Markets and Time Frames:
BTC: 2H (86% correct) to 4H (90% correct, recommended)
DAX40:https://www.tradingview.com/x/vGlk1lxG/
WaveTrend Strategy It is the wave trend indicator transformed into a strategy with Zapay intelligence. Buys on yellow candles and sells on turquoise candles. Opens both long and short trades. All parameters can be adjusted. Set the parameter according to the chart minute and test.
ICT - Quit your Job in 90 daysICT — Quit Your Job in 90 Days Strategy
This strategy is an implementation of ICT's "Quit Your Job in 90 Days" concept, fully automated and designed to follow the principles of Smart Money Concepts (SMC) as taught by ICT.
Core Logic:
• Identifies daily session high and low points to mark key liquidity areas.
• Detects changes of structure (CoS) after liquidity sweeps to confirm potential reversals.
• Places entries on the close of the CoS candle (or using a limit entry for better risk-reward, if enabled).
• Stop loss is placed at significant recent highs/lows, using a customizable lookback logic to align with ICT’s concepts.
• Targets the opposite swing point (session high or low) as the main take profit level.
• Includes filters to enforce one trade per day and avoid chasing setups too far away from key levels.
• Risk-to-reward filters ensure trades are only taken if minimum R:R criteria are met.
This strategy was designed to be run on the 1-minute timeframe, following ICT's recommended execution style for this specific setup. It includes options for both market entries and calculated limit orders to improve entry prices where possible.
Extra Features:
• One-trade-per-day rule to maintain discipline.
• Adjustable distance constraints relative to swings to avoid overextended moves.
• Option to automatically cancel untriggered limit orders after a specific session cutoff time.
This script is intended as an educational tool to help visualize and test the "Quit Your Job in 90 Days" approach in a systematic, backtestable way.
Disclaimer: This is not financial advice and is provided for research and educational purposes only. Always validate results thoroughly before trading with live capital.
ZYTX SuperTrend V1ZYTX SuperTrend V1 Indicator
Multi-strategy intelligent rebalancing with >95% win rate
Enables 24/7 automated trading
ZYTX CCI SuperTrendZYTX CCI SuperTrend
The definitive integration of CCI and SuperTrend trend-following indicators, delivering exemplary performance in automated trading bots.
JS Elite XAUUSD Scalper v1.0📈 Elite XAUUSD Scalper v1.0 – A Premium Scalping Strategy for Gold
The Elite XAUUSD Scalper v1.0 is a high-performance scalping strategy designed to capture quick price movements in the XAUUSD (Gold) market. Built with precision and optimized for intraday trading, this strategy uses a combination of Fast & Slow EMAs, ATR (Average True Range), and advanced Order Block & Liquidity Sweep logic to identify profitable opportunities in real-time.
Key Features:
Multiple Confluences: The strategy utilizes the HTF Trend Filter, RSI, Volume Analysis, and Order Blocks to ensure that trades are placed with the highest probability of success.
Real-time Entry & Exit Signals: Automated long and short entries with Take-Profit (TP), Stop-Loss (SL), and Partial TP levels for precise risk management.
Trailing Stop: Automatically trails stop-loss to lock in profits as the price moves in your favor, ensuring that you can ride the trend while protecting your gains.
Alerts: Get notified of long and short signals in real-time via TradingView alerts. Never miss a trade!
Strategy Logic:
Trend Filter: The strategy incorporates a higher time-frame (HTF) trend filter, which ensures that trades are taken only in the direction of the overall trend.
Scalping Precision: The Fast EMA (4) and Slow EMA (14) ensure timely entry and exit points, while the ATR (2) adds an extra layer of risk management, ensuring your stops are intelligently placed.
Risk-to-Reward: Set to a 2:1 reward-to-risk ratio, with an option for partial take-profit at 1.2x RR, allowing you to lock in gains while letting the trade run.
Order Block & Liquidity Sweep: Identifies price levels with high institutional interest, ensuring your trades align with market liquidity.
Ideal For:
Intraday Traders: This strategy is perfect for traders looking to capitalize on fast, small price movements in XAUUSD (Gold).
Scalpers & Swing Traders: It’s designed to handle quick moves while minimizing drawdown and securing profits during market swings.
Why Choose Elite XAUUSD Scalper v1.0?
Customizable: Adjust the strategy's risk parameters, trailing stop, and partial TP to suit your trading style and risk tolerance.
Highly Accurate: Combining the Fast & Slow EMAs, ATR, and order block logic, this strategy increases the accuracy of your trades, helping you stay ahead of market movements.
Automated: Set it and forget it — the strategy takes care of entries, exits, and risk management, freeing you to focus on other markets or activities.
🚀 Start Trading with Elite XAUUSD Scalper v1.0 Today!
Unlock the power of high-frequency scalping with the Elite XAUUSD Scalper v1.0. Get access to the strategy and start trading smarter today.
💬 Disclaimer
This strategy is for educational purposes only. Past performance is not indicative of future results. Use this strategy at your own risk and ensure that you fully understand its features and risks before trading with real capital.
BGSwing StrategyThis Pine Script® strategy detects bullish and bearish liquidity levels (SSL/BSL) based on swing points and executes trades based on breakout-failure logic.
✨ Features:
• Automatically identifies Swing Highs (BSL) and Swing Lows (SSL)
• Configurable strategy execution on Break & Fail (Break and Close Back)
• Optional buy/sell direction filtering
• Customizable Take Profit & Stop Loss (in points)
• Visual liquidity levels drawn as horizontal lines
• Optional signal labels displayed directly on the chart
⚙️ Parameters:
• Liquidity Strength: defines the number of bars for valid highs/lows
• Direction Filter: Buy only / Sell only / Both
• Line style, width, and color customization
• Option to auto-delete old liquidity levels
Ideal for traders using price action and smart money concepts who want clean entry logic and visual confirmation.
Enjoy and use responsibly. 📈
HedgeFi - 30 Min OpenTest script for Miyagi
Script maps the first 30minute candle high and low for London and NY sessions.
When price cleanly closes above the high or below the low, within the first 90 minutes of the session, a signal is generated.
Aligned to NY timezone.
Darvas Box Short Squeeze Strategy//@version=5
strategy("Darvas Box Short Squeeze Strategy", overlay=true)
// Inputs for the Darvas Box
darvasLength = input(20, title="Darvas Box Length")
riskRewardRatio = input(3, title="Risk to Reward Ratio")
riskAmount = input(100, title="Risk Amount ($)")
// Calculate the highest high and lowest low for Darvas Box
var float highLevel = na
var float lowLevel = na
var float darvasHigh = na
var float darvasLow = na
var bool inBox = false
if (high >= ta.highest(high, darvasLength) )
highLevel := high
inBox := true
if (low <= ta.lowest(low, darvasLength) )
lowLevel := low
inBox := false
if (inBox)
darvasHigh := highLevel
darvasLow := lowLevel
// Short Squeeze Condition: Significant upward movement with high volume
shortSqueezeCondition = (close > darvasHigh and volume > ta.sma(volume, 20))
// Entry logic for shorting on resistance
if (shortSqueezeCondition and close >= darvasHigh)
strategy.entry("Short", strategy.short)
// Long entry on major support (if price breaches below darvasLow)
if (close <= darvasLow)
strategy.entry("Long", strategy.long)
// Risk and Reward Levels
var float longTakeProfit = na
var float longStopLoss = na
var float shortTakeProfit = na
var float shortStopLoss = na
if (strategy.position_size > 0) // For Long position
longTakeProfit := strategy.position_avg_price * (1 + riskRewardRatio / 1)
longStopLoss := strategy.position_avg_price - (riskAmount / strategy.position_size)
if (strategy.position_size < 0) // For Short position
shortTakeProfit := strategy.position_avg_price * (1 - riskRewardRatio / 1)
shortStopLoss := strategy.position_avg_price + (riskAmount / (strategy.position_size))
// Exit logic
if (strategy.position_size > 0)
strategy.exit("Take Profit Long", from_entry="Long", limit=longTakeProfit, stop=longStopLoss)
if (strategy.position_size < 0)
strategy.exit("Take Profit Short", from_entry="Short", limit=shortTakeProfit, stop=shortStopLoss)
// Plotting levels for visualization
plot(longTakeProfit, color=color.green, style=plot.style_cross, title="Long Take Profit")
plot(longStopLoss, color=color.red, style=plot.style_cross, title="Long Stop Loss")
plot(shortTakeProfit, color=color.green, style=plot.style_cross, title="Short Take Profit")
plot(shortStopLoss, color=color.red, style=plot.style_cross, title="Short Stop Loss")
Multi-Confluence Swing Hunter V1# Multi-Confluence Swing Hunter V1 - Complete Description
Overview
The Multi-Confluence Swing Hunter V1 is a sophisticated low timeframe scalping strategy specifically optimized for MSTR (MicroStrategy) trading. This strategy employs a comprehensive point-based scoring system that combines optimized technical indicators, price action analysis, and reversal pattern recognition to generate precise trading signals on lower timeframes.
Performance Highlight:
In backtesting on MSTR 5-minute charts, this strategy has demonstrated over 200% profit performance, showcasing its effectiveness in capturing rapid price movements and volatility patterns unique to MicroStrategy's trading behavior.
The strategy's parameters have been fine-tuned for MSTR's unique volatility characteristics, though they can be optimized for other high-volatility instruments as well.
## Key Innovation & Originality
This strategy introduces a unique **dual scoring system** approach:
- **Entry Scoring**: Identifies swing bottoms using 13+ different technical criteria
- **Exit Scoring**: Identifies swing tops using inverse criteria for optimal exit timing
Unlike traditional strategies that rely on simple indicator crossovers, this system quantifies market conditions through a weighted scoring mechanism, providing objective, data-driven entry and exit decisions.
## Technical Foundation
### Optimized Indicator Parameters
The strategy utilizes extensively backtested parameters specifically optimized for MSTR's volatility patterns:
**MACD Configuration (3,10,3)**:
- Fast EMA: 3 periods (vs standard 12)
- Slow EMA: 10 periods (vs standard 26)
- Signal Line: 3 periods (vs standard 9)
- **Rationale**: These faster parameters provide earlier signal detection while maintaining reliability, particularly effective for MSTR's rapid price movements and high-frequency volatility
**RSI Configuration (21-period)**:
- Length: 21 periods (vs standard 14)
- Oversold: 30 level
- Extreme Oversold: 25 level
- **Rationale**: The 21-period RSI reduces false signals while still capturing oversold conditions effectively in MSTR's volatile environment
**Parameter Adaptability**: While optimized for MSTR, these parameters can be adjusted for other high-volatility instruments. Faster-moving stocks may benefit from even shorter MACD periods, while less volatile assets might require longer periods for optimal performance.
### Scoring System Methodology
**Entry Score Components (Minimum 13 points required)**:
1. **RSI Signals** (max 5 points):
- RSI < 30: +2 points
- RSI < 25: +2 points
- RSI turning up: +1 point
2. **MACD Signals** (max 8 points):
- MACD below zero: +1 point
- MACD turning up: +2 points
- MACD histogram improving: +2 points
- MACD bullish divergence: +3 points
3. **Price Action** (max 4 points):
- Long lower wick (>50%): +2 points
- Small body (<30%): +1 point
- Bullish close: +1 point
4. **Pattern Recognition** (max 8 points):
- RSI bullish divergence: +4 points
- Quick recovery pattern: +2 points
- Reversal confirmation: +4 points
**Exit Score Components (Minimum 13 points required)**:
Uses inverse criteria to identify swing tops with similar weighting system.
## Risk Management Features
### Position Sizing & Risk Control
- **Single Position Strategy**: 100% equity allocation per trade
- **No Overlapping Positions**: Ensures focused risk management
- **Configurable Risk/Reward**: Default 5:1 ratio optimized for volatile assets
### Stop Loss & Take Profit Logic
- **Dynamic Stop Loss**: Based on recent swing lows with configurable buffer
- **Risk-Based Take Profit**: Calculated using risk/reward ratio
- **Clean Exit Logic**: Prevents conflicting signals
## Default Settings Optimization
### Key Parameters (Optimized for MSTR/Bitcoin-style volatility):
- **Minimum Entry Score**: 13 (ensures high-conviction entries)
- **Minimum Exit Score**: 13 (prevents premature exits)
- **Risk/Reward Ratio**: 5.0 (accounts for volatility)
- **Lower Wick Threshold**: 50% (identifies true hammer patterns)
- **Divergence Lookback**: 8 bars (optimal for swing timeframes)
### Why These Defaults Work for MSTR:
1. **Higher Score Thresholds**: MSTR's volatility requires more confirmation
2. **5:1 Risk/Reward**: Compensates for wider stops needed in volatile markets
3. **Faster MACD**: Captures momentum shifts quickly in fast-moving stocks
4. **21-period RSI**: Reduces noise while maintaining sensitivity
## Visual Features
### Score Display System
- **Green Labels**: Entry scores ≥10 points (below bars)
- **Red Labels**: Exit scores ≥10 points (above bars)
- **Large Triangles**: Actual trade entries/exits
- **Small Triangles**: Reversal pattern confirmations
### Chart Cleanliness
- Indicators plotted in separate panes (MACD, RSI)
- TP/SL levels shown only during active positions
- Clear trade markers distinguish signals from actual trades
## Backtesting Specifications
### Realistic Trading Conditions
- **Commission**: 0.1% per trade
- **Slippage**: 3 points
- **Initial Capital**: $1,000
- **Account Type**: Cash (no margin)
### Sample Size Considerations
- Strategy designed for 100+ trade sample sizes
- Recommended timeframes: 4H, 1D for swing trading
- Optimal for trending/volatile markets
## Strategy Limitations & Considerations
### Market Conditions
- **Best Performance**: Trending markets with clear swings
- **Reduced Effectiveness**: Highly choppy, sideways markets
- **Volatility Dependency**: Optimized for moderate to high volatility assets
### Risk Warnings
- **High Allocation**: 100% position sizing increases risk
- **No Diversification**: Single position strategy
- **Backtesting Limitation**: Past performance doesn't guarantee future results
## Usage Guidelines
### Recommended Assets & Timeframes
- **Primary Target**: MSTR (MicroStrategy) - 5min to 15min timeframes
- **Secondary Targets**: High-volatility stocks (TSLA, NVDA, COIN, etc.)
- **Crypto Markets**: Bitcoin, Ethereum (with parameter adjustments)
- **Timeframe Optimization**: 1min-15min for scalping, 30min-1H for swing scalping
### Timeframe Recommendations
- **Primary Scalping**: 5-minute and 15-minute charts
- **Active Monitoring**: 1-minute for precise entries
- **Swing Scalping**: 30-minute to 1-hour timeframes
- **Avoid**: Sub-1-minute (excessive noise) and above 4-hour (reduces scalping opportunities)
## Technical Requirements
- **Pine Script Version**: v6
- **Overlay**: Yes (plots on price chart)
- **Additional Panes**: MACD and RSI indicators
- **Real-time Compatibility**: Confirmed bar signals only
## Customization Options
All parameters are fully customizable through inputs:
- Indicator lengths and levels
- Scoring thresholds
- Risk management settings
- Visual display preferences
- Date range filtering
## Conclusion
This scalping strategy represents a comprehensive approach to low timeframe trading that combines multiple technical analysis methods into a cohesive, quantified system specifically optimized for MSTR's unique volatility characteristics. The optimized parameters and scoring methodology provide a systematic way to identify high-probability scalping setups while managing risk effectively in fast-moving markets.
The strategy's strength lies in its objective, multi-criteria approach that removes emotional decision-making from scalping while maintaining the flexibility to adapt to different instruments through parameter optimization. While designed for MSTR, the underlying methodology can be fine-tuned for other high-volatility assets across various markets.
**Important Disclaimer**: This strategy is designed for experienced scalpers and is optimized for MSTR trading. The high-frequency nature of scalping involves significant risk. Past performance does not guarantee future results. Always conduct your own analysis, consider your risk tolerance, and be aware of commission/slippage costs that can significantly impact scalping profitability.
Volatility Index Percentile Risk STOCK StrategyVolatility-Index Percentile Risk STOCK Strategy
──────────────────────────────────────────────
PURPOSE
• Go long equities only when implied volatility (from any VIX-style index) is in its quietest percentile band.
• Scale stop-loss distance automatically with live volatility so risk stays proportional across timeframes and market regimes.
HOW IT WORKS
1. Pull the closing price of a user-selected volatility index (default: CBOE VIX, Nasdaq VXN, etc.).
2. Compute its 1-year (252-bar) percentile.
– If percentile < “Enter” threshold → open / maintain long.
– If percentile > “Exit” threshold → flatten.
3. Set the stop-loss every bar at:
SL % = (current VIX value) ÷ Risk Divisor
(e.g., VIX = 20 and divisor = 57 → 0.35 % SL below entry).
This keeps risk tighter when volatility is high and looser when it’s calm.
USER INPUTS
• VIX-style Index — symbol of any volatility index
• Look-back — length for percentile (default 252)
• Enter Long < Percentile — calm-market trigger (default 15 %)
• Exit Long > Percentile — fear trigger (default 60 %)
• Risk Divisor (SL) — higher number = tighter stop; start with 57 on 30-min charts
• Show Debug Plots — optional visibility of percentile & SL%
RECOMMENDED BACK-TEST SETTINGS
• Timeframe: 30 min – Daily on liquid stocks/ETFs highly correlated to the chosen VIX.
• Initial capital: 100 000 | Order size: 10 % of equity
• Commission: 0.03 % | Slippage: 5 ticks
• Enable *Bar Magnifier* and *Fill on bar close* for realistic execution.
ADDITIONAL INFORMATION
• **Self-calibrating risk** – no static ATR or fixed %, adapts instantly to changing volatility.
• **Percentile filter** – regime-aware entry logic that avoids false calm periods signalled by raw VIX levels.
• **Timeframe-agnostic** – works from intraday to weekly; √T-style divisor lets you fine-tune stops quickly ,together with the percentiles and days length.
• Zero look-ahead.
CAVEATS
• Long-only; no built-in profit target. Add one if your plan requires fixed R:R exits.
• Works best on indices/stocks that move with the selected vol index.
• Back-test results are educational; past performance never guarantees future returns.
LICENSE & CREDITS
Released under the Mozilla Public License 2.0.
Inspired by academic research on volatility risk premia and mean-reversion.
DISCLAIMER
This script is for informational and educational purposes only. It is **not** financial advice. Use at your own risk.
Aftershock Playbook: Stock Earnings Drift EngineStrategy type
Event-driven post-earnings momentum engine (long/short) built for single-stock charts or ADRs that publish quarterly results.
What it does
Detects the exact earnings bar (request.earnings, lookahead_off).
Scores the surprise and launches a position on that candle’s close.
Tracks PnL: if the first leg closes green, the engine automatically re-enters on the very next bar, milking residual drift.
Blocks mid-cycle trades after a loss until the next earnings release—keeping the risk contained to one cycle.
Think of it as a sniper that fires on the earnings pop, reloads once if the shot lands, then goes silent until the next report.
Core signal inputs
Component Default Purpose
EPS Surprise % +0 % / –5 % Minimum positive / negative shock to trigger longs/shorts.
Reverse signals? Off Quick flip for mean-reversion experiments.
Time Risk Mgt. Off Optional hard exit after 45 calendar days (auto-scaled to any TF).
Risk engine
ATR-based stop (ATR × 2 by default, editable).
Bar time stop (15-min → Daily: Have to select the bar value ).
No pyramiding beyond the built-in “double-tap”.
All positions sized as % of equity via Strategy Properties.
Visual aids
Yellow triangle marks the earnings bar.
Diagnostics table (top-right) shows last Actual, Estimate, and Surprise %.
Status-line tool-tips on every input.
Default inputs
Setting Value
Positive surprise ≥ 0 %
Negative surprise ≤ –5 %
ATR stop × 2
ATR length 50
Hold horizon 350 ( 1h timeframe chart bars)
Back-test properties
Initial capital 10 000
Order size 5 % of equity
Pyramiding 1 (internal re-entry only)
Commission 0.03 %
Slippage 5 ticks
Fills Bar magnifier ✔ · On bar close ✔ · Standard OHLC ✔
How to use
Add the script to any earnings-driven stock (AAPL, MSFT, TSLA…).
Turn on Time Risk Management if you want stricter risk management
Back-test different ATR multipliers to fit the stock’s volatility.
Sync commission & slippage with your broker before forward-testing.
Important notes
Works on every timeframe from 15 min to 1 D. Sweet spot around 30min/1h
All request.earnings() & request.security() calls use lookahead_off—zero repaint.
The “double-tap” re-entry occurs once per winning cycle to avoid drift-chasing loops.
Historical stats ≠ future performance. Size positions responsibly.