TradingView strategy research

Long-short equity research: gross exposure, net exposure and borrow

A long-short equity strategy buys one group of stocks and sells another group short. Its return depends on both stock selection and the size of each book. Gross exposure adds long and short market values; net exposure subtracts the short value from the long value, each divided by account equity. A 130/30 portfolio has 160% gross exposure and 100% net exposure. Neither the long-short label nor equal long and short dollars establishes market neutrality. Research also needs historical borrow availability, financing and an executable portfolio ledger.

See the decision guide

Two books, one equity denominator

Let E be positive net asset value, L the current market value of long shares and S the absolute market value of short shares. Account equity includes cash, long assets, short liabilities and accrued costs. Short-sale proceeds are accompanied by a liability to return shares; receiving those proceeds does not create equity. The following definitions apply to cash equity positions in one reporting currency.

  • For E = $100,000, L = $80,000 and S = $80,000, gross exposure is 160% and net exposure is 0%. If betaL = 1.3 and betaS = 0.7, estimated portfolio beta is 0.8 × 1.3 - 0.8 × 0.7 = 0.48 despite dollar neutrality.
  • Sector, size, currency and liquidity exposures can remain after a beta adjustment. Estimated betas can also change during stress. Market neutrality is an objective that needs measurement, not a property of every long-short portfolio.
  • Recalculate exposure as prices and equity change. If equity is zero or negative, these ratios are not a usable sizing rule; stop new allocation and apply the account liquidation policy.
MeasureFormulaWhat it tells you
Long exposureL / ESize of the long book relative to equity.
Short exposureS / EAbsolute size of the short book relative to equity.
Gross exposure(L + S) / ECombined stock exposure before offsetting directions.
Net exposure(L - S) / ESigned dollar imbalance; not a complete market-risk estimate.
Approximate market beta(L / E) × betaL - (S / E) × betaSA model estimate using consistent beta measurements, not a guaranteed hedge.

What the 130/30 variant changes

A 130/30 strategy targets longs worth 130% of equity and shorts worth 30%. AQR describes this as a relaxed-constraint portfolio: the short book allows a larger long book while retaining 100% net exposure. On $100,000 of equity, target holdings are $130,000 long and $30,000 short, giving $160,000 gross exposure. Broker collateral and margin terms determine whether the allocation can actually be funded.

  • If both 130/30 books move by the same +10% before costs, the long book gains $13,000 and the short book loses $3,000: +$10,000, or +10% of initial equity. This algebra illustrates the remaining net exposure, not an expected outcome.
  • Gross exposure is not the margin deposit or the maximum possible loss. A concentrated short can rise far beyond its entry price, and the two books can lose together.
Illustrative allocationGross / netResearch implication
100% long, 0% short100% / 100%A long-only baseline for evaluating whether shorting adds value after costs.
130% long, 30% short160% / 100%More selection exposure and short-related costs; positive market exposure remains.
80% long, 80% short160% / 0%Same gross size as 130/30, different dollar direction; factor exposures still need testing.

A reproducible selection and rebalance protocol

This illustrative price-momentum experiment separates signal research from portfolio construction. It is not a tested source of excess return. Freeze the rules before evaluating later dates, use a point-in-time stock universe, and keep delisted stocks and failed candidates in the research record.

  • For eight executable short slots, target shorts are 24% and longs 124%, so gross is 148% and net remains 100%. Keeping longs at 130% instead would produce 106% net exposure. Report actual exposure when rounding, partial fills or price moves prevent exact targets.
  • Use the first sample to define parameters, then evaluate later untouched dates. Compare with a 100% long-only baseline using the same long selection and cost assumptions. Record turnover, drawdown, borrow failures, factor exposures and after-cost results.
  • This deliberately concentrated example is a mechanism demonstration. Position and sector limits, loss limits and margin buffers need their own predeclared rules before an executable portfolio is considered.
