Zeal Terminal Open in Zeal Terminal

Pine Script v5 · Strategy

I11L Long Put-Call Ratio Inversion

A Pine Script v5 strategy built on SMA ("USI:PCC","D",close, 20), Stdev (ratio_sma, 30) and Crossunder (ratio_sma, upperDeviation). It has 4 order rules, 1 entry among them, and trades long only with the default settings. Exits use a profit target and no stop loss. Each trade commits 10000 in cash and pays no commission. 5 settings; defaults include SL 0.01, CRV 3 and Lookback period in Days 30.

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 I11L Long Put-Call Ratio Inversion repaint?
No
No repainting patterns were found in the source. The live replay was not measured: it had no trades to compare.
How did I11L Long Put-Call Ratio Inversion do on BTCUSDT 1D with default settings?
Not measured
It closed no trades there from 26 Jan 2024 to 21 Oct 2026 with the default settings, so there is no result to report. Its entry conditions never all held on this data. It closed no trades on the other markets either. A backtest, not investment advice.
Does I11L Long Put-Call Ratio Inversion run in Pine Script v6?
Not tested
Neither version placed a trade on any of the 8 markets, so there was nothing to compare. The v6 version is shown for reference and is not offered as a download.
Does I11L Long Put-Call Ratio Inversion use a stop loss?
No
Its exits set a profit target but no stop.
Does I11L Long Put-Call Ratio Inversion run in Zeal Terminal?
Yes
It compiles in 18 ms and runs 1,000 bars in 34 ms, in the browser.

BTCUSDT · 1D · default settings

  • SMA
  • SMA
  • Stdev
  • Crossunder
  • Crossover
  • Winning trade
  • Losing trade
  • Equity
  • Buy and hold
0.0050,000100,000AprJulOct2025AprJulOct2026AprJulOct$10,000$20,253Equity from $10,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. The engine's host API cannot yet declare a chart's symbol and timeframe, so this page sets them on the engine directly for each market. The live re-run is not offered here: the script requests USI:PCC D, which this page cannot load in your browser.

Needs USI:PCC D data, not available: not a Binance spot market Values that depend on it are empty on this chart.

Net profit
0.00%
$0.00
Buy and hold
+102.5%
same period
Closed trades
0
0 won · 0 lost
Profitable
0.0%
of closed trades
Profit factor
—
gross profit ÷ gross loss
Max drawdown
0.00%
$0.00

One run with the author's default settings, $10,000 starting capital, commission as the script sets it. 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 stop loss

    strategy.exit is used without a stop, loss or trailing stop.

  • Check

    No commission

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

  • Note

    3 settings have no label

    In the settings dialog SL (line 5), CRV (line 6), ratio_sma_lookback_len (line 9) show an empty name. The labels on this page come from the variable names.

  • 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
SL (no label in the script)0.01float · step 0.01TP isSL
CRV (no label in the script)3floatTP
Lookback period in Days30int · step 10median standartDeviation
Ratio sma lookback len (no label in the script)20int · step 10ratio_sma
Standard Deviation Multiple1.5floatupperDeviation lowerDeviation

What it calculates

  • SMArequest.security("USI:PCC","D",close), Ratio sma lookback len (20)ratio_sma · line 11
  • SMAratio_sma, Lookback period in Days (30)median · line 12
  • Stdevratio_sma, Lookback period in Days (30)standartDeviation · line 13
  • Crossunderratio_sma, upperDeviationisBuy · line 16
  • Crossoverratio_sma, lowerDeviationisSell · line 19

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.

closecloseprice dataratio_sma_lookback_lenRatio sma lookback lensetting · 20lenLookback period in Dayssetting · 30SLSLsetting · 0.01CRVCRVsetting · 3multStandard Deviation Mult…setting · 1.5highhighprice datalowlowprice dataratio_smaSMA→ ratio_smamedianSMA→ medianstandartDeviationStdev→ standartDeviationisBuyCrossunder→ isBuyisSellCrossover→ isSellTPTPvalueupperDeviation, lowerDeviationupperDeviation · lowerD…2 valuesisCloseShortisCloseShortconditionisSLisSLconditionisTPisTPconditionentry:LongOpen Longstrategy.entryexit:Close Shortexit Close Shortstrategy.exitexit:SLexit SLstrategy.exitexit:TPexit TPstrategy.exitplot:30plotplotplot:31plotplotplot:32plotplotplot:33plotplotbgcolor:34bgcolorbgcolorbgcolor:35bgcolorbgcolor

