Hi Team,
Trying to fetch the future contracts so that i can construct the option symbols but when try to fetch the details usign this code:
import pandas as pd
import requests, gzip, io
print(“
OpenAlgo Python Bot is running.”)
UPSTOX_INSTRUMENT_URL = (
"https://assets.upstox.com/market-quote/instruments/exchange/complete.csv.gz"
)
def load_instruments():
r = requests.get(UPSTOX_INSTRUMENT_URL)
r.raise_for_status()
with gzip.open(io.BytesIO(r.content), "rt") as f:
df = pd.read_csv(f)
print("Loaded instruments:", len(df))
return df
df_instruments = load_instruments()
mcx_all = df_instruments[df_instruments[“exchange”] == “MCX”]
print(“Total MCX rows:”, len(mcx_all))
print(“\nUnique instrument_type values in MCX:”)
print(mcx_all[“instrument_type”].value_counts())
print(“\nSample MCX rows (10):”)
print(
mcx_all\[
\["tradingsymbol", "instrument_type", "expiry", "strike", "option_type"\]
\].head(10)
)
print(“\nSample MCX FUT-like rows (contains ‘FUT’):”)
print(
mcx_all\[
mcx_all\["tradingsymbol"\].str.contains("FUT", case=False, na=False)
\]\[
\["tradingsymbol", "instrument_type", "expiry"\]
\].head(20)
)
Gettign below message:
Loaded instruments: 133702
Total MCX rows: 0
Unique instrument_type values in MCX:
Series(, Name: count, dtype: int64)
Sample MCX rows (10):
Empty DataFrame
Columns: [tradingsymbol, instrument_type, expiry, strike, option_type]
Index:
Sample MCX FUT-like rows (contains ‘FUT’):
Empty DataFrame
Columns: [tradingsymbol, instrument_type, expiry]
Index:
so it snot able to fidn the future contracts.
I searched on google and found this:
Upstox API support for MCX trading is often disabled by default for many accounts, even if it is enabled in the standard trading terminal
can anyone please help.