Analyze Strategy
analyze_strategyFull Description
Use this after valid legs are known. Primary final step for P/L, Greeks, POP, and widget payoff. Supports chart and P/L grid heatmap views; set output_view='pl_grid' to start in heatmap view or output_view='pl_curve' to start in chart view. Default quote_mode='refresh' selectively refreshes matched leg prices. For recommendation-style turns, run this once for the chosen strategy unless the user explicitly asks for comparisons.
Parameters (2 required, 7 optional)
legsarrayOptions legs: call/put with strike, expiration, buy/sell, quantity.
symbolstringUnderlying ticker symbol.
compact_uibooleanOptional. If true, hides scenario controls for a simpler widget presentation.
grid_densitystringGrid resolution for heatmap output and matrix payloads. Default is 'standard'.
compactstandarddenseiv_adjustmentnumberOptional IV adjustment percent (e.g. -15).
output_viewstringPresentation mode. 'full' (default) returns the standard interactive analysis view. 'pl_grid' starts with the P/L grid selected. 'pl_curve' starts with the payoff chart selected.
fullpl_gridpl_curveprice_range_sigmanumberPrice span for grid generation in standard deviations (sigma). Default is 2.5.
quote_modestringPricing mode: 'refresh' uses selective live quotes for matched legs (default), 'chain' uses chain prices only.
chainrefreshtime_stepsintegerOptional cap for time slices used in grid generation.