Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

Faytterro Estimator Strategy

A Pine Script v5 strategy with no technical-analysis calculation. It has 4 order rules, 2 entries among them, and trades long and short with the default settings. Exits use a stop loss. Each trade commits 100% of equity and pays no commission. 5 settings; defaults include source hlc3, faytterro estimator lenght 10 and minumum enrty-close gap (different direction) 650.

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 Faytterro Estimator Strategy repaint?
No
No repainting patterns were found in the source, and a live tick-by-tick replay matched history on 17 of 17 trades.
How did Faytterro Estimator Strategy do on BTCUSDT 1D with default settings?
−15.80%
From 26 Jan 2024 to 21 Oct 2026, over 52 closed trades, against +102.5% for buy and hold. A backtest, not investment advice.
What alerts does Faytterro Estimator Strategy have?
1
alertcondition.
Does Faytterro Estimator Strategy run in Pine Script v6?
No
The v6 version runs in Zeal Terminal's engine, but its results differ from the v5 version: Trades differ: 52 before, 0 after on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine. It is shown for reference and is not offered as a download.
Does Faytterro Estimator Strategy use a stop loss?
Yes
strategy.exit sets a stop on line 38, 41.

BTCUSDT · 1D · default settings

  • 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 (5)
40,00060,00080,000100,000120,000AprJulOct2025AprJulOct2026AprJulOct$868,516$2,025,273Equity from $1,000,000
Binance BTCUSDT 1D candles, 26 Jan 2024 to 21 Oct 2026, 1,000 bars, default settings. Triangles mark entries; circles mark exits. The script plots nothing itself; the lines and the lower pane are its own calculations, drawn for reference.
Net profit
−15.80%
−$157,983.00
Buy and hold
+102.5%
same period
Closed trades
52
21 won · 31 lost
Profitable
40.4%
of closed trades
Profit factor
0.78
gross profit ÷ gross loss
Max drawdown
32.02%
−$324,516.00

One run with the author's default settings, $1,000,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.

  • Check

    Every trade uses all the equity

    default_qty_value is 100% of equity.

  • Note

    No slippage

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

Settings

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

SettingDefaultType and rangeFeeds
sourcehlc3sourcecr
faytterro estimator lenght10int · max 500cr buy sell line 19
minumum enrty-close gap (different direction)650floatbuy sell sbuy ssell
minumum entry-entry gap (same direction)650floatbuy sell sbuy ssell
trailing stop loss5float · step 0.1exit close long exit close short

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.

hlc3hlc3price datalenfaytterro estimator len…setting · 10closecloseprice datalen4minumum entry-entry gap…setting · 650len3minumum enrty-close gap…setting · 650zzvaluecrcrvaluebbbbvaluessssvaluebuybuyconditionsellsellconditionsbuysbuyconditionssellssellconditionentry:longOpen longstrategy.entryexit:close longexit close longstrategy.exitentry:shortOpen shortstrategy.entryexit:close shortexit close shortstrategy.exitalertcondition:29alertconditionalertcondition

Order rules

OrderFires whenBy defaultLine
Open long long(buy)On37
Exit close long stop(buy)On38
Open short short(sell)On40
Exit close short stop(sell)On41

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

Alerts

AlertCallMessageLine
(no title)alertconditionno message29

Does it repaint?

No

No repainting patterns in the source, and the live replay matched history.

17/17trades identical when replayed liveThe last 300 bars, from 26 Dec 2025, were fed to the engine as live ticks, four per bar, and compared with the historical run. Orders are decided once per closed bar, so nothing can change mid-bar.
  • ClearHigher-timeframe dataThe script requests no other symbol or timeframe.
  • 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−15.8%+102.5%5240%0.7832.0%26 Jan 2024 – 21 Oct 2026
BTCUSDT 4h−7.7%+5.5%2544%0.7919.9%8 May 2026 – 21 Oct 2026
ETHUSDT 1D−7.4%+9.8%617%0.007.4%26 Jan 2024 – 21 Oct 2026
ETHUSDT 4h0.0%+8.4%00%—0.0%8 May 2026 – 21 Oct 2026
SOLUSDT 1D0.0%+16.7%00%—0.0%26 Jan 2024 – 21 Oct 2026
SOLUSDT 4h0.0%+21.5%00%—0.0%8 May 2026 – 21 Oct 2026
BNBUSDT 1D0.0%+148.3%00%—0.0%26 Jan 2024 – 21 Oct 2026
BNBUSDT 4h0.0%+17.1%00%—0.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 market1155%$18,122.60
Sideways market2631%−$245,563.00
Falling market1547%$69,458.00

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

