Zeal Terminal Open in Zeal Terminal

Pine Script v4 · Strategy

ARR-Pivote-India-Stategy

A Pine Script v4 strategy with no technical-analysis calculation. It has 5 order rules, 2 entries among them, and trades long and short with the default settings. Exits use a stop loss. Each trade is one contract and pays no commission. 11 settings; defaults include Max Loss on one Trade 0.5, Trade base Level PP and Close all trade @ Hours 13.

Generated from the script's code by a template: every clause is a fact read from the source. Not written by a person or a model, and not taken from the author's description.

Does ARR-Pivote-India-Stategy repaint?
Yes
At least one pattern in the source can repaint: higher-timeframe data.
How did ARR-Pivote-India-Stategy do on BTCUSDT 1D with default settings?
−0.42%
From 26 Jan 2024 to 21 Oct 2026, over 2 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
Can ARR-Pivote-India-Stategy be converted to Pine Script v5?
Yes
The upgrade takes 1 step, from v4; each was run before and after on the same candles with identical results, and the v5 script can be downloaded below.
Does ARR-Pivote-India-Stategy use a stop loss?
Yes
strategy.exit sets a stop on line 98, 99.
Does ARR-Pivote-India-Stategy run in Zeal Terminal?
Yes
It compiles in 26 ms and runs 1,000 bars in 117 ms, in the browser.

BTCUSDT · 1D · default settings

  • TP
  • PP
  • Winning trade
  • Losing trade
  • Equity
  • Buy and hold
Prerendered with the defaults. Change anything and run it here. The script runs in your browser.
Settings (11)
S2R1S2R1S2R1S2R1S2R1S2R1S2R1S2R1S2R1S2R1S2R1S2R1S2R1S2R1S2R1S2R1S2R1S2R1S2R1S2R1S2R1S2R1S2PDPDPPR1S240,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOct$141,581$202,527Equity from $100,000
Binance BTCUSDT 1D candles, 26 Jan 2024 to 21 Oct 2026, 1,000 bars, default settings. Triangles mark entries; circles mark exits. Lines are what the script plots. Lines, boxes and labels are the script's own drawings, the most recent ones its limits keep.
Net profit
−0.42%
−$423.06
Buy and hold
+102.5%
same period
Closed trades
2
0 won · 2 lost
Profitable
0.0%
of closed trades
Profit factor
0.00
gross profit ÷ gross loss
Max drawdown
0.56%
−$557.76

One run with the author's default settings, $100,000 starting capital, commission as the script sets it. A long position was still open at the last bar. A single backtest says little about future results and is not a recommendation. Backtests are simulations on historical data and are not investment advice.

Review

What a careful reader of this script would point out, found by checking the source and the backtest.

  • Check

    No commission

    The backtest assumes free trading. Results on any real exchange will be lower.

  • Note

    No slippage

    Fills are assumed at the exact open price. Add slippage in the properties for a more realistic test.

  • Note

    Uses an argument v6 removed

    when = on line 94, 96, 100. The upgraded version below moves each call inside an if block.

Upgrade and export

Written in Pine Script v4. The upgrade to v5 takes 1 step, one per version, each applied to the result of the one before. A last clean-v5 pass then types the settings and moves when = into if blocks, which v6 requires. Every step runs before and after on the same candles in Zeal Terminal's engine; a step whose results differ is shown but not offered as a download. Upgrades preserve behaviour: bugs are fixed in the Review, never silently here.

  • Upgrading to v5 renames security → request.security.
  • 3 strategy calls use the when = argument (line 94, 96, 100). It is deprecated in v5 and removed in v6, where each call moves inside an if block.

v4 → v5

Verified

Same 2 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.

  • Line 4: //@version=4 → //@version=5
  • Line 9: input(type = input.bool) → input.bool()
  • Line 10: input(type = input.bool) → input.bool()
  • Line 11: input(type = input.bool) → input.bool()
  • Line 12: input(type = input.bool) → input.bool()
  • Line 13: input(type = input.bool) → input.bool()