StagePredeclared rule
Score at month-endOn matching completed daily sessions, score each eligible stock as its 63-bar price return minus the benchmark 63-bar price return. Use split-consistent prices; this score excludes dividends.
Select namesRank valid scores descending, break ties by symbol, and choose the top 10 for longs and bottom 10 for shorts from at least 20 valid names. Preserve membership as it was known then. If fewer than 20 names are valid, initiate no new basket.
Check borrowRequire dated availability and quantity for each selected short. Do not replace a failed short with a later winner. Each permitted short receives up to 3% of equity; unavailable slots receive zero.
Set exposureSet long exposure to 100% plus the executable short exposure, capped at 130%. Equal-weight the 10 long names. Ten executable shorts yield 13% per long and 3% per short.
Execute and monitorSubmit after the ranking close for the next executable session. Record each fill, commission and rejected order. Scale intended longs to confirmed short capacity; if a long fill fails, recompute actual net and gross exposure rather than inventing the missing fill.
Exit and reviewRebalance to the next monthly target using actual position differences. Borrow loss or a broker margin requirement overrides the calendar; cover at executable prices and reduce the long target accordingly. Record halted or delayed exits as open risk.

Worked 130/30 return and borrow-cost calculation

Assume $100,000 starting equity, $130,000 of long stocks and $30,000 of short stocks, fixed quantities, no intermediate rebalance and 30 calendar days held. Long prices rise 4%; short prices fall 2%. These are fictional basket returns, not backtest results. All costs below are hypothetical dollar assumptions.

  • The borrow line assumes a constant $30,000 fee base and a 360-day convention. Real daily collateral marks, rates, settlement timing and day-count rules depend on the broker. IBKR identifies borrow fees and interest on short-sale proceeds as separate components; do not assume they cancel.
  • At a hypothetical 60% borrow rate with the same fee base, borrow costs $1,500 and net profit falls to $3,790, or 3.79%. No quoted rate on this page is a current offer.
  • If the long book falls 4% and the short book rises 12%, price P&L is -$5,200 - $3,600 = -$8,800. Holding the illustrative cost inputs fixed gives -$9,460, or -9.46%; actual borrow and financing costs would also change.
  • Use either price returns plus explicit dividend cash flows or a consistent total-return treatment. Do not count distributions twice. If observed fills already include slippage, remove the separate allowance for that same slippage.
ComponentCalculationResult
Long price profit$130,000 × 4%+$5,200
Short price profit-$30,000 × (-2%)+$600
Gross price profit$5,200 + $600+$5,800
Borrow fee$30,000 × 6% × 30 / 360-$150
Commissions and execution allowanceAssumed combined entry and exit cost-$320
Net financing expenseAssumed debit interest less any short-proceeds interest-$100
Dividend cash flows$0 received on longs; $90 owed on shorts-$90
Net result$5,800 - $150 - $320 - $100 - $90+$5,140, or 5.14% of starting equity

Unavailable shorts belong in the result

The SEC explains that US short-sale orders generally require a documented locate, subject to exceptions, and that short sellers owe dividends on borrowed shares. A historical price series does not establish borrow eligibility. IBKR also notes that readily available stock can become hard to borrow. Treat missing availability as unknown rather than silently allowing every historical short.

  • Track requested shorts, approved quantities, rejected quantities, fee changes and forced covers separately. Dropping failed requests from the sample can overstate the strategy that an account could execute.
  • Rules, margin requirements and access differ by jurisdiction, security and broker. This page does not establish legal eligibility for a particular account.
Observed constraintRequired research treatment
No borrow at entryReject the order, retain its original signal and record the reason. Apply the predetermined lower-exposure allocation.
Only part of the quantity availableCap the short to available shares and recompute financing and long targets from the executed quantity.
Borrow recalled or rate risesModel a forced cover or the predeclared fee-limit exit at an executable price. A recall is not an assumed fill at the prior close.
Halt, gap or short squeezeKeep the liability marked under a documented valuation rule until a real exit is possible. A stop instruction cannot guarantee a fill.
Historical availability missingLabel the test unconstrained or hypothetical; run no-short and expensive-borrow scenarios. None proves historical tradability.

