Market feed : adding new instrument after feed.run_forever()

As per your market feed
live data is comming to specify instruement but after some time/logic i want to add another instruement also.
but give me only previous instruement result. not appended result show as output. how to solve it?

Hello @bhadreshakomal

Welcome to Dhan Community!

You can do the same by using subscribe_instruments packet in Python library to subscribe to additional instruments, while the socket is running.

Thanks for reply.
but i clearly not understand how to use “subscribe_instruments”
any example? or any video by DHAN? (like marketfeed example in github)

Hello @bhadreshakomal

Do not have examples for this at the moment. Maybe someone from community can help you here? @Sammy

@Hardik , facing same issue. unable to subscribe after feed is started and running.

If possible give some examples or link for it

@Dhan , @Dhan_Cares , @PravinJ , @t7support , @Sammy , @Shally

Thanks

@TraderX I don’t have any sample code. Am not using marketfeed api for my trading.

1 Like

Hi @t7support , Thanks for the reply.

From one of your replies in other app’s community forum, I could see that you primarily do option buying either thru tradingview/dhan platforms/ direct api’s as well. how do you manage to get latest ltp and option greeks without websockets? do you utilize any other api endpoints in dhan for it?

Just asking, since I am cracking my head around building by own trading software for personal use. @Dhan @PravinJ Dhan’s API’s are good. but the wss needs some basic improvements. via DhanSDK @Hardik , once feed is started, unable to subscribe/unsubscribe on the go. only option is to stop and restart. Hope they fix it. I could see that this issue is open for months now

Yes all trend following, momentum strategies executed by option buying happens from tradingview. No external data feed needed here.

For my automated option selling on expiry days I make a simple http call to fetch intraday historical data and place orders via Trading Api. Here also therefore live market feed via websockets not needed. I also don’t look for greeks.

1 Like

Sorry for delayed response. you can not get any option greek data from API. I tried to get it from 4-5 Brokers but none of them provided it.

True. It is just on and off and since i performed on it single index , so there is nothing much to choose for me.

Let me know if there is any issues you are facing.

2 Likes

Hey, does dhan api provides- different countries indexes data also? like we see on dhan broker terminal?

No, as of now it is limited to Indian Index.