%LTP change for NSE option chain

Hi @Tradehull_Imran

Not getting %LTP change for nse options from dhan api. While this is available to view on the app or desktop.

How can I fetch this info or calculate it locally using the available data?

@vedvishwa Try this. Google Search

Hi @vedvishwa ,

Refer the below code-

ltp_data = tsl.get_ltp_data(['NIFTY'])
ltp = ltp['NIFTY']
ltp_change_percent = ((ltp - previous_close) / previous_close) * 100
1 Like

@Tradehull_Imran

It’s not clear…

How to get previous close price here….