7 more edits
  • Line 14: input(type = input.bool) → input.bool()
  • Line 15: input(type = input.bool) → input.bool()
  • Line 16: input(type = input.float) → input.float()
  • Line 17: input(type = input.string) → input.string()
  • Line 19: input(type = input.integer) → input.int()
  • Line 20: input(type = input.session) → input.session()
  • Line 30: security → request.security
⋯//Reference credit goes to All-//@version=4+//@version=5strategy("ARR-Pivote-India-Stategy",shorttitle="ARR-PP-Ind", overlay=true)⋯//User Input-showPrevDayHighLow = input(false, title="Show previous day's High & Low(PDH/PDL)", type=input.bool)+showPrevDayHighLow = input.bool(false, title="Show previous day's High & Low(PDH/PDL)")-showPivoteLine = input(true, title="Show Pivot Point(PP)", type=input.bool)+showPivoteLine = input.bool(true, title="Show Pivot Point(PP)")-showPivoteR1Line = input(false, title="Show Pivot Point Resistance (R1)", type=input.bool)+showPivoteR1Line = input.bool(false, title="Show Pivot Point Resistance (R1)")-showPivoteS1Line = input(false, title="Show Pivot Point Support (S1)", type=input.bool)+showPivoteS1Line = input.bool(false, title="Show Pivot Point Support (S1)")-showTypicalPriceLine = input(true, title="Show True Price", type=input.bool)+showTypicalPriceLine = input.bool(true, title="Show True Price")-tradeLong = input(true, title="Trade on Long Entry", type=input.bool)+tradeLong = input.bool(true, title="Trade on Long Entry")-tradeShort = input(false, title="Trade on Short Entry", type=input.bool)+tradeShort = input.bool(false, title="Trade on Short Entry")-maxLoss = input(0.5, title="Max Loss on one Trade", type=input.float)+maxLoss = input.float(0.5, title="Max Loss on one Trade")-tradeOn=input(title="Trade base Level", type=input.string,+tradeOn=input.string(title="Trade base Level",     options=["PP", "PDH", "PDL","R1","S1"], defval="PP")-closeHrs = input(13, title="Close all trade @ Hours", type=input.integer)+closeHrs = input.int(13, title="Close all trade @ Hours")-sessSpec = input("0915-1530", title="Session time", type=input.session)+sessSpec = input.session("0915-1530", title="Session time")// Defaults⋯// Get High & Low-getSeries(_e, _timeFrame) => security(syminfo.tickerid, _timeFrame, _e, lookahead=barmerge.lookahead_on) +getSeries(_e, _timeFrame) => request.security(syminfo.tickerid, _timeFrame, _e, lookahead=barmerge.lookahead_on) is_newbar(res, sess) =>⋯

Clean v5

VerifiedDownload the v5 script

Same 2 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine.

  • Line 94: when = strategy.position_size <= 0 → if block
  • Line 96: when = strategy.position_size <= 0 → if block
  • Line 100: when = hour == closeHrs → if block
⋯if (open < tradeEventPrice) and ( close >tradeEventPrice ) and ( hour < (closeHrs-2)  ) and tradeLong-    strategy.entry("buy", strategy.long, 1, when=strategy.position_size <= 0)+    if strategy.position_size <= 0+        strategy.entry("buy", strategy.long, 1)if (open > tradeEventPrice) and ( close <tradeEventPrice ) and ( hour < (closeHrs-2)  ) and  tradeShort-    strategy.entry("Sell", strategy.short, 1, when=strategy.position_size <= 0)+    if strategy.position_size <= 0+        strategy.entry("Sell", strategy.short, 1)mxloss=orbPrevDayClose*maxLoss⋯strategy.exit("exit", "Sell",  loss = mxloss) -strategy.close_all(when =   hour == closeHrs   , comment = "close all entries")+if hour == closeHrs+    strategy.close_all(comment = "close all entries")

