I am unable to get the bid and ask data . I have upstox plus so i should get 30 level depth but i get only 5 levels bid but not ask data
@ARKAPRAVA_50636039 Use mode: full_d30 here. Reference here.
sir i have tried it but still the same and the symbolls often causes problems too like the same would work fine after few hours but not right now symbols like nifty futures or crudeoil ar highly liquid still the problem persists
Then it seems issue in your code rather than APIs.
sir this is the code is used -
import asyncio
import json
import ssl
import websockets
import requests
import MarketDataFeedV3_pb2 as pb
===== CONFIG =====
ACCESS_TOKEN = open(“access_token.txt”).read().strip()
===== AUTHORIZE =====
def get_ws_url():
url = “https://api.upstox.com/v3/feed/market-data-feed/authorize”
headers = {
"Accept": "application/json",
"Authorization": f"Bearer {ACCESS_TOKEN}"
}
res = requests.get(url, headers=headers).json()
return res["data"]["authorized_redirect_uri"]
===== LOAD INSTRUMENT =====
def load_instruments():
with open(“instruments.txt”, “r”) as f:
return [line.strip() for line in f if line.strip()]
===== DECODE =====
def decode(msg):
feed = pb.FeedResponse()
feed.ParseFromString(msg)
return feed
===== MAIN =====
async def connect():
instruments = load_instruments()
print("SUBSCRIBED:", instruments)
ws_url = get_ws_url()
print("WS URL:", ws_url)
ssl_context = ssl._create_unverified_context()
async with websockets.connect(ws_url, ssl=ssl_context) as ws:
print("✅ Connected")
# 🔥 IMPORTANT: use FULL (not full_d30)
sub_msg = {
"guid": "test-feed",
"method": "sub",
"data": {
"mode": "full",
"instrumentKeys": instruments
}
}
await ws.send(json.dumps(sub_msg).encode())
# ===== LOOP =====
while True:
message = await ws.recv()
feed = decode(message)
# ignore heartbeat
if not feed.feeds:
continue
for key, value in feed.feeds.items():
if not value.HasField("ff"):
continue
ff = value.ff
# skip index feed
if not ff.HasField("marketFF"):
continue
market = ff.marketFF
if not market.HasField("marketLevel"):
continue
quotes = market.marketLevel.bidAskQuote
if not quotes:
continue
print("\n==============================")
print(f"{key} | LIVE DEPTH")
print("==============================")
# 🔥 print top levels (stable)
for q in quotes[:5]:
print(
f"BID: {q.bp:<10} ({q.bidQ:<6}) | "
f"ASK: {q.ap:<10} ({q.askQ:<6})"
)
===== RUN =====
asyncio.run(connect())
Use the example code as mentioned above in the link instead of this incorrect vibe code.
Thank you and with due respect sir , do i use the mode: full d30 in the code example you provided me ?
Yes.
Hello,
I depolyedt wo algoverse stratgies But no trade is showing in my account BUT i can see some trade happing . Pls suggest.
Hello @YOGITA_23902663
Can you share your unique 6-digit Upstox ID for us to be able to look into this?
Screenshot will help us further.
We will look into this.
Please note, Algoverse will take trades only when the market conditions for the strategies deployed are satisfied.
Thanks,
Aniruddho Ghosh
Id is 6PBPMZ, I have closed Algo now as there was no proper response from your end , But if you can sort. out. I can start again.
You can see date when I depolyed algo and Algo running time.
Pls call me at 8529567719 for better explanation and discussion.
Hello @YOGITA_23902663 ,
We will get this checked and come back.
Thank you for your prompt response.
Hi @YOGITA_23902663,
Please avoid sharing personal details like your mobile number or email ID publicly on the Community for your own safety.
You can share your UCC instead and we’ll arrange a callback if required. Thank you.
noted with thanks.
Hi,
Any progress on this one.
Hello @YOGITA_23902663 , Good morning!
We checked internally and found that:
- Momentum Options Buying, &
- Nifty Trend Catcher - were the two strategies that were deployed.
These took positions on the day you’d logged in to Algoverse (March 06), and the rest of the days it didnt.
Please note: Logging into Algoverse is necessary for the strategies to take positions.
Else even if the signals are generated, the strategy will not be taking any positions - which is what had happened.
In future, whenever you deploy any strategy - do log in to Algoverse daily, so that whenever the signals are generated - the strategy deployed can take positions.
Thanks,
Aniruddho Ghosh