How bad could the drawdown be?

38.8%

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

0%45%
All 52 trades
SideEntryExitBarsP&L
short5 Jun 2024 70,537.8012 Jun 2024 69,577.907$13,608.90
long5 Jul 2024 57,050.005 Jul 2024 54,693.500−$41,868.30
short26 Jul 2024 65,799.9027 Jul 2024 69,012.601−$47,445.20
short28 Jul 2024 67,896.5029 Jul 2024 69,822.801−$26,223.80
long15 Aug 2024 58,683.4015 Aug 2024 56,915.200−$27,059.70
short28 Aug 2024 59,415.0029 Aug 2024 60,830.801−$20,754.60
long13 Sep 2024 58,132.3016 Sep 2024 57,718.403−$6,054.24
short1 Oct 2024 63,327.607 Oct 2024 62,994.506$4,440.60
short26 Oct 2024 66,698.3028 Oct 2024 69,841.002−$39,986.10
short29 Oct 2024 69,962.2029 Oct 2024 73,258.100−$38,095.60
short30 Oct 2024 72,736.405 Nov 2024 70,471.806$23,990.80
short24 Nov 2024 97,672.4027 Nov 2024 95,674.703$16,250.90
short28 Nov 2024 95,863.104 Dec 2024 98,437.406−$21,773.40
short5 Dec 2024 98,587.305 Dec 2024 103,517.000−$39,451.50
short19 Dec 2024 100,204.0020 Dec 2024 97,242.701$22,151.90
short28 Jan 2025 102,083.0030 Jan 2025 105,459.002−$25,525.90
short31 Jan 2025 104,723.003 Feb 2025 101,386.003$23,776.30
long14 Feb 2025 96,608.1018 Feb 2025 94,020.104−$20,627.10
long8 Mar 2025 86,801.709 Mar 2025 82,557.201−$36,643.20
long10 Mar 2025 80,734.5010 Mar 2025 80,086.700−$5,718.15
long11 Mar 2025 78,595.9012 Mar 2025 80,610.101$18,118.30
long21 Mar 2025 84,223.4028 Mar 2025 84,554.307$2,848.67
long16 Apr 2025 83,644.004 May 2025 95,856.4018$106,286.00
short4 May 2025 95,856.408 May 2025 98,218.704−$20,559.10
short20 May 2025 105,574.0021 May 2025 109,527.001−$30,470.60
short25 May 2025 107,762.007 Jun 2025 105,760.0013$14,547.20
short22 Jul 2025 117,380.009 Aug 2025 117,918.0018−$3,652.11
long4 Sep 2025 111,706.0022 Sep 2025 115,232.0018$25,070.20
short22 Sep 2025 115,232.0029 Sep 2025 114,382.007$6,046.94
short13 Oct 2025 114,959.0019 Oct 2025 109,276.006$40,792.60
long25 Oct 2025 111,005.0029 Oct 2025 110,850.004−$1,210.35
long31 Oct 2025 108,323.003 Nov 2025 105,834.003−$19,871.30
long17 Nov 2025 94,261.4017 Nov 2025 91,329.900−$26,277.50
long29 Nov 2025 90,890.701 Dec 2025 87,455.502−$30,941.50
long25 Dec 2025 87,669.408 Jan 2026 90,405.6014$24,584.80
short16 Jan 2026 95,604.8028 Jan 2026 90,547.5012$42,969.70
long16 Feb 2026 68,832.6017 Feb 2026 66,685.001−$26,684.20
long18 Feb 2026 67,503.5023 Feb 2026 65,375.705−$26,119.10
long24 Feb 2026 64,656.0026 Feb 2026 66,756.002$26,064.20
long2 Mar 2026 65,776.503 Mar 2026 66,807.201$12,982.90
short15 Mar 2026 71,211.9016 Mar 2026 74,419.401−$37,903.00
short26 Mar 2026 71,336.5031 Mar 2026 68,566.805$31,201.00
long6 Apr 2026 69,034.2019 Apr 2026 74,881.3013$70,707.90
short25 Apr 2026 77,437.101 May 2026 78,809.406−$16,046.60
short3 May 2026 78,686.806 May 2026 82,077.103−$38,323.90
long14 Jun 2026 64,458.0017 Jun 2026 64,069.303−$5,133.49
long19 Jun 2026 62,958.0023 Jun 2026 62,474.904−$6,491.55
short17 Jul 2026 63,830.2020 Jul 2026 65,729.103−$24,974.90
short21 Jul 2026 65,255.5019 Aug 2026 65,602.8029−$4,335.18
short1 Sep 2026 78,581.303 Sep 2026 80,193.102−$16,618.20
short4 Sep 2026 81,270.4018 Sep 2026 79,031.5014$21,862.50
short2 Oct 2026 84,880.1019 Oct 2026 82,116.0017$26,554.90

