Back to Blog
How the Volrix Backtesting Engine Works

How the Volrix Backtesting Engine Works

Sharing some key concepts and methodologies we've used with the backtesting engine of Volrix. This would help you to understand the concepts in a better way.

Volrix Team13 June 202613 min read

How the Volrix Backtesting Engine Works

Key concepts, assumptions, and methodology behind the framework

I’m sharing some of the key concepts and methodologies we’ve used while building Volrix.

These points are important because Volrix is not just a normal backtesting UI where you select a few settings and get a report. Volrix is built as a backtesting engine that can be used by AI agents like Claude, ChatGPT, Cursor, Codex, or any other MCP compatible client.

We calculate metrics by assumed capital of 1.5 Lakhs on all backtests, you can ask AI to get accurate capital or you can input capital according to you.

So the AI agent needs to understand how the engine thinks, how entries and exits are handled, what assumptions are being made, and what limitations exist because of the data.

The goal is simple.

We want the backtest to be as realistic as possible, based on the data we have.

Right now, Volrix works mainly on 1 minute candle data. Because of that, there are a few important things to understand before testing strategies.

1. We are bound by 1 minute data

Volrix currently uses 1 minute OHLC candle data.

That means for every minute, we have:

  • Open
  • High
  • Low
  • Close

We do not have tick by tick data.

Because of this, the engine cannot know the exact sequence of price movement inside a candle.

For example, within the same 1 minute candle, price may have touched both stop loss and target. But without tick data, we cannot know what happened first.

So for stop loss, target, and wait trade based entries, we use the high and low of the 1 minute candle to check whether a level was touched.

This is practical and scalable, but it also means the strategy has to be built while respecting the 1 minute data limitation.

2. Stop loss, target, and wait trade logic use candle high and low

For individual legs, stop loss and target are checked using the high and low of the 1 minute candle.

If the stop loss price is touched inside the candle, the stop loss is considered triggered.

If the target price is touched inside the candle, the target is considered triggered.

If a wait trade entry level is touched inside the candle, the wait trade condition is considered valid.

This works well for individual option legs because we are checking whether that specific option’s price touched a specific level.

But again, we do not know the exact tick level movement inside the candle. So the engine follows a clear rule instead of assuming perfect execution.

3. Re-entries happen only after the candle closes

Re-entries do not happen immediately inside the same candle.

If a trade exits because of stop loss or target, the re-entry is checked only after that candle closes.

This is important.

If we allow exit and re-entry inside the same 1 minute candle, the backtest can become unrealistic very quickly. Without tick data, we cannot know whether the trade actually had enough time to exit and enter again at the right price.

So Volrix waits for the candle to close and then evaluates re-entry.

This keeps the backtest more realistic.

4. Entry is taken at the open of the next candle

Volrix follows a next candle execution model.

If you mention entry at 09:20, the entry is taken at the 09:20 candle open, not at the 09:19 candle close.

This is important because the 09:19 close is only known after the candle is complete. You cannot use that close price and enter on the same completed candle without creating lookahead bias.

For indicator based systems, this becomes even more important.

For example, if you are using a 5 minute chart and the signal comes on the TradingView candle marked as 09:20, that candle actually completes at 09:24:59.

So the entry will be taken at the 09:25 candle open.

This is how it would happen realistically.

You first wait for the candle to complete, then you act on the next candle.

5. Exit is taken as per candle close

For time based exits, the exit is taken as per the close of the candle.

For example, if the exit time is 15:15, the exit is considered at 15:14:59.

This is because the 15:15 candle starts after that. So if the strategy says exit at 15:15, the position is closed using the completed candle just before that time.

The idea is to keep the execution logic consistent and realistic.

6. Entry cannot be taken on the last candle of the day

This is one of the most important assumptions in Volrix.

If the market closes at 15:30, the last candle available is usually the 15:29 candle.

But Volrix does not allow the strategy to loop over the last candle for taking fresh entries.

This does not mean the 15:29 candle is missing.

The data is present.

The reason is simple. You cannot realistically take a fresh entry at the close of the 15:29 candle because the market closes immediately after that.

