Pine strategy: 108 point + ADX
As written, the script takes no trades. Its signal block never moves the anchor price while the market keeps trending, so only 3 raw signals appear in 202 days: a SELL on 26 Dec 2025, a BUY on 2 Jan 2026 (ADX 18.5, below the 25 filter, so skipped) and a SELL on 7 Jan 2026 with no position to exit. The "Breakout" and "Reversal" modes also contain identical code.
The table and charts below use my reading of the idea: the anchor follows each new high or low, and the signal flips after a 108 point pullback. Everything else is as written. The script itself says this block is a stand-in for Ari's exact indicator.
Where the profit comes from: the "EOD exit" is a market order that fills at the next candle's open, which is 09:15 the next morning. So the strategy really holds overnight. Closing the same day at the last candle instead gives 57 trades, profit factor 0.81 and -₹29,211. The result is 202 days of one market phase, so treat it as a lead, not proof.
Trailing-anchor version
Rupees are for 1 lot (65) on the index itself, which cannot be traded directly. The index has no real lot, so this treats it like a future with 0.03% cost per side.
Profit and loss
Hover the running total for the figure after each trade (rupees, 1 lot of 65). The bars show points per trade.
How trades ended
| Exit | Trades | Points |
|---|---|---|
| EOD(next open) | 20 | +4,063.9 |
| SELL+ADX | 4 | +261.4 |
| stop(gap) | 9 | -658.1 |
| stop | 24 | -1,202.4 |
Other settings tried
| Version | Trades | Win rate | Points | Net | Profit factor |
|---|---|---|---|---|---|
| As written (anchor never trails) | 0 | - | - | - | - |
| Trailing anchor, all else as written | 57 | 37% | +2,464.7 | +₹106,693 | 1.58 |
| Trailing, EOD exit on the same day | 57 | 39% | +373.2 | -₹29,211 | 0.81 |
| Trailing, no ADX filter | 99 | 37% | +2,922.5 | +₹97,009 | 1.31 |
| Trailing, ADX threshold 20 | 82 | 35% | +2,277.9 | +₹71,208 | 1.26 |
| Trailing, no stop | 57 | 53% | +3,184.9 | +₹153,492 | 1.68 |
| Trailing, stop 100 points | 57 | 51% | +3,244.8 | +₹157,384 | 1.74 |
| Trailing, move 54 points | 163 | 28% | +2,624.7 | +₹17,708 | 1.04 |
| Trailing, move 162 points | 38 | 29% | +122.7 | -₹27,706 | 0.81 |
Small changes flip the result, for example a 162 point move or exiting on the same day. That is a sign the edge is thin.
Traded as CE and PE options
The same signals, but buying real option premiums from the Fyers minute data: a BUY signal buys an at-the-money CE, and in the two-sided versions a SELL signal buys an at-the-money PE. Exit on the opposite signal, a 50 point move against the entry in the index, or the end-of-day rule. One lot of 65, costs and slippage included.
Only 6 to 17 trades are possible. Fyers keeps minute prices only for contracts that are still listed, so option data starts on 29 Jul 2026. Three signals had no listed contract with a price at that minute and were skipped. With so few trades, the differences between the rows below are noise, not findings.
| Version | Trades | Win rate | Net | Costs | Profit factor | Skipped |
|---|---|---|---|---|---|---|
| Buy CE on BUY signal (Pine long-only), EOD at next open | 6 | 50% | +₹8,795 | ₹421 | 4.14 | 3 |
| Buy CE on BUY, buy PE on SELL, EOD at next open | 16 | 25% | -₹423 | ₹844 | 0.97 | 3 |
| Buy CE on BUY (long-only), EOD same day | 6 | 50% | +₹3,957 | ₹411 | 1.98 | 3 |
| Buy CE on BUY, PE on SELL, EOD same day | 17 | 41% | +₹10,104 | ₹900 | 1.73 | 3 |
Trades: Buy CE on BUY, buy PE on SELL, EOD at next open
| Side | Contract (expiry, strike) | Entry (month-day time) | Exit (month-day time) | Bought at (option price) | Sold at (option price) | Net (rupees) | Why it ended |
|---|---|---|---|---|---|---|---|
| CE | 10-19 23,100 | 10-16 10:15 | 10-19 09:15 | 99.3 | 139.8 | +₹2,607 | EOD next open |
| PE | 10-19 22,950 | 10-15 15:15 | 10-16 09:15 | 118.1 | 86.0 | -₹2,105 | EOD next open |
| PE | 10-19 22,550 | 10-14 13:15 | 10-14 13:43 | 157.2 | 116.7 | -₹2,657 | stop |
| PE | 10-19 22,450 | 10-12 10:30 | 10-13 09:15 | 170.3 | 207.8 | +₹2,400 | EOD next open |
| CE | 10-19 22,400 | 10-09 09:30 | 10-12 09:15 | 214.3 | 331.9 | +₹7,589 | EOD next open |
| PE | 10-19 22,600 | 10-07 09:30 | 10-07 10:18 | 195.5 | 170.9 | -₹1,633 | stop |
| PE | 10-19 22,450 | 10-05 11:45 | 10-05 13:40 | 209.3 | 177.5 | -₹2,103 | stop |
| CE | 10-19 22,350 | 10-01 14:45 | 10-05 09:15 | 337.2 | 337.0 | -₹76 | EOD next open |
| CE | 10-19 22,700 | 09-29 11:30 | 09-29 12:32 | 365.2 | 329.8 | -₹2,364 | stop |
| PE | 10-19 23,250 | 09-24 09:30 | 09-25 09:15 | 215.2 | 215.1 | -₹49 | EOD next open |
| PE | 10-19 23,350 | 09-22 12:15 | 09-23 09:15 | 219.7 | 203.7 | -₹1,085 | EOD next open |
| CE | 10-27 23,250 | 09-16 10:30 | 09-17 09:15 | 461.4 | 457.2 | -₹360 | EOD next open |
| PE | 10-27 24,150 | 08-24 13:15 | 08-24 15:29 | 291.9 | 283.4 | -₹607 | stop |
| CE | 10-27 24,200 | 08-20 09:30 | 08-21 09:15 | 593.3 | 616.6 | +₹1,399 | EOD next open |
| PE | 10-27 24,300 | 08-13 10:30 | 08-13 11:57 | 315.2 | 302.4 | -₹889 | stop |
| PE | 10-27 24,600 | 08-04 09:30 | 08-05 09:15 | 376.2 | 369.8 | -₹490 | EOD next open |
The nearest expiry at least 2 days away that has a price at entry is used, so early trades sit in the 27 Oct contract, which is far dated and moves less than a weekly would. The last PE trade was still open at the end of the data and is not counted.
Index trades (trailing-anchor version)
| Entry (month-day time) | Exit (month-day time) | Bought at (index level) | Sold at (index level) | Points | Net (rupees) | Why it ended |
|---|---|---|---|---|---|---|
| 10-16 10:15 | 10-19 09:15 | 23,095.1 | 23,150.8 | +55.6 | +₹2,712 | EOD(next open) |
| 10-09 09:30 | 10-12 09:15 | 22,375.6 | 22,593.1 | +217.5 | +₹13,257 | EOD(next open) |
| 10-01 14:45 | 10-05 09:15 | 22,358.1 | 22,532.3 | +174.2 | +₹10,444 | EOD(next open) |
| 09-29 11:30 | 09-29 12:30 | 22,696.3 | 22,646.2 | -50.1 | -₹4,141 | stop |
| 09-16 10:30 | 09-17 09:15 | 23,229.6 | 23,195.2 | -34.5 | -₹3,148 | EOD(next open) |
| 08-20 09:30 | 08-21 09:15 | 24,191.0 | 24,284.0 | +92.9 | +₹5,093 | EOD(next open) |
| 08-17 13:15 | 08-17 15:15 | 24,346.2 | 24,296.2 | -50.1 | -₹4,205 | stop |
| 08-13 09:15 | 08-13 09:30 | 24,431.7 | 24,342.0 | -89.7 | -₹6,785 | stop(gap) |
| 08-05 09:15 | 08-05 09:30 | 24,669.3 | 24,619.2 | -50.1 | -₹4,218 | stop |
| 07-24 12:30 | 07-27 09:15 | 23,783.9 | 23,928.3 | +144.4 | +₹8,456 | EOD(next open) |
| 07-15 09:30 | 07-15 12:30 | 24,196.6 | 24,146.5 | -50.1 | -₹4,199 | stop |
| 07-09 09:30 | 07-09 15:00 | 24,022.8 | 23,972.7 | -50.1 | -₹4,192 | stop |
| 07-06 09:45 | 07-07 09:15 | 24,369.4 | 24,464.4 | +95.0 | +₹5,219 | EOD(next open) |
| 06-24 10:15 | 06-25 09:15 | 23,917.8 | 24,125.8 | +207.9 | +₹12,577 | EOD(next open) |
| 06-16 10:45 | 06-16 11:30 | 23,962.3 | 23,912.2 | -50.1 | -₹4,190 | stop |
| 06-11 11:30 | 06-11 14:45 | 23,237.5 | 23,187.4 | -50.1 | -₹4,162 | stop |
| 06-03 12:45 | 06-03 13:00 | 23,325.2 | 23,275.2 | -50.1 | -₹4,165 | stop |
| 06-02 13:00 | 06-03 09:15 | 23,458.9 | 23,415.9 | -43.0 | -₹3,712 | EOD(next open) |
| 05-20 11:30 | 05-21 09:15 | 23,600.0 | 23,830.0 | +229.9 | +₹14,019 | EOD(next open) |
| 05-18 11:00 | 05-19 09:15 | 23,465.0 | 23,675.2 | +210.2 | +₹12,744 | EOD(next open) |
| 05-13 10:30 | 05-13 10:45 | 23,452.3 | 23,402.2 | -50.1 | -₹4,170 | stop |
| 05-07 12:45 | 05-07 13:00 | 24,462.9 | 24,387.6 | -75.4 | -₹5,854 | stop(gap) |
| 05-05 13:00 | 05-06 09:15 | 24,012.7 | 24,170.9 | +158.2 | +₹9,343 | EOD(next open) |
| 04-30 12:30 | 05-04 09:15 | 23,912.1 | 24,063.5 | +151.4 | +₹8,902 | EOD(next open) |
| 04-29 09:30 | 04-29 14:30 | 24,110.5 | 24,188.4 | +77.8 | +₹4,115 | SELL+ADX |
| 04-27 09:30 | 04-27 11:30 | 24,045.1 | 23,995.0 | -50.1 | -₹4,193 | stop |
| 04-13 10:30 | 04-15 09:15 | 23,721.9 | 24,163.7 | +441.8 | +₹27,783 | EOD(next open) |
| 04-10 09:30 | 04-13 09:15 | 23,938.1 | 23,589.5 | -348.6 | -₹23,589 | EOD(next open) |
| 04-07 10:15 | 04-07 10:45 | 22,921.9 | 22,871.8 | -50.1 | -₹4,149 | stop |
| 04-02 12:45 | 04-06 09:15 | 22,363.4 | 22,780.2 | +416.8 | +₹26,212 | EOD(next open) |
| 04-01 13:15 | 04-01 13:30 | 22,883.3 | 22,808.2 | -75.0 | -₹5,769 | stop(gap) |
| 04-01 09:30 | 04-01 09:45 | 22,928.6 | 22,851.4 | -77.3 | -₹5,917 | stop(gap) |
| 03-25 09:30 | 03-25 14:30 | 23,214.8 | 23,337.2 | +122.5 | +₹7,055 | SELL+ADX |
| 03-24 09:30 | 03-24 09:45 | 22,839.7 | 22,747.2 | -92.5 | -₹6,901 | stop(gap) |
| 03-23 14:00 | 03-23 14:30 | 22,598.9 | 22,548.8 | -50.1 | -₹4,137 | stop |
| 03-20 09:15 | 03-20 12:30 | 23,110.2 | 23,155.6 | +45.3 | +₹2,042 | SELL+ADX |
| 03-16 11:30 | 03-16 12:30 | 23,172.8 | 23,122.8 | -50.1 | -₹4,159 | stop |
| 03-16 09:45 | 03-16 10:00 | 23,240.3 | 23,168.7 | -71.6 | -₹5,559 | stop(gap) |
| 03-12 11:00 | 03-12 11:15 | 23,741.7 | 23,691.6 | -50.1 | -₹4,181 | stop |
| 03-09 11:00 | 03-09 11:15 | 23,866.3 | 23,816.2 | -50.1 | -₹4,186 | stop |
| 03-05 09:45 | 03-05 10:15 | 24,596.4 | 24,546.3 | -50.1 | -₹4,215 | stop |
| 03-04 11:15 | 03-04 11:30 | 24,436.2 | 24,366.9 | -69.4 | -₹5,463 | stop(gap) |
| 03-02 14:15 | 03-02 14:30 | 24,787.6 | 24,730.8 | -56.8 | -₹4,658 | stop(gap) |
| 02-26 10:15 | 02-26 10:45 | 25,558.7 | 25,508.6 | -50.1 | -₹4,252 | stop |
| 02-25 09:30 | 02-25 12:30 | 25,584.9 | 25,534.8 | -50.1 | -₹4,253 | stop |
| 02-20 10:00 | 02-23 09:15 | 25,520.3 | 25,678.3 | +158.0 | +₹9,268 | EOD(next open) |
| 02-16 12:30 | 02-17 09:15 | 25,576.5 | 25,637.9 | +61.4 | +₹2,989 | EOD(next open) |
| 02-06 11:45 | 02-06 12:15 | 25,623.9 | 25,573.8 | -50.1 | -₹4,255 | stop |
| 02-03 10:45 | 02-03 13:15 | 25,798.3 | 25,748.2 | -50.1 | -₹4,262 | stop |
| 02-02 11:45 | 02-03 09:15 | 24,869.0 | 26,308.0 | +1,439.0 | +₹92,534 | EOD(next open) |
| 02-01 13:00 | 02-01 13:45 | 25,074.2 | 25,024.2 | -50.1 | -₹4,233 | stop |
| 01-27 11:45 | 01-27 12:00 | 25,154.2 | 25,103.9 | -50.3 | -₹4,253 | stop(gap) |
| 01-27 09:45 | 01-27 10:00 | 25,148.9 | 25,098.8 | -50.1 | -₹4,236 | stop |
| 01-22 09:30 | 01-22 10:15 | 25,385.3 | 25,335.2 | -50.1 | -₹4,246 | stop |
| 01-21 12:15 | 01-21 14:00 | 25,135.2 | 25,151.0 | +15.8 | +₹43 | SELL+ADX |
| 01-19 15:00 | 01-19 15:15 | 25,629.4 | 25,579.3 | -50.1 | -₹4,255 | stop |
| 01-12 12:30 | 01-13 09:15 | 25,661.0 | 25,897.2 | +236.2 | +₹14,348 | EOD(next open) |
How the replay works
- Signals use confirmed candle closes. Orders fill at the next candle's open, as TradingView does with process_orders_on_close=false.
- ADX and the DI lines follow Pine's ta.dmi (Wilder smoothing, length 12 and 12).
- The stop loss of 50 points becomes active from the candle after entry. A gap through the stop fills at the open, otherwise at the stop price. Slippage applies on every fill.
- Not modelled: futures basis, margin, option premiums, and any difference between Fyers and TradingView candles.
Original Pine script
//@version=6
strategy("NIFTY 50 - 108 Point + ADX Strategy",
overlay=true,
pyramiding=0,
initial_capital=100000,
currency=currency.INR,
default_qty_type=strategy.fixed,
default_qty_value=1,
commission_type=strategy.commission.percent,
commission_value=0.03,
slippage=2,
process_orders_on_close=false)
// 1. INPUTS
groupSignal = "Primary Signal"
movePoints = input.float(108.0, "Signal Movement (NIFTY points)", minval=0.05, step=1.0, group=groupSignal)
signalMode = input.string("Reversal", "Signal Logic", options=["Reversal", "Breakout"], group=groupSignal)
groupADX = "ADX Confirmation"
diLength = input.int(12, "DI Length", minval=1, group=groupADX)
adxSmoothing = input.int(12, "ADX Smoothing", minval=1, group=groupADX)
adxThreshold = input.float(25.0, "ADX Threshold", minval=1, step=0.5, group=groupADX)
groupRisk = "Risk Management"
useStop = input.bool(true, "Enable Stop Loss", group=groupRisk)
stopPoints = input.float(50.0, "Stop Loss (NIFTY points)", minval=1, group=groupRisk)
useTarget = input.bool(false, "Enable Profit Target", group=groupRisk)
targetPoints = input.float(100.0, "Profit Target (NIFTY points)", minval=1, group=groupRisk)
useEod = input.bool(true, "Close at End of Day", group=groupRisk)
eodHour = input.int(15, "EOD Hour (exchange time)", minval=0, maxval=23, group=groupRisk)
eodMinute = input.int(20, "EOD Minute", minval=0, maxval=59, group=groupRisk)
// 2. TIMEFRAME VALIDATION
is15m = timeframe.isminutes and timeframe.multiplier == 15
if barstate.isfirst and not is15m
runtime.error("Use this strategy on a 15-minute chart.")
// 3. PRIMARY SIGNAL PROXY
// NOTE: Replace this block with Ari's exact indicator formula when available.
var float anchor = na
var int trend = 0
if barstate.isfirst
anchor := close
bool buySignal = false
bool sellSignal = false
if barstate.isconfirmed
if signalMode == "Reversal"
if close >= anchor + movePoints
buySignal := trend != 1
if buySignal
trend := 1
anchor := close
else if close <= anchor - movePoints
sellSignal := trend != -1
if sellSignal
trend := -1
anchor := close
else
if close >= anchor + movePoints
buySignal := trend != 1
if buySignal
trend := 1
anchor := close
else if close <= anchor - movePoints
sellSignal := trend != -1
if sellSignal
trend := -1
anchor := close
// 4. ADX FILTER
[plusDI, minusDI, adxValue] = ta.dmi(diLength, adxSmoothing)
adxConfirmed = adxValue > adxThreshold
// 5. ENTRY AND EXIT RULES (long-only)
enterLong = buySignal and adxConfirmed
exitLong = sellSignal and adxConfirmed
if enterLong and strategy.position_size == 0
strategy.entry("Long", strategy.long, comment="BUY + ADX")
if exitLong and strategy.position_size > 0
strategy.close("Long", comment="SELL + ADX")
// 6. STOP LOSS AND PROFIT TARGET
if strategy.position_size > 0
stopPrice = strategy.position_avg_price - stopPoints
targetPrice = strategy.position_avg_price + targetPoints
if useStop and useTarget
strategy.exit("Risk Exit", "Long", stop=stopPrice, limit=targetPrice)
else if useStop
strategy.exit("Risk Exit", "Long", stop=stopPrice)
else if useTarget
strategy.exit("Risk Exit", "Long", limit=targetPrice)
// 7. END-OF-DAY EXIT
eodReached = hour(time_close) > eodHour or (hour(time_close) == eodHour and minute(time_close) >= eodMinute)
if useEod and eodReached and strategy.position_size > 0
strategy.close("Long", comment="EOD Exit")
// 8/9. plotshape + alertcondition blocks omitted on this page (visual only)