Silvara-Mcx-Comex

358
Silvara MCX-COMEX Arbitrage Monitor

This indicator tracks the price gap between India's MCX and the international COMEX market for Silver and Gold. It converts the COMEX price to Indian rupees (INR), adds import duty, and compares it with the live MCX price. It shows how much MCX is trading at a premium or discount to the international price, which is the gap arbitrage traders watch.

WHAT IT SHOWS
A dashboard in the centre of the chart with three sections:
- Silver Deviation and Gold Deviation: COMEX day-change %, MCX day-change %, the difference between them, the converted landed price and MCX price in INR, and the live percentage gap.
- Ratio Dashboard: daily open, high, low and close of Gold/Silver, Gold/Platinum and Platinum/Silver.

HOW IT IS CALCULATED
1. Daily divergence % = COMEX % change since the previous day's close minus MCX % change since the previous day's close, calculated separately for Silver and Gold.
2. Landed price (INR):
- Silver (per kg) = COMEX USD/oz x USDINR x (1000 / 31.1034768) x (1 + duty%)
- Gold (per 10 g) = COMEX USD/oz x USDINR x (100 / 311) x (1 + duty%)
3. Difference (INR) = landed price minus MCX price.
4. Difference % = difference / MCX price x 100.
Import duty is an input (default 15%).

Symbols used: MCX:SILVER1!, MCX:GOLD1!, COMEX:SI1!, COMEX:GC1!, VANTAGE:USDINR, TVC:GOLD/TVC:SILVER, TVC:GOLD/TVC:PLATINUM, TVC:PLATINUM/TVC:SILVER.

ALERTS
1. Timer-lock alerts (the main feature). The daily divergence % is split into bands at every 0.5 level from +5.0 to -5.0, each band 0.2 wide (level +/- 0.1). The landed-price difference % is split into bands at every 0.5 level from -1.5 to -15.0, also 0.2 wide. Instead of alerting every time a value touches a band, the script alerts once, only after the value has stayed continuously inside the same band for a set number of seconds (3 to 300, default 30). Leaving the band resets the timer. This gives one alert per sustained stay instead of repeated alerts when the value flickers around a band edge. It runs separately for Silver and Gold, and for both measures. The alert conditions are "Silver / Gold Deviation Timer Locked" and "COMEX-MCX Deviation Timer Locked".
2. Touch alerts on the INR difference. Set your own Entry Upside, Exit and Entry Downside levels for Silver and Gold. These trigger immediately on a cross.
3. Ratio alerts. Set your own Buy, Sell and Free levels for Gold/Silver, Gold/Platinum and Platinum/Silver. Buy triggers when the ratio crosses down through the level, Sell when it crosses up, and Free on a cross in either direction.

HOW TO USE
1. Add the indicator to any chart. The dashboard is drawn in the centre of the chart.
2. Set Import Duty % to match your own landed-cost assumption.
3. Set "Target seconds to lock" for each timer-lock alert in the Timer Settings groups.
4. Set your touch and ratio levels in the alert input groups (default 0 means unused).
5. Create an alert on this indicator and pick the condition you want.

LIMITATIONS
- Continuous front-month contracts (1!) can be in different contract months on MCX and COMEX, and can show gaps at roll time.
- Import duty is a manual input. GST, freight, premiums and dealer margins are not included, so real landed cost will differ.
- COMEX symbols need the appropriate CME market data on your TradingView plan.
- Timer-lock logic runs only on realtime updates, not on historical bars. Its timers reset when the script reloads.
- Timer-lock bands cover -5 to +5 for the daily divergence and only -1.5 to -15 for the landed-price difference. Positive landed-price premiums are not covered by timer-lock alerts.
- Alert messages are fixed text and do not include the live value.
- For monitoring only. Not financial advice.

SOURCE CODE
This script is open-source, so you can check the calculations and reuse them with credit.

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.