So the candle can be used for indicator calculations, but not for taking a new position.

If an indicator crossover happens on the last candle of the day, then it is fair to consider the entry or exit on the next trading day, generally around the 09:15 close or 09:16 open depending on the strategy logic.

7. The last candle can still be used for indicators

Even though fresh entries are not allowed on the last candle, that candle is still useful.

Indicators may need the full day’s data.

For example:

  • Moving averages
  • RSI
  • VWAP
  • Supertrend
  • Pivot related calculations
  • Previous day range calculations

So Volrix does not ignore the last candle.

It only prevents unrealistic fresh entries on that candle.

8. Daily close and minute close can be different

In Indian markets, the close price shown on daily charts is not always the same as the last traded price.

The official daily close is generally calculated using the average price of the last 30 minutes.

But in Volrix, when we calculate things like pivot points, previous day range, previous day high, previous day low, or previous day close, we currently use intraday minute data.

As of 13th June 2026, Volrix does not use the official daily chart close for these calculations.

So there can be a difference between:

  • Close shown on daily charts
  • Close derived from minute data
  • Close used inside Volrix calculations

This is expected and users should keep this in mind while comparing Volrix results with TradingView, broker charts, or exchange level data.

9. Combined premium stop loss works only on 1 minute close

Combined premium stop loss is different from individual leg stop loss.

For an individual option leg, we can check the candle high and low to see whether stop loss or target was touched.

But for combined premium, using the high and low of multiple legs can give wrong results.

Why?

Because the high of one option leg and the high of another option leg may not have happened at the same exact second.

So if we combine highs and lows from different legs, we may create a price that never actually existed in the market at the same moment.

We tried handling combined premium stop loss using high and low, but it was not accurate enough.

So currently, combined premium stop loss is handled using 1 minute close.

If you are testing a strategy on a higher timeframe and using combined premium SL, you should ask the AI agent to check the exit on 1 minute close.

This is very important.

10. Spot or futures breakout with options entry

A lot of strategies generate signals on spot or futures and then execute in options.

For example:

  • NIFTY spot breaks the day high
  • BANKNIFTY futures breaks VWAP
  • CRUDEOIL futures breaks an opening range
  • Spot breaks previous day high
  • Futures breaks a swing level

Detecting the breakout on spot or futures is possible using the high or low of the candle.

But if the final trade is being taken in options, we cannot know the exact option price at the exact second when the spot or futures breakout happened.

It can take assumption of breakout price, in the symbol in which breakout is checked using high and low of the candle

That would require tick level synchronized data.

Since Volrix works with 1 minute candle data, the options entry has to be taken using the available options candle after the breakout condition is confirmed.

This avoids assuming a perfect option entry price.

11. Volrix can work on the main timeframe and 1 minute timeframe

The framework is built in such a way that logic can run on both:

  • The main strategy timeframe
  • The 1 minute execution timeframe

This is useful because many strategies are not purely 1 minute strategies.

For example, a strategy may use:

  • 5 minute candle for breakout
  • 15 minute candle for trend
  • 1 minute candle for stop loss
  • 1 minute candle for combined premium exit
  • 1 minute candle for wait trade
  • Higher timeframe for filters

So Volrix allows the strategy to think on one timeframe and manage execution on another timeframe.

This is especially useful when AI agents are writing and testing strategy logic.

12. Lookahead bias is avoided wherever possible

One of the biggest issues in backtesting is lookahead bias.

Lookahead bias means the strategy uses information that would not have been available at the time of taking the trade.

For example, if a 5 minute candle closes at 09:24:59, you cannot take an entry at 09:20 using the final close of that same candle.

That would be unrealistic.

So Volrix acts only after the candle is complete.

This is why indicator based entries are taken on the next candle open.

The engine should not make the backtest look better by using future information.

13. Data alignment across spot, futures, and options matters

Many strategies use multiple instruments together.

For example:

  • Signal from spot
  • Confirmation from futures
  • Execution in options
  • Exit based on combined premium
  • Filters based on IV, VIX, Greeks, or open interest

When multiple instruments are involved, timestamp alignment becomes very important.

The signal candle, option candle, futures candle, and exit candle need to be aligned properly.

