More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Backtest Honesty Auditor: Bias, India Costs, Verdict

    1

    Most backtests that look great are wrong in the same few ways.

    $12

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Backtest Honesty Auditor: Bias, India Costs, Verdict

    Example session with this skill installed

    Can you sanity-check this backtest before I trade it? NIFTY 15-minute opening range breakout, buying options. The numbers below are illustrative, from a quick test.

    Rules: the opening range is the high and low of 09:15-09:30. After 09:30, if a 5-minute bar breaks above the range high, buy the ATM call; below the range low, buy the ATM put. One trade a day. Stop: spot back inside the range. Target: 2x the range width on spot. Otherwise exit at 15:20. Size: 1 lot (75 units).

    Backtest (illustrative): Jan 2024 to Dec 2025, 480 trades, 41% win rate, gross P&L Rs 1,48,800 (Rs 310 per trade), max drawdown Rs 22,000. No costs or slippage. I tried range lengths of 5, 10, 15, 20, 30 and 45 minutes; 15 was best.

    Core of the code (pandas, 5-minute bars):

    or_hi = day.between_time("09:15", "09:25")["high"].max()
    or_lo = day.between_time("09:15", "09:25")["low"].min()
    
        for t, bar in day.between_time("09:30", "15:15").iterrows():
            if bar.high > or_hi:
                side = "CE"; entry_spot = or_hi
                break
            if bar.low < or_lo:
                side = "PE"; entry_spot = or_lo
                break
        strike = round(day["close"].iloc[-1] / 50) * 50
        opt = options[(options.strike == strike) & (options.type == side)]
        entry_px = opt.loc[t, "close"]
    
    # walk forward bar by bar; if a bar hits both stop and target, take target
    exit_px = simulate_exit(opt, spot, t, stop=..., target=..., tie="target")
    pnl = (exit_px - entry_px) * 75
    
    • Read your context and instructions
    • Compiled the backtest honesty auditor

    Verdict: FIX. Don't trade it yet. Two bugs in the code mean the Rs 310 per trade gross isn't a real number yet. Even if it were, costs and slippage cut it to about

    Rs 90–165 net per trade (estimate), which is

    29–54% of gross. That's thin enough that fixing the bugs could leave no edge at all. All the P&L figures here are your illustrative ones, not real results.

    Findings

    #CheckStatusEvidenceImpact
    1Look-aheadBlockerstrike = round(day["close"].iloc[-1] / 50) * 50This picks the strike from the day's last close, which isn't known at entry. On days that trend, you're effectively buying the strike the day ended at. The result can't be used until the strike comes from spot at time t. The size and direction of the error can't be known without a rerun.
    1bLook-aheadMajortie="target"When one bar hits both stop and target, the backtest assumes the target came first. With no 1-minute data, the honest assumption is the stop. Rerun with tie="stop".
    1cLook-aheadUnknownentry_px = opt.loc[t, "close"] together with simulate_exit(..., t, ...)You fill at the close of the breakout bar. That's fine only if simulate_exit starts at bar t+1. If it checks bar t's own high and low, it's using prices from before your fill.
    1dData bugBlocker (likely)options[(options.strike == strike) & (options.type == side)]There's no expiry filter. If your options data covers more than one expiry, opt.loc[t, "close"] returns several rows or the wrong contract. Filter to the nearest weekly expiry, with a rule for expiry day.
    1eLogic bugMinor/Unknownthe for … break loopside and t are never reset each day. On a day with no breakout, the loop runs to the end and leaves t at 15:15, and side is stale from the previous day or undefined. So it may "trade" days that had no signal. 480 trades in about 495 sessions is very high for a breakout rule. Count how many days actually broke out. Also, a bar that breaks both sides always goes to CE, because the high test runs first.
    2SurvivorshipClearSingle index (NIFTY)Survivorship bias doesn't apply to one index.
    3RepaintingClear, with a conditionbetween_time("09:15","09:25") on 5-minute barsThis is correct if bars are labelled by start time: the 09:15, 09:20 and 09:25 bars cover 09:15–09:30. If your bars are labelled by end time, the range is off by one bar. Check your data vendor's convention.
    4FillsMajorentry_spot = or_hi, and option filled at bar closeThere's no slippage, and fills use the last traded price rather than ask to buy and bid to sell. Breakouts in the first hour are when spreads and market-order slippage are worst. Your spot stop and target also count from or_hi, but the real fill is wherever spot was at the bar's close, often well past or_hi. So the recorded risk and reward don't match the trades you'd actually get.
    5OverfittingMajor"tried 5, 10, 15, 20, 30, 45; 15 was best"You tried 6 range lengths, reported the best, and have no out-of-sample test. The stop and target multiple were probably chosen by eye too. You didn't say whether 10 and 20 minutes were also profitable.
    6CostsMajor (close to blocker)"No costs or slippage"At current rates, charges plus slippage take 47–71% of gross. See the cost check below.
    7Sample and regimeMajorFixed 75 units across Jan 2024 to Dec 2025480 trades is enough to judge from. But the contract changed during the test. The NIFTY lot was 25 until late 2024 and 75 after. It has been revised again since (I believe to 65, but check the current NSE lot size). Weekly expiries were also cut back and the expiry day moved. So rupee P&L at a fixed 75 is misleading. Report points per unit, split by year and by expiry or non-expiry day.

    Cost check

    I ran scripts/india_costs.py, with rates checked 2026-11-07. These include the 2026-04-01 STT increase to 0.15% of options sell premium.

    Typical trade

    (assumed): buy at a premium of Rs 120 and sell at Rs 124.13, which reproduces your Rs 310 gross on 75 units.

    Per tradeSlippage Rs 0.5/unit/side (assumed)Slippage Rs 1.0/unit/side (assumed)
    Charges (Rs 40 brokerage, Rs 13.96 STT, Rs 6.51 exchange, Rs 8.37 GST, other)Rs 69.13Rs 69.13
    SlippageRs 75Rs 150
    Total costRs 144Rs 219
    Net per tradeRs 166Rs 91
    Net over 480 tradesRs 79,616Rs 43,616
    Costs as share of gross46.5%70.7%

    The breakeven move is Rs 1.9–2.9 per unit of premium. Rs 1/side is a realistic floor for market orders on a breakout. It also matters that the costs are certain while the gross isn't, because the gross is still distorted by the strike look-ahead and tie="target".

    Fix list (in this order)

    Pick the strike from spot at entry. Use strike = round(spot.loc[t, "close"] / 50) * 50, and select the

    nearest weekly expiry explicitly. Assert that opt has exactly one row per timestamp.
    2.

    Reset side and t at the start of every day, and skip days with no breakout. Then check how many trades remain.
    3.

    Make fills honest. Enter at the next bar's open, start simulate_exit at t+1, and set tie="stop". If your data has bid/ask, buy at the ask and sell at the bid. If not, add at least Rs 1 per unit per side.
    4. Add costs with the script, at the STT rate in force on each trade date.
    5.

    Out-of-sample test. Keep the 15-minute range fixed and run it once on data you haven't looked at, for example Jan–Oct 2026. Also show results for 10, 15 and 20 minutes side by side. If you want a plateau rather than a single lucky peak, all three should be profitable.
    6.

    Report points per unit, and break results down by year and by expiry or non-expiry day. Show P&L without the top 5 trades and the longest losing streak.

    What would change the verdict

    To TRUST: after fixes 1–4, net per trade stays clearly positive. As a rough bar, more than about Rs 100 after Rs 1/side slippage, with 10, 15 and 20 minutes all profitable. It must also hold up out of sample in 2026 with at least about 100 trades, and the profit shouldn't depend on the top 5 days. Even then, TRUST means paper trade or start with one lot, not "safe".

    To DISCARD: after the strike and expiry fixes and the honest tie rule, net is zero or negative, or the 2026 holdout loses money.

    Paper trading at one lot is fine to start any time. Opening-range breakout on NIFTY is a reasonable idea to test. This is the honest version of the backtest you need before putting money on it.

    The rates are current as of today (2026-11-07). Recheck them if you rerun later. This is an engineering audit of the backtest, not investment advice.


    The cost model's real output for the Rs 0.5 slippage case:

    Round trip: options long, qty 75, entry 120 -> exit 124.13
    Rates as of 2026-11-07 (NSE; run --rates for sources)
      turnover            Rs 18,309.75
      brokerage           Rs 40.00
      stt                 Rs 13.96
      exchange_txn        Rs 6.51
      ipft                Rs 0.00
      sebi_fee            Rs 0.02
      stamp_duty          Rs 0.27
      gst                 Rs 8.37
      charges total       Rs 69.13
      slippage            Rs 75.00
      COST PER TRADE      Rs 144.13
      gross P&L           Rs 309.75
      net P&L             Rs 165.62
      break-even move     Rs 1.92 per unit
      cost / entry value  1.601%
    
    Over 480 trades:
      total cost          Rs 69,183.69 (charges Rs 33,183.69, slippage Rs 36,000.00)
      gross P&L           Rs 148,800.00
      NET P&L             Rs 79,616.31
      per trade           gross Rs 310.00, net Rs 165.87
      costs eat           46.5% of gross
    

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Most backtests that look great are wrong in the same few ways. The fill happens at a price you only knew after the bar closed. The stock list is today's winners. The best of twenty parameter sets gets reported. And costs are "not included", which on Indian F&O after the 2026 STT hike can eat half the edge or more.

    Backtest Honesty Auditor makes your agent audit a backtest the way a skeptical reviewer would, then commit to a verdict.

    What it checks, in order:

    1. Look-ahead: same-bar fills, breakout fills at the trigger level, strikes picked from later prices, shift(-1) and friends, optimistic "target first" intrabar ordering.
    2. Survivorship and universe: current constituents or F&O lists applied to past years, missing delisted symbols.
    3. Repainting: pivots, zigzags and higher-timeframe values that change after the fact; synthetic bars used for fills.
    4. Fills and slippage: LTP fills for options, zero slippage, touched limits counted as filled, size beyond depth.
    5. Overfitting: parameter sweeps, rules added after looking at losers, no held-out test, sharp peaks instead of plateaus.
    6. Costs: an offline Python cost model for NSE delivery, intraday, futures and options. Brokerage, STT (including exercise STT), exchange transaction charges, IPFT, SEBI fee, stamp duty and GST, plus slippage, scaled to your trade count with a break-even move per unit.
    7. Sample and regime: thin samples, outlier days, single-regime periods.

    Each check gets Blocker, Major, Minor, Clear or Unknown, with the exact line of code or rule quoted. You get a verdict first (TRUST, FIX or DISCARD) and a findings table, then the cost breakdown, a ranked fix list with a test for each, and what result would change the verdict. Estimates are labelled as estimates.

    Every rate in the cost model is dated and sourced (rates checked 2026-11-07: Finance Act 2026 STT from 2026-04-01, NSE transaction charges from 2026-03-01, which absorb most of the old IPFT contribution; the remaining IPFT is Rs 0.01 per crore, so it rounds to Rs 0.00 per trade). Rates sit in one table at the top of the script, so updating them is a one-line edit.

    Requires: an agent that loads SKILL.md skills (for example Claude Code) and can run Python 3 for the cost model. Standard library only: no packages, no network, no API keys. The audit itself works without Python; only the cost numbers need it.

    Known limitations

    • The cost model covers NSE. BSE charges differ (notably on index options); pass your own rates or edit the table.
    • Rates change. They are dated in the script; check them when the date is old.
    • It audits what you show it. With only a summary and no code, many checks come back Unknown, and the verdict says so.
    • It doesn't re-run your backtest or fetch market data. It tells you which re-runs to do and what to look for.
    • Not investment advice. TRUST means "worth paper trading", not "will make money".

    FAQ

    Does it work for non-Indian markets? The six bias checks work anywhere. The cost model is India-only; for other markets the agent asks for or assumes your costs and marks the cost check approximate.

    Does the script touch the internet or my files? No. It reads only its command-line arguments and prints a report.

    Can I use my broker's brokerage? Yes: --brokerage-flat and --brokerage-pct override the default discount-broker schedule.

    Will it just tell me everything is broken? It gives TRUST when the backtest earns it, and on a DISCARD it says which idea is worth keeping.

    The cost model covers NSE. BSE charges differ (notably on index options); pass your own rates or edit the table. Rates change. They are dated in the script; check them when the date is old. It audits what you show it. With only a summary and no code, many checks come back Unknown, and the verdict says so. It doesn't re-run your backtest or fetch market data. It tells you which re-runs to do and what to look for. Not investment advice. TRUST means "worth paper trading", not "will make money".

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 10 days ago

    Permissions

    Terminal / Shell
    Read Files
    Listed10 days ago

    What's inside

    Frequently Asked Questions

    The six bias checks work anywhere. The cost model is India-only; for other markets the agent asks for or assumes your costs and marks the cost check approximate.

    No. It reads only its command-line arguments and prints a report.

    Yes: `--brokerage-flat` and `--brokerage-pct` override the default discount-broker schedule.

    It gives TRUST when the backtest earns it, and on a DISCARD it says which idea is worth keeping.

    New in Trading & Investing