Order rules

OrderFires whenBy defaultLine
Open Long long(isBuy)On22
Exit Close Short limit(isCloseShort)On24
Exit SL limit(isSL)On26
Exit TP limit(isTP)On28

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

Does it repaint?

No

No repainting patterns in the source.

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.
  • ClearHigher-timeframe data1 request.security call(s), none with lookahead on.
  • 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

Not run on other markets: the script requests USI:PCC D, and that data is not available here (not a Binance spot market). Its results would rest on empty values.

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
I11L Long Put-Call Ratio Inversion this page—v5 strategy0.0%00.0%
Double Bollinger Binary Options by Trade_by_DBsma stdevv5 strategyNo trades on this market
Improved Bollinger Swing Strategy Stock Nasdaq by exlux99sma stdevv4 strategy−20.4%722.3%
P-Signal Strategy by Kharevskystdev smav4 strategy−9.7%2934.6%
P-Signal Strategy & Alert by Kharevskystdev smav4 strategy−9.7%2934.6%
Bollinger Stop Strategy by ROBO_Tradingsma stdevv5 strategy−32.0%4161.5%

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.

  • No v6-only features. v6 is not needed to run this script.

Clean v5

Verified

Nothing to change.

Does it run in Pine Script v6?

Not tested

Neither version placed a trade on any of the 8 markets, so there was nothing to compare. The v6 version is shown for reference and is not offered as a download. It differs from the v5 version by 1 edit.

⋯// © I11L-//@version=5+//@version=6strategy("I11L Long Put/Call Ratio Inversion", overlay=false, pyramiding=1, default_qty_value=10000, initial_capital=10000, default_qty_type=strategy.cash)⋯

Where it runs

EngineCompilesRunsMatches TradingView
Zeal Terminal · OpenPineScript v2Yes 18 msWith a workaround 1,000 bars in 34 msNot measured
PineTSNot testedNot testedNot measured

The engine's host API cannot yet declare a chart's symbol and timeframe, so this page sets them on the engine directly for each market.

“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/// © I11L//@version=5strategy("I11L Long Put/Call Ratio Inversion", overlay=false, pyramiding=1, default_qty_value=10000, initial_capital=10000, default_qty_type=strategy.cash)SL = input.float(0.01,step=0.01)CRV = input.float(3)TP = SL * CRVlen = input.int(30,"Lookback period in Days",step=10)ratio_sma_lookback_len = input.int(20,step=10)mult = input.float(1.5,"Standard Deviation Multiple")ratio_sma = ta.sma(request.security("USI:PCC","D",close),ratio_sma_lookback_len)median = ta.sma(ratio_sma,len)standartDeviation = ta.stdev(ratio_sma,len)upperDeviation = median + mult*standartDeviationlowerDeviation = median - mult*standartDeviationisBuy = ta.crossunder(ratio_sma, upperDeviation)// and close < buyZoneisCloseShort = (ratio_sma > median and strategy.position_size < 0)isSL = (strategy.position_avg_price * (1.0 - SL) > low and strategy.position_size > 0) or (strategy.position_avg_price * (1.0 + SL) < high and strategy.position_size < 0)isSell = ta.crossover(ratio_sma,lowerDeviation) isTP = strategy.position_avg_price * (1 + TP) < highif(isBuy)    strategy.entry("Long", strategy.long)if(isCloseShort)    strategy.exit("Close Short",limit=close)if(isSL)    strategy.exit("SL",limit=close)if(isTP)    strategy.exit("TP",limit=close)    plot(ratio_sma,color=color.white)plot(median,color=color.gray)plot(upperDeviation,color=color.rgb(0,255,0,0))plot(lowerDeviation,color=color.rgb(255,0,0,0))bgcolor(isBuy?color.rgb(0,255,0,90):na)bgcolor(isSell?color.rgb(255,0,0,90):na)