Skip to content

Commit

Permalink
adjusted the caclculation of the exposure value by including current …
Browse files Browse the repository at this point in the history
…price
  • Loading branch information
mnsrulz committed Aug 17, 2024
1 parent 9911901 commit 4803d7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/api/symbols/[symbol]/options/analyze/tradier/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4803d7f

Please sign in to comment.