If one instrument has missing data at a timestamp, the engine should not assume something that did not exist in the data.

This is especially important for options because some strikes may not trade actively every minute.

14. Illiquid strikes can make backtests misleading

Not every option strike is liquid.

Some strikes may have:

  • Missing candles
  • Stale prices
  • Low volume
  • Wide bid ask spread
  • Sudden jumps
  • No proper trading activity for many minutes

This is common in far OTM options, deep ITM options, commodity options, and sometimes even expiry day contracts.

A strategy may look good on paper but may not be tradable in reality if the selected strikes are illiquid.

So while testing, it is better to avoid unrealistic strike selection and add liquidity aware checks wherever possible.

15. Slippage and costs matter a lot

A strategy without costs is not a real strategy.

Especially in options, costs can completely change the result.

A backtest should ideally account for:

  • Brokerage
  • Exchange charges
  • STT
  • Stamp duty
  • Slippage
  • Bid ask spread
  • Market impact

This becomes even more important when the strategy has:

  • Multiple legs
  • Frequent re-entries
  • Stop loss modifications
  • Fast exits
  • Expiry day trading
  • Low premium options

A strategy that looks profitable before costs can become weak after realistic costs.

16. Backtest is a simulation, not a guarantee

Volrix gives a structured simulation of how a strategy would have behaved.

It is not a guarantee that the same result will happen in the future.

Every backtest depends on:

  • Timeframe
  • Entry logic
  • Exit logic
  • Strike selection
  • Slippage assumptions
  • Market regime
  • Risk management
  • Execution assumptions

So the backtest should be used to understand the behavior of a strategy, not blindly predict future returns.

17. AI prompts should clearly mention execution assumptions

Since Volrix is used through AI agents, the way you ask the agent matters a lot.

A good prompt should clearly mention:

  • What instrument to use
  • Whether signal is from spot, futures, or options
  • What option strike to trade
  • What timeframe to use
  • How entry should happen
  • Whether entry should be on next candle open
  • How stop loss should be checked
  • How target should be checked
  • Whether combined premium SL should be on 1 minute close
  • When re-entry is allowed
  • What time to exit
  • Whether fresh entry is allowed near market close
  • What filters to apply

The clearer the prompt, the better the backtest.

If the prompt is vague, the AI agent may make assumptions. Sometimes those assumptions may not match what the trader actually wanted.

18. Example

Let’s say someone wants to test this strategy:

  • Use NIFTY spot for signal
  • Mark high and low from 09:15 to 09:30
  • If spot breaks range high, buy ATM CE
  • If spot breaks range low, buy ATM PE
  • Take entry in options after breakout confirmation
  • Stop loss based on option price
  • Target based on option price
  • Exit at 15:15
  • No fresh entry on the last candle of the day

In this case, the breakout can be detected using the high or low of the NIFTY spot candle.

But the option entry price cannot be assumed at the exact tick when spot broke the level.

So the option entry should be taken using the next available option candle as per the execution rule.

This is more realistic than assuming a perfect entry at the breakout tick.

19. Why we follow these rules

Backtesting engines can easily make strategies look better than they actually are.

That usually happens because of:

  • Perfect entries
  • Perfect exits
  • Same candle re-entries
  • Lookahead bias
  • Ignoring slippage
  • Using high and low incorrectly
  • Assuming tick level execution without tick level data

Volrix tries to avoid these issues by following strict execution assumptions.

Sometimes this can make the result look less attractive.

But that is fine.

The purpose of Volrix is not to create the best looking report.

The purpose is to create a backtest that is realistic enough to trust.

Conclusion

Volrix is built around practical execution assumptions for Indian index and commodity derivatives backtesting.

Right now, since the engine works mainly with 1 minute candle data, there are clear rules around entries, exits, stop loss, targets, re-entries, combined premium logic, and spot or futures based options execution.

These rules help reduce unrealistic assumptions and make the backtest closer to how the strategy could actually behave in live markets.

As Volrix evolves, the methodology will keep improving.

But the core principle will remain the same.

A backtest should be realistic, explainable, and close to how the strategy could actually be traded.