Does it run in Pine Script v6?

Yes

Same 2 trades and the same P&L on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine. Both versions were run on Zeal Terminal's engine, and the results are identical. It differs from the v5 version by 1 edit.

Download the v6 script

⋯//Reference credit goes to All-//@version=5+//@version=6strategy("ARR-Pivote-India-Stategy",shorttitle="ARR-PP-Ind", overlay=true)⋯

Settings

Every input the script declares, with its default and what it feeds. Bounds are the ones the script enforces.

SettingDefaultType and rangeFeeds
Show previous day's High & Low(PDH/PDL)falsebool PDH PDL
Show Pivot Point(PP)truebool PP
Show Pivot Point Resistance (R1)falsebool R1
Show Pivot Point Support (S1)falsebool S1
Show True PricetrueboolTP
Trade on Long Entrytrueboolentry buy line 93
Trade on Short Entryfalseboolentry Sell line 95
Max Loss on one Trade0.5floatmxloss
Trade base LevelPPstring · options ["PP", "PDH", "PDL","R1","S1"]tradeEventPrice
Close all trade @ Hours13int (written input.integer)entry buy entry Sell line 93 line 95 close_all
Session time0915-1530sessionnewbar

What it calculates

No technical-analysis calculation: the script works on prices and settings directly.

Signal flow

How price data and settings reach the orders. Each box is a name in the script, or several computed the same way; each arrow is a value one of them reads. Hover a box for its members.

sessSpecSession timesetting · 0915-1530highhighprice datalowlowprice dataclosecloseprice dataopenopenprice datamaxLossMax Loss on one Tradesetting · 0.5tradeOnTrade base Levelsetting · PPcloseHrsClose all trade @ Hourssetting · 13lStyle, t, y, m, dlStyle · t +35 valuesnewbarnewbarvaluestartstartvalueendendvaluePrevDayHighPrevDayHighvaluePrevDayLowPrevDayLowvaluePrevDayClose, orbPrevDayClosePrevDayClose · orbPrevD…2 valuesPivoteLinePivoteLinevaluePivoteR1PivoteR1valuePivoteS1PivoteS1valueorbPrevDayOpenorbPrevDayOpenvalueTypicalPriceTypicalPricevaluel_pdhl_pdhvaluel_pdll_pdlvaluemxlossmxlossvaluetradeEventPricetradeEventPriceconditioncColor, rColor, sColor, _pdh, _pdl, _Pp, l_pp, l_R1, l_SRColourcColor · rColor +7entry:buyOpen buystrategy.entryentry:SellOpen Sellstrategy.entryexit:exitexit exitstrategy.exitclose_all:close_all strategy.close_allplot:71TPplotplot:72 PDHplotplot:73 PDLplotplot:74 PPplotplot:75 R1plotplot:76 S1plot

Order rules

OrderFires whenBy defaultLine
Open buy longstrategy.position_size <= 0On94
Open Sell shortstrategy.position_size <= 0On96
Exit exit stopevery barOn98
Exit exit stopevery barOn99
Close hour == closeHrsOn100

Each order is guarded by the setting shown. “Off” orders never fire unless that setting is switched on.

Does it repaint?

Yes

At least one pattern in the source can repaint; it is marked Check below.

Not measuredNo trades to compareThe last 300 bars, from 26 Dec 2025, were fed to the engine as live ticks, but neither the live nor the historical run produced any trades in them, so the replay says nothing either way.
  • CheckHigher-timeframe data1 security call(s) use lookahead_on (line 30). Without a [1] offset this reads future bars in history.
  • ClearFuture-bar referencesNo negative history offsets such as close[-1].
  • ClearIntrabar recalculationNo varip, calc_on_every_tick or realtime-only state. Orders are decided once per closed bar.
  • ClearOrder timingOrders fill at the next bar's open, after the signal bar has closed.

