update unusual activity page

This commit is contained in:
MuslemRahimi 2025-02-04 17:22:34 +01:00
parent 5da3db056d
commit 439474c2f9
3 changed files with 14 additions and 11 deletions

View File

@ -84,9 +84,9 @@
} }
// Aggregate call size, put size, and premium // Aggregate call size, put size, and premium
if (optionType === "Call") { if (optionType === "Calls") {
aggregatedData[date].callSize += size; aggregatedData[date].callSize += size;
} else if (optionType === "Put") { } else if (optionType === "Puts") {
aggregatedData[date].putSize += size; aggregatedData[date].putSize += size;
} }
@ -260,10 +260,10 @@
{ key: "dte", label: "DTE", align: "right" }, { key: "dte", label: "DTE", align: "right" },
{ key: "optionType", label: "P/C", align: "right" }, { key: "optionType", label: "P/C", align: "right" },
{ key: "unusualType", label: "Type", align: "right" }, { key: "unusualType", label: "Type", align: "right" },
{ key: "executionEst", label: "Exec", align: "right" },
{ key: "sentiment", label: "Sent.", align: "right" }, { key: "sentiment", label: "Sent.", align: "right" },
{ key: "size", label: "Size", align: "right" }, { key: "size", label: "Size", align: "right" },
{ key: "strike", label: "Strike", align: "right" }, { key: "strike", label: "Strike", align: "right" },
{ key: "avgPrice", label: "Avg Price Paid", align: "right" },
{ key: "price", label: "Spot", align: "right" }, { key: "price", label: "Spot", align: "right" },
{ key: "premium", label: "Prem", align: "right" }, { key: "premium", label: "Prem", align: "right" },
]; ];
@ -272,11 +272,11 @@
date: { order: "none", type: "date" }, date: { order: "none", type: "date" },
optionType: { order: "none", type: "string" }, optionType: { order: "none", type: "string" },
unusualType: { order: "none", type: "string" }, unusualType: { order: "none", type: "string" },
executionEst: { order: "none", type: "string" },
dte: { order: "none", type: "number" }, dte: { order: "none", type: "number" },
sentiment: { order: "none", type: "sentiment" }, sentiment: { order: "none", type: "sentiment" },
size: { order: "none", type: "number" }, size: { order: "none", type: "number" },
strike: { order: "none", type: "number" }, strike: { order: "none", type: "number" },
avgPrice: { order: "none", type: "number" },
price: { order: "none", type: "number" }, price: { order: "none", type: "number" },
premium: { order: "none", type: "number" }, premium: { order: "none", type: "number" },
}; };
@ -326,6 +326,7 @@
return sortOrder === "asc" return sortOrder === "asc"
? sentimentA - sentimentB ? sentimentA - sentimentB
: sentimentB - sentimentA; : sentimentB - sentimentA;
case "number": case "number":
default: default:
valueA = parseFloat(a[key]); valueA = parseFloat(a[key]);
@ -406,6 +407,13 @@
> >
{item?.unusualType} {item?.unusualType}
</td> </td>
<td
class="text-white text-sm sm:text-[1rem] text-end whitespace-nowrap"
>
{item?.executionEst}
</td>
<td <td
class="text-sm sm:text-[1rem] text-end whitespace-nowrap {item?.sentiment === class="text-sm sm:text-[1rem] text-end whitespace-nowrap {item?.sentiment ===
'Bullish' 'Bullish'
@ -427,11 +435,6 @@
{item?.strike} {item?.strike}
</td> </td>
<td
class="text-white text-sm sm:text-[1rem] text-end whitespace-nowrap"
>
{item?.avgPrice}
</td>
<td <td
class="text-white text-sm sm:text-[1rem] text-end whitespace-nowrap" class="text-white text-sm sm:text-[1rem] text-end whitespace-nowrap"
> >

View File

@ -22,7 +22,7 @@ export const load = async ({ locals, params }) => {
}; };
const getHistoricalPrice = async () => { const getHistoricalPrice = async () => {
const postData = { ticker: params.tickerID, timePeriod: "six-months" }; const postData = { ticker: params.tickerID, timePeriod: "max" };
const response = await fetch(apiURL + "/historical-price", { const response = await fetch(apiURL + "/historical-price", {
method: "POST", method: "POST",
headers: { headers: {

View File

@ -22,7 +22,7 @@ export const load = async ({ locals, params }) => {
}; };
const getHistoricalPrice = async () => { const getHistoricalPrice = async () => {
const postData = { ticker: params.tickerID, timePeriod: "six-months" }; const postData = { ticker: params.tickerID, timePeriod: "max" };
const response = await fetch(apiURL + "/historical-price", { const response = await fetch(apiURL + "/historical-price", {
method: "POST", method: "POST",
headers: { headers: {