{"record":{"id":"0ce07a2f0970530e","repo":"jackwener/OpenCLI","slug":"no-option-greeks-were-returned-for-symbol-conf","errorCode":null,"errorMessage":"No option greeks were returned for ${symbol}. Confirm the symbol, expiration, and Barchart login state.","messagePattern":"No option greeks were returned for (.+?)\\. Confirm the symbol, expiration, and Barchart login state\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/barchart/greeks.js","lineNumber":174,"sourceCode":"      })()\n    `));\n        if (!data || data.ok !== true) {\n            if (data?.reason === 'http') {\n                throw new CommandExecutionError(`Barchart greeks request failed: HTTP ${data.status}${data.statusText ? ` ${data.statusText}` : ''}`);\n            }\n            if (data?.reason === 'malformed') {\n                throw new CommandExecutionError(`Barchart greeks returned an unreadable options payload${data.message ? `: ${data.message}` : ''}`);\n            }\n            if (data?.reason === 'exception') {\n                throw new CommandExecutionError(`Barchart greeks request failed: ${data.message || 'unknown error'}`);\n            }\n            throw new CommandExecutionError(`Failed to fetch Barchart greeks for ${symbol}`);\n        }\n        if (!Array.isArray(data.rows)) {\n            throw new CommandExecutionError('Barchart greeks returned an unreadable options payload');\n        }\n        if (data.rows.length === 0) {\n            throw new EmptyResultError('barchart greeks', `No option greeks were returned for ${symbol}. Confirm the symbol, expiration, and Barchart login state.`);\n        }\n        return data.rows.map(r => {\n            if (!r || typeof r !== 'object' || Array.isArray(r)) {\n                throw new CommandExecutionError('Barchart greeks returned a malformed option row');\n            }\n            const type = String(r.type || '').trim();\n            const expirationValue = String(r.expiration || '').trim();\n            if (!/^(call|put)$/i.test(type) || r.strike === undefined || r.strike === null || r.strike === '' || !expirationValue) {\n                throw new CommandExecutionError('Barchart greeks returned a malformed option row identity');\n            }\n            return {\n                type,\n                strike: r.strike,\n                last: r.last != null ? Number(Number(r.last).toFixed(2)) : null,\n                iv: r.iv != null ? Number(Number(r.iv).toFixed(2)) + '%' : null,\n                delta: r.delta != null ? Number(Number(r.delta).toFixed(4)) : null,\n                gamma: r.gamma != null ? Number(Number(r.gamma).toFixed(4)) : null,\n                theta: r.theta != null ? Number(Number(r.theta).toFixed(4)) : null,","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/barchart/greeks.js#L156-L192","documentation":"An EmptyResultError thrown when the Barchart greeks request succeeded and `data.rows` is an array, but it contains zero rows. The library surfaces this to tell the user the lookup completed yet matched no option greeks, and hints that symbol, expiration, or login state may be at fault.","triggerScenarios":"`barchart greeks SYMBOL --expiration <date>` where the expiration has passed, the symbol has no options chain, or Barchart silently returns an empty rows list because the session is not authenticated.","commonSituations":"Querying expired option expirations, misspelled or OTC symbols without listed options, weekends/holdiays with no chain snapshot, expired Barchart login yielding an empty-but-valid payload.","solutions":["Re-run with a valid future expiration date for the symbol.","Confirm the symbol has listed options (try a liquid ticker like SPY).","Re-login to Barchart; an invalid session can yield empty rows.","Check the market is open / chain data is published for that date."],"exampleFix":"// before\nawait cli.run(['barchart','greeks','OLDTICKER','--expiration','2020-01-17']);\n// after\nawait cli.run(['barchart','greeks','SPY','--expiration','2026-09-18']);","handlingStrategy":"validation","validationCode":"function validateGreeksRequest(symbol, expiration){\n  if (!/^[A-Z.]{1,6}$/.test(symbol)) throw new Error('bad symbol');\n  if (expiration && new Date(expiration) <= new Date()) throw new Error('expiration is in the past');\n}","typeGuard":"const hasOptionsListed = (symbol) => /^[A-Z]{1,5}$/.test(symbol); // liquid US symbol heuristic","tryCatchPattern":"try {\n  const rows = await cli.run(['barchart','greeks', symbol, '--expiration', exp]);\n} catch (e) {\n  if (e.name === 'EmptyResultError') {\n    console.warn(`No greeks for ${symbol} @ ${exp}; try another expiration or check login state`);\n  }\n}","preventionTips":["Always pass a future, listed expiration date","Verify the symbol has an options chain before querying","Re-login to Barchart when results come back empty","Handle EmptyResultError explicitly instead of treating it as a bug"],"tags":["barchart","options","empty-result"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}