OPEN-SOURCE SCRIPT
GOLDM Regime Detector v2.0

## **GOLDM Regime Detector v2.0**
**Institutional-Grade Options Selling Framework for MCX Gold Mini**
---
### **Overview**
GOLDM Regime Detector v2.0 is a **rule-based decision engine** built for systematic option sellers operating in **MCX Gold Mini (GOLDM)**.
Unlike traditional indicators that generate isolated signals, this framework continuously evaluates market structure and outputs a **complete trading stance** — covering **regime, structure, strike placement, position sizing, and exits**.
The objective is simple:
> **Trade the right structure, in the right environment, with controlled risk.**
---
### **Regime Architecture**
The model classifies market conditions into four execution states:
* **Regime 1 — Premium Selling (Full Size)**
Range-bound market with stable volatility
→ Deploy **Iron Condors / Strangles**
* **Regime 2 — Directional Selling (Full Size)**
Orderly trend with controlled volatility
→ Deploy **Credit Spreads aligned with trend**
* **Regime 3 — Reduced Exposure (Half Size)**
Suboptimal or uncertain conditions
→ Trade **wider strikes with reduced capital**
* **Regime 4 — Defensive Mode**
Volatility expansion or structural break
→ **No new exposure — manage or exit existing positions**
---
### **Model Construction**
The system integrates multiple dimensions of market behavior:
* **Trend** → EMA slope + ADX (direction + strength)
* **Volatility** → ATR percentile + expansion dynamics
* **Positioning** → Bollinger %B (range vs extremes)
* **Time Risk** → Days to Expiry (DTE constraints)
* **Event Risk** → Manual override for macro events
Each regime is triggered only when conditions align across these factors, ensuring **context-aware execution rather than reactive trading**.
---
### **Strike Engineering**
All strike levels are **systematically derived from ATR**, ensuring consistency across volatility regimes:
* Dynamic distance from spot based on regime quality
* Wider strikes in adverse conditions
* Rounded to **MCX-standard 500 intervals**
This removes discretionary bias from strike selection and aligns risk with market conditions.
---
### **Embedded Risk Framework**
The script includes a predefined exit structure:
* **Profit Capture** → 40–50% premium decay
* **Stop Loss** → Premium expansion threshold (2× entry)
* **Time Exit** → Forced closure near expiry
* **Regime Transition** → Automatic shift to defensive posture
* **Partial Management** → Profit lock-in with trailing logic
---
### **Execution Interface**
* Real-time **regime classification**
* **Suggested structure** (IC / spreads)
* **Strike levels plotted on chart**
* **Confidence score**
* **DTE and event warnings**
* Fully integrated **decision dashboard**
---
### **Usage Guidelines**
* Apply on **MCX:GOLDM1! or front-month futures**
* Optimized for **Daily timeframe**
* Execute systematically — **regime → structure → strikes → risk management**
* Designed for traders prioritizing **process over prediction**
---
### **Positioning**
This framework is built for traders who:
* Prefer **structured decision-making over discretionary trading**
* Want **consistency across market regimes**
* Understand that **edge comes from execution discipline, not prediction**
---
### **Disclaimer**
This tool provides a structured framework for decision-making.
Execution, risk management, and capital allocation remain the responsibility of the user.
---
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.