Antigravity OCC Strategy (MA 5 + Delayed TSL)# OCC Strategy Optimized (MA 5 + Delayed TSL) - User Guide
## Introduction
The **OCC Strategy Optimized** is an enhanced version of the classic **Open Close Cross (OCC)** strategy. This strategy is designed for high-precision trend following, utilizing the crossover logic of Open and Close moving averages to identify market shifts. This optimized version incorporates advanced risk management, multi-timeframe analysis, and a variety of moving average types to provide a robust trading solution for modern markets.
>
> **Special Thanks:** This strategy is based on the original work of **JustUncleL**, a renowned Pine Script developer. You can find their work and profile on TradingView here: (in.tradingview.com).
---
## Key Features
### 1. Optimized Core Logic
- **MA Period (Default: 5):** The strategy is tuned with a shorter MA length to reduce lag and capture trends earlier.
- **Crossing Logic:** Signals are generated when the Moving Average of the **Close** crosses the Moving Average of the **Open**.
### 2. Multi-Timeframe (MTF) Analysis
- **Alternate Resolution:** Use a higher timeframe (Resolution Multiplier) to filter out noise. By default, it uses $3 \times$ your current chart timeframe to confirm the trend.
- **Non-Repainting:** Includes an optional delay offset to ensure signals are confirmed and do not disappear (repaint) after the bar closes.
### 3. Advanced Risk Management
This script features a hierarchical exit system to protect your capital and lock in profits:
- **Fixed Stop Loss (Initial):** Protects against sudden market reversals immediately after entry.
- **Delayed Trailing Stop Loss (TSL):**
- **Activation Delay:** The TSL only activates after the trade reaches a specific profit threshold (e.g., 1%). This prevents being stopped out too early in the trade's development.
- **Ratchet Trail:** Once activated, the stop loss "ratchets" up/down, never moving backward, ensuring you lock in profits as the trend continues.
- **Take Profit (TP):** A fixed percentage target to exit the trade at a pre-defined profit level.
### 4. Versatility
- **12 MA Types:** Choose from SMA, EMA, DEMA, TEMA, WMA, VWMA, SMMA, HullMA, LSMA, ALMA, SSMA, and TMA.
- **Trade Direction:** Toggle between Long-only, Short-only, or Both.
- **Visuals:** Optional bar coloring to visualize the trend directly on the candlesticks.
---
## User Input Guide
### Core Settings
- **Use Alternate Resolution?:** Enable this to use the MTF logic.
- **Multiplier for Alternate Resolution:** How many charts higher the "filter" timeframe should be.
- **MA Type:** Select your preferred moving average smoothing method.
- **MA Period:** The length of the Open/Close averages.
- **Delay Open/Close MA:** Use `1` or higher to force non-repainting behavior.
### Risk Management Settings
- **Use Trailing Stop Loss?:** Enables the TSL system.
- **Trailing Stop %:** The distance the stop follows behind the price.
- **TSL Activation % (Delay):** The profit % required before the TSL starts moving.
- **Initial Fixed Stop Loss %:** Your hard stop if the trade immediately goes against you.
- **Take Profit %:** Your ultimate profit target for the trade.
---
## How to Trade with This Strategy
1. **Identify the Trend:** Look for the Moving Average lines (Close vs Open) to cross.
2. **Wait for Confirmation:** If using MTF, ensure the higher timeframe also shows a trend change.
3. **Manage the Trade:** Let the TSL work. Once the trade hits the activation threshold, the TSL will take over, protecting your runner.
4. **Position Sizing:** Adjust the `Properties` tab in the script settings to match your desired capital allocation (Default is 10% of equity).
---
## Credits
Original Strategy by: **JustUncleL**
Optimized and Enhanced by: **Antigravity AI**
Indicateurs et stratégies
Trend Pulse Channel StrategyOverview
Trend Pulse Channel Strategy is a long-only trend-following breakout strategy built around an adaptive multi-pole smoothing filter and a volatility-adjusted price channel.
The strategy is designed to participate in sustained directional moves by entering only when price confirms momentum strength beyond a dynamic upper boundary, while avoiding mean-reversion and low-quality consolidation phases.
This script is published as a strategy and includes realistic backtesting assumptions for position sizing, commissions, and slippage.
Core Concept
At the heart of the strategy is a multi-pole adaptive EMA-based filter, inspired by advanced digital signal smoothing techniques.
Using multiple poles allows the filter to reduce noise while preserving responsiveness to genuine trend changes.
To adapt the channel width to changing market conditions, the strategy applies the same filtering logic to True Range, producing a volatility-aware envelope rather than a static or fixed-percentage band.
This combination allows the strategy to:
Track directional bias using a smoothed central filter
Adjust channel width dynamically based on market volatility
Trigger entries only when price expansion confirms trend strength
Entry Logic
A long position is opened when:
Price crosses above the upper channel band
The signal occurs within the user-defined date range
This condition represents a volatility-confirmed breakout aligned with the prevailing directional filter.
Exit Logic
The long position is closed when:
Price crosses back below the upper band
This exit logic aims to stay in trending moves while exiting when upside momentum weakens.
The strategy does not open short positions by design.
Inputs and Defaults
The default inputs are selected to balance smoothness, responsiveness, and stability:
Source (HLC3): Reduces single-price noise by averaging high, low, and close
Period (144): Defines the primary smoothing horizon of the adaptive filter
Poles (4): Controls the smoothness vs. responsiveness trade-off
Range Multiplier (1.414): Scales the volatility envelope using filtered True Range
Reduced Lag (optional): Applies lag compensation to improve responsiveness
Fast Response (optional): Blends multi-pole and single-pole filters for quicker reaction at the cost of smoothness
All inputs are fully configurable and can be adjusted to suit different instruments and timeframes.
Risk Management & Position Sizing
The strategy uses:
Position size: 10% of equity per trade
No pyramiding
Long positions only
This sizing approach is intended to reflect sustainable risk exposure rather than aggressive capital deployment. Users may further adjust position size based on their own risk tolerance.
Backtesting Assumptions
The strategy is tested using :
Initial capital: 10,000
Commission: 0.1%
Slippage: 1 tick
Order fill model: Standard OHLC
These settings are chosen to provide more realistic performance estimates compared to idealized backtests.
This strategy is best suited for :
Trend-oriented markets
Higher timeframes where breakouts are more reliable
Users seeking systematic trend participation rather than frequent scalping
In sideways or range-bound market conditions, price may cross the channel boundaries frequently.
This can result in a higher number of entry and exit signals that do not develop into sustained trends.
For this reason, the strategy should be used with an understanding of basic technical analysis concepts, including market structure, trend identification, and consolidation behavior.
It is intended as a decision-support tool, not a standalone trading system.
Users—whether beginners or experienced traders—should avoid relying solely on this strategy and are encouraged to combine it with broader market context and additional analysis methods.
Disclaimer
This script is provided for educational and analytical purposes only. It does not constitute financial advice. Past performance does not guarantee future results.
EMA and Dow Theory Strategies V2📘 Overview
This strategy is an advanced evolution of the original EMA × Dow Theory hybrid model. V2 introduces true swing‑based trend detection, gradient trend‑zones, higher‑timeframe swing overlays, and dynamic exit logic designed for intraday to short‑term trading across crypto, forex, stocks, and indices.
The system provides precise entries, adaptive exits, and highly visual guidance that helps traders understand trend structure at a glance.
🧠 Key Features
🔹 1. Dual‑EMA Trend Logic (Symbol + External Index)
Both the chart symbol and an external index (OTHERS.D) are evaluated using fast/slow EMAs to determine correlation‑based trend bias.
🔹 2. Dow Theory Swing Detection (Real‑time)
The script identifies swing highs/lows and updates trend direction when price breaks them. This creates a structural trend model that reacts faster than EMAs alone.
🔹 3. Gradient Trend Zones (Visual Trend Strength)
When trend is up or down, the area between price and the latest swing level is filled with a multi‑step gradient. This makes trend strength and distance-to-structure visually intuitive.
🔹 4. Higher‑Timeframe Swing Trend (htfTrend)
Swing highs/lows from a higher timeframe (e.g., 4H) are plotted to show macro structure. Used only for visual context, not for filtering entries.
🔹 5. RSI‑Based Entry Protection
RSI prevents entries during extreme overbought/oversold conditions.
🔹 6. Dynamic Exit System
Includes:
Custom stop‑loss (%)
Partial take‑profit (TP1/TP2/TP3)
Automatic scale‑out when trend color weakens
“Color‑change lockout” to prevent immediate re‑entry
Real‑time PnL tracking and labels
🔹 7. Alerts for All Key Events
Entry, stop‑loss, partial exits, and trend‑change exits all generate structured JSON alerts.
🔹 8. Visual PnL Labels & Equity Tracking
PnL for the latest trade is displayed directly on the chart, including scale‑out adjustments.
⚙️ Input Parameters
Parameter Description
Fast EMA / Slow EMA EMAs used for symbol trend detection
Index Fast / Slow EMA EMAs applied to external index
StopLoss (%) Custom stop‑loss threshold
Scale‑Out % Portion to exit when trend color weakens
RSI Period / Levels Overbought/oversold filters
Swing Detection Length Bars used to detect swing highs/lows
Stats Display Position of statistics table
🧭 About htfTrend (Higher Timeframe Trend)
The higher‑timeframe swing trend is displayed visually but not used for entry logic.
Why? Strict HTF filtering reduces trade frequency and often removes profitable setups. By keeping it visual‑only, traders retain flexibility while still benefiting from macro structure awareness.
Use it as a contextual guide, not a constraint.
📘 概要
本ストラテジーは、V1 を大幅に拡張した EMA × ダウ理論 × スイング構造 × 上位足トレンド可視化 の複合型モデルです。 短期〜デイトレード向けに最適化されており、仮想通貨・FX・株式・指数など幅広いアセットで利用できます。
V2 では、スイング構造の自動検出、グラデーションによるトレンド強度の可視化、上位足スイングライン、動的な利確/損切りロジック が追加され、視覚的にもロジック的にも大幅に強化されています。
🧠 主な機能
🔹 1. 銘柄+外部インデックスの EMA クロス判定
対象銘柄と OTHERS.D の EMA を比較し、相関を考慮したトレンド方向を判定します。
🔹 2. ダウ理論に基づくスイング高値・安値の自動検出
スイング更新によりトレンド方向を切り替える、構造ベースのトレンド判定を採用。
🔹 3. グラデーション背景によるトレンド強度の可視化
スイングラインから現在価格までを段階的に塗り分け、 「どれだけトレンドが伸びているか」を直感的に把握できます。
🔹 4. 上位足スイングトレンド(htfTrend)の表示
4H などの上位足でのスイング高値・安値を表示し、 大局的なトレンド構造を視覚的に把握できます(ロジックには未使用)。
🔹 5. RSI による過熱・売られすぎフィルター
極端な RSI 状態でのエントリーを防止。
🔹 6. 動的イグジットシステム
カスタム損切り(%)
TP1/TP2/TP3 の段階的利確
トレンド色の弱まりによる自動スケールアウト
色変化後の再エントリー制限(waitForColorChange)
リアルタイム PnL の追跡とラベル表示
🔹 7. アラート完備(JSON 形式)
エントリー、損切り、部分利確、トレンド反転などすべてに対応。
🔹 8. 損益ラベル・統計表示
直近トレードの損益をチャート上に表示し、視覚的に把握できます。
⚙️ 設定項目
設定項目名 説明
Fast / Slow EMA 銘柄の EMA 設定
Index Fast / Slow EMA 外部インデックスの EMA 設定
損切り(%) カスタム損切りライン
部分利確割合 トレンド弱化時のスケールアウト割合
RSI 期間・水準 過熱/売られすぎフィルター
スイング検出期間 スイング高値・安値の検出に使用
統計表示位置 テーブルの表示位置
🧭 上位足トレンド(htfTrend)について
上位足スイングの更新に基づくトレンド判定を表示しますが、 エントリー条件には使用していません。
理由: 上位足を厳密にロジックへ組み込むと、トレード機会が大幅に減るためです。
本ストラテジーでは、 「大局の把握は視覚で、エントリーは柔軟に」 という設計思想を採用しています。
→ 裁量で利確判断や逆張り回避に活用できます。
ML Adaptive SuperTrend Strategy [trade_crush]# ML Adaptive SuperTrend Strategy - User Guide
## Introduction
The **ML Adaptive SuperTrend Strategy** is a sophisticated trading tool that combines traditional trend-following logic with **Machine Learning (K-Means Clustering)** to dynamically adapt to market volatility. Unlike standard SuperTrend indicators that use a fixed ATR, this strategy analyzes historical volatility to categorize the current market into distinct clusters, providing more precise entries and exits.
>
> **Special Thanks:** This strategy is based on the innovative work of **AlgoAlpha**. You can explore their extensive library of high-quality indicators and strategies on TradingView: (www.tradingview.com).
---
## Machine Learning Engine (K-Means)
The core of this strategy is its ability to "learn" from recent market behavior.
- **K-Means Clustering**: The script takes the last $N$ bars of ATR data and runs an iterative clustering algorithm to find three "centroids" representing **High**, **Medium**, and **Low** volatility.
- **Adaptive ATR**: Based on the current volatility, the strategy selects the nearest centroid to use as the ATR value for the SuperTrend calculation. This ensures the trailing stop tightens during low volatility and widens during high volatility to avoid "noise".
---
## Key Features
### 1. Non-Repainting Signals
- **Confirm Signals**: When enabled, signals are only triggered after a bar closes. This ensures that the arrows and entries you see on the chart are permanent and reliable for backtesting.
### 2. Intelligent Risk Management
- **Multiple SL/TP Types**: Choose between **Percentage** based stops or **ATR** based stops for both Stop Loss and Take Profit.
- **Trailing Stop Loss (TSL)**:
- Supports both Percentage and ATR modes.
- **Activation Offset**: Only activates the trailing mechanism after the price has moved a certain percentage in your favor, protecting early-stage trades.
### 3. Risk-Based Position Sizing
- **Dynamic Quantity**: If enabled, the strategy automatically calculates the trade size based on your **Risk % Per Trade** and the distance to your **Stop Loss**. This ensures you never lose more than your defined risk on a single trade.
---
## User Input Guide
### SuperTrend & ML Settings
- **ATR Length**: The window used to calculate market volatility.
- **SuperTrend Factor**: The multiplier that determines the distance of the trailing stop from the price.
- **Use ML Adaptive ATR**: Toggle between the ML-enhanced logic and standard ATR.
- **Training Data Length**: How many historical bars the ML engine analyzes to find clusters.
### Risk Management
- **Stop Loss Type**: Set to Percentage, ATR, or None.
- **TS Activation Offset**: The profit buffer required before the trailing stop starts following the price.
- **Use Risk-Based Sizing**: Toggle this to let the script manage your position size automatically.
---
## How to Trade with This Strategy
1. **Monitor the Dashboard**: Check the top-right table to see which volatility cluster the market is currently in.
2. **Observe the Fills**: The adaptive fills (green/red) visualize the "breathing room" the strategy is giving the price.
3. **Execution**: The strategy enters on "ML Bullish" (Triangle Up) and "ML Bearish" (Triangle Down) signals.
4. **Exits**: The script will automatically exit based on your SL, TP, or Trailing Stop settings.
---
## Credits
Original Concept: **AlgoAlpha**
Strategy Conversion & Enhancements: **Antigravity AI**
V3 Valentini Pro Scalper [Dashboard]Gemini 3.0 pro's take on Fabio Valentini's world #1 strategy scalp 12/19/2025
FVG Strategy with validationThe code needs to be fixed because it renders the boxes incorrectly, otherwise you can see that the code is profitable in some markets
extradestrategy super BTCUSD M15cocok untuk btc usd tidak di perjual belikan harap tidak menggunakan sembarangan
sullaojo 3mHere is the English translation for the alert setup instructions:
**How to Set Up Alerts (After Adding the Code)**
1. Click the **Add to chart** button to apply the indicator to your graph.
2. Click the **Alarm Clock icon (Alerts)** on the top right toolbar of TradingView, or press `Alt + A`.
3. In the **Condition** field:
* Select the indicator named **"MA Crossover Buy Alert..."**
* Select **"แจ้งเตือนซื้อ (Buy Alert)"** to receive only buy signals.
4. In the **Trigger** (or Options) section: Select **Once per bar close**.
*(This is recommended per the textbook to confirm that the closing price actually crossed the line, avoiding false signals during intraday volatility.)*
5. Check **Notify on App** (for mobile) or **Show pop-up** as desired, then click **Create**.
Now, when the moving averages cross according to the textbook's conditions, the system will send you an alert immediately!
Heikin Ashi Wick Strategy
🔥 Heikin Ashi Wick Momentum Strategy
“Trade momentum decay before the trend breaks.
>> FOCUS ON WICKS, NOT ONLY CANDLE COLOR<<
What Makes This Different (Traffic Driver)
✔ Uses Heikin Ashi wicks (almost nobody does this correctly)
✔ Captures trend continuation, not breakouts
✔ Exits before momentum collapse, not after
✔ Non-repainting
✔ Clean charts, instant readability
This Strategy Is REALLY Trading
This is a Heikin Ashi momentum-decay system:
• Enters when trend is strong but not euphoric
• Exits when:
o Trend stops probing higher
o Sellers gain relative strength
It avoids:
• Chasing strong breakout candles
• Holding through momentum rollovers
Candle Type Used: Heikin Ashi (manually calculated)
NOTE: The script does not use regular candles.
It reconstructs Heikin Ashi (HA) candles from raw OHLC:
• HA Close = average of open, high, low, close
• HA Open = midpoint of prior HA candle (smoothed)
• HA High / Low = extremes of HA open/close vs real high/low
➡️ This filters noise and emphasizes trend structure and momentum.
Strengths
✅ Works well in strong, smooth trends
✅ Very clean logic (no indicators)
✅ Non-repainting
✅ Early exits protect capital
Best Use
This works best on:
• Daily timeframe
• Strong trend ETFs / megacaps
o QQQ
o SPY
o NVDA, MSFT, AAPL
• When combined with:
o EMA 21 trend filter (your preference)
o Market regime filter (e.g., above 50/200 SMA)
o Rising 10 EMA and 20 EMA
________________________________________
8️⃣ Weaknesses (Important)
⚠️ No stop loss (only structure-based exits)
⚠️ Can exit too early in explosive trends
⚠️ Will chop in sideways markets
⚠️ No volatility filter (ATR, EMA, regime)
How to Avoid the Weaknesses — Summary
Turn the setup from a concept into a robust strategy by adding these controls:
1. Trade Only Trends
o Require price above EMA-21 (optionally EMA-21 > EMA-50)
o Eliminates chop and sideways markets
2. Improve Exits (Avoid Leaving Winners Too Early)
o Partial exit when upper wick disappears
o Full exit only when lower wick dominates
o Optional: require 2 consecutive exit candles
3. Add Risk Protection
o Use a volatility stop: ~1.5× ATR(14) below entry or below HA swing low
o Protects against gaps and sudden reversals
4. Filter Weak Signals
o Require meaningful wick size (≈30–40% of candle range)
o Avoids low-quality indecision candles
5. Avoid Bad Volatility
o Skip entries when ATR is expanding aggressively
o Focus on calmer, controllable trends
6. Limit Time in Trade
o Add a max bars hold (e.g., 10–15 bars on daily)
o Prevents capital getting stuck in fading trends
⚠️ Educational use only. Not financial advice. Trading involves risk and losses can exceed expectations. Past performance does not guarantee future results. Use at your own risk.
SMH_DualMomentum (ROC + Volume Trend)SMH Dual Momentum (ROC + Volume Confirmation)
This indicator identifies high-quality bullish trends by combining price momentum (Rate of Change) with volume confirmation, and exits when momentum structurally fails.
Core Logic
BUY signal
Rate of Change (ROC) over N periods is above a positive threshold (strong upside momentum)
Current volume is above its moving average (rising market participation)
SELL signal
ROC crosses below zero, indicating loss of bullish momentum
Why It Works
ROC measures the speed and strength of price movement, filtering out weak or drifting trends
Volume confirmation ensures momentum is supported by real capital flow, reducing false breakouts
Momentum-based exit avoids prolonged drawdowns and capital stagnation
Key Advantages
Focuses on trend continuation, not prediction
Filters out low-quality price moves and range-bound markets
Captures long, high-conviction trends with relatively few trades
Simple, robust rules using only price and volume
Best Use Cases
Designed for trend-driven ETFs such as SMH (Semiconductors)
Suitable for swing to position trading on daily charts
Works best in markets with strong sector rotation and institutional participation
Notes
This is a trend-following momentum tool, not a mean-reversion indicator
No stop-loss is built in; risk management should be handled externally if required
Parameters can be adjusted to match different timeframes or assets
Gold M5 Scalping (Strategy)This is the New Strategy for my new Indicator for M5 Scalping.
Just to test my result.
Will release my indicator soon
9 EMA Trend-Flow StrategyThis strategy avoids trading inside the noise and waits for Bitcoin to "coil up" before exploding.
1. Chart Setup
Timeframe: 5 Minutes
Bollinger Bands: Length 20, Standard Deviation 2 (Default).
RSI (Relative Strength Index): Length 14.
EMA (Exponential Moving Average): Length 200 (Trend Filter).
2. The Rules
Long Setup (Buy)
The Trend Filter: Price must be above the 200 EMA.
The Squeeze: The Bollinger Bands must visually contract (narrow), indicating volatility is dying down.
The Trigger: A 5m candle closes strongly above the Upper Bollinger Band.
Confirmation: RSI must be rising and above 50 (but ideally not yet "pegged" at 90+).
Short Setup (Sell)
The Trend Filter: Price must be below the 200 EMA.
The Squeeze: The Bollinger Bands contract.
The Trigger: A 5m candle closes strongly below the Lower Bollinger Band.
Confirmation: RSI must be falling and below 50.
Execution Guide
Entry Technique
Don't enter immediately when the candle touches the band. Wait for the candle close.
Why? Bitcoin frequently "wicks" through bands to trap traders (fakeouts) before reversing. A solid close outside the band confirms momentum.
Exit Strategy (Take Profit)
Target 1 (Conservative): Close 50% of the position when price expands to a fixed risk-reward ratio (e.g., 1.5R).
Target 2 (Runner): Keep the remaining position open as long as price "walks the band" (stays outside or touching the outer band). Close the rest when a candle finally closes back inside the Bollinger Bands.
Stop Loss
Placement: Place your Stop Loss (SL) slightly below the Middle Band (the 20 SMA) at the time of entry.
Trailing: As the price moves in your favor, move your SL to trail the Middle Band.
NQ Lunch High Low First Sweep StrategyThis script identifies the FIRST liquidity sweep of the Lunch session high or low
after the Lunch session has ended, based on ICT / Killzone concepts.
Logic summary:
• Tracks Lunch session High and Low (New York time)
• After Lunch session closes, monitors the market on 5-minute timeframe
• Triggers ONLY on the first sweep:
– Price wicks beyond Lunch High and closes back below → SHORT signal
– Price wicks beyond Lunch Low and closes back above → LONG signal
• Generates an alert at the exact bar where entry is expected
• Designed specifically for Nasdaq (NQ) futures
• One trade per day – no overtrading
Notes:
• Intended for 5-minute charts only
• Uses New York session timing
• This script does NOT manage exits (TP/SL) – entry logic only
• Best used as a confluence tool, not a standalone system
Educational & discretionary use only.
Ichimoku Cloud Strategy - 1H HyperliquidStategy for Hyperliquid 1hr time frame using Ichimoku's Cloud.
Liquidity Maxing [JOAT]Liquidity Maxing - Institutional Liquidity Matrix
Introduction
Liquidity Maxing is an open-source strategy for TradingView built around institutional market structure concepts. It identifies structural shifts, evaluates trades through multi-factor confluence, and implements layered risk controls.
The strategy is designed for swing trading on 4-hour timeframes, focusing on how institutional order flow manifests in price action through structure breaks, inducements, and liquidity sweeps.
Core Functionality
Liquidity Maxing performs three primary functions:
Tracks market structure to identify when control shifts between buyers and sellers
Scores potential trades using an eight-factor confluence system
Manages position sizing and risk exposure dynamically based on volatility and user-defined limits
The goal is selective trading when multiple conditions align, rather than frequent entries.
Market Structure Engine
The structure engine tracks three key events:
Break of Structure (BOS): Price pushes beyond a prior pivot in the direction of trend
Change of Character (CHoCH): Control flips from bullish to bearish or vice versa
Inducement Sweeps (IDM): Market briefly runs stops against trend before moving in the real direction
The structure module continuously updates strong highs and lows, labeling structural shifts visually. IDM markers are optional and disabled by default to maintain chart clarity.
The trade engine requires valid structure alignment before considering entries. No structure, no trade.
Eight-Factor Confluence System
Instead of relying on a single indicator, Liquidity Maxing uses an eight-factor scoring system:
Structure alignment with current trend
RSI within healthy bands (different ranges for up and down trends)
MACD momentum agreement with direction
Volume above adaptive baseline
Price relative to main trend EMA
Session and weekend filter (configurable)
Volatility expansion/contraction via ATR shifts
Higher-timeframe EMA confirmation
Each factor contributes one point to the confluence score. The default minimum confluence threshold is 6 out of 8, but you can adjust this from 1-8 based on your preference for trade frequency versus selectivity.
Only when structure and confluence agree does the strategy proceed to risk evaluation.
Dynamic Risk Management
Risk controls are implemented in multiple layers:
ATR-based stops and targets with configurable risk-to-reward ratio (default 2:1)
Volatility-adjusted position sizing to maintain consistent risk per trade as ranges expand or compress
Daily and weekly risk budgets that halt new entries once thresholds are reached
Correlation cooldown to prevent clustered trades in the same direction
Global circuit breaker with maximum drawdown limit and emergency kill switch
If any guardrail is breached, the strategy will not open new positions. The dashboard clearly displays risk state for transparency.
Market Presets
The strategy includes configuration presets optimized for different market types:
Crypto (BTC/ETH): RSI bands 70/30, volume multiplier 1.2, enhanced ATR scaling
Forex Majors: RSI bands 75/25, volume multiplier 1.5
Indices (SPY/QQQ): RSI bands 70/30, volume multiplier 1.3
Custom: Default values for user customization
For crypto assets, the strategy automatically applies ATR volatility scaling to account for higher volatility characteristics.
Monitoring and Dashboards
The strategy includes optional monitoring layers:
Risk Operations Dashboard (top-right):
Trend state
Confluence score
ATR value
Current position size percentage
Global drawdown
Daily and weekly risk consumption
Correlation guard state
Alert mode status
Performance Console (top-left):
Net profit
Current equity
Win rate percentage
Average trade value
Sharpe-style ratio (rolling 50-bar window)
Profit factor
Open trade count
Optional risk tint on chart background provides visual indication of "safe to trade" versus "halted" state.
All visualization elements can be toggled on/off from the inputs for clean chart viewing or full telemetry during parameter tuning.
Alerts and Automation
The strategy supports alert integration with two formats:
Standard alerts: Human-readable messages for long, short, and risk-halt conditions
Webhook format: JSON-formatted payloads ready for external execution systems (optional)
Alert messages are predictable and unambiguous, suitable for manual review or automated forwarding to execution engines.
Built-in Validation Suite
The strategy includes an optional validation layer that can be enabled from inputs. It checks:
Internal consistency of structure and confluence metrics
Sanity and ordering of risk parameters
Position sizing compliance with user-defined floors and caps
This validation is optional and not required for trading, but provides transparency into system operation during development or troubleshooting.
Strategy Parameters
Market Presets:
Configuration Preset: Choose between Crypto (BTC/ETH), Forex Majors, Indices (SPY/QQQ), or Custom
Market Structure Architecture:
Pivot Length: Default 5 bars
Filter by Inducement (IDM): Default enabled
Visualize Structure: Default enabled
Structure Lookback: Default 50 bars
Risk & Capital Preservation:
Risk:Reward Ratio: Default 2.0
ATR Period: Default 14
ATR Multiplier (Stop): Default 2.0
Max Drawdown Circuit Breaker: Default 10%
Risk per Trade (% Equity): Default 1.5%
Daily Risk Limit: Default 6%
Weekly Risk Limit: Default 12%
Min Position Size (% Equity): Default 0.25%
Max Position Size (% Equity): Default 5%
Correlation Cooldown (bars): Default 3
Emergency Kill Switch: Default disabled
Signal Confluence:
RSI Length: Default 14
Trend EMA: Default 200
HTF Confirmation TF: Default Daily
Allow Weekend Trading: Default enabled
Minimum Confluence Score (0-8): Default 6
Backtesting Considerations
When backtesting this strategy, consider the following:
Commission: Default 0.05% (adjustable in strategy settings)
Initial Capital: Default $100,000 (adjustable)
Position Sizing: Uses percentage of equity (default 2% per trade)
Timeframe: Optimized for 4-hour charts, though can be tested on other timeframes
Results will vary significantly based on:
Market conditions and volatility regimes
Parameter settings, especially confluence threshold
Risk limit configuration
Symbol characteristics (crypto vs forex vs equities)
Past performance does not guarantee future results. Win rate, profit factor, and other metrics should be evaluated in context of drawdown periods, trade frequency, and market conditions.
How to Use This Strategy
This is a framework that requires understanding and parameter tuning, not a one-size-fits-all solution.
Recommended workflow:
Start on 4-hour timeframe with default parameters and appropriate market preset
Run backtests and study performance console metrics: focus on drawdown behavior, win rate, profit factor, and trade frequency
Adjust confluence threshold to match your risk appetite—higher thresholds mean fewer but more selective trades
Set realistic daily and weekly risk budgets appropriate for your account size and risk tolerance
Consider ATR multiplier adjustments based on market volatility characteristics
Only connect alerts or automation after thorough testing and parameter validation
Treat this as a risk framework with an integrated entry engine, not merely an entry signal generator. The risk controls are as important as the trade signals.
Strategy Limitations
Designed for swing trading timeframes; may not perform optimally on very short timeframes
Requires sufficient market structure to identify pivots; may struggle in choppy or low-volatility environments
Crypto markets require different parameter tuning than traditional markets
Risk limits may prevent entries during favorable setups if daily/weekly budgets are exhausted
Correlation cooldown may delay entries that would otherwise be valid
Backtesting results depend on data quality and may not reflect live trading with slippage
Design Philosophy
Many indicators tell you when price crossed a moving average or RSI left oversold. This strategy addresses questions institutional traders ask:
Who is in control of the market right now?
Is this move structurally significant or just noise?
Do I want to add more risk given what I've already done today/week?
If I'm wrong, exactly how painful can this be?
The strategy provides disciplined, repeatable answers to these questions through systematic structure analysis, confluence filtering, and multi-layer risk management.
Technical Implementation
The strategy uses Pine Script v6 with:
Custom types for structure, confluence, and risk state management
Functional programming approach for reusable calculations
State management through persistent variables
Optional visual elements that can be toggled independently
The code is open-source and can be modified to suit individual needs. All important logic is visible in the source code.
Disclaimer
This script is provided for educational and informational purposes only. It is not intended as financial, investment, trading, or any other type of advice or recommendation. Trading involves substantial risk of loss and is not suitable for all investors. Past performance, whether real or indicated by historical tests of strategies, is not indicative of future results.
No representation is being made that any account will or is likely to achieve profits or losses similar to those shown. In fact, there are frequently sharp differences between backtested results and actual results subsequently achieved by any particular trading strategy.
The user should be aware of the risks involved in trading and should trade only with risk capital. The authors and publishers of this script are not responsible for any losses or damages, including without limitation, any loss of profit, which may arise directly or indirectly from use of or reliance on this script.
This strategy uses technical analysis methods and indicators that are not guaranteed to be accurate or profitable. Market conditions change, and strategies that worked in the past may not work in the future. Users should thoroughly test any strategy in a paper trading environment before risking real capital.
Commission and slippage settings in backtests may not accurately reflect live trading conditions. Real trading results will vary based on execution quality, market liquidity, and other factors not captured in backtesting.
The user assumes full responsibility for all trading decisions made using this script. Always consult with a qualified financial advisor before making investment decisions.
Enjoy - officialjackofalltrades
Infinity Algo Backtest═════════════════════════════════════════════════════════════════════════
█ THE PROBLEM
Most trading strategies fail because they rely on static settings that break when market conditions change. Traders spend hours manually optimizing parameters — only to see them underperform in live markets. Backtesting becomes guesswork instead of science.
█ THE SOLUTION
Infinity Algo V3.0 Backtest solves this with Auto-Tune — an optimization engine that runs 500+ parameter simulations in the background and selects the best configuration for your specific market, automatically.
Combined with multi-mode entry engines, flexible exit management, and adaptive risk controls — this is a complete backtesting system trusted by 8,000+ traders worldwide.
═════════════════════════════════════════════════════════════════════════
█ KEY FEATURES
✅ 5 Entry Modes: Normal, Smart, AI, HL Sniper, AI Sniper
✅ 3 Exit Modes: Percentage targets, Signal step-outs, Opposite signal flip
✅ 6 Take-Profit Levels with customizable partial position sizing
✅ Trailing Stop-Loss (None / Breakeven / Moving Target)
✅ Auto-Tune Optimization (Walk-Forward or Static)
✅ Pyramiding support for add-on entries
✅ Structured alert payloads for webhook automation
✅ Works on any market: Crypto, Forex, Stocks, Indices, Commodities
═════════════════════════════════════════════════════════════════════════
█ WHAT MAKES INFINITY ALGO DIFFERENT
🧠 Auto-Tune Engine (The Core Innovation)
Unlike static strategies, Infinity Algo continuously backtests parameter combinations and surfaces the optimal settings for your current asset. Choose from 12 scoring metrics including Sharpe Ratio, Sortino Ratio, Profit Factor, and Win Rate.
🎯 Multi-Mode Entry System
Switch between trend-following, contrarian, and sniper modes — all within one strategy. No need to maintain multiple scripts.
🛡️ Adaptive Risk Management
Trailing SL modes that respond to your TP hits:
Breakeven: Locks in safety after your chosen TP is reached
Moving Target: Ratchets your stop to the previous TP level as profit grows
═════════════════════════════════════════════════════════════════════════
█ ENTRY ENGINES 🎯
Normal + Smart (Default)
Normal: Contrarian entries — momentum cross against the trend filter for reversal plays
Smart: Trend-following entries — momentum cross with the trend filter for continuation plays
AI / Auto-Tune
Automated parameter selection based on historical simulation
Walk-Forward: Re-optimizes every N bars to adapt to regime changes
Static: Locks in the best settings from full history
HL Sniper
Trend-trigger mode for selective, high-conviction entries
Fewer signals, but higher probability setups
AI Sniper
Auto-Tune optimizes the Sniper configuration specifically for your market
═════════════════════════════════════════════════════════════════════════
█ EXIT MODES 🚪
1) Percentage Targets
Up to 6 TP levels (TP1…TP6) with customizable partial exits
Configure both price distance (%) and position size (%) for each level
Designed for scaling out rather than all-in/all-out
2) Signal Step-Outs
Momentum-shift condition triggers partial exits
Optional higher-timeframe confirmation
"New TP Must Beat Last" prevents weak consecutive exits
3) Opposite Signal
Closes/flips position when the next opposite entry signal appears
Best for trend-following systems
═════════════════════════════════════════════════════════════════════════
█ USE CASES
📈 Trending Markets
Use "Smart" signals + Percentage TPs. Stay aligned with momentum while scaling out at multiple targets. Enable Moving Target trailing to lock in profits.
📉 Ranging / Choppy Markets
Use "Normal" signals (contrarian mode). Catch reversals at range boundaries. Tighter TP targets work better here.
⚡ High Volatility / News Events
Use "HL Sniper" for selective entries. Fewer signals, higher conviction. Wider SL to avoid stop hunts.
🤖 Automation & Bots
Structured alert payloads work with 3Commas, Alertatron, Cornix, TradingConnector, and custom webhooks. One alert contains Entry + 6 TPs + SL.
═════════════════════════════════════════════════════════════════════════
█ HOW TO USE 🔧
Apply to your chart (any timeframe, any market)
Start with Entry Signals = "Normal + Smart", Exit Mode = "Percentage"
Pick your direction (Long / Short / Both)
Adjust signal thresholds and trend filter length to match your style
Configure TP% levels and Qty% — total should sum to 100%
Enable Stop-Loss and choose a trailing mode
Set commission and slippage in Strategy Properties for realistic results
Optional: Enable Auto-Tune for adaptive optimization
═════════════════════════════════════════════════════════════════════════
█ STRATEGY PROPERTIES 📊
Default settings for reproducible backtests:
Initial capital: 10,000 USD
Order size type: Cash
Default order size: 10,000
Process orders on close: Enabled
Pyramiding: Controlled by "Allow Add-On Entries"
For realistic results, set commission and slippage in Strategy Properties to match your broker/exchange.
═════════════════════════════════════════════════════════════════════════
█ ALERTS & AUTOMATION 🔔
The strategy outputs structured alert payloads compatible with:
3Commas, Alertatron, Cornix, TradingConnector, Wunderbit
Custom webhook receivers (JSON format)
Setup: Create alert → Select "Order fills and alert() function calls" → Use {{strategy.order.alert_message}} placeholder
═════════════════════════════════════════════════════════════════════════
█ WORKS ON
Crypto
Forex
Stocks
Indices
Commodities
═════════════════════════════════════════════════════════════════════════
█ OUR PHILOSOPHY 💡
We believe success lies in the trader, not the indicator. Infinity Algo is a decision-support tool — not a crystal ball.
Realistic Expectations:
No strategy wins 100% of the time — Infinity Algo is no exception
Auto-Tune optimizes on past data — it cannot predict the future
Backtest results ≠ live results (fees, slippage, and emotions matter)
Always validate with out-of-sample data before going live
Use proper position sizing and risk management
═════════════════════════════════════════════════════════════════════════
█ LIMITATIONS ⚠️
Backtests are simulations — results depend on market conditions, fees, slippage, and parameters
Auto-Tune can overfit if used without out-of-sample validation
Multi-timeframe exit logic confirms on higher-TF bar closes (slight delay expected)
Use standard candles/bars for strategy testing (avoid Heikin Ashi, Renko)
═════════════════════════════════════════════════════════════════════════
█ DISCLAIMER 📜
This strategy is provided for educational and informational purposes only and does not constitute financial advice. Past performance is not indicative of future results. Trading involves substantial risk of loss, and you are solely responsible for your own trading decisions.
═════════════════════════════════════════════════════════════════════════
NIFTY_2MIN_CVD_short_StrategySummary
This strategy is an intraday system designed for the Nifty index on a 2-minute timeframe, focusing exclusively on identifying high-probability short (sell) entries. It utilizes a combination of rapid price action and Cumulative Volume Delta (CVD) to detect "Buying Absorption" at local peaks.
Concept & Core Logic
The strategy is engineered to identify "Inverted V-shaped" reversals where aggressive buying pressure is exhausted and absorbed by large-scale limit orders from sellers.
Price Action Trigger: The strategy looks for a specific two-part sequence:
Sudden Bullish Movement: A rapid upward move that often traps late buyers or triggers short-covering.
Sudden Reversal: Immediately followed by a strong, high-momentum bearish (red) candle, signaling a swift rejection of the higher prices.
CVD Absorption Filter: To confirm the validity of the reversal, the strategy analyzes the Cumulative Volume Delta (CVD). It identifies instances where the relative movement of the CVD is significantly higher than the corresponding price movement. This specific divergence highlights "Buying Absorption"—a market condition where aggressive market buy orders are being filled by passive limit sell orders, preventing further price appreciation and creating a heavy ceiling for the reversal.
Risk Management
To maintain a disciplined approach, the strategy employs fixed exit parameters based on the underlying Nifty price:
Take Profit: 25 points.
Stop Loss: 30 points.
Intended Use
This tool is intended for traders who study mechanical, rule-based systems and order flow dynamics. It provides a structured framework for observing how volume delta divergence (CVD) and rapid price rejections interact at potential market turning points.
Disclaimer: This script is for educational and informational purposes only. It is not financial advice. All trading involves risk, and past performance is not indicative of future results. Please conduct your own research and backtesting before making any trading decisions.





















