Get Quote Market Data Api?

sanind shared this question 14 months ago
Answered

I have real time and historical subscriptions via Fyers.

I am using python https://pypi.org/project/truedata-ws/

How to get LTP for any symbols for one time in the script. Is there any API for this?

subscribing to real-time for one-time purpose does not look good. Is there any better way please let me know. Thanks

Replies (1)

photo
1

You can get the LTP for one time in a scrip by using the specific number of bars historical API and setting the no. of bars=1.

Please refer the documentation portion as mentioned below:-

  • Using a specific number of bars (Enabled for Tick, 1 min & EOD bars)

You can specify the number of bars (or ticks) which you want to see or use in your code. This is currently enabled for Ticks , 1 min bars & EOD Bars.

hist_data_6=td_app.get_n_historical_bars(symbol, no_of_bars=1, bar_size='tick'

photo
1

Thanks, Aditya.

Yes, I Checked that already, but I see a few seconds' delay with that. Especially in Stock Options this few seconds delay is causing huge slippage in Paper Trade.

I compared this with Finvasia

print(s.td.history("BPCL221229350CE", bar_size="tick", bidask=False, options=[]).tail(1))
s.finvasia.quote(exchange="NFO", symbol='BPCL29DEC22C350').lp[0]

It would be nice if we have a separate quote API that gives the real-time value.

photo
Leave a Comment
 
Attach a file