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.
---
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.