The checks read the source; the replay runs it. Together they catch the common causes, not every possible one.

Other markets

The same script with default settings on 8 Binance markets. Each row is a separate backtest over the most recent 1,000 bars.

MarketNetBuy and holdTradesWonProfit factorMax drawdownPeriod
BTCUSDT 1D−0.4%+102.5%20%0.000.6%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h−8.5%+5.5%260%0.008.7%8 May 2026 – 21 Oct 2026
ETHUSDT 1D−1.8%+9.8%1370%0.001.8%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h−0.1%+8.4%160%0.000.2%8 May 2026 – 21 Oct 2026
SOLUSDT 1D−0.1%+16.7%1380%0.000.1%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h−0.0%+21.5%180%0.000.0%8 May 2026 – 21 Oct 2026
BNBUSDT 1D−0.2%+148.3%870%0.000.3%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h−0.0%+17.1%160%0.000.0%8 May 2026 – 21 Oct 2026

Backtests are simulations on historical data and are not investment advice.

The trades

By market direction

At entry, last 90 barsTradesWonP&L
Rising market0—$0.00
Sideways market20%−$423.06
Falling market0—$0.00

Rising and falling mean the market moved more than 15% over the 90 bars before entry.

How bad could the drawdown be?

0.4%

The 95th percentile of the worst drawdown when the same 2 trades are reshuffled 5,000 times. The bar spans the 5th to 95th percentile, 0.4% to 0.4%; the tick is what actually happened, 0.4%. Order luck alone moves it this much.

0%1%
All 2 trades
SideEntryExitBarsP&L
long30 Jan 2024 43,302.7030 Jan 2024 43,092.600−$210.16
long2 Feb 2024 43,082.902 Feb 2024 42,870.100−$212.90

Similar scripts

No other indicator or strategy here shares enough of its calculations.

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 26 msYes 1,000 bars in 117 msNot measured
PineTSNo v5 and v6 only—Not measured

“Matches TradingView” needs this script's own output exported from TradingView and compared bar by bar, which has not been done for this script. The engine is built on OpenPineScript, whose conformance results are in its conformance report. PineTS runs Pine Script v5 and v6 only.

Source

