Automated software/utility to backtest options strategy

myamit

Well-Known Member
#1
Hello,

I need some help in terms of options trading & backtesting with historical data.

What I'm trying to achieve is to test out various different strategies on historical Index options data. What I want to achieve is following...

1. set the date in the past (eg 05-01-2007)
2. see a list of all options available on that date in the past
3. make a strategy with these options (I will have defined business rules)
4. then increase the date by 1 day and see whats happening with the strategy taken
5. make adjustments in the strategy (formula driven & only if necessary)
6. and so on until expiration of the options in the strategy
7. Execute such strategy for atleast last 5-7 years data.

I primarliy trade on NSE (National Stock Exchange, India) and preferred Index options are Nifty options.


What I need here is...

1. Historical data of Nifty options
2. A software / tool that allows me to build rule based strategy & execute in replay mode
3. A statstical probability advisor

Could anybody plesae share if you have come across such tools or simlar things?

PS: I do have Nifty options price data in text format. Also I believe this option strategy will work same as with any security or index globally.
 
#2
All of this can be applied in Metastocks/Amibroker/Advanced GET with Historical RT data subscriptions. In Traderji itself you have resources to do so. If You can spend your money on it, Its worth an investment.

Now adding some personal advice on your strategy :
Based on your question, you are trying invest some good amount of time and money in reseraching market. All the best to you!

Your method id based on analysis of option Historical prices for same underlying entity (here it is NIFTY Index). Your method may work perfectly work in Stock options/futures but in NIFTY Index it may not.

Reason for this : Most of the Index option Traders are speculative or the people who believe in lotteries. Those category of people will stay in the market but the same people will not stay in market. Those category will exist (meaning the people who wants to make double the money over night will always be there in the market). But the same Mr.Xyz and Mr.ABC will not stay in the market. So the behavioural pattern of the madness of Crowd will always change in the market, which will react in Option prices. Most NIFTY option traders are buying/selling OTM calls/puts which will not be the same in a past year.

My advice to you is study the Technical analysis of the Index, Study some psycology. Which will give you a better edge in the FnO market. This helps me everyday in the market. For the last 5 years I never saw a similar price pattern in NIFTY option prices but I did saw similar pattern in NIFTY index prices.

Just my two cents (or Rupees)
 
#3
Hello myamit - Coming from a technology/software background, I am currently building a tool that aims to do pretty much exactly what you have described. However, it is not yet complete.

So far I have:

1 - Historical NIFTY Options data between 01-01-2004 and 31-12-2009, scraped and loaded into a database
2 - Some simple tools to query this data and generate custom plots

The strategy backtesting part is something that I have been thinking of doing, but haven't got time to finish it yet.

If you are interested, I will keep you posted. In fact, if there are more people interested in this, I may be motivated to finish this sooner.

Regards
Ketan
 

rkkarnani

Well-Known Member
#4
All of this can be applied in Metastocks/Amibroker/Advanced GET with Historical RT data subscriptions. In Traderji itself you have resources to do so. If You can spend your money on it, Its worth an investment.

Now adding some personal advice on your strategy :
Based on your question, you are trying invest some good amount of time and money in reseraching market. All the best to you!

Your method id based on analysis of option Historical prices for same underlying entity (here it is NIFTY Index). Your method may work perfectly work in Stock options/futures but in NIFTY Index it may not.

Reason for this : Most of the Index option Traders are speculative or the people who believe in lotteries. Those category of people will stay in the market but the same people will not stay in market. Those category will exist (meaning the people who wants to make double the money over night will always be there in the market). But the same Mr.Xyz and Mr.ABC will not stay in the market. So the behavioural pattern of the madness of Crowd will always change in the market, which will react in Option prices. Most NIFTY option traders are buying/selling OTM calls/puts which will not be the same in a past year.

My advice to you is study the Technical analysis of the Index, Study some psycology. Which will give you a better edge in the FnO market. This helps me everyday in the market. For the last 5 years I never saw a similar price pattern in NIFTY option prices but I did saw similar pattern in NIFTY index prices.

Just my two cents (or Rupees)
Hi Guru, Agree with you. It is always advisable to analyse the underlying to get direction on the Option Strategy.
As your name suggests why not impart some knowledge here with a few good strategies thrown in!!!
 

myamit

Well-Known Member
#5
@PaisaBox

Nice to hear that someone is working on development of utility that I badly need. Plesae keep me posted. Also if you need any help at conceptulizing or coding, please feel free to ask.
 

myamit

Well-Known Member
#6
Hello OGuru,

Thank you for your post & advice.

I fully understand your concerns about Nifty options being used as speculation tool (and for that matter any individual stock option too). Though what I'm working on is just to use Time Decay to my advantage and to keep other parameters market neutral (as far as possible). I've manually backtested this for one year & this shows huge gains with very minimum downside. Basically with this utility what I want to do is to finetune few parameters (I may have to run same routine quite a few times) and understand effect of this over a period (here let's say 5 years).
 
Last edited:
#7
I beg to differ with OptionGuru (oguru) on many counts.

First, there is no basis to believe that only NIFTY option traders are speculators/lottery-believers, and stock option traders are not. If anything, I think it is the other way round, because stock prices (and correspondingly stock option prices) are more prone to manipulation and wild price swings, and hence draw more than the usual share of lottery-buyers and overnight success dreamers.

That apart, I believe NIFTY options are a better/safer bet than stock options, for the following reasons:

1 - Much higher liquidity. Most stock options (even the largecap ones) have much lower volumes.

2 - Lower volatility. An individual stock is much more likely to make wild price swings, compared to NIFTY.

3 - (Most important) An individual stock is always more susceptible to fraud, manipulation or some other "rare event" that screws things up completely. Remember Satyam? The likelihood of something like that happening to NIFTY as a whole is comparatively very, very small.

For all these reasons, I feel NIFTY options are the way to go, particularly so for sell-oriented strategies.

Just my 2 paisa (or rupees)

- Ketan
 
Last edited:

SaravananKS

Well-Known Member
#8
Hello OGuru,

Thank you for your post & advice.

I fully understand your concerns about Nifty options being used as speculation tool (and for that matter any individual stock option too). Though what I'm working on is just to use Time Decay to my advantage and to keep other parameters market neutral (as far as possible). I've manually backtested this for one year & this shows huge gains with very minimum downside. Basically with this utility what I want to do is to finetune few parameters (I may have to run same routine quite a few times) and understand effect of this over a period (here let's say 5 years).
Yes Recently Nifty gives some profitable opportunies in writing to gain time value.SafeTrader can get some minimum profit.But I am also searching for such a tool to backtest.
For My Observation these delta neutral Stregies would work only sideways Market.
Since for past one year nifty ranging these strategies giving profit!!:)
 

SaravananKS

Well-Known Member
#10
if any body initiate Backtesing Startegy in Options then I would glad to share my knowledge in Options Volitality along technical in Programming since I am also software developer!!:argue: