Options Valuation Model
Options valuation functions let you project greeks and PnL at future time anchors or specific DTEs. The options valuation model is a Black-Scholes-Merton (BSM) model which uses implied volatilities from the legs to be used to extract Greeks and PnL at future dates.
The solver uses the option valuation model to scan through a range of underlying prices to find minima, maxima, or roots (zero crossings) of selected metrics.
The selected metric to return can be a value (profit or greek) or the underlying price (strike) at the given criteria.
These functionality allows you to pinpoint places on the Risk Graph and extract values for use in your strategy logic.
Practical example
Consider you would like to extract the Maximal Profit and the break-even points of a calendar structure. You can find these marked on the picture.

The following code can be used to extract the values of interest:
"Entry": {
...
"VarDefines": {
"breakeven_lower": "options.model_solver(position, leg_short_call_dte, underlying_price * 0.5, underlying_price * 2, pnl, zero, return_price)",
"breakeven_upper": "options.model_solver(position, leg_short_call_dte, underlying_price * 2, underlying_price * 0.5, pnl, zero, return_price)",
"max_win": "options.model_solver(position, leg_short_call_dte, underlying_price * 2, underlying_price * 0.5, pnl, maximize, return_value)",
"max_loss": "options.model_solver(position, leg_short_call_dte, underlying_price * 2, underlying_price * 0.5, pnl, minimize, return_value)"
}
}
After running the strategy, we can confirm the variables captured in the variable we defined

The above demonstration is shown in the [FEAT-OptionValuation] built-in template.
It's faster to use options.model as it evaluates a single point.
Use options.model_solver only when you need to find minima, maxima, or roots over a price range.
Module prototypes
Functions
| Signature | Description |
|---|---|
options.model(target, dteDaysOrAnchor, underlyingPrice, metric[, model_params]) -> number | Evaluate position/leg at a time anchor or DTE using a scenario underlying price and return the selected metric |
options.model_solver(target, dteOrKey, start, end, metric, goal, result[, solver_params]) -> number | Scan a price range to minimize/maximize/zero a metric and return value or price per result |
Targets
| Name | Description |
|---|---|
position | Evaluate all open and pending legs of the position |
leg_<name> | Evaluate a specific leg by name (e.g., leg_short_call) |
Time Anchors
| Name | Description |
|---|---|
at_exp | Evaluate at the leg’s/position’s expiration(s) |
first_exp | Earliest expiration among the selected legs |
last_exp | Latest expiration among the selected legs |
now | Current backtest time (DTE=0) |
Metrics
| Name | Description |
|---|---|
pnl | Projected profit and loss |
delta | Sensitivity to underlying price |
gamma | Rate of change of delta |
theta | Time decay |
vega | Sensitivity to volatility |
wvega | Weighted vega using option DTE |
rho | Sensitivity to interest rates |
Goals
| Name | Description |
|---|---|
minimize | Find the minimum of the metric over the price range |
maximize | Find the maximum of the metric over the price range |
zero/root | Find the price where the metric crosses zero (root) |
Result
| Name | Description |
|---|---|
return_value | Return the metric value at the solution |
return_price | Return the underlying price at the solution (alias: strike) |
strike | Alias for return_price |
Parameters at a Glance
target:positionorleg_<name>dteDaysOrAnchor/dteOrKey: non‑negative DTE days or a time anchor (at_exp,first_exp,last_exp,now)metric: one ofpnl, delta, gamma, theta, vega, wvega, rhogoal: one ofminimize,maximize,zero/root(for solver)result:return_valueorreturn_price/strike(for solver)model_params/solver_params: optional tuning parameters (leave empty for defaults)
Usage Notes
- Use
options.modelfor point evaluations at a given time and scenario price. Runs faster thanoptions.model_solver - Use
options.model_solverto scan a price range and extract a price or value at the optimum/zero. Takes multiple iterations over theoptions.modelcall. Use it only when required. - Swapping the
startandendparameters inoptions.model_solverwill reverse the scan direction. - For visual exploration of projected risk and greeks, see Position Monitor.