Inspect the price score in Pine Script

The indicator below calculates the price score for the chart stock against a chosen benchmark. Use a standard daily chart with compatible sessions and adjustment settings. It checks both current and lookback endpoint timestamps; missing or mismatched observations remain blank. It does not rank a universe, choose portfolio weights, inspect stock borrow or place orders.

  • For a stock moving from $100 to $108 and a benchmark moving from $200 to $210 over matching endpoints, score = 100 × (0.08 - 0.05) = +3 percentage points. A stock moving from $100 to $96 instead scores -9 points.
  • A positive score means outperformance of this benchmark over this window, not a positive absolute return or a top-decile rank. All stocks share the same benchmark subtraction, so it does not change their cross-sectional ordering.
  • Endpoint matching does not prove every intervening session was valid or that a historical universe is unbiased. Audit the source data separately. The script updates after a completed chart bar; use a separately maintained month-end schedule for portfolio decisions.
Pine Script v6 research indicator. The score is a return difference in percentage points, not a portfolio return, borrow signal or complete long-short backtest.pine
//@version=6
indicator("Long-short equity price-score research", overlay = false)
int lookback = input.int(63, "Lookback daily bars", minval = 1, maxval = 500)
string benchmark = input.symbol("AMEX:SPY", "Benchmark")
if not timeframe.isdaily or timeframe.multiplier != 1
    runtime.error("Use a standard 1D chart with matching sessions.")
[bNow, bPast, bTime, bCloseTime, bPastTime, bPastCloseTime] = request.security(benchmark, timeframe.period, [close, close[lookback], time, time_close, time[lookback], time_close[lookback]], gaps = barmerge.gaps_on, lookahead = barmerge.lookahead_off)
bool aligned = bTime == time and bCloseTime == time_close and bPastTime == time[lookback] and bPastCloseTime == time_close[lookback]
bool valid = barstate.isconfirmed and aligned and not na(close[lookback]) and not na(bNow) and not na(bPast) and close[lookback] > 0 and bPast > 0
float score = valid ? 100 * ((close / close[lookback] - 1) - (bNow / bPast - 1)) : na
plot(score, "Price score (percentage points)", color = color.blue, linewidth = 2, style = plot.style_linebr)
hline(0, "Benchmark price return", color = color.gray)

Keep the portfolio ledger separate from chart orders

TradingView can request other symbols for calculations, but the broker emulator simulates strategy orders using chart data. Reading ten stocks does not create ten separately financed positions in the Strategy Tester. A directional strategy on one stock and a synthetic spread chart both need additional work before their results describe a long-short equity portfolio.

  • Maintain quantities, cash, borrow liabilities, dividend payments and transaction costs for every stock. Mark equity and exposures each session and reconcile the total to the sum of both books and cash flows.
  • Pine Script AI Coding Agent can help draft or revise the score and its data checks. Review the generated source, confirm timing and request syntax validation before using it in a research process.
  • Strategy Optimizer can compare parameters of a separate supported TradingView strategy. The indicator shown here has no strategy trades to optimize. Testing a chart-stock execution rule can inform one component, but cannot establish borrow feasibility or the combined portfolio result.
Where Pineify fits

Pine Script AI Coding Agent

Turn a stated scoring rule into a Pine research indicator, review data timing and request a syntax check before exporting observations to portfolio research.

Also useful: Strategy Optimizer. Compare inputs after building a separate chart-symbol strategy with explicit fills and costs. Portfolio allocation and borrow accounting remain separate research tasks.

Draft a price-score monitor

Frequently asked questions

Educational research, not investment advice. All allocations, returns and fee inputs shown here are hypothetical and have not been performance-tested. Short selling can produce losses beyond the initial short-sale proceeds. Margin calls, borrow recalls and execution failures can prevent the intended allocation or exit.

Sources and verification

Published by Pineify. Pineify is an independent product and is not affiliated with TradingView. Sources support the technical explanations; examples do not establish trading performance.