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.
---
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。