NOPE
A line under the chart shows NOPE (net options pricing effect): options share delta as a percent of volume.
Share delta is how much stock dealers (the market makers who hedge options) must hold to hedge those options. Through each session, call buying lifts the line above zero and put buying pulls it below. The further from zero, the more that hedging can move the price. Use it to spot sessions where hedging may push price, on crypto, CME (Chicago futures exchange) or US stock charts.
Under the hood: the recipe reads two options_flow fields, the share delta at the ask and at the bid (Data sources). It also reads the chart's own volume, the session from time.session (Data sources) and the market's clock from market.zone() (The market's facts). It draws a split line coloured around zero (Styling). It is also the nope template, the NOPE card under Order flow in the editor's starter list, and it compiles as written.
The wrun indicator
// NOPE: a line under the chart shows NOPE (net options pricing effect): options share delta as a percent of volume.
// Share delta is how much stock dealers (the market makers who hedge options) must hold to hedge those options. Through
// each session, call buying lifts the line above zero and put buying pulls it below. The further from zero, the more
// that hedging can move the price. Use it to spot sessions where hedging may push price, on crypto, CME (Chicago
// futures exchange) or US stock charts.
//
// Technical notes: NOPE is the share delta the options traded on the chart's underlying carry, as a percent of the
// chart's own volume, summed through the session (the regular session on a US stock, the whole trading day on CME; each
// trade date starts again). A print's share delta is its size times its delta in the underlying's units (contracts
// times 100 shares on a US stock, coins on crypto, futures on CME), calls up and puts down, so a session of call buying
// reads above zero and one of put buying below. The idea is the dealers': whoever writes the options hedges that delta
// in the underlying, so the larger the delta against its own volume, the harder the options lean on its price. Delta,
// Both sides (the default) counts each print's delta once whichever side it traded on, as the standard NOPE does (the
// dealers wrote every option); Bought minus sold counts a print bought at the ask as it is and one sold at the bid
// against. Prints at the mid or with no quote carry no share delta in the flow rows, so they count in neither. The line
// is in the up colour above zero and the down colour below. On CME it counts the whole trading day, from the 17:00
// Chicago open through the evening, the night and the hours after the regular window; on crypto, where every bar is in
// session, the venue's option delta meets the chart's own volume (a Coinbase chart divides Deribit's delta by
// Coinbase's coins). The rows come from options_flow, one per bar: 1-minute rows reach back 7 days and 5-minute rows 30
// days, so older bars carry none; a bar the session counts without a row adds no delta and no stock volume, and those
// bars are counted.
param.choice("delta", ["Both sides", "Bought minus sold"], "Both sides", { label: "Delta", description: "Both sides, the standard NOPE, counts every trade as if it were bought. Calls then lift the line and puts pull it down. Bought minus sold counts trades at the bid (the buyer's price, so the seller gave in) as sold. A call sold there pulls the line down." });
input("close", ohlcv.close); // the chart's own candles: the bar grid
input("volume", ohlcv.volume); // the chart's own volume in the bar (shares on a US stock): NOPE's denominator
input("trade_date", time.trade_date); // the bar's trade date (on CME the one that opens at 17:00 Chicago): the sums start again on each
input("session", time.session); // 1 in the regular session, 2 before it, 3 after it, 0 closed: 1 counts, and 1 to 3 on CME
market.zone(); // the market's clock, written by the chart: 2 Chicago (CME), whose whole trading day counts
input("delta_ask", options_flow.share_delta_ask, { missing: "nan", description: "Share delta (how many shares dealers hedge) bought at the ask in this bar. Each trade adds its size times its delta, with 100 shares per contract on a US stock." }); // NaN on a bar the class serves no row for
input("delta_bid", options_flow.share_delta_bid, { missing: "nan", description: "Share delta sold at the bid in this bar." });
output("nope", line, lower, { color: "theme.text", width: 2, split: "level", up_color: "theme.up", down_color: "theme.down", label: "NOPE", format: "0.00", unit: "%", description: "NOPE (net options pricing effect): the session's options share delta as a percent of this chart's own volume. A session of call buying reads above zero and put buying below. The further from zero, the more hedging could move the price." });
output("zero", line, lower, { color: "theme.muted", width: 1, legend: false, description: "The zero line: above it calls lead, below it puts lead." });
// The readings, data-only: the Console reads them.
output("nope_bar", none, lower, { description: "This bar's options share delta as a percent of this bar's volume. Empty on a bar with no options data or no volume." });
output("option_delta", none, lower, { description: "The session's options share delta so far, in the chart's size unit, shares on a US stock." });
output("stock_volume", none, lower, { description: "This chart's own volume over the session's bars that had options data, shares on a US stock." });
output("missing_bars", none, lower, { description: "Bars the session counts that had no options data: regular-session bars, or every bar of the trading day on CME. They count in neither sum." });
string("note", { max_bytes: 64 }); // the one line while there is nothing to draw
render.label("note_label", { position: "top_center", text: "note", color: "theme.muted", style: "plain", offset: [0, 8] });
let signed = false; // setting and the market's clock, read in onStart()
let zone = 0;
let day: f64 = NaN; // the trade date the sums run over
let optionDelta = 0.0; // the session's sums
let stockVolume = 0.0;
let rows = 0; // counted bars of this session that carried a flow row
let missing = 0; // counted bars of this session without one
let runRows = 0; // flow rows over the whole run
function onStart(): void {
signed = p_delta() == 1.0;
zone = i32(p_market_zone());
}
// onBar() runs once per bar: a new trade date starts the sums again; a bar the session counts with a flow row adds its
// share delta and the stock's volume, one without a row counts as missing; then the line and the readings.
function onBar(): void {
const date = in_trade_date();
if (!isNaN(date) && date != day) {
day = date;
optionDelta = 0.0;
stockVolume = 0.0;
rows = 0;
missing = 0;
}
// The bars the sums count: the regular session (time.session 1), and on CME (zone 2) its whole trading day, from the
// 17:00 Chicago open through the evening, the night and the hours after the regular window (1 to 3).
const regular = zone == 2 ? in_session() >= 1.0 : in_session() == 1.0;
const ask = in_delta_ask();
const bid = in_delta_bid();
const shares = in_volume();
const served = !isNaN(ask) && !isNaN(bid);
const barDelta = signed ? ask - bid : ask + bid;
let barNope: f64 = NaN;
if (regular && served && !isNaN(shares)) {
optionDelta += barDelta;
stockVolume += shares;
rows += 1;
runRows += 1;
if (shares > 0.0) barNope = (100.0 * barDelta) / shares;
} else if (regular && !served) missing += 1;
const reading = rows > 0 && stockVolume > 0.0;
out_nope(reading ? (100.0 * optionDelta) / stockVolume : NaN);
out_zero(0.0);
out_nope_bar(barNope);
out_option_delta(rows > 0 ? optionDelta : NaN);
out_stock_volume(rows > 0 ? stockVolume : NaN);
out_missing_bars(f64(missing));
if (bar.isLast()) str_note(runRows == 0 ? "No options flow on this chart yet" : rows == 0 ? "No options flow yet this session" : ""); // an empty text draws no label
}How it works
The delta. share_delta_ask and share_delta_bid sum size times delta over the bar's priced prints at the ask and at the bid (contracts times 100 shares on a US stock). Delta, Both sides (the default) adds the two: each print's delta counts once, whichever side it traded on, as the classic NOPE counts every option traded on the view that the dealers wrote them all. Bought minus sold takes the ask minus the bid instead, so a print sold at the bid counts against. Prints at the mid or with no quote carry no share delta in the flow rows and count in neither reading.
Over the stock's volume. On each bar the session counts (time.session reads 1, the regular session) with a flow row, the bar's share delta joins the session's sum and the bar's stock volume joins the denominator; nope is 100 times the one over the other. On a US stock pre-market and after-hours bars count in neither, even when they carry a row: the stock trades then while most options do not. The sums start again on each trade date. On CME (market.zone() 2) the sums count the whole trading day, from the 17:00 Chicago open through the evening, the night and the hours after the regular window (time.session reads 1 to 3), because the futures and their options trade through all of it; the daily halt counts in neither sum. On crypto every bar is in session, and the chain's option delta meets the chart's own volume, so on a Coinbase chart it divides the chain venue's delta by Coinbase's coins.
Per bar. nope_bar reads the same ratio on the bar alone, option_delta and stock_volume the session's two sums.
What the settings do
- Delta: Both sides, the standard NOPE, counts every trade as bought. Bought minus sold counts trades at the bid (the buyer's price, so the seller gave in) as sold.
Where it runs
It works on three kinds of charts. On a coin with listed options, it reads that coin's own options on its exchange. A copy you run from the editor (where you write and run your own indicators) reads them too. On a US stock or ETF chart with US listed options, every indicator in your browser can read it. On a CME futures chart, every indicator in your browser can read it too, once you accept the CME market data terms (Limitations). US options data runs 15 minutes behind unless you have real-time US options data. CME data runs 10 minutes behind unless you have real-time CME data. The legend shows which delay you get. It shows the last 7 days on 1-minute charts and the last 30 days on 5-minute charts.
When data is missing
A session bar with no options data adds neither delta nor volume. So the ratio stays fair over the bars that have both. The Console (the editor's panel that prints values) counts the others (see Run it). The line stays empty before the session's first options data. A label at the top says "No options flow on this chart yet" while no bar has options data. It says "No options flow yet this session" while the newest session has none.
Customize it
- The classic or the signed reading. Switch Delta to Bought minus sold to see the hedge the aggressors leave with the dealers, rather than every option written.
- Same-day options. Add
dte: "0dte"to both flow inputs: the expiring contracts carry the delta that moves fastest into the close. - A band. Keep each session's closing
nopein a ring and draw its average and spread as levels to tell an unusual day from an ordinary one.
Run it
- In the editor's Explorer, press the Templates icon ("Browse starter templates") and pick NOPE under Order flow.
- Press Run on a BTC chart or a US stock chart: the line draws under the chart. On a US stock or a CME future the copy reads the flow at your own tier, and the legend names the tier. On a CME future, accept the CME market data terms first.
- At the editor's Console prompt, type
nopefor the session's reading,last 20 nope_barfor the last 20 bars on their own, ormissing_barsfor the session's bars without data.
Concepts used
- Data sources for the
options_flowshare delta fields - Data sources for
time.sessionandtime.trade_date - The market's facts for
market.zone(), which counts CME's whole trading day - Styling for the
splitline - Limitations for the US options rule