From 4803d7f03a410d984d125487d94efe22ad871c90 Mon Sep 17 00:00:00 2001 From: mnsrulz Date: Sat, 17 Aug 2024 20:39:27 +0000 Subject: [PATCH] adjusted the caclculation of the exposure value by including current price --- src/app/api/symbols/[symbol]/options/analyze/tradier/route.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/api/symbols/[symbol]/options/analyze/tradier/route.ts b/src/app/api/symbols/[symbol]/options/analyze/tradier/route.ts index 867a71c..610cf53 100644 --- a/src/app/api/symbols/[symbol]/options/analyze/tradier/route.ts +++ b/src/app/api/symbols/[symbol]/options/analyze/tradier/route.ts @@ -55,8 +55,8 @@ export async function GET(request: Request, p: { params: { symbol: string } }) { const cv_o = allOp.find(j => j.strike == sp && j.expiration_date == dt && j.option_type == 'call'); const pv_o = allOp.find(j => j.strike == sp && j.expiration_date == dt && j.option_type == 'put'); - const cv = (cv_o?.open_interest || 0) * (cv_o?.greeks?.delta || 0) * 100; - const pv = (pv_o?.open_interest || 0) * (pv_o?.greeks?.delta || 0) * 100; + const cv = (cv_o?.open_interest || 0) * (cv_o?.greeks?.delta || 0) * 100 * currentPrice; + const pv = (pv_o?.open_interest || 0) * (pv_o?.greeks?.delta || 0) * 100 * currentPrice; model[sp].calls.push(cv); model[sp].puts.push(pv); model[sp].data.push(-cv, pv);