INVITE-ONLY SCRIPT

Synthetic Max Pain [SolQuant]

21
The Synthetic Max Pain [SolQuant] indicator calculates estimated "max pain" price levels using modeled open interest distributions. Max pain is the price at which the largest number of leveraged positions would face maximum loss — a concept borrowed from options theory and adapted for perpetual futures markets.

The indicator projects two key levels: MP Long (support) and MP Short (resistance), representing the zones where long and short positions respectively face the most pain. These levels are recalculated at each anchor period reset and can be displayed across multiple timeframes simultaneously.


USAGE

Reading Max Pain Levels
Two horizontal lines are displayed for each enabled timeframe anchor:
MP Long (Support): The price level where the highest concentration of modeled put/short open interest sits below the anchor price. Price tends to find support near this level as market makers may defend it.
MP Short (Resistance): The price level where the highest concentration of modeled call/long open interest sits above the anchor price. Price tends to face resistance here.

When price trades between MP Long and MP Short, it is within the "max pain range" — the zone where the most positions remain profitable. Breaks beyond these levels can signal directional moves as liquidations cascade.

Multi-Timeframe Anchors
Four anchor timeframes can be enabled simultaneously: Hourly, 4-Hour, Daily, and Weekly. Each recalculates its levels when a new period begins using that period's opening price as the anchor. Shorter timeframes provide intraday levels, while longer timeframes frame the broader structure.

Stacking multiple timeframes reveals confluence zones where max pain levels from different anchors overlap — these tend to be stronger support/resistance areas.

Midline
An optional midline plots the average of the primary timeframe's MP Long and MP Short, representing the theoretical equilibrium point where market maker pain is balanced.

Historical vs Current Mode
In Current mode (default), only the latest levels are drawn as horizontal lines extending back a configurable number of bars. In Historical mode, levels are plotted as step lines across the entire chart history, allowing backtesting and pattern recognition of how price interacts with max pain levels over time.


DETAILS

Synthetic OI Modeling
Since TradingView does not provide granular strike-level open interest data, this indicator constructs a synthetic model. It generates a strike ladder centered on the anchor price and distributes modeled open interest across strikes using a Gaussian (bell curve) distribution.

The distribution is offset from at-the-money to simulate realistic OI concentration in out-of-the-money options/positions, with an additional boost for slightly OTM strikes where retail positioning typically clusters.

Put and Call Bias
The Put Bias and Call Bias parameters act as multipliers on their respective OI distributions. A Put Bias greater than 1.0 amplifies the modeled short OI, pushing the MP Long level further from the anchor (more bearish skew). A Call Bias greater than 1.0 does the same for long OI. These parameters allow the model to reflect the market's directional lean.

OI Spread
The OI Spread parameter controls how concentrated or dispersed the modeled open interest is around the anchor price. A lower spread creates tighter max pain levels closer to the anchor, while a higher spread pushes them further away. This should be tuned based on the asset's typical volatility.

Payoff Calculation
For each strike in the ladder, the indicator calculates the standard option payoff functions — max(settlement - strike, 0) for calls and max(strike - settlement, 0) for puts — weighted by the modeled OI at that strike. The strikes with peak OI below and above the anchor become MP Long and MP Short respectively.


SETTINGS

Strike Configuration
Strike Increment: Distance between modeled strikes. Should scale with asset price (e.g., $1-2 for SOL, $500-1000 for BTC).
Number of Strikes: Total strikes in the ladder. More strikes cover a wider price range.
Auto Strike Increment: Automatically sets increment to approximately 1% of price.

Max Pain Model
OI Spread %: Controls how spread out the modeled OI distribution is.
Put Bias: Multiplier for short-side OI (higher = more bearish skew).
Call Bias: Multiplier for long-side OI (higher = more bullish skew).

Anchor Timeframes
Show Hourly / 4 Hour / Daily / Weekly: Enable multiple anchor timeframes simultaneously.

Display
Show MP Long / MP Short / Midline: Toggle individual level visibility.
Show Historical Levels: Switch between current-only and full-history display.
Line Width: Visual thickness of level lines.


This indicator uses a synthetic model to estimate max pain levels. It does not use actual exchange open interest data at the strike level. The modeled levels are approximations based on statistical distributions and should be used as one factor among many in a trading analysis framework. It does not constitute financial advice and past performance does not guarantee future results.

כתב ויתור

המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.