NIFTY lab

NIFTY 108-point + ADX — trailing-anchor variant

Literal port of the pasted Pine v6 strategy · 6,125 bars over 245 sessions · 2025-10-23 .. 2026-10-19 · units are index points at 1 unit (the script's default_qty_value=1), not option premiums

Read this first

Unit: index points at 1 unit (not option premiums)

Trades behind the rows below: 4 to 113 closed trades, over 245 sessions

Buying and holding the index over the same bars: -3,164.1 points

This page is NOT the pasted script. It is the same idea with a ratcheting anchor (my reading of the intent), which is the only variant in the sample that trades enough to measure. The as-pasted result is on nifty108_adx_15m. As pasted, this strategy barely trades. 15 signals in 245 sessions, 8 of them past the ADX gate, and 4 trades closed for -208.0 points. The anchor only moves when the trend flips, so in a trending market it parks at a pre-move level and never fires again; a signal blocked by ADX is still consumed, because the state machine advances before the ADX test.

How this was measured

Signal trace (as pasted)

Bar closeSignalCloseAnchorADXADX > 25?
2025-10-23 14:15SELL25,943.025,943.0nanblocked
2025-10-29 12:00BUY26,054.826,054.829.8passes
2025-10-30 09:30SELL25,921.525,921.525.5passes
2025-11-19 14:00BUY26,033.026,033.019.2blocked
2025-11-25 14:45SELL25,899.825,899.822.2blocked
2025-11-26 09:30BUY26,024.126,024.123.9blocked
2025-12-03 10:30SELL25,904.425,904.445.5passes
2025-12-04 09:30BUY26,028.226,028.225.5passes
2025-12-08 14:00SELL25,914.425,914.446.7passes
2025-12-12 09:30BUY26,024.826,024.829.6passes
2025-12-16 09:45SELL25,906.125,906.119.7blocked
2025-12-22 09:15BUY26,125.526,125.521.4blocked
2025-12-26 14:30SELL26,017.326,017.349.8passes
2025-12-31 12:45BUY26,147.226,147.249.6passes
2026-01-08 10:30SELL26,031.626,031.623.1blocked

As pasted vs the variants

VariantTrades closedTrades that won (%)Net points (after costs)Biggest drop (pts)
as pasted425.0%-208.0-131.4
trailing anchor + ADX + 50-pt stop6136.1%+1,811.0-871.4
trailing, no ADX11338.9%+1,843.5-1,029.3
trailing, no ADX, no stop11354.0%+3,676.5-1,375.7
trailing + ADX, EOD filled same bar6139.3%-191.7-935.0

A trade is one that finished: it entered and it exited. "Trades that won" counts the finished trades whose price move was positive — slippage already deducted, commission not yet — while "net points" is the same trades after commission as well. The two columns can disagree. "Biggest drop" is the deepest fall from the running peak of the money curve, in the same points as the net column and after the same costs. It is a size, not a percentage.

Why the last row matters

The script sets process_orders_on_close=false, so the 15:20 "end-of-day" close does not fill on that bar — it fills at the next bar's open, i.e. the next session's 09:15. The position is therefore held overnight, despite the input being called "Close at End of Day". Modelling that faithfully moves the 61-trade variant from -191.7 points to +1,811.0 points — a swing of 2,003 points. The exit price moved +32.8 points per trade on average over 61 matched trades (t-stat 1.44), which is not distinguishable from zero. That is noise, not an edge, and it is why neither number should be read as a result.