Copied verbatim from the author's published script, with its licence header intact. The author may have updated the original since this snapshot.

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/// © arameshraju//Reference credit goes to All//@version=4strategy("ARR-Pivote-India-Stategy",shorttitle="ARR-PP-Ind", overlay=true)// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/// © arameshraju//User InputshowPrevDayHighLow = input(false, title="Show previous day's High & Low(PDH/PDL)", type=input.bool)showPivoteLine = input(true, title="Show Pivot Point(PP)", type=input.bool)showPivoteR1Line = input(false, title="Show Pivot Point Resistance (R1)", type=input.bool)showPivoteS1Line = input(false, title="Show Pivot Point Support (S1)", type=input.bool)showTypicalPriceLine = input(true, title="Show True Price", type=input.bool)tradeLong = input(true, title="Trade on Long Entry", type=input.bool)tradeShort = input(false, title="Trade on Short Entry", type=input.bool)maxLoss = input(0.5, title="Max Loss on one Trade", type=input.float)tradeOn=input(title="Trade base Level", type=input.string,     options=["PP", "PDH", "PDL","R1","S1"], defval="PP")closeHrs = input(13, title="Close all trade @ Hours", type=input.integer)sessSpec = input("0915-1530", title="Session time", type=input.session)// Defaults// ColorscColor = color.blackrColor = color.redsColor = color.green// Line style & TransparencylStyle = plot.style_linelTransp = 35// Get High & LowgetSeries(_e, _timeFrame) => security(syminfo.tickerid, _timeFrame, _e, lookahead=barmerge.lookahead_on) is_newbar(res, sess) =>    t = time(res, sess)    na(t[1]) and not na(t) or t[1] < tnewbar = is_newbar("375", sessSpec)// Today's Session Start timestampy = year(timenow)m = month(timenow)d = dayofmonth(timenow)// Start & End time for Todaystart = timestamp(y, m, d, 09, 15)end = start + 86400000PrevDayHigh = getSeries(high[1], 'D')PrevDayLow = getSeries(low[1], 'D')PrevDayClose = getSeries(close[1], 'D')PivoteLine=(PrevDayHigh+PrevDayLow+PrevDayClose) /3PivoteR1=(PivoteLine*2) -PrevDayLowPivoteS1=(PivoteLine*2) -PrevDayHighorbPrevDayOpen = getSeries(open[1], 'D')orbPrevDayClose = getSeries(close[1], 'D')//** True PriceTypicalPrice=(high[1]+low[1]+close[1])/3//Preview Day High line_pdh = line.new(start, PrevDayHigh, end, PrevDayHigh, xloc.bar_time, color=color.red, style=line.style_solid, width=2)line.delete(_pdh[1])_pdl = line.new(start, PrevDayLow, end, PrevDayLow, xloc.bar_time, color=color.green, style=line.style_solid, width=2)line.delete(_pdl[1])_Pp = line.new(start, PrevDayLow, end, PrevDayLow, xloc.bar_time, color=color.green, style=line.style_dashed, width=2)line.delete(_Pp[1])//Previous Day Low Linel_pdh = label.new(start, PrevDayHigh, text="PD", xloc=xloc.bar_time, textcolor=rColor, style=label.style_none)label.delete(l_pdh[1])l_pdl = label.new(start, PrevDayLow, text="PD", xloc=xloc.bar_time, textcolor=sColor, style=label.style_none)label.delete(l_pdl[1])//Pivote Linel_pp = label.new(start, PivoteLine, text="PP", xloc=xloc.bar_time, textcolor=color.black, style=label.style_none)label.delete(l_pp[1])l_R1 = label.new(start, PivoteR1, text="R1", xloc=xloc.bar_time, textcolor=color.fuchsia, style=label.style_none)label.delete(l_pp[1])l_SR = label.new(start, PivoteS1, text="S2", xloc=xloc.bar_time, textcolor=color.navy, style=label.style_none)label.delete(l_pp[1])plot(showTypicalPriceLine?TypicalPrice:na , title='TP', color=rColor)plot(showPrevDayHighLow?PrevDayHigh:na , title=' PDH', color=rColor)plot(showPrevDayHighLow?PrevDayLow:na, title=' PDL', color=sColor)plot(showPivoteLine?PivoteLine:na, title=' PP', color=color.black)plot(showPivoteR1Line?PivoteR1:na, title=' R1', color=color.fuchsia)plot(showPivoteS1Line?PivoteS1:na, title=' S1', color=color.navy)// Today's Session Start timestamp// Start & End time for Today//endTime = timestamp(t, m, d, 15, 00)tradeEventPrice= if string("PDH")==tradeOn     PrevDayHighelse if string("PDL")==tradeOn    PrevDayLowelse if string("R1")==tradeOn    PivoteR1else if string("S1")==tradeOn    PivoteS1else if string("TR")==tradeOn    TypicalPrice    else    PivoteLine//tradeEventPrice=PrevDayHighif (open < tradeEventPrice) and ( close >tradeEventPrice ) and ( hour < (closeHrs-2)  ) and tradeLong    strategy.entry("buy", strategy.long, 1, when=strategy.position_size <= 0)if (open > tradeEventPrice) and ( close <tradeEventPrice ) and ( hour < (closeHrs-2)  ) and  tradeShort    strategy.entry("Sell", strategy.short, 1, when=strategy.position_size <= 0)mxloss=orbPrevDayClose*maxLossstrategy.exit("exit", "buy",  loss = mxloss) strategy.exit("exit", "Sell",  loss = mxloss) strategy.close_all(when =   hour == closeHrs   , comment = "close all entries")