OPEN-SOURCE SCRIPT
Gold Mining Margin MACRO

Gold Mining Margin Macro Indicator — Description
This indicator measures the structural profitability of gold mining by comparing the gold price with estimated production costs. It is designed as a macro-context tool, not a short-term trading signal.
The script tracks three core components:
Gold − AISC (All-In Sustaining Cost) → proxy for mining profitability
Energy-adjusted mining margin → incorporates oil as a major production cost input
Gold / Oil ratio → intermarket relationship between gold and energy costs
Together, these metrics help visualize the economic pressure or expansion phase of the gold mining sector.
What the indicator measures
The indicator estimates whether gold is trading:
near production-cost pressure levels
in a neutral profitability zone
in a strong mining-profit environment
or in a boom phase
A weekly regime classification is used to reduce noise and focus on macro-cycle conditions rather than short-term price fluctuations.
Primary use case
This indicator is intended to help identify:
potential gold price floor zones
mining-sector stress conditions
cyclical turning points in gold
confirmation context for cycle-based analysis
It works best when combined with:
cycle analysis
intermarket analysis
positioning data
macroeconomic context
Important note
The AISC value is user-defined and represents an approximate global industry cost level, not the cost of a specific mining company.
The indicator is meant to reflect sector-level economics, not individual equities.
This indicator measures the structural profitability of gold mining by comparing the gold price with estimated production costs. It is designed as a macro-context tool, not a short-term trading signal.
The script tracks three core components:
Gold − AISC (All-In Sustaining Cost) → proxy for mining profitability
Energy-adjusted mining margin → incorporates oil as a major production cost input
Gold / Oil ratio → intermarket relationship between gold and energy costs
Together, these metrics help visualize the economic pressure or expansion phase of the gold mining sector.
What the indicator measures
The indicator estimates whether gold is trading:
near production-cost pressure levels
in a neutral profitability zone
in a strong mining-profit environment
or in a boom phase
A weekly regime classification is used to reduce noise and focus on macro-cycle conditions rather than short-term price fluctuations.
Primary use case
This indicator is intended to help identify:
potential gold price floor zones
mining-sector stress conditions
cyclical turning points in gold
confirmation context for cycle-based analysis
It works best when combined with:
cycle analysis
intermarket analysis
positioning data
macroeconomic context
Important note
The AISC value is user-defined and represents an approximate global industry cost level, not the cost of a specific mining company.
The indicator is meant to reflect sector-level economics, not individual equities.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.