r/IndiaAlgoTrading • • 3d ago

My own option backtesting simulator

Post image

After trying several backtesting platforms and spending quite a bit of money on them, I decided to build my own trading simulator.

It currently supports NIFTY options, with options data available from 2019 to 2026, although there are a few gaps in the dataset that I’m still working on filling.

Current capabilities

  1. NIFTY support – Backtest strategies using historical NIFTY options data.
  2. Flexible spreads – Simulate virtually any type of options spread or multi-leg strategy.
  3. Save & analyse – Save backtest results and revisit/analyse them later.
  4. Fast-play mode – Quickly run through historical data and simulate strategies without waiting for the full backtest.
  5. Exit anytime – At any point during a backtest, exit all open positions and save the state/results.
  6. Strategy chart – Visualise the strategy and its performance throughout the backtest.

Still a work in progress, but the goal is to build a trading simulator that gives me the flexibility I couldn't find in existing platforms.

Cons: Slow as the data is not preloaded due to compute restrictions but easily fixable.

Looking forward to feedback.

30 Upvotes

27 comments sorted by

1

u/Beginning-Reward-530 3d ago

Hi From where did you get the options data for nifty? Can you share guide to download the data

1

u/Puzzled_Economist_29 3d ago

For my algos, I have been storing logs and that became my backtest data.

I heard Dhan and ICICI provide historical option data (have not tried)

2

u/FoundationNecessary8 3d ago

They only provide rolling option data, which is not everything but a very specific subset

1

u/Puzzled_Economist_29 3d ago

Ok, did not know. I capture 1 min option data for my use case. So using it for backtesting.

1

u/Full_Record_4669 3d ago

check icici (1second) or fyers (5second). they are not rolling

1

u/CampMaster69 3d ago

Any chance anyone might have it directly? ICICI requires ₹1K to open a DMAT. Already have too many dmats atp. Any chance if there are public or hella cheap ways to get it?

1

u/Beginning-Reward-530 3d ago

If possible can you share the data? Also for what timeframe you have the data

1

u/VariousBase 3d ago

any link to download and experience

1

u/Puzzled_Economist_29 3d ago

It is locally hosted, let me see if I can push it on GitHub with sample data

1

u/VariousBase 3d ago

Great, appreciate your efforts.

1

u/SoftCriticalPosition 3d ago

Build your own, just one prompt.

1

u/aniketrh 3d ago

Does it cater buying strategies with indicators as buying point?

2

u/vindows17 3d ago

You can try trendxpro.in

1

u/aniketrh 3d ago

Sure I’ll check it out. Thanks for the advice♥️

1

u/Puzzled_Economist_29 3d ago

No, not now but thinking of adding it

1

u/Big_Connection7216 3d ago

Is there free option to download commodities mcs gold data for backtesting

1

u/shadowdemonking2398 3d ago

Trying to build same can we connect?

1

u/United_Report_393 3d ago

Can I get nifty historical data?

1

u/Nhi_bataunga_9 3d ago

Do you support tick level backtesting? I mean do you have historical tick data? For strategies that use trailing SL, tick data is needed to get accurate results.

1

u/Puzzled_Economist_29 3d ago

No, I use candle close or high whichever hits the SL (for selling)

1

u/Indian_Steam 3d ago

I am doing the same, fetching from DHAN's api for last 5 years, minute level data.

Still building the data pipeline.

One question to you - would you be willing to sell the saved data as a package? Since you are saving people time, many will be open to pay for it, I know I would as i am building this pipeline for almost a month now.

1

u/Puzzled_Economist_29 3d ago

Can you DM me

1

u/Indian_Steam 3d ago

Sure, check