Double&Triple Pattern[TS_Indie]📌 Description – Double & Triple Pattern Indicator
The Double & Triple Pattern Indicator is developed to help traders systematically and clearly identify Double Top, Double Bottom, Triple Top, and Triple Bottom chart patterns.
⚙️ Core Logic & Working Mechanism
The Double & Triple Pattern Indicator is built on the concept of price swing formation, based on the logic of Trend Entry_0 , which focuses on structured market analysis and price action behavior.
The indicator detects three main swing points (Swing 1, Swing 2, and Swing 3). A Fibonacci Box is then created using Swing A and Swing B as reference points to define the swing detection zone.
When all three swings remain inside the defined Fibonacci Box, the structure is considered a valid Price Action setup.
The indicator then plots key lines on the chart:
➩ Break Line – used to confirm the signal (confirmation)
➩ Cancel Line – used to invalidate the price action if price moves against the conditions
➛ When price breaks the Break Line , the structure is confirmed and a Pending Order is placed at Swing B , with the Stop Loss set at Swing 1.
➛ If price breaks the Cancel Line first, the price action structure is immediately invalidated.
⚙️ Fibonacci Entry Zone & Change SL Settings
➩ When Fibo Entry Zone is set to 0, the Pending Order is placed directly at Swing B.
➩ When the value is greater than 0, the Pending Order is calculated using Fibonacci levels drawn from Swing B to the Stop Loss level.
➩ Change SL allows switching the Stop Loss reference between Swing 1 and Swing A.
⚙️ Min & Max Control for Swing Size : xATR
When enabling Control Size Swing : xATR , the indicator filters Swing B based on the defined Min and Max range.
This allows traders to selectively test larger or smaller swing-based price actions , depending on their trading strategy.
⭐ Pending Order Cancellation Conditions
A Pending Order will be canceled under the following conditions:
1.A new Price Action signal appears on either the Buy or Sell side.
2.When Time Session is enabled, the Pending Order is canceled once price exits the selected session.
🕹 Order Management Rule
When there is an active open position, the indicator restricts the creation of new Pending Orders to prevent overlapping positions.
💡 Double Pattern Example
💡 Triple Pattern Example
⚠️ Disclaimer
This indicator is designed for technical analysis purposes only and does not constitute investment advice.
Users should apply proper risk management and make decisions at their own discretion.
🥂 Community Sharing
If you find parameter settings that work well or produce strong statistical results, feel free to share them with the community so we can improve and develop this indicator together.
Indicators and strategies
PMax - Asymmetric MultipliersDescription: This script is an enhanced version of the popular PMax (Profit Maximizer) indicator, originally developed by KivancOzbilgic. It has been converted into a full strategy with advanced customization options for backtesting and trend following.
Key Features & Modifications:
Asymmetric ATR Multipliers: Unlike the standard version, this script allows you to set different ATR multipliers for Upper (Short/Resistance) and Lower (Long/Support) bands.
Default Upper: 1.5 (Tighter trailing for Short positions)
Default Lower: 3.0 (Wider trailing for Long positions to avoid whipsaws)
Expanded MA Types: Added HULL (HMA) and VAR (Variable Index Dynamic Average) options.
VAR is highly recommended for filtering out noise in ranging markets.
HULL is ideal for scalping and faster reactions.
Built-in Risk Management: A fixed 5% Stop Loss mechanism is integrated into the strategy. It protects your capital by closing positions if the price moves 5% against you, even if the trend hasn't reversed yet.
Visibility Fix: Solved the issue where the PMax line would disappear or start at zero in the initial bars.
How to Use:
Use the VAR MA type for trend following in volatile markets.
Adjust the "Stop Loss Percent" input to fit your risk appetite.
The strategy employs an "Always In" logic (Long/Short) but respects the hard Stop Loss.
Credits: Original PMax logic by KivancOzbilgic.
Simple ICT Sweep + FVG (LuxAlgo Swings FIXED)something i created if anyone can improve it or change for better visual
Strategy with VWRSI and SAVE orders Long or Short or BothVWRSI is very powerful indicator coded by Algo Alpha and I Make Strategy of it
But there is no stop loss instate the Strategy is using Save orders to minimize the market manipulation
The best to used is side way market with long and short enable
The Strategy trigger long or short market order -
long - ta.crossover(rsi, 20)
short - ta.crossunder(rsi, 80)
And if is not take profit from the first trade start with the save trades until will do
the sum of the first order - base order and the save order can be adjust from the user
as well the deviation from the first order
IF some user have questions let me know
Nuaing Trend Zone + Trade Guide PRO Multi TF + Structure Nuaing Trend Zone + Trade Guide PRO Multi TF + Structure
Buy-Dip / Sell-Pullback Buy the Dip / Sell the Pullback – Trend-Following Strategy (EOD → Next Day Execution)
Overview
This is a trend-following futures strategy designed to participate in pullbacks within established trends, not to predict reversals.
It works on End-of-Day (EOD) confirmation and executes trades on the next trading session, making it suitable for positional and swing traders.
The strategy combines momentum, trend direction, volatility, and price location to filter for high-quality setups while avoiding overtrading.
🔍 Core Philosophy
Trade only in the direction of the prevailing trend
Buy dips in uptrends
Sell pullbacks in downtrends
Avoid chasing price after extended gaps
Use volatility-adjusted risk management (ATR-based SL & targets)
📊 Indicators Used
RSI (20)
Measures underlying momentum strength
Stochastic Oscillator (55, 34, 21)
Confirms pullback exhaustion within a trend
Supertrend (10, 2)
Defines primary trend direction
Bollinger Bands (20, 2)
Provides structural trend bias
ATR (5)
Used for:
Entry gap filter
Stop-loss
Profit target
Supertrend buffer
✅ Long (Buy) Setup – Evaluated at EOD
A long setup is generated when all of the following conditions are satisfied at the close of the trading day:
RSI(20) is above the bullish threshold (default: 48)
Stochastic %K is above %D (confirming pullback momentum)
Supertrend direction is bullish
Price is near or above Supertrend, allowing a volatility-adjusted buffer (ATR-based)
Price is above the Bollinger Band middle line
This combination ensures:
The market is trending up
Momentum supports continuation
The pullback is controlled, not a breakdown
❌ Short (Sell) Setup – Evaluated at EOD
A short setup is generated when:
RSI(20) is below the bearish threshold (default: 52)
Stochastic %K is below %D
Supertrend direction is bearish
Price is near or below Supertrend, with an ATR buffer
Price is below the Bollinger Band middle line
This filters for pullbacks within sustained downtrends.
⏰ Trade Execution Logic (Next Day Rule)
Once a setup is confirmed at EOD, a trade is attempted on the next trading session
To avoid chasing gaps:
Long trades are allowed only if price does not move more than a defined multiple of the previous day’s True Range
Short trades follow the same logic in reverse
This is implemented via limit orders, ensuring realistic backtesting and execution behavior
🛑 Risk Management
All exits are volatility-adjusted using ATR:
Stop-Loss:
1.1 × ATR(5) from entry price
Target:
2.2 × ATR(5) from entry price
This results in a risk–reward ratio of approximately 1:2
ATR is frozen at entry to avoid forward-looking bias.
🧠 Why This Strategy Works
Avoids low-quality trades during consolidation
Participates only when trend + momentum align
Prevents emotional gap-chasing
Adapts automatically to changing volatility
Suitable for index futures and liquid stocks
📌 Recommended Usage
Timeframe: Daily
Instruments:
Index Futures (e.g. NIFTY, BANKNIFTY)
Highly liquid stocks
Market Type: Trending markets
Not ideal for: Sideways or low-volatility environments
⚙️ Customization Tips
You can control trade frequency and aggressiveness by adjusting:
RSI thresholds
Supertrend buffer (ATR multiple)
Gap filter multiplier
Stochastic edge parameter
Looser settings → more trades
Stricter settings → higher selectivity
⚠️ Disclaimer
This strategy is for educational and research purposes only.
Backtest results do not guarantee future performance.
Always validate with paper trading before deploying real capital.
Smart Money Bot [MTF Confluence Edition]Uses multi-time frame analysis and supply and demand strategy.
Best used when swing trading.
Institutional Execution Engine v3 [Nishith Rajwar]
Institutional Execution Engine v3
Market-Structure-Driven Execution Framework (Indicator + Strategy Hybrid)
The **Institutional Execution Engine v3** is a professional-grade execution framework designed to model **how institutional participants interact with liquidity, volatility regimes, and market structure**.
It is built for **index traders, crypto traders, and systematic intraday participants** who require **non-repainting, forward-validated signals** with strict risk control.
This is **not a mashup of indicators**.
Every module is purpose-built and interacts through a unified execution pipeline.
---
🔍 Core Concepts & Methodology
1️⃣ Market Structure & POI Engine
* Identifies **Points of Interest (POIs)** using swing structure, volatility context, and liquidity positioning
* POIs are **confirmed only after bar close** (strict non-repaint enforcement)
* Adaptive pivot sensitivity based on selected execution preset
2️⃣ Liquidity-Aware Scoring System
Each potential trade is filtered through a **multi-factor execution score**, including:
* Structural alignment
* Volatility normalization (ATR regime)
* Liquidity reaction quality
* Directional efficiency
Trades are only allowed when the **minimum institutional score threshold** is met.
3️⃣ Regime Detection (Forward-Walk Safe)
The engine dynamically classifies market conditions into execution regimes:
* Trending
* Rotational
* Mean-reverting
Regime detection is **forward-walk compatible** and does **not leak future data**.
4️⃣ Risk-First Execution Model
* ATR-normalized stop placement
* R-multiple-based take-profit targeting
* Optional **single-trade-per-session guard**
* Strategy engine includes **open-trade protection** to prevent over-execution
5️⃣ Strategy + Indicator Hybrid
This script can be used in **two ways**:
* **Indicator mode** → discretionary execution with visual POIs, signals, and context
* **Strategy mode** → systematic backtesting with full TradingView Strategy Tester support
Both modes share the **same execution logic** (no divergence).
---
⚙️ Preset-Driven Architecture
Built-in execution presets auto-configure internal parameters without changing core logic:
* **Scalp (Index)**
* **Daytrade (Index)**
* **Crypto Intraday**
* **Institutional Research (FWalk)**
Presets adjust pivot sensitivity, score thresholds, ATR behavior, and risk profile — while preserving execution integrity.
---
## 🚫 Non-Repainting & Data Integrity
* No look-ahead bias
* No future bar references
* No repainting signals
* VWAP and regime logic reset correctly per session
* Safe handling of strategy.opentrades to avoid execution errors
All signals are **bar-close confirmed**.
---
📊 Who This Is For
✔ Index traders (NIFTY / BANKNIFTY / SENSEX)
✔ Crypto intraday traders
✔ Systematic traders validating execution logic
✔ Traders who value **structure + liquidity + risk discipline** over indicators
---
⚠️ Disclaimer
This script is a **research and execution framework**, not financial advice.
Always forward-test and adapt risk parameters to your instrument and timeframe.
---
**Author:** Nishith Rajwar
**Version:** v3
**Execution Philosophy:** Trade where institutions execute — not where indicators react.
ARVEXV1“Failed Reversal – Opposite Candle Only (No Doji/Hammer/Hanging Man)”:
This strategy captures failed reversal attempts where the current candle is opposite to the previous candle and volume is higher. It enters long if a bearish candle fails to break a previous bullish candle’s low, and short if a bullish candle fails to break a previous bearish candle’s high. Signals are canceled for Doji, Hammer, or Hanging Man candles. Entries only, fully backtestable.
NQ BB+PS StrategyBollinger Band and ProScalper combined strategy/indicators. Designed to take quick 1:1 Risk to Reward trades. Entry on close of signal bar, set auto SL and TP levels to 50 ticks. If a signal in the opposing direction populates, close open trade and follow current signal or simply reverse positions. There is a "+" Sign above signals that fire in the direction of the current EMA trend signaling an A+ set up. Recommended following the first 4-6 signals of the day prior to 11am before the mid day "chop".
Optimized BTC Mean Reversion (RSI 20/65)📈 Optimized BTC Mean Reversion (RSI 20/65)
Optimized BTC Mean Reversion (RSI 20/65) is a rule-based trading strategy designed to capture mean-reversion moves in strong market structures, primarily optimized for Bitcoin, but adaptable to other liquid cryptocurrencies.
The strategy combines RSI extremes, Stochastic momentum, and EMA trend filtering to identify high-probability reversal zones while maintaining strict risk management.
🔍 Strategy Logic
This system focuses on entering trades when price temporarily deviates from equilibrium, while still respecting the broader trend.
✅ Long Conditions
RSI below 20 (oversold)
Stochastic below 25
Price trading above the 200 EMA (or within a controlled deviation)
Designed to buy sharp pullbacks in bullish conditions
❌ Short Conditions
RSI above 65 (overbought)
Stochastic above 75
Price trading below the 200 EMA
Designed to sell relief rallies in bearish conditions
🛡 Risk Management
Fixed Stop Loss: 4%
Fixed Take Profit: 6%
Risk/Reward: 1 : 1.5
No pyramiding (single position at a time)
Full equity position sizing (adjustable)
All exits are predefined at entry, ensuring consistency and emotional discipline.
📊 Indicators Used
200 EMA – Trend direction filter
RSI (14) – Mean-reversion trigger (20 / 65 levels)
Stochastic Oscillator – Momentum confirmation
👁 Visual Features
EMA plotted directly on chart
Real-time Stop Loss, Take Profit, and Entry Price lines
Clear long/short entry markers
Works on all timeframes (optimized for intraday and swing trading)
🔔 Alerts
Long entry alerts
Short entry alerts
(Perfect for automation or discretionary execution)
⚠️ Disclaimer
This strategy is intended for educational and research purposes only. Past performance does not guarantee future results. Always test on a demo account and adjust risk parameters to your own trading plan.
Hammer/Inv Hammer + ema and other settings + stratok, so thrown everything at this one as the previous only had longs.
so we have all the options, but main feature is the ema to divide up the longs and short, shorts above, longs below, we all know price ends up back to the ema at some point.
I have added a volume filter, this calculates the average volume from the last "20" candles (which can be adjusted) then when a hammer appears it has to be larger than the average volume to be valid.
Also added trading hours in, if you are switching between RTH and ETH it can cause issue if it enters a position EOD then you get an anomaly trade as we can hold positions past certain times.
Also added some trading strategy, so after 2 wins it wont trade again that day or after 1 loss. you decide.
So much to play with now.
ALT Risk Strategy with Fear & Greed + ISM PMI📊 Overview
This advanced crypto trading strategy combines multiple macro indicators to identify optimal buy and sell zones for altcoins. It tracks the relationship between altcoin performance versus Bitcoin (ALT/BTC pairs) while incorporating broader market sentiment and economic data to generate risk-adjusted entry and exit signals.
🎯 Core Methodology
Base Risk Metric (65% weight):
MACD Momentum (5%): Normalized trend strength on weekly ALT/BTC pair
RSI (60%): Relative strength indicating overbought/oversold conditions
Price Deviation (35%): Distance from 150-period moving average
Fear & Greed Index (20% weight):
Analyzes market sentiment using multiple factors:
Price momentum and rate of return
Money flow and volume analysis
Volatility metrics (crypto: BVOL24H, traditional: VIX)
Dominance indicators (crypto: BTC.D, traditional: Gold)
Two modes: Crypto-focused or Traditional markets
Customizable smoothing and weighting
US ISM PMI Integration (15% weight):
Manufacturing economic indicator (contraction vs expansion)
PMI < 50 = Economic weakness = Better crypto buying opportunities
PMI > 50 = Economic strength = Risk-on environment
Configurable offset to lead/lag the signal
Daily data smoothed over customizable period
💰 Trading Logic
Tiered Buy System:
Level 1 (Risk < 70): Initial entry with conservative amount
Level 2 (Risk < 50): Double down as risk decreases
Level 3 (Risk < 30): Maximum accumulation at extreme lows
All purchases customizable by dollar amount
Tiered Sell System:
Level 1 (Risk > 70): Take partial profits (default 25%)
Level 2 (Risk > 85): Continue scaling out (default 35%)
Level 3 (Risk > 100): Final exit (default 40%)
Sells reset when new buys occur (can re-accumulate)
⚙️ Key Features
Multi-Asset Support: ETH, SOL, ADA, LINK, UNI, XRP, DOGE, AVAX, MATIC, RENDER, or custom
Exchange Selection: Works with Binance, Coinbase, Kraken, Bitfinex, Bybit
3Commas Integration: Optional webhook alerts for automated bot trading
Visual Risk Zones: Color-coded indicator (green/lime/yellow/orange/red/maroon)
Real-time Info Table: Displays current risk metric, F&G index, PMI value, weights, and position status
Flexible Weighting: Adjust influence of each component (Base/F&G/PMI)
Weekly Timeframe: Reduces noise and focuses on macro trends
📈 Use Cases
DCA Strategy: Dollar-cost averaging with intelligent timing
Swing Trading: Catching major market cycles (weeks to months)
Risk Management: Exit before major downturns, enter during fear
Macro Trading: Align crypto positions with economic conditions
Bot Automation: Connect to 3Commas for hands-free execution
🎓 Credits & Attribution
Original Concept & Base Risk Metric:
Inspired by community-developed ALT/BTC risk oscillators
Fear & Greed methodology adapted from crypto market sentiment research
Enhancements & Integration:
ISM PMI integration and weighting system
Multi-indicator combination framework
Tiered buy/sell logic with reset mechanism
3Commas webhook integration
Development:
Primary Development: Claude AI (Anthropic)
Collaboration & Testing: User feedback and iteration
Pine Script Implementation: TradingView v5
⚠️ Disclaimer
This strategy is for educational and informational purposes only. Past performance does not guarantee future results. Cryptocurrency trading involves substantial risk of loss. Always conduct your own research and consider your risk tolerance before trading. The strategy uses lagging indicators (weekly timeframe) which may not react quickly to sudden market changes.
🔧 Recommended Settings
For better performance than default conservative settings:
Increase buy amounts: Try $50/$75/$100 for more meaningful positions
Adjust thresholds: Consider 40/60/80 for more frequent entries
Test different weights: Experiment with F&G and PMI influence
Optimize for your asset: Different cryptos may require different parameters
Version: 1.0
Last Updated: December 2025
Compatible With: TradingView Pine Script v5
Slope Failure (Momentum Stall) STRATEGY//======================================================================================
// SLOPE FAILURE (MOMENTUM STALL) STRATEGY
//--------------------------------------------------------------------------------------
// WHAT THIS STRATEGY DOES
// -----------------------
// This strategy trades **momentum failure**, not trend direction.
//
// Instead of predicting where price will go, it detects when **momentum can no longer
// continue in its current direction** and briefly fades that failure.
//
// Core idea:
// - Momentum expands → slope grows
// - Momentum stalls → slope collapses or flips
// - That stall represents **state transition**, not noise
//
// The system exploits these transitions repeatedly at short horizons.
//
//--------------------------------------------------------------------------------------
// HOW MOMENTUM IS MEASURED
// ------------------------
// 1. Source price (optionally smoothed)
// 2. First derivative (slope = price - price )
// 3. Optional smoothing of the slope itself
//
// The slope represents **instantaneous directional force**, not trend bias.
//
//--------------------------------------------------------------------------------------
// ENTRY LOGIC (SLOPE FAILURE)
// ---------------------------
// • Bull Slope Failure (SHORT):
// - Prior slope was sufficiently positive
// - Current slope collapses to zero or below
// → Upward momentum failed → enter SHORT
//
// • Bear Slope Failure (LONG):
// - Prior slope was sufficiently negative
// - Current slope rises to zero or above
// → Downward momentum failed → enter LONG
//
// Optional:
// - Minimum slope band can be enforced to avoid weak/noisy failures
//
//--------------------------------------------------------------------------------------
// EXIT LOGIC
// ----------
// Primary exits are **force-based**, not price-based:
//
// • Longest Slope Local Turn (optional):
// - Detects when the strongest slope in a recent window has occurred
// - Exits when momentum starts decaying from that extreme
//
// • Percent Stop Loss (optional):
// - Fixed % protection relative to entry price
//
// The strategy does NOT rely on profit targets.
// Winners are exited when **momentum decays**, not when price "looks good".
//
//--------------------------------------------------------------------------------------
// POSITION SIZING
// ---------------
// This strategy supports **percent-of-equity sizing**, computed dynamically:
//
// position size = (account equity × % allocation) / price
//
// This allows:
// - P&L to scale smoothly
// - Drawdowns to remain proportional
// - The same logic to work across symbols and account sizes
//
//--------------------------------------------------------------------------------------
// STRATEGY CHARACTERISTICS
// ------------------------
// • High trade count
// • Win rate near ~45–50%
// • Small, fast losers
// • Slightly larger winners
// • Very low drawdown
//
// This profile is intentionally designed for **scalability**, not prediction.
//
//--------------------------------------------------------------------------------------
// IMPORTANT NOTES
// ---------------
// • This is NOT a trend-following strategy
// • This is NOT a mean-reversion guess
// • This is a momentum **state-transition detector**
//
// The edge comes from structure + exits + sizing — not indicators.
//
//======================================================================================
VWAP Mean Reversion (RSI + Deviation + ATR Risk)33this is an indicator that relies on other indicators. it relies on volume price action fvgs.OBS. and standard deviations.
Hammer Strategy (CLOSE ON NEXT BAR) [WORKING]Adjustable hammer and inverted hammer candle
Ham? INV? is the hammer
Entry on HAM, INV OR HAM?, INV? close next bar
Hammer Breakout (Adjustable RR)Hammer candle detection and strat for back testing.
diamond indicates a detected hammer candle, the position is entered at the hammer candle close.
Stop loss below the hammer candle wick.
Adjustbale rr based on the distance to the stop (bottom of wick)
Crypto LONG PYThis trading approach is a powerful combination of technical tools aimed at taking advantage of market fluctuations with precision and reliability. By integrating Bollinger Bands (BB), the Relative Strength Index (RSI), Exponential Moving Averages (EMA), and Fibonacci retracement levels (Fib), we create a strategy that captures key market moves and helps identify optimal entry and exit points, all within the context of the New York market conditions (NY).
Bollinger Bands provide insight into market volatility, offering signals about potential extreme price movements. The RSI is used to measure momentum and assess overbought or oversold conditions, indicating when the market might be nearing a reversal. Meanwhile, EMAs add a layer of smoothing, allowing us to observe short- and medium-term trends, helping filter out false signals and providing a clearer view of the overall market direction.
Additionally, Fibonacci retracements are integrated to identify key support and resistance levels, pinpointing potential areas of price retracement and continuation. When combined, these indicators offer a holistic approach to navigating the markets, enabling traders to make data-driven, informed decisions.
This approach is ideal for traders looking for a meticulous methodology for trading during the NY session, where liquidity and volatility tend to be at their highest. Leverage the synergy between these indicators to optimize your trading strategy and maximize your market performance.
ARVEX V1“Failed Reversal – Opposite Candle Only (No Doji/Hammer/Hanging Man)”:
This strategy captures failed reversal attempts where the current candle is opposite to the previous candle and volume is higher. It enters long if a bearish candle fails to break a previous bullish candle’s low, and short if a bullish candle fails to break a previous bearish candle’s high. Signals are canceled for Doji, Hammer, or Hanging Man candles. Entries only, fully backtestable.
Ribbon Cross Strategy This strategy uses a simple moving-average ribbon crossover system with a customizable entry filter. You can choose whether trades trigger near the fast or slow average, allowing flexibility in capturing early or confirmed trend moves.
It’s best suited for index trading on intraday timeframes , helping identify short-term trend reversals and continuations with clear visual cues and backtestable logic.
Capitulation Detector StrategyA multi-factor capitulation detector designed to identify exhaustion points in extended trends. It focuses on fading capitulation moves after multi-leg trends with extreme volume and price extension.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
THE CONCEPT
Capitulation occurs when the last holders give up — panic selling into lows or euphoric buying into highs. These moments create asymmetric opportunities because:
Sentiment becomes maximally skewed
Weak hands are flushed out
Price deviates far from equilibrium
The "fuel" for continuation is exhausted
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
THE 6 FACTORS
Trend Persistence — Price stays on one side of 38 EMA for 12+ bars, confirming a sustained directional move
Acceleration — Price stays on one side of 5 EMA for 3+ bars, showing the move is accelerating into exhaustion
Volume Spike — Current bar volume ≥ 2x the 20-bar average
Body Expansion — Candle body ≥ 1.5x average, showing conviction/panic in the move
Extension — Price is 2+ ATR away from the 38 EMA, indicating overextension from equilibrium
Multi-Leg Structure — At least 3 consecutive lower lows (for longs) or higher highs (for shorts)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SIGNAL LOGIC
Bullish Capitulation: 4+ factors align + price below 38 EMA + down candle + volume spike
Bearish Capitulation: 4+ factors align + price above 38 EMA + up candle + volume spike
The strategy enters counter-trend, fading the exhaustion move.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EXIT OPTIONS
ATR-based stop loss (default: 2 ATR)
ATR-based take profit (default: 3 ATR)
Optional trailing stop
Time filter for session-specific trading
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
BEST PRACTICES
Works best on liquid instruments with clean trends
More reliable after 3+ legs in the trend
Higher conviction when daily AND intraday timeframes align
"The bigger and more extended, the better"
Consider VWAP as additional confirmation (not coded here)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SETTINGS GUIDE
Min Score: Increase for fewer, higher-quality signals
Volume Spike Multiplier: 2x; increase for stricter filter
Extension ATR: Higher values = more overextended setups only
Trend Bars Min: Higher values = longer established trends required
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ALERTS
Bullish Capitulation (potential long)
Bearish Capitulation (potential short)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
DISCLAIMER
This is a counter-trend strategy — inherently higher risk than trend-following. Always use proper position sizing and risk management. Backtest thoroughly on your specific instruments and timeframes.
MNO_2Step_Strategy_MOU_KAKU (Publish-Clear)//@version=5
strategy("MNO_2Step_Strategy_MOU_KAKU (Publish-Clear)", overlay=true, pyramiding=0,
max_labels_count=500, max_lines_count=500,
initial_capital=100000,
default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// =========================
// Inputs
// =========================
emaSLen = input.int(5, "EMA Short (5)")
emaMLen = input.int(13, "EMA Mid (13)")
emaLLen = input.int(26, "EMA Long (26)")
macdFast = input.int(12, "MACD Fast")
macdSlow = input.int(26, "MACD Slow")
macdSignal = input.int(9, "MACD Signal")
macdZeroTh = input.float(0.2, "MOU: MACD near-zero threshold", step=0.05)
volLookback = input.int(5, "Volume MA days", minval=1)
volMinRatio = input.float(1.3, "MOU: Volume ratio min", step=0.1)
volStrong = input.float(1.5, "Strong volume ratio (Breakout/KAKU)", step=0.1)
volMaxRatio = input.float(3.0, "Volume ratio max (filter)", step=0.1)
wickBodyMult = input.float(2.0, "Pinbar: lowerWick >= body*x", step=0.1)
pivotLen = input.int(20, "Resistance lookback", minval=5)
pullMinPct = input.float(5.0, "Pullback min (%)", step=0.1)
pullMaxPct = input.float(15.0, "Pullback max (%)", step=0.1)
breakLookbackBars = input.int(5, "Pullback route: valid bars after break", minval=1)
// --- Breakout route (押し目なし初動ブレイク) ---
useBreakoutRoute = input.bool(true, "Enable MOU Breakout Route (no pullback)")
breakConfirmPct = input.float(0.3, "Break confirm: close > R*(1+%)", step=0.1)
bigBodyLookback = input.int(20, "Break candle body MA length", minval=5)
bigBodyMult = input.float(1.2, "Break candle: body >= MA*mult", step=0.1)
requireCloseNearHigh = input.bool(true, "Break candle: close near high")
closeNearHighPct = input.float(25.0, "Close near high threshold (% of range)", step=1.0)
allowMACDAboveZeroInstead = input.bool(true, "Breakout route: allow MACD GC above zero instead")
// 表示
showEMA = input.bool(true, "Plot EMAs")
showMouLabels = input.bool(true, "Show MOU/MOU-B labels")
showKakuLabels = input.bool(true, "Show KAKU labels")
showDebugTbl = input.bool(true, "Show debug table (last bar)")
showStatusLbl = input.bool(true, "Show status label (last bar always)")
locChoice = input.string("Below Bar", "Label location", options= )
lblLoc = locChoice == "Below Bar" ? location.belowbar : location.abovebar
// =========================
// 必ず決済が起きる設定(投稿クリア用)
// =========================
enableTPSL = input.bool(true, "Enable TP/SL")
tpPct = input.float(2.0, "Take Profit (%)", step=0.1, minval=0.1) // ←投稿クリア向けに近め
slPct = input.float(1.0, "Stop Loss (%)", step=0.1, minval=0.1) // ←投稿クリア向けに近め
maxHoldBars = input.int(30, "Max bars in trade (force close)", minval=1)
entryMode = input.string("MOU or KAKU", "Entry trigger", options= )
// ✅ 保険:トレード0件を避ける(投稿クリア用)
// 1回でもクローズトレードができたら自動で沈黙
publishAssist = input.bool(true, "Publish Assist (safety entry if 0 trades)")
// =========================
// EMA
// =========================
emaS = ta.ema(close, emaSLen)
emaM = ta.ema(close, emaMLen)
emaL = ta.ema(close, emaLLen)
plot(showEMA ? emaS : na, color=color.new(color.yellow, 0), title="EMA 5")
plot(showEMA ? emaM : na, color=color.new(color.blue, 0), title="EMA 13")
plot(showEMA ? emaL : na, color=color.new(color.orange, 0), title="EMA 26")
emaUpS = emaS > emaS
emaUpM = emaM > emaM
emaUpL = emaL > emaL
goldenOrder = emaS > emaM and emaM > emaL
above26_2days = close > emaL and close > emaL
baseTrendOK = (emaUpS and emaUpM and emaUpL) and goldenOrder and above26_2days
// =========================
// MACD
// =========================
= ta.macd(close, macdFast, macdSlow, macdSignal)
macdGC = ta.crossover(macdLine, macdSig)
macdUp = macdLine > macdLine
macdNearZero = math.abs(macdLine) <= macdZeroTh
macdGCAboveZero = macdGC and macdLine > 0 and macdSig > 0
macdMouOK = macdGC and macdNearZero and macdUp
macdBreakOK = allowMACDAboveZeroInstead ? (macdMouOK or macdGCAboveZero) : macdMouOK
// =========================
// Volume
// =========================
volMA = ta.sma(volume, volLookback)
volRatio = volMA > 0 ? (volume / volMA) : na
volumeMouOK = volRatio >= volMinRatio and volRatio <= volMaxRatio
volumeStrongOK = volRatio >= volStrong and volRatio <= volMaxRatio
// =========================
// Candle patterns
// =========================
body = math.abs(close - open)
upperWick = high - math.max(open, close)
lowerWick = math.min(open, close) - low
pinbar = (lowerWick >= wickBodyMult * body) and (lowerWick > upperWick) and (close >= open)
bullEngulf = close > open and close < open and close >= open and open <= close
bigBull = close > open and open < emaM and close > emaS and (body > ta.sma(body, 20))
candleOK = pinbar or bullEngulf or bigBull
// =========================
// Resistance / Pullback route
// =========================
res = ta.highest(high, pivotLen)
pullbackPct = res > 0 ? (res - close) / res * 100.0 : na
pullbackOK = pullbackPct >= pullMinPct and pullbackPct <= pullMaxPct
brokeRes = ta.crossover(close, res )
barsSinceBreak = ta.barssince(brokeRes)
afterBreakZone = (barsSinceBreak >= 0) and (barsSinceBreak <= breakLookbackBars)
pullbackRouteOK = afterBreakZone and pullbackOK
// =========================
// Breakout route (押し目なし初動ブレイク)
// =========================
breakConfirm = close > res * (1.0 + breakConfirmPct / 100.0)
bullBreak = close > open
bodyMA = ta.sma(body, bigBodyLookback)
bigBodyOK = bodyMA > 0 ? (body >= bodyMA * bigBodyMult) : false
rng = math.max(high - low, syminfo.mintick)
closeNearHighOK = not requireCloseNearHigh ? true : ((high - close) / rng * 100.0 <= closeNearHighPct)
mou_breakout = useBreakoutRoute and baseTrendOK and breakConfirm and bullBreak and bigBodyOK and closeNearHighOK and volumeStrongOK and macdBreakOK
mou_pullback = baseTrendOK and volumeMouOK and candleOK and macdMouOK and pullbackRouteOK
mou = mou_pullback or mou_breakout
// =========================
// KAKU (Strict): 8条件 + 最終三点
// =========================
cond1 = emaUpS and emaUpM and emaUpL
cond2 = goldenOrder
cond3 = above26_2days
cond4 = macdGCAboveZero
cond5 = volumeMouOK
cond6 = candleOK
cond7 = pullbackOK
cond8 = pullbackRouteOK
all8_strict = cond1 and cond2 and cond3 and cond4 and cond5 and cond6 and cond7 and cond8
final3 = pinbar and macdGCAboveZero and volumeStrongOK
kaku = all8_strict and final3
// =========================
// Entry (strategy)
// =========================
entrySignal = entryMode == "KAKU only" ? kaku : (mou or kaku)
canEnter = strategy.position_size == 0
newEntryKaku = canEnter and kaku and entrySignal
newEntryMouB = canEnter and (not kaku) and mou_breakout and entrySignal
newEntryMou = canEnter and (not kaku) and mou_pullback and entrySignal
// --- Publish Assist(保険エントリー) ---
// 条件が厳しすぎて「トレード0件」だと投稿時に警告が出る。
// closedtradesが0の間だけ、軽いEMAクロスで1回だけ拾う(その後は沈黙)。
assistFast = ta.ema(close, 5)
assistSlow = ta.ema(close, 20)
assistEntry = publishAssist and strategy.closedtrades == 0 and canEnter and ta.crossover(assistFast, assistSlow)
// 実エントリー
if newEntryKaku or newEntryMouB or newEntryMou or assistEntry
strategy.entry("LONG", strategy.long)
// ラベル(視認)
if showMouLabels and newEntryMou
label.new(bar_index, low, "猛(IN)", style=label.style_label_up, color=color.new(color.lime, 0), textcolor=color.black)
if showMouLabels and newEntryMouB
label.new(bar_index, low, "猛B(IN)", style=label.style_label_up, color=color.new(color.lime, 0), textcolor=color.black)
if showKakuLabels and newEntryKaku
label.new(bar_index, low, "確(IN)", style=label.style_label_up, color=color.new(color.yellow, 0), textcolor=color.black)
if assistEntry
label.new(bar_index, low, "ASSIST(IN)", style=label.style_label_up, color=color.new(color.aqua, 0), textcolor=color.black)
// =========================
// Exit (TP/SL + 強制クローズ)
// =========================
inPos = strategy.position_size > 0
tpPx = inPos ? strategy.position_avg_price * (1.0 + tpPct/100.0) : na
slPx = inPos ? strategy.position_avg_price * (1.0 - slPct/100.0) : na
if enableTPSL
strategy.exit("TP/SL", from_entry="LONG", limit=tpPx, stop=slPx)
// 最大保有バーで強制決済(これが「レポート無し」回避の最後の保険)
var int entryBar = na
if strategy.position_size > 0 and strategy.position_size == 0
entryBar := bar_index
if strategy.position_size == 0
entryBar := na
forceClose = inPos and not na(entryBar) and (bar_index - entryBar >= maxHoldBars)
if forceClose
strategy.close("LONG")
// =========================
// 利確/損切/強制クローズのラベル
// =========================
closedThisBar = (strategy.position_size > 0) and (strategy.position_size == 0)
avgPrev = strategy.position_avg_price
tpPrev = avgPrev * (1.0 + tpPct/100.0)
slPrev = avgPrev * (1.0 - slPct/100.0)
hitTP = closedThisBar and high >= tpPrev
hitSL = closedThisBar and low <= slPrev
// 同一足TP/SL両方は厳密に判断できないので、表示は「TP優先」で簡略(投稿ギリギリ版)
if hitTP
label.new(bar_index, high, "利確", style=label.style_label_down, color=color.new(color.lime, 0), textcolor=color.black)
else if hitSL
label.new(bar_index, low, "損切", style=label.style_label_up, color=color.new(color.red, 0), textcolor=color.white)
else if closedThisBar and forceClose
label.new(bar_index, close, "時間決済", style=label.style_label_left, color=color.new(color.gray, 0), textcolor=color.white)
// =========================
// Signals (猛/猛B/確)
// =========================
plotshape(showMouLabels and mou_pullback and not kaku, title="MOU_PULLBACK", style=shape.labelup, text="猛",
color=color.new(color.lime, 0), textcolor=color.black, location=lblLoc, size=size.tiny)
plotshape(showMouLabels and mou_breakout and not kaku, title="MOU_BREAKOUT", style=shape.labelup, text="猛B",
color=color.new(color.lime, 0), textcolor=color.black, location=lblLoc, size=size.tiny)
plotshape(showKakuLabels and kaku, title="KAKU", style=shape.labelup, text="確",
color=color.new(color.yellow, 0), textcolor=color.black, location=lblLoc, size=size.small)
// =========================
// Alerts
// =========================
alertcondition(mou, title="MNO_MOU", message="MNO: MOU triggered")
alertcondition(mou_breakout, title="MNO_MOU_BREAKOUT", message="MNO: MOU Breakout triggered")
alertcondition(mou_pullback, title="MNO_MOU_PULLBACK", message="MNO: MOU Pullback triggered")
alertcondition(kaku, title="MNO_KAKU", message="MNO: KAKU triggered")
alertcondition(assistEntry, title="MNO_ASSIST_ENTRY", message="MNO: ASSIST ENTRY (publish safety)")
// =========================
// Status label(最終足に必ず表示)
// =========================
var label status = na
if showStatusLbl and barstate.islast
label.delete(status)
statusTxt =
"MNO RUNNING " +
"ClosedTrades: " + str.tostring(strategy.closedtrades) + " " +
"BaseTrend: " + (baseTrendOK ? "OK" : "NO") + " " +
"MOU: " + (mou ? "YES" : "no") + " (猛=" + (mou_pullback ? "Y" : "n") + " / 猛B=" + (mou_breakout ? "Y" : "n") + ") " +
"KAKU: " + (kaku ? "YES" : "no") + " " +
"VolRatio: " + (na(volRatio) ? "na" : str.tostring(volRatio, format.mintick)) + " " +
"Pull%: " + (na(pullbackPct) ? "na" : str.tostring(pullbackPct, format.mintick)) + " " +
"Pos: " + (inPos ? "IN" : "OUT")
status := label.new(bar_index, high, statusTxt, style=label.style_label_left, textcolor=color.white, color=color.new(color.black, 0))
// =========================
// Debug table(最終足のみ)
// =========================
var table t = table.new(position.top_right, 2, 14, border_width=1, border_color=color.new(color.white, 60))
fRow(_name, _cond, _r) =>
bg = _cond ? color.new(color.lime, 70) : color.new(color.red, 80)
tx = _cond ? "OK" : "NO"
table.cell(t, 0, _r, _name, text_color=color.white, bgcolor=color.new(color.black, 0))
table.cell(t, 1, _r, tx, text_color=color.white, bgcolor=bg)
if showDebugTbl and barstate.islast
table.cell(t, 0, 0, "MNO Debug", text_color=color.white, bgcolor=color.new(color.black, 0))
table.cell(t, 1, 0, "", text_color=color.white, bgcolor=color.new(color.black, 0))
fRow("BaseTrend", baseTrendOK, 1)
fRow("MOU Pullback", mou_pullback, 2)
fRow("MOU Breakout", mou_breakout, 3)
fRow("Break confirm", breakConfirm, 4)
fRow("Break big body", bigBodyOK, 5)
fRow("Break close high", closeNearHighOK, 6)
fRow("Break vol strong", volumeStrongOK, 7)
fRow("Break MACD", macdBreakOK, 8)
fRow("KAKU all8", all8_strict, 9)
fRow("KAKU final3", final3, 10)
fRow("AssistEntry", assistEntry, 11)
fRow("ClosedTrades>0", strategy.closedtrades > 0, 12)






