Similar scripts

Indicators and strategies built from the same calculations, run on BTCUSDT 1D with their own defaults so they can be compared directly.

ScriptSharesTypeNetTradesMax drawdown
Faytterro Estimator Strategy this page—v5 strategy−15.8%5232.0%
Alex Days HiLo Rajib by 14rajibhighest lowestv4 strategyNo trades on this market
Donchian Strat EXMO by pskoroplashighest lowestv4 strategy+12.1%2268.0%
Average Highest High and Lowest Low Swinger Strategy by exlux99lowest highestv4 strategy+6.4%2049.6%
Highest High and Lowest Low Channel Strategy by ceyhunhighest lowestv5 strategy−3.7%267.9%
Donchian Channels System [racer8] by racer8highest lowestv4 strategy−3.2%3643.6%

Upgrade and export

Written in Pine Script v5. The clean-v5 step types the settings and moves when = into if blocks, which v6 requires; it is run before and after like any upgrade.

  • 1 setting uses the untyped input() (line 5). It still compiles in v6; input.int, input.float or input.source state the type.
  • No v6-only features. v6 is not needed to run this script.

Clean v5

VerifiedDownload the v5 script

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

  • Line 5: input() → input.source()
⋯strategy("Faytterro Estimator Strategy v2", overlay=true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100)-src=input(hlc3,title="source")+src=input.source(hlc3,title="source")len=input.int(10,title="faytterro estimator lenght", maxval=500)⋯

Does it run in Pine Script v6?

No

The v6 version runs in Zeal Terminal's engine, but its results differ from the v5 version: Trades differ: 52 before, 0 after on BTCUSDT 1D, 1,000 bars, in Zeal Terminal's engine. It is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.

⋯// © faytterro-//@version=5+//@version=6strategy("Faytterro Estimator Strategy v2", overlay=true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 22 msYes 1,000 bars in 157 msNot measured
PineTSNot testedNot testedNot 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.

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/// © faytterro//@version=5strategy("Faytterro Estimator Strategy v2", overlay=true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100)src=input(hlc3,title="source")len=input.int(10,title="faytterro estimator lenght", maxval=500)len2=100len3=input.float(650,title="minumum enrty-close gap (different direction)")len4=input.float(650,title="minumum entry-entry gap (same direction)")cr(x, y) =>    z = 0.0    weight = 0.0    for i = 0 to y-1        z:=z + x[i]*((y-1)/2+1-math.abs(i-(y-1)/2))    z/(((y+1)/2)*(y+1)/2)cr= cr(src,2*len-1) dizi = array.new_float(500)var line=array.new_line()for i=0 to len*2    array.set(dizi,i,(i*(i-1)*(cr-2*cr[1]+cr[2])/2+i*(cr[1]-cr[2])+cr[2]))buy = array.get(dizi,len+1+5)>array.get(dizi,len+1+4) and array.get(dizi,len+1+5)<cr[len] sell = array.get(dizi,len+1+5)<array.get(dizi,len+1+4) and array.get(dizi,len+1+5)>cr[len]bb=buy? hlc3 : nass=sell? hlc3 : na sbuy= buy and close<(close[ta.barssince(buy or sell)])[1]-len4 and close<ta.highest(fixnan(ss),len2)-len3*3ssell= sell and close>(close[ta.barssince(buy or sell)])[1]+len4 and close>ta.lowest(fixnan(bb),len2)+len3*3buy:= buy and close<(close[ta.barssince(buy or sell)])[1]-len4 and close<ta.highest(fixnan(ss),len2)-len3 //and close>ta.highest(fixnan(ss),len2)-len3*3sell:=  sell and close>(close[ta.barssince(buy or sell)])[1]+len4 and close>ta.lowest(fixnan(bb),len2)+len3 //and close<ta.lowest(fixnan(bb),len2)+len3*3alertcondition(buy or sell)sl = input.float(5, title = "trailing stop loss", step = 0.1)//if (sbuy)//    strategy.entry("strong long", strategy.long,width) //   strategy.exit("close long","strong long", stop = close*(100-sb)/100  )//if (ssell)//    strategy.entry("strong sell", strategy.short,width)if (buy)    strategy.entry("long", strategy.long)    strategy.exit("close long","long", trail_price = close, trail_offset = close*sl)if (sell)    strategy.entry("short", strategy.short)    strategy.exit("close short","short", trail_price = close, trail_offset = close*sl)