Continous futures and options data from nse using nsepy

Hi i have been trying to develop an options strategy based on forward volatility.But i need continous future data.can u help?

Hello Shubhrabaran, 

 

We can't get continous futures data from nsepy and other tools. You can perhaps download futures data from libraries like yfinance, nsepy or quandl. This is how you can do it for yfinance: 

 

import yfinance as yf

data = yf.download(tickers='GC=F',end='2020-04-20',start='2020-04-13',interval = "1m")

 

This returns us 1-minute gold-futures data for the last 8 days. 

 

Thereafter, you can convert this data to continuous future data. There are a variety of ways you can do this in. Some common ones are:

 

1) Panama method - Shifts each contract data to end the gap.

 

2) Proportional adjustment - This readjusts the price of older futures data using the opening of the new series 

 

3) Rollover Series - It creates a continuous contract by taking linear weights between successive contract prices. For example, imagine two contracts near ( c1 ) and far ( c2 ).

 

On the first day the price of the continous contract will be c1 x 0 + c2 x 1. On the following day it will be c1 x 0.33 + c2 x 0.67. Therafter, c1 x 0.5 + c2 x 0.5. Thereafter, c1 x 0.67 + c2 x 0.33. Finally, c1 x 1 + c2 x 0.

Hi i got code for it but i do not know how to use it can you guide me?Following is the link.



Answer to Is there any way to get free historical options data to do a back test in R or Python? by Varun Divakar(Lead,Research and development at Quantinsti)



https://www.quora.com/Is-there-any-way-to-get-free-historical-options-data-to-do-a-back-test-in-R-or-Python/answer/Varun-Divakar-1?ch=3&share=37363dbc&srid=utwJD

 

Hello Shubhrabaran, 



Please ask any questions regarding that code.