add gex and dex pages
This commit is contained in:
parent
61bab23524
commit
018462809d
@ -17,10 +17,10 @@
|
|||||||
|
|
||||||
if (state !== "overview" && subSectionMap[state]) {
|
if (state !== "overview" && subSectionMap[state]) {
|
||||||
displaySubSection = state;
|
displaySubSection = state;
|
||||||
//goto(`/stocks/${$etfTicker}${subSectionMap[state]}`);
|
//goto(`/etf/${$etfTicker}${subSectionMap[state]}`);
|
||||||
} else {
|
} else {
|
||||||
displaySubSection = state;
|
displaySubSection = state;
|
||||||
//goto(`/stocks/${$etfTicker}/statistics`);
|
//goto(`/etf/${$etfTicker}/statistics`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,7 +157,7 @@
|
|||||||
<ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" />
|
<ArrowLogo class="w-8 h-8 mr-3 flex-shrink-0" />
|
||||||
</div>
|
</div>
|
||||||
<span class="text-white p-3 ml-3 mr-3">
|
<span class="text-white p-3 ml-3 mr-3">
|
||||||
Build your Stock Screener to find profitable stocks.
|
Build your Stock Screener to find profitable etf.
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
94
src/routes/etf/[tickerID]/options/dex/+layout.svelte
Normal file
94
src/routes/etf/[tickerID]/options/dex/+layout.svelte
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { etfTicker } from "$lib/store";
|
||||||
|
import { page } from "$app/stores";
|
||||||
|
|
||||||
|
export let data;
|
||||||
|
|
||||||
|
let displaySubSection = "overview";
|
||||||
|
|
||||||
|
function changeSubSection(state) {
|
||||||
|
const subSectionMap = {
|
||||||
|
dex: "/options/dex",
|
||||||
|
strike: "/options/dex/strike",
|
||||||
|
expiry: "/options/dex/expiry",
|
||||||
|
};
|
||||||
|
|
||||||
|
if (state !== "overview" && subSectionMap[state]) {
|
||||||
|
displaySubSection = state;
|
||||||
|
//goto(`/etf/${$etfTicker}${subSectionMap[state]}`);
|
||||||
|
} else {
|
||||||
|
displaySubSection = state;
|
||||||
|
//goto(`/etf/${$etfTicker}/statistics`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$: {
|
||||||
|
if ($page?.url?.pathname) {
|
||||||
|
const parts = $page?.url?.pathname.split("/");
|
||||||
|
const sectionMap = {
|
||||||
|
overview: "overview",
|
||||||
|
strike: "strike",
|
||||||
|
expiry: "expiry",
|
||||||
|
};
|
||||||
|
|
||||||
|
const foundSection = parts?.find((part) =>
|
||||||
|
Object?.values(sectionMap)?.includes(part),
|
||||||
|
);
|
||||||
|
|
||||||
|
displaySubSection =
|
||||||
|
Object?.keys(sectionMap)?.find(
|
||||||
|
(key) => sectionMap[key] === foundSection,
|
||||||
|
) || "overview";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<section class="w-full overflow-hidden min-h-screen">
|
||||||
|
<div class="w-full overflow-hidden m-auto">
|
||||||
|
<div class="sm:p-0 flex justify-center w-full m-auto overflow-hidden">
|
||||||
|
<div
|
||||||
|
class="relative flex justify-center items-start overflow-hidden w-full"
|
||||||
|
>
|
||||||
|
<main class="w-full">
|
||||||
|
<nav
|
||||||
|
class="sm:ml-4 overflow-x-scroll pt-1 text-sm sm:text-[1rem] whitespace-nowrap"
|
||||||
|
>
|
||||||
|
<ul class="flex flex-row items-center w-full text-white">
|
||||||
|
<a
|
||||||
|
href={`/etf/${$etfTicker}/options/dex`}
|
||||||
|
on:click={() => changeSubSection("overview")}
|
||||||
|
class="p-2 px-5 cursor-pointer {displaySubSection === 'overview'
|
||||||
|
? 'text-white bg-primary sm:hover:bg-opacity-[0.95]'
|
||||||
|
: 'text-gray-400 sm:hover:text-white sm:hover:bg-primary sm:hover:bg-opacity-[0.95]'}"
|
||||||
|
>
|
||||||
|
Overview
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a
|
||||||
|
href={`/etf/${$etfTicker}/options/dex/strike`}
|
||||||
|
on:click={() => changeSubSection("strike")}
|
||||||
|
class="p-2 px-5 cursor-pointer {displaySubSection === 'strike'
|
||||||
|
? 'text-white bg-primary sm:hover:bg-opacity-[0.95]'
|
||||||
|
: 'text-gray-400 sm:hover:text-white sm:hover:bg-primary sm:hover:bg-opacity-[0.95]'}"
|
||||||
|
>
|
||||||
|
By Strike
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
href={`/etf/${$etfTicker}/options/dex/expiry`}
|
||||||
|
on:click={() => changeSubSection("expiry")}
|
||||||
|
class="p-2 px-5 cursor-pointer {displaySubSection === 'expiry'
|
||||||
|
? 'text-white bg-primary sm:hover:bg-opacity-[0.95]'
|
||||||
|
: 'text-gray-400 sm:hover:text-white sm:hover:bg-primary sm:hover:bg-opacity-[0.95]'}"
|
||||||
|
>
|
||||||
|
By Expiry
|
||||||
|
</a>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
<div class="mt-2 sm:mt-0">
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
50
src/routes/etf/[tickerID]/options/dex/+page.server.ts
Normal file
50
src/routes/etf/[tickerID]/options/dex/+page.server.ts
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
|
||||||
|
|
||||||
|
export const load = async ({ locals, params }) => {
|
||||||
|
const { apiKey, apiURL, user } = locals;
|
||||||
|
|
||||||
|
const getData = async () => {
|
||||||
|
const postData = {
|
||||||
|
params: params.tickerID,
|
||||||
|
category: "overview"
|
||||||
|
};
|
||||||
|
|
||||||
|
const response = await fetch(apiURL + "/options-gex-dex", {
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"X-API-KEY": apiKey,
|
||||||
|
},
|
||||||
|
body: JSON.stringify(postData),
|
||||||
|
});
|
||||||
|
const output = await response.json();
|
||||||
|
|
||||||
|
return output;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const getHistoricalPrice = async () => {
|
||||||
|
const postData = { ticker: params.tickerID, timePeriod: "one-year" };
|
||||||
|
const response = await fetch(apiURL + "/historical-price", {
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"X-API-KEY": apiKey,
|
||||||
|
},
|
||||||
|
body: JSON.stringify(postData),
|
||||||
|
});
|
||||||
|
|
||||||
|
const output = await response.json();
|
||||||
|
return output;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Make sure to return a promise
|
||||||
|
return {
|
||||||
|
getData: await getData(),
|
||||||
|
getHistoricalPrice: await getHistoricalPrice(),
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
525
src/routes/etf/[tickerID]/options/dex/+page.svelte
Normal file
525
src/routes/etf/[tickerID]/options/dex/+page.svelte
Normal file
@ -0,0 +1,525 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import {
|
||||||
|
abbreviateNumberWithColor,
|
||||||
|
abbreviateNumber,
|
||||||
|
monthNames,
|
||||||
|
} from "$lib/utils";
|
||||||
|
import {
|
||||||
|
stockTicker,
|
||||||
|
screenWidth,
|
||||||
|
numberOfUnreadNotification,
|
||||||
|
displayCompanyName,
|
||||||
|
} from "$lib/store";
|
||||||
|
import { onMount } from "svelte";
|
||||||
|
import TableHeader from "$lib/components/Table/TableHeader.svelte";
|
||||||
|
import UpgradeToPro from "$lib/components/UpgradeToPro.svelte";
|
||||||
|
import Infobox from "$lib/components/Infobox.svelte";
|
||||||
|
import { Chart } from "svelte-echarts";
|
||||||
|
|
||||||
|
import { init, use } from "echarts/core";
|
||||||
|
import { LineChart, BarChart } from "echarts/charts";
|
||||||
|
import {
|
||||||
|
GridComponent,
|
||||||
|
TooltipComponent,
|
||||||
|
LegendComponent,
|
||||||
|
} from "echarts/components";
|
||||||
|
import { CanvasRenderer } from "echarts/renderers";
|
||||||
|
|
||||||
|
use([
|
||||||
|
LineChart,
|
||||||
|
BarChart,
|
||||||
|
GridComponent,
|
||||||
|
TooltipComponent,
|
||||||
|
LegendComponent,
|
||||||
|
CanvasRenderer,
|
||||||
|
]);
|
||||||
|
|
||||||
|
export let data;
|
||||||
|
let rawData = data?.getData || [];
|
||||||
|
|
||||||
|
rawData = rawData?.map((item) => ({
|
||||||
|
...item,
|
||||||
|
net_delta: (item?.call_delta || 0) + (item?.put_delta || 0),
|
||||||
|
put_call_ratio:
|
||||||
|
item?.call_delta > 0
|
||||||
|
? Math.abs((item?.put_delta || 0) / item?.call_delta)
|
||||||
|
: null,
|
||||||
|
}));
|
||||||
|
|
||||||
|
let displayList = rawData?.slice(0, 150);
|
||||||
|
let timePeriod = "3M";
|
||||||
|
|
||||||
|
let options = null;
|
||||||
|
|
||||||
|
function filterDataByPeriod(historicalData, period = "3M") {
|
||||||
|
const currentDate = new Date();
|
||||||
|
let startDate = new Date();
|
||||||
|
|
||||||
|
// Calculate the start date based on the period input
|
||||||
|
switch (period) {
|
||||||
|
case "3M":
|
||||||
|
startDate.setMonth(currentDate.getMonth() - 3);
|
||||||
|
break;
|
||||||
|
case "6M":
|
||||||
|
startDate.setMonth(currentDate.getMonth() - 6);
|
||||||
|
break;
|
||||||
|
case "1Y":
|
||||||
|
startDate.setFullYear(currentDate.getFullYear() - 1);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new Error(`Unsupported period: ${period}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filter the data based on the calculated start date
|
||||||
|
let filteredData = historicalData?.filter((item) => {
|
||||||
|
if (!item?.date) return false;
|
||||||
|
const itemDate = new Date(item.date);
|
||||||
|
return itemDate >= startDate && itemDate <= currentDate;
|
||||||
|
});
|
||||||
|
|
||||||
|
filteredData?.forEach((entry) => {
|
||||||
|
const matchingData = data?.getHistoricalPrice?.find(
|
||||||
|
(d) => d?.time === entry?.date,
|
||||||
|
);
|
||||||
|
if (matchingData) {
|
||||||
|
entry.price = matchingData?.close;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Extract the dates and gamma values from the filtered data
|
||||||
|
const dateList = filteredData?.map((item) => item.date);
|
||||||
|
const gammaList = filteredData?.map((item) => item.net_delta);
|
||||||
|
const priceList = filteredData?.map((item) => item.price);
|
||||||
|
|
||||||
|
return { dateList, gammaList, priceList };
|
||||||
|
}
|
||||||
|
|
||||||
|
function plotData() {
|
||||||
|
const data = rawData?.sort((a, b) => new Date(a?.date) - new Date(b?.date));
|
||||||
|
const { dateList, gammaList, priceList } = filterDataByPeriod(
|
||||||
|
data,
|
||||||
|
timePeriod,
|
||||||
|
);
|
||||||
|
const options = {
|
||||||
|
animation: false,
|
||||||
|
tooltip: {
|
||||||
|
trigger: "axis",
|
||||||
|
hideDelay: 100,
|
||||||
|
borderColor: "#969696", // Black border color
|
||||||
|
borderWidth: 1, // Border width of 1px
|
||||||
|
backgroundColor: "#313131", // Optional: Set background color for contrast
|
||||||
|
textStyle: {
|
||||||
|
color: "#fff", // Optional: Text color for better visibility
|
||||||
|
},
|
||||||
|
formatter: function (params) {
|
||||||
|
// Get the timestamp from the first parameter
|
||||||
|
const timestamp = params[0].axisValue;
|
||||||
|
|
||||||
|
// Initialize result with timestamp
|
||||||
|
let result = timestamp + "<br/>";
|
||||||
|
|
||||||
|
// Add each series data
|
||||||
|
params?.forEach((param) => {
|
||||||
|
const marker =
|
||||||
|
'<span style="display:inline-block;margin-right:4px;' +
|
||||||
|
"border-radius:10px;width:10px;height:10px;background-color:" +
|
||||||
|
param.color +
|
||||||
|
'"></span>';
|
||||||
|
result +=
|
||||||
|
marker +
|
||||||
|
param.seriesName +
|
||||||
|
": " +
|
||||||
|
abbreviateNumber(param.value) +
|
||||||
|
"<br/>";
|
||||||
|
});
|
||||||
|
|
||||||
|
return result;
|
||||||
|
},
|
||||||
|
axisPointer: {
|
||||||
|
lineStyle: {
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
silent: true,
|
||||||
|
grid: {
|
||||||
|
left: $screenWidth < 640 ? "5%" : "0%",
|
||||||
|
right: $screenWidth < 640 ? "5%" : "0%",
|
||||||
|
bottom: "10%",
|
||||||
|
containLabel: true,
|
||||||
|
},
|
||||||
|
xAxis: [
|
||||||
|
{
|
||||||
|
type: "category",
|
||||||
|
data: dateList,
|
||||||
|
axisLabel: {
|
||||||
|
color: "#fff",
|
||||||
|
|
||||||
|
formatter: function (value) {
|
||||||
|
// Assuming dates are in the format 'yyyy-mm-dd'
|
||||||
|
const dateParts = value.split("-");
|
||||||
|
const monthIndex = parseInt(dateParts[1]) - 1; // Months are zero-indexed in JavaScript Date objects
|
||||||
|
const year = parseInt(dateParts[0]);
|
||||||
|
const day = parseInt(dateParts[2]);
|
||||||
|
return `${day} ${monthNames[monthIndex]} ${year}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
yAxis: [
|
||||||
|
{
|
||||||
|
type: "value",
|
||||||
|
splitLine: {
|
||||||
|
show: false, // Disable x-axis grid lines
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
show: false, // Hide y-axis labels
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "value",
|
||||||
|
splitLine: {
|
||||||
|
show: false, // Disable x-axis grid lines
|
||||||
|
},
|
||||||
|
position: "right",
|
||||||
|
axisLabel: {
|
||||||
|
show: false, // Hide y-axis labels
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: "Price",
|
||||||
|
type: "line",
|
||||||
|
data: priceList,
|
||||||
|
yAxisIndex: 1,
|
||||||
|
lineStyle: { width: 2 },
|
||||||
|
itemStyle: {
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
smooth: true,
|
||||||
|
showSymbol: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Gamma",
|
||||||
|
type: "bar",
|
||||||
|
data: gammaList,
|
||||||
|
itemStyle: {
|
||||||
|
color: "#9B5DC4",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatDate(dateStr) {
|
||||||
|
// Parse the input date string (YYYY-mm-dd)
|
||||||
|
var date = new Date(dateStr);
|
||||||
|
|
||||||
|
// Get month, day, and year
|
||||||
|
var month = date.getMonth() + 1; // Month starts from 0
|
||||||
|
var day = date.getDate();
|
||||||
|
var year = date.getFullYear();
|
||||||
|
|
||||||
|
// Extract the last two digits of the year
|
||||||
|
var shortYear = year.toString().slice(-2);
|
||||||
|
|
||||||
|
// Add leading zeros if necessary
|
||||||
|
month = (month < 10 ? "0" : "") + month;
|
||||||
|
day = (day < 10 ? "0" : "") + day;
|
||||||
|
|
||||||
|
var formattedDate = month + "/" + day + "/" + year;
|
||||||
|
|
||||||
|
return formattedDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleScroll() {
|
||||||
|
const scrollThreshold = document.body.offsetHeight * 0.8; // 80% of the website height
|
||||||
|
const isBottom = window.innerHeight + window.scrollY >= scrollThreshold;
|
||||||
|
|
||||||
|
if (isBottom && displayList?.length !== rawData?.length) {
|
||||||
|
const nextIndex = displayList?.length;
|
||||||
|
const filteredNewResults = rawData?.slice(nextIndex, nextIndex + 50);
|
||||||
|
displayList = [...displayList, ...filteredNewResults];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMount(() => {
|
||||||
|
window.addEventListener("scroll", handleScroll);
|
||||||
|
return () => {
|
||||||
|
window.removeEventListener("scroll", handleScroll);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
$: columns = [
|
||||||
|
{ key: "date", label: "Date", align: "left" },
|
||||||
|
{ key: "call_delta", label: "Call Delta", align: "right" },
|
||||||
|
{ key: "put_delta", label: "Put Delta", align: "right" },
|
||||||
|
{ key: "net_delta", label: "Net Delta", align: "right" },
|
||||||
|
{ key: "put_call_ratio", label: "P/C Delta", align: "right" },
|
||||||
|
];
|
||||||
|
|
||||||
|
$: sortOrders = {
|
||||||
|
date: { order: "none", type: "date" },
|
||||||
|
call_delta: { order: "none", type: "number" },
|
||||||
|
put_delta: { order: "none", type: "number" },
|
||||||
|
net_delta: { order: "none", type: "number" },
|
||||||
|
put_call_ratio: { order: "none", type: "number" },
|
||||||
|
};
|
||||||
|
|
||||||
|
const sortData = (key) => {
|
||||||
|
// Reset all other keys to 'none' except the current key
|
||||||
|
for (const k in sortOrders) {
|
||||||
|
if (k !== key) {
|
||||||
|
sortOrders[k].order = "none";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cycle through 'none', 'asc', 'desc' for the clicked key
|
||||||
|
const orderCycle = ["none", "asc", "desc"];
|
||||||
|
let originalData = rawData;
|
||||||
|
const currentOrderIndex = orderCycle.indexOf(sortOrders[key].order);
|
||||||
|
sortOrders[key].order =
|
||||||
|
orderCycle[(currentOrderIndex + 1) % orderCycle.length];
|
||||||
|
const sortOrder = sortOrders[key].order;
|
||||||
|
|
||||||
|
// Reset to original data when 'none' and stop further sorting
|
||||||
|
if (sortOrder === "none") {
|
||||||
|
originalData = [...rawData]; // Reset originalData to rawDataVolume
|
||||||
|
displayList = originalData;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Define a generic comparison function
|
||||||
|
const compareValues = (a, b) => {
|
||||||
|
const { type } = sortOrders[key];
|
||||||
|
let valueA, valueB;
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case "date":
|
||||||
|
valueA = new Date(a[key]);
|
||||||
|
valueB = new Date(b[key]);
|
||||||
|
break;
|
||||||
|
case "string":
|
||||||
|
valueA = a[key].toUpperCase();
|
||||||
|
valueB = b[key].toUpperCase();
|
||||||
|
return sortOrder === "asc"
|
||||||
|
? valueA.localeCompare(valueB)
|
||||||
|
: valueB.localeCompare(valueA);
|
||||||
|
case "number":
|
||||||
|
default:
|
||||||
|
valueA = parseFloat(a[key]);
|
||||||
|
valueB = parseFloat(b[key]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sortOrder === "asc") {
|
||||||
|
return valueA < valueB ? -1 : valueA > valueB ? 1 : 0;
|
||||||
|
} else {
|
||||||
|
return valueA > valueB ? -1 : valueA < valueB ? 1 : 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Sort using the generic comparison function
|
||||||
|
displayList = [...originalData].sort(compareValues);
|
||||||
|
};
|
||||||
|
|
||||||
|
$: {
|
||||||
|
if (typeof window !== "undefined" && timePeriod) {
|
||||||
|
options = plotData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<svelte:head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width" />
|
||||||
|
<title>
|
||||||
|
{$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ""}
|
||||||
|
{$displayCompanyName} ({$stockTicker}) Gamma Exposure · Stocknear
|
||||||
|
</title>
|
||||||
|
<meta
|
||||||
|
name="description"
|
||||||
|
content={`Explore historic volume & open interest of option chains & save individual contracts for later`}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- Other meta tags -->
|
||||||
|
<meta
|
||||||
|
property="og:title"
|
||||||
|
content={`${$displayCompanyName} (${$stockTicker}) Gamma Exposure · Stocknear`}
|
||||||
|
/>
|
||||||
|
<meta
|
||||||
|
property="og:description"
|
||||||
|
content={`Explore historic volume & open interest of option chains & save individual contracts for later`}
|
||||||
|
/>
|
||||||
|
<meta property="og:type" content="website" />
|
||||||
|
<!-- Add more Open Graph meta tags as needed -->
|
||||||
|
|
||||||
|
<!-- Twitter specific meta tags -->
|
||||||
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
|
<meta
|
||||||
|
name="twitter:title"
|
||||||
|
content={`${$displayCompanyName} (${$stockTicker}) Gamma Exposure · Stocknear`}
|
||||||
|
/>
|
||||||
|
<meta
|
||||||
|
name="twitter:description"
|
||||||
|
content={`Explore historic volume & open interest of option chains & save individual contracts for later`}
|
||||||
|
/>
|
||||||
|
<!-- Add more Twitter meta tags as needed -->
|
||||||
|
</svelte:head>
|
||||||
|
|
||||||
|
<section
|
||||||
|
class="w-full bg-default overflow-hidden text-white min-h-screen pb-40"
|
||||||
|
>
|
||||||
|
<div class="w-full flex h-full overflow-hidden">
|
||||||
|
<div
|
||||||
|
class="w-full relative flex justify-center items-center overflow-hidden"
|
||||||
|
>
|
||||||
|
{#if rawData?.length > 0}
|
||||||
|
<div class="sm:p-7 w-full m-auto mt-2 sm:mt-0">
|
||||||
|
<h2
|
||||||
|
class=" flex flex-row items-center text-white text-xl sm:text-2xl font-bold w-fit"
|
||||||
|
>
|
||||||
|
Daily Delta Exposure
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<div class="w-full overflow-hidden m-auto mt-5">
|
||||||
|
{#if options !== null}
|
||||||
|
<div class="app w-full relative">
|
||||||
|
<div
|
||||||
|
class="flex justify-start space-x-2 absolute right-0 top-0 z-10"
|
||||||
|
>
|
||||||
|
{#each ["3M", "6M", "1Y"] as item}
|
||||||
|
<label
|
||||||
|
on:click={() => (timePeriod = item)}
|
||||||
|
class="px-3 py-1 text-sm {timePeriod === item
|
||||||
|
? 'bg-white text-black '
|
||||||
|
: 'text-white bg-table text-opacity-[0.6]'} transition ease-out duration-100 sm:hover:bg-white sm:hover:text-black rounded-md cursor-pointer"
|
||||||
|
>
|
||||||
|
{item}
|
||||||
|
</label>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Chart {init} {options} class="chart" />
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
|
<div class="flex justify-center items-center h-80">
|
||||||
|
<div class="relative">
|
||||||
|
<label
|
||||||
|
class="bg-primary rounded-md h-14 w-14 flex justify-center items-center absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="loading loading-spinner loading-md sm:loading-[1rem] text-gray-400"
|
||||||
|
></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
<div class="w-full overflow-x-scroll text-white">
|
||||||
|
<table
|
||||||
|
class="w-full table table-sm table-compact bg-table border border-gray-800 rounded-none sm:rounded-md m-auto overflow-x-auto"
|
||||||
|
>
|
||||||
|
<thead>
|
||||||
|
<TableHeader {columns} {sortOrders} {sortData} />
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{#each displayList as item, index}
|
||||||
|
<tr
|
||||||
|
class="sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] odd:bg-odd border-b border-gray-800 {index +
|
||||||
|
1 ===
|
||||||
|
displayList?.slice(0, 3)?.length &&
|
||||||
|
data?.user?.tier !== 'Pro'
|
||||||
|
? 'opacity-[0.1]'
|
||||||
|
: ''}"
|
||||||
|
>
|
||||||
|
<td
|
||||||
|
class="text-white text-sm sm:text-[1rem] text-start whitespace-nowrap"
|
||||||
|
>
|
||||||
|
{formatDate(item?.date)}
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
class="text-white text-sm sm:text-[1rem] text-end whitespace-nowrap"
|
||||||
|
>
|
||||||
|
{@html abbreviateNumberWithColor(
|
||||||
|
item?.call_delta,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
)}
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
class="text-white text-sm sm:text-[1rem] text-end whitespace-nowrap"
|
||||||
|
>
|
||||||
|
{@html abbreviateNumberWithColor(
|
||||||
|
item?.put_delta,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
)}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td
|
||||||
|
class="text-white text-sm sm:text-[1rem] text-end whitespace-nowrap"
|
||||||
|
>
|
||||||
|
{@html abbreviateNumberWithColor(
|
||||||
|
item?.net_delta,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
)}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td
|
||||||
|
class="text-white text-sm sm:text-[1rem] text-end whitespace-nowrap"
|
||||||
|
>
|
||||||
|
{#if item?.put_call_ratio <= 1}
|
||||||
|
<span class="text-[#00FC50]"
|
||||||
|
>{item?.put_call_ratio?.toFixed(2)}</span
|
||||||
|
>
|
||||||
|
{:else}
|
||||||
|
<span class="text-[#FF2F1F]"
|
||||||
|
>{item?.put_call_ratio?.toFixed(2)}</span
|
||||||
|
>
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{/each}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<UpgradeToPro {data} />
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
|
<div class="sm:p-7 w-full m-auto mt-2 sm:mt-0">
|
||||||
|
<h2
|
||||||
|
class=" flex flex-row items-center text-white text-xl sm:text-2xl font-bold w-fit"
|
||||||
|
>
|
||||||
|
Hottest Contracts
|
||||||
|
</h2>
|
||||||
|
<div class="mt-2">
|
||||||
|
<Infobox text="No data is available" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.app {
|
||||||
|
height: 400px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 560px) {
|
||||||
|
.app {
|
||||||
|
width: 100%;
|
||||||
|
height: 300px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.chart {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
35
src/routes/etf/[tickerID]/options/dex/expiry/+page.server.ts
Normal file
35
src/routes/etf/[tickerID]/options/dex/expiry/+page.server.ts
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
|
||||||
|
|
||||||
|
export const load = async ({ locals, params }) => {
|
||||||
|
const { apiKey, apiURL, user } = locals;
|
||||||
|
|
||||||
|
const getData = async () => {
|
||||||
|
const postData = {
|
||||||
|
params: params.tickerID,
|
||||||
|
category: "expiry"
|
||||||
|
};
|
||||||
|
|
||||||
|
const response = await fetch(apiURL + "/options-gex-dex", {
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"X-API-KEY": apiKey,
|
||||||
|
},
|
||||||
|
body: JSON.stringify(postData),
|
||||||
|
});
|
||||||
|
const output = await response.json();
|
||||||
|
|
||||||
|
return output;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Make sure to return a promise
|
||||||
|
return {
|
||||||
|
getData: await getData(),
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
427
src/routes/etf/[tickerID]/options/dex/expiry/+page.svelte
Normal file
427
src/routes/etf/[tickerID]/options/dex/expiry/+page.svelte
Normal file
@ -0,0 +1,427 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { abbreviateNumberWithColor } from "$lib/utils";
|
||||||
|
import {
|
||||||
|
etfTicker,
|
||||||
|
screenWidth,
|
||||||
|
numberOfUnreadNotification,
|
||||||
|
displayCompanyName,
|
||||||
|
} from "$lib/store";
|
||||||
|
import { onMount } from "svelte";
|
||||||
|
import TableHeader from "$lib/components/Table/TableHeader.svelte";
|
||||||
|
import UpgradeToPro from "$lib/components/UpgradeToPro.svelte";
|
||||||
|
import Infobox from "$lib/components/Infobox.svelte";
|
||||||
|
import { Chart } from "svelte-echarts";
|
||||||
|
|
||||||
|
import { init, use } from "echarts/core";
|
||||||
|
import { LineChart, BarChart } from "echarts/charts";
|
||||||
|
import {
|
||||||
|
GridComponent,
|
||||||
|
TooltipComponent,
|
||||||
|
LegendComponent,
|
||||||
|
} from "echarts/components";
|
||||||
|
import { CanvasRenderer } from "echarts/renderers";
|
||||||
|
|
||||||
|
use([
|
||||||
|
LineChart,
|
||||||
|
BarChart,
|
||||||
|
GridComponent,
|
||||||
|
TooltipComponent,
|
||||||
|
LegendComponent,
|
||||||
|
CanvasRenderer,
|
||||||
|
]);
|
||||||
|
|
||||||
|
export let data;
|
||||||
|
let rawData = data?.getData || [];
|
||||||
|
|
||||||
|
rawData = rawData?.map((item) => ({
|
||||||
|
...item,
|
||||||
|
net_delta: (item?.call_delta || 0) + (item?.put_delta || 0),
|
||||||
|
put_call_ratio:
|
||||||
|
item?.call_delta > 0
|
||||||
|
? Math.abs((item?.put_delta || 0) / item?.call_delta)
|
||||||
|
: null,
|
||||||
|
}));
|
||||||
|
|
||||||
|
let displayList = rawData?.slice(0, 150);
|
||||||
|
let options = null;
|
||||||
|
|
||||||
|
function formatDate(dateString) {
|
||||||
|
if (!dateString) return null; // Handle null or undefined input
|
||||||
|
const date = new Date(dateString);
|
||||||
|
const formatter = new Intl.DateTimeFormat("en-US", {
|
||||||
|
month: "short",
|
||||||
|
day: "numeric",
|
||||||
|
year: "2-digit",
|
||||||
|
});
|
||||||
|
return formatter.format(date);
|
||||||
|
}
|
||||||
|
|
||||||
|
function plotData() {
|
||||||
|
// Process and sort data by strike in descending order
|
||||||
|
const processedData = rawData
|
||||||
|
?.map((d) => ({
|
||||||
|
expiry: formatDate(d?.expiry),
|
||||||
|
callDelta: d?.call_delta,
|
||||||
|
putDelta: d?.put_delta,
|
||||||
|
netDelta: d?.net_delta,
|
||||||
|
}))
|
||||||
|
.sort((a, b) => a.strike - b.strike);
|
||||||
|
|
||||||
|
const expiries = processedData.map((d) => d.expiry);
|
||||||
|
const callDelta = processedData.map((d) => d.callDelta?.toFixed(2));
|
||||||
|
const putDelta = processedData.map((d) => d.putDelta?.toFixed(2));
|
||||||
|
const netDelta = processedData.map((d) => d.netDelta?.toFixed(2));
|
||||||
|
|
||||||
|
const options = {
|
||||||
|
animation: false,
|
||||||
|
tooltip: {
|
||||||
|
trigger: "axis",
|
||||||
|
axisPointer: {
|
||||||
|
type: "shadow",
|
||||||
|
},
|
||||||
|
backgroundColor: "#313131",
|
||||||
|
textStyle: {
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
formatter: function (params) {
|
||||||
|
const expiry = params[0].axisValue;
|
||||||
|
const put = params[0].data;
|
||||||
|
const call = params[1].data;
|
||||||
|
const net = params[2].data;
|
||||||
|
|
||||||
|
return `
|
||||||
|
<div style="text-align:left;">
|
||||||
|
<b>Expiry:</b> ${expiry}<br/>
|
||||||
|
<span style="color:#9B5DC4;">● Put Delta:</span> ${abbreviateNumberWithColor(put, false, true)}<br/>
|
||||||
|
<span style="color:#C4E916;">● Call Delta:</span> ${abbreviateNumberWithColor(call, false, true)}<br/>
|
||||||
|
<span style="color:#FF2F1F;">● Net Delta:</span> ${abbreviateNumberWithColor(net, false, true)}<br/>
|
||||||
|
</div>`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
left: $screenWidth < 640 ? "5%" : "1%",
|
||||||
|
right: $screenWidth < 640 ? "5%" : "0%",
|
||||||
|
bottom: "10%",
|
||||||
|
containLabel: true,
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: "value",
|
||||||
|
name: "Delta",
|
||||||
|
nameTextStyle: { color: "#fff" },
|
||||||
|
splitLine: { show: false },
|
||||||
|
axisLabel: {
|
||||||
|
show: false, // Hide y-axis labels
|
||||||
|
},
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: "category",
|
||||||
|
data: expiries,
|
||||||
|
axisLine: { lineStyle: { color: "#fff" } },
|
||||||
|
axisLabel: { color: "#fff" },
|
||||||
|
splitLine: { show: false },
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: "Put Delta",
|
||||||
|
type: "bar",
|
||||||
|
data: putDelta,
|
||||||
|
stack: "Delta",
|
||||||
|
itemStyle: { color: "#9B5DC4" },
|
||||||
|
barWidth: "40%",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Net Delta",
|
||||||
|
type: "bar",
|
||||||
|
data: netDelta,
|
||||||
|
stack: "Delta",
|
||||||
|
itemStyle: { color: "#FF2F1F" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Call Delta",
|
||||||
|
type: "bar",
|
||||||
|
data: callDelta,
|
||||||
|
stack: "Delta",
|
||||||
|
itemStyle: { color: "#C4E916" },
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleScroll() {
|
||||||
|
const scrollThreshold = document.body.offsetHeight * 0.8; // 80% of the website height
|
||||||
|
const isBottom = window.innerHeight + window.scrollY >= scrollThreshold;
|
||||||
|
|
||||||
|
if (isBottom && displayList?.length !== rawData?.length) {
|
||||||
|
const nextIndex = displayList?.length;
|
||||||
|
const filteredNewResults = rawData?.slice(nextIndex, nextIndex + 50);
|
||||||
|
displayList = [...displayList, ...filteredNewResults];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMount(() => {
|
||||||
|
window.addEventListener("scroll", handleScroll);
|
||||||
|
return () => {
|
||||||
|
window.removeEventListener("scroll", handleScroll);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
$: columns = [
|
||||||
|
{ key: "expiry", label: "Expiry Date", align: "left" },
|
||||||
|
{ key: "call_delta", label: "Call Delta", align: "right" },
|
||||||
|
{ key: "put_delta", label: "Put Delta", align: "right" },
|
||||||
|
{ key: "net_delta", label: "Net Delta", align: "right" },
|
||||||
|
{ key: "put_call_ratio", label: "P/C Delta", align: "right" },
|
||||||
|
];
|
||||||
|
|
||||||
|
$: sortOrders = {
|
||||||
|
expiry: { order: "none", type: "date" },
|
||||||
|
call_delta: { order: "none", type: "number" },
|
||||||
|
put_delta: { order: "none", type: "number" },
|
||||||
|
net_delta: { order: "none", type: "number" },
|
||||||
|
put_call_ratio: { order: "none", type: "number" },
|
||||||
|
};
|
||||||
|
|
||||||
|
const sortData = (key) => {
|
||||||
|
// Reset all other keys to 'none' except the current key
|
||||||
|
for (const k in sortOrders) {
|
||||||
|
if (k !== key) {
|
||||||
|
sortOrders[k].order = "none";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cycle through 'none', 'asc', 'desc' for the clicked key
|
||||||
|
const orderCycle = ["none", "asc", "desc"];
|
||||||
|
let originalData = rawData;
|
||||||
|
const currentOrderIndex = orderCycle.indexOf(sortOrders[key].order);
|
||||||
|
sortOrders[key].order =
|
||||||
|
orderCycle[(currentOrderIndex + 1) % orderCycle.length];
|
||||||
|
const sortOrder = sortOrders[key].order;
|
||||||
|
|
||||||
|
// Reset to original data when 'none' and stop further sorting
|
||||||
|
if (sortOrder === "none") {
|
||||||
|
originalData = [...rawData]; // Reset originalData to rawDataVolume
|
||||||
|
displayList = originalData;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Define a generic comparison function
|
||||||
|
const compareValues = (a, b) => {
|
||||||
|
const { type } = sortOrders[key];
|
||||||
|
let valueA, valueB;
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case "date":
|
||||||
|
valueA = new Date(a[key]);
|
||||||
|
valueB = new Date(b[key]);
|
||||||
|
break;
|
||||||
|
case "string":
|
||||||
|
valueA = a[key].toUpperCase();
|
||||||
|
valueB = b[key].toUpperCase();
|
||||||
|
return sortOrder === "asc"
|
||||||
|
? valueA.localeCompare(valueB)
|
||||||
|
: valueB.localeCompare(valueA);
|
||||||
|
case "number":
|
||||||
|
default:
|
||||||
|
valueA = parseFloat(a[key]);
|
||||||
|
valueB = parseFloat(b[key]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sortOrder === "asc") {
|
||||||
|
return valueA < valueB ? -1 : valueA > valueB ? 1 : 0;
|
||||||
|
} else {
|
||||||
|
return valueA > valueB ? -1 : valueA < valueB ? 1 : 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Sort using the generic comparison function
|
||||||
|
displayList = [...originalData].sort(compareValues);
|
||||||
|
};
|
||||||
|
|
||||||
|
$: {
|
||||||
|
if (typeof window !== "undefined") {
|
||||||
|
options = plotData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<svelte:head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width" />
|
||||||
|
<title>
|
||||||
|
{$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ""}
|
||||||
|
{$displayCompanyName} ({$etfTicker}) Delta Exposure by Expiry · Stocknear
|
||||||
|
</title>
|
||||||
|
<meta
|
||||||
|
name="description"
|
||||||
|
content={`Analyze Delta Exposure by expiry for ${$displayCompanyName} (${$etfTicker}). Access historical volume, open interest trends, and save options contracts for detailed analysis and insights.`}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- Other meta tags -->
|
||||||
|
<meta
|
||||||
|
property="og:title"
|
||||||
|
content={`${$displayCompanyName} (${$etfTicker}) Delta Exposure by Expiry · Stocknear`}
|
||||||
|
/>
|
||||||
|
<meta
|
||||||
|
property="og:description"
|
||||||
|
content={`Analyze Delta Exposure by expiry for ${$displayCompanyName} (${$etfTicker}). Access historical volume, open interest trends, and save options contracts for detailed analysis and insights.`}
|
||||||
|
/>
|
||||||
|
<meta property="og:type" content="website" />
|
||||||
|
<!-- Add more Open Graph meta tags as needed -->
|
||||||
|
|
||||||
|
<!-- Twitter specific meta tags -->
|
||||||
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
|
<meta
|
||||||
|
name="twitter:title"
|
||||||
|
content={`${$displayCompanyName} (${$etfTicker}) Delta Exposure by Expiry · Stocknear`}
|
||||||
|
/>
|
||||||
|
<meta
|
||||||
|
name="twitter:description"
|
||||||
|
content={`Analyze Delta Exposure by expiry for ${$displayCompanyName} (${$etfTicker}). Access historical volume, open interest trends, and save options contracts for detailed analysis and insights.`}
|
||||||
|
/>
|
||||||
|
<!-- Add more Twitter meta tags as needed -->
|
||||||
|
</svelte:head>
|
||||||
|
|
||||||
|
<section
|
||||||
|
class="w-full bg-default overflow-hidden text-white min-h-screen pb-40"
|
||||||
|
>
|
||||||
|
<div class="w-full flex h-full overflow-hidden">
|
||||||
|
<div
|
||||||
|
class="w-full relative flex justify-center items-center overflow-hidden"
|
||||||
|
>
|
||||||
|
{#if rawData?.length > 0}
|
||||||
|
<div class="sm:p-7 w-full m-auto mt-2 sm:mt-0">
|
||||||
|
<h2
|
||||||
|
class=" flex flex-row items-center text-white text-xl sm:text-2xl font-bold w-fit"
|
||||||
|
>
|
||||||
|
Delta Exposure By Expiry
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<div class="w-full overflow-hidden m-auto">
|
||||||
|
{#if options !== null}
|
||||||
|
<div class="app w-full relative">
|
||||||
|
<Chart {init} {options} class="chart" />
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
|
<div class="flex justify-center items-center h-80">
|
||||||
|
<div class="relative">
|
||||||
|
<label
|
||||||
|
class="bg-primary rounded-md h-14 w-14 flex justify-center items-center absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="loading loading-spinner loading-md sm:loading-[1rem] text-gray-400"
|
||||||
|
></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
<div class="w-full overflow-x-scroll text-white">
|
||||||
|
<table
|
||||||
|
class="w-full table table-sm table-compact bg-table border border-gray-800 rounded-none sm:rounded-md m-auto overflow-x-auto"
|
||||||
|
>
|
||||||
|
<thead>
|
||||||
|
<TableHeader {columns} {sortOrders} {sortData} />
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{#each displayList as item, index}
|
||||||
|
<tr
|
||||||
|
class="sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] odd:bg-odd border-b border-gray-800 {index +
|
||||||
|
1 ===
|
||||||
|
displayList?.slice(0, 3)?.length &&
|
||||||
|
data?.user?.tier !== 'Pro'
|
||||||
|
? 'opacity-[0.1]'
|
||||||
|
: ''}"
|
||||||
|
>
|
||||||
|
<td
|
||||||
|
class="text-white text-sm sm:text-[1rem] text-start whitespace-nowrap"
|
||||||
|
>
|
||||||
|
{formatDate(item?.expiry)}
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
class="text-white text-sm sm:text-[1rem] text-end whitespace-nowrap"
|
||||||
|
>
|
||||||
|
{@html abbreviateNumberWithColor(
|
||||||
|
item?.call_delta?.toFixed(2),
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
)}
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
class="text-white text-sm sm:text-[1rem] text-end whitespace-nowrap"
|
||||||
|
>
|
||||||
|
{@html abbreviateNumberWithColor(
|
||||||
|
item?.put_delta?.toFixed(2),
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
)}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td
|
||||||
|
class="text-white text-sm sm:text-[1rem] text-end whitespace-nowrap"
|
||||||
|
>
|
||||||
|
{@html abbreviateNumberWithColor(
|
||||||
|
item?.net_delta?.toFixed(2),
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
)}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td
|
||||||
|
class="text-white text-sm sm:text-[1rem] text-end whitespace-nowrap"
|
||||||
|
>
|
||||||
|
{#if item?.put_call_ratio <= 1 && item?.put_call_ratio !== null}
|
||||||
|
<span class="text-[#00FC50]"
|
||||||
|
>{item?.put_call_ratio?.toFixed(2)}</span
|
||||||
|
>
|
||||||
|
{:else if item?.put_call_ratio > 1 && item?.put_call_ratio !== null}
|
||||||
|
<span class="text-[#FF2F1F]"
|
||||||
|
>{item?.put_call_ratio?.toFixed(2)}</span
|
||||||
|
>
|
||||||
|
{:else}
|
||||||
|
n/a
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{/each}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<UpgradeToPro {data} />
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
|
<div class="sm:p-7 w-full m-auto mt-2 sm:mt-0">
|
||||||
|
<h2
|
||||||
|
class=" flex flex-row items-center text-white text-xl sm:text-2xl font-bold w-fit"
|
||||||
|
>
|
||||||
|
Hottest Contracts
|
||||||
|
</h2>
|
||||||
|
<div class="mt-2">
|
||||||
|
<Infobox text="No data is available" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.app {
|
||||||
|
height: 600px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 560px) {
|
||||||
|
.app {
|
||||||
|
width: 100%;
|
||||||
|
height: 500px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.chart {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
35
src/routes/etf/[tickerID]/options/dex/strike/+page.server.ts
Normal file
35
src/routes/etf/[tickerID]/options/dex/strike/+page.server.ts
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
|
||||||
|
|
||||||
|
export const load = async ({ locals, params }) => {
|
||||||
|
const { apiKey, apiURL, user } = locals;
|
||||||
|
|
||||||
|
const getData = async () => {
|
||||||
|
const postData = {
|
||||||
|
params: params.tickerID,
|
||||||
|
category: "strike"
|
||||||
|
};
|
||||||
|
|
||||||
|
const response = await fetch(apiURL + "/options-gex-dex", {
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"X-API-KEY": apiKey,
|
||||||
|
},
|
||||||
|
body: JSON.stringify(postData),
|
||||||
|
});
|
||||||
|
const output = await response.json();
|
||||||
|
|
||||||
|
return output;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Make sure to return a promise
|
||||||
|
return {
|
||||||
|
getData: await getData(),
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
415
src/routes/etf/[tickerID]/options/dex/strike/+page.svelte
Normal file
415
src/routes/etf/[tickerID]/options/dex/strike/+page.svelte
Normal file
@ -0,0 +1,415 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import {
|
||||||
|
abbreviateNumberWithColor,
|
||||||
|
abbreviateNumber,
|
||||||
|
monthNames,
|
||||||
|
} from "$lib/utils";
|
||||||
|
import {
|
||||||
|
etfTicker,
|
||||||
|
screenWidth,
|
||||||
|
numberOfUnreadNotification,
|
||||||
|
displayCompanyName,
|
||||||
|
} from "$lib/store";
|
||||||
|
import { onMount } from "svelte";
|
||||||
|
import TableHeader from "$lib/components/Table/TableHeader.svelte";
|
||||||
|
import UpgradeToPro from "$lib/components/UpgradeToPro.svelte";
|
||||||
|
import Infobox from "$lib/components/Infobox.svelte";
|
||||||
|
import { Chart } from "svelte-echarts";
|
||||||
|
|
||||||
|
import { init, use } from "echarts/core";
|
||||||
|
import { LineChart, BarChart } from "echarts/charts";
|
||||||
|
import {
|
||||||
|
GridComponent,
|
||||||
|
TooltipComponent,
|
||||||
|
LegendComponent,
|
||||||
|
} from "echarts/components";
|
||||||
|
import { CanvasRenderer } from "echarts/renderers";
|
||||||
|
|
||||||
|
use([
|
||||||
|
LineChart,
|
||||||
|
BarChart,
|
||||||
|
GridComponent,
|
||||||
|
TooltipComponent,
|
||||||
|
LegendComponent,
|
||||||
|
CanvasRenderer,
|
||||||
|
]);
|
||||||
|
|
||||||
|
export let data;
|
||||||
|
let rawData = data?.getData || [];
|
||||||
|
|
||||||
|
rawData = rawData?.map((item) => ({
|
||||||
|
...item,
|
||||||
|
net_delta: (item?.call_delta || 0) + (item?.put_delta || 0),
|
||||||
|
put_call_ratio:
|
||||||
|
item?.call_delta > 0
|
||||||
|
? Math.abs((item?.put_delta || 0) / item?.call_delta)
|
||||||
|
: null,
|
||||||
|
}));
|
||||||
|
|
||||||
|
let displayList = rawData?.slice(0, 150);
|
||||||
|
let options = null;
|
||||||
|
|
||||||
|
function plotData() {
|
||||||
|
// Process and sort data by strike in descending order
|
||||||
|
const processedData = rawData
|
||||||
|
?.map((d) => ({
|
||||||
|
strike: d?.strike,
|
||||||
|
callDelta: d?.call_delta,
|
||||||
|
putDelta: d?.put_delta,
|
||||||
|
netDelta: d?.net_delta,
|
||||||
|
}))
|
||||||
|
.sort((a, b) => a.strike - b.strike);
|
||||||
|
|
||||||
|
const strikes = processedData.map((d) => d.strike);
|
||||||
|
const callDelta = processedData.map((d) => d.callDelta?.toFixed(2));
|
||||||
|
const putDelta = processedData.map((d) => d.putDelta?.toFixed(2));
|
||||||
|
const netDelta = processedData.map((d) => d.netDelta?.toFixed(2));
|
||||||
|
|
||||||
|
const options = {
|
||||||
|
animation: false,
|
||||||
|
tooltip: {
|
||||||
|
trigger: "axis",
|
||||||
|
axisPointer: {
|
||||||
|
type: "shadow",
|
||||||
|
},
|
||||||
|
backgroundColor: "#313131",
|
||||||
|
textStyle: {
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
formatter: function (params) {
|
||||||
|
const strike = params[0].axisValue;
|
||||||
|
const put = params[0].data;
|
||||||
|
const call = params[1].data;
|
||||||
|
const net = params[2].data;
|
||||||
|
|
||||||
|
return `
|
||||||
|
<div style="text-align:left;">
|
||||||
|
<b>Strike:</b> ${strike}<br/>
|
||||||
|
<span style="color:#9B5DC4;">● Put Delta:</span> ${abbreviateNumberWithColor(put, false, true)}<br/>
|
||||||
|
<span style="color:#C4E916;">● Call Delta:</span> ${abbreviateNumberWithColor(call, false, true)}<br/>
|
||||||
|
<span style="color:#FF2F1F;">● Net Delta:</span> ${abbreviateNumberWithColor(net, false, true)}<br/>
|
||||||
|
</div>`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
left: $screenWidth < 640 ? "5%" : "0%",
|
||||||
|
right: $screenWidth < 640 ? "5%" : "0%",
|
||||||
|
bottom: "5%",
|
||||||
|
containLabel: true,
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: "value",
|
||||||
|
name: "Delta",
|
||||||
|
nameTextStyle: { color: "#fff" },
|
||||||
|
splitLine: { show: false },
|
||||||
|
axisLabel: {
|
||||||
|
show: false, // Hide y-axis labels
|
||||||
|
},
|
||||||
|
},
|
||||||
|
yAxis: {
|
||||||
|
type: "category",
|
||||||
|
data: strikes,
|
||||||
|
axisLine: { lineStyle: { color: "#fff" } },
|
||||||
|
axisLabel: { color: "#fff" },
|
||||||
|
splitLine: { show: false },
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: "Put Delta",
|
||||||
|
type: "bar",
|
||||||
|
data: putDelta,
|
||||||
|
stack: "Delta",
|
||||||
|
itemStyle: { color: "#9B5DC4" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Net Delta",
|
||||||
|
type: "bar",
|
||||||
|
data: netDelta,
|
||||||
|
stack: "Delta",
|
||||||
|
itemStyle: { color: "#FF2F1F" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Call Delta",
|
||||||
|
type: "bar",
|
||||||
|
data: callDelta,
|
||||||
|
stack: "Delta",
|
||||||
|
itemStyle: { color: "#C4E916" },
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleScroll() {
|
||||||
|
const scrollThreshold = document.body.offsetHeight * 0.8; // 80% of the website height
|
||||||
|
const isBottom = window.innerHeight + window.scrollY >= scrollThreshold;
|
||||||
|
|
||||||
|
if (isBottom && displayList?.length !== rawData?.length) {
|
||||||
|
const nextIndex = displayList?.length;
|
||||||
|
const filteredNewResults = rawData?.slice(nextIndex, nextIndex + 50);
|
||||||
|
displayList = [...displayList, ...filteredNewResults];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMount(() => {
|
||||||
|
window.addEventListener("scroll", handleScroll);
|
||||||
|
return () => {
|
||||||
|
window.removeEventListener("scroll", handleScroll);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
$: columns = [
|
||||||
|
{ key: "strike", label: "Strike Price", align: "left" },
|
||||||
|
{ key: "call_delta", label: "Call Delta", align: "right" },
|
||||||
|
{ key: "put_delta", label: "Put Delta", align: "right" },
|
||||||
|
{ key: "net_delta", label: "Net Delta", align: "right" },
|
||||||
|
{ key: "put_call_ratio", label: "P/C Delta", align: "right" },
|
||||||
|
];
|
||||||
|
|
||||||
|
$: sortOrders = {
|
||||||
|
strike: { order: "none", type: "number" },
|
||||||
|
call_delta: { order: "none", type: "number" },
|
||||||
|
put_delta: { order: "none", type: "number" },
|
||||||
|
net_delta: { order: "none", type: "number" },
|
||||||
|
put_call_ratio: { order: "none", type: "number" },
|
||||||
|
};
|
||||||
|
|
||||||
|
const sortData = (key) => {
|
||||||
|
// Reset all other keys to 'none' except the current key
|
||||||
|
for (const k in sortOrders) {
|
||||||
|
if (k !== key) {
|
||||||
|
sortOrders[k].order = "none";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cycle through 'none', 'asc', 'desc' for the clicked key
|
||||||
|
const orderCycle = ["none", "asc", "desc"];
|
||||||
|
let originalData = rawData;
|
||||||
|
const currentOrderIndex = orderCycle.indexOf(sortOrders[key].order);
|
||||||
|
sortOrders[key].order =
|
||||||
|
orderCycle[(currentOrderIndex + 1) % orderCycle.length];
|
||||||
|
const sortOrder = sortOrders[key].order;
|
||||||
|
|
||||||
|
// Reset to original data when 'none' and stop further sorting
|
||||||
|
if (sortOrder === "none") {
|
||||||
|
originalData = [...rawData]; // Reset originalData to rawDataVolume
|
||||||
|
displayList = originalData;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Define a generic comparison function
|
||||||
|
const compareValues = (a, b) => {
|
||||||
|
const { type } = sortOrders[key];
|
||||||
|
let valueA, valueB;
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case "date":
|
||||||
|
valueA = new Date(a[key]);
|
||||||
|
valueB = new Date(b[key]);
|
||||||
|
break;
|
||||||
|
case "string":
|
||||||
|
valueA = a[key].toUpperCase();
|
||||||
|
valueB = b[key].toUpperCase();
|
||||||
|
return sortOrder === "asc"
|
||||||
|
? valueA.localeCompare(valueB)
|
||||||
|
: valueB.localeCompare(valueA);
|
||||||
|
case "number":
|
||||||
|
default:
|
||||||
|
valueA = parseFloat(a[key]);
|
||||||
|
valueB = parseFloat(b[key]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sortOrder === "asc") {
|
||||||
|
return valueA < valueB ? -1 : valueA > valueB ? 1 : 0;
|
||||||
|
} else {
|
||||||
|
return valueA > valueB ? -1 : valueA < valueB ? 1 : 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Sort using the generic comparison function
|
||||||
|
displayList = [...originalData].sort(compareValues);
|
||||||
|
};
|
||||||
|
|
||||||
|
$: {
|
||||||
|
if (typeof window !== "undefined") {
|
||||||
|
options = plotData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<svelte:head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width" />
|
||||||
|
<title>
|
||||||
|
{$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ""}
|
||||||
|
{$displayCompanyName} ({$etfTicker}) Delta Exposure by Strike Price ·
|
||||||
|
Stocknear
|
||||||
|
</title>
|
||||||
|
<meta
|
||||||
|
name="description"
|
||||||
|
content={`Analyze Delta Exposure by strike price for ${$displayCompanyName} (${$etfTicker}). Access historical volume, open interest trends, and save options contracts for detailed analysis and insights.`}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- Other meta tags -->
|
||||||
|
<meta
|
||||||
|
property="og:title"
|
||||||
|
content={`${$displayCompanyName} (${$etfTicker}) Delta Exposure by Strike Price · Stocknear`}
|
||||||
|
/>
|
||||||
|
<meta
|
||||||
|
property="og:description"
|
||||||
|
content={`Analyze Delta Exposure by strike price for ${$displayCompanyName} (${$etfTicker}). Access historical volume, open interest trends, and save options contracts for detailed analysis and insights.`}
|
||||||
|
/>
|
||||||
|
<meta property="og:type" content="website" />
|
||||||
|
<!-- Add more Open Graph meta tags as needed -->
|
||||||
|
|
||||||
|
<!-- Twitter specific meta tags -->
|
||||||
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
|
<meta
|
||||||
|
name="twitter:title"
|
||||||
|
content={`${$displayCompanyName} (${$etfTicker}) Delta Exposure by Strike Price · Stocknear`}
|
||||||
|
/>
|
||||||
|
<meta
|
||||||
|
name="twitter:description"
|
||||||
|
content={`Analyze Delta Exposure by strike price for ${$displayCompanyName} (${$etfTicker}). Access historical volume, open interest trends, and save options contracts for detailed analysis and insights.`}
|
||||||
|
/>
|
||||||
|
<!-- Add more Twitter meta tags as needed -->
|
||||||
|
</svelte:head>
|
||||||
|
|
||||||
|
<section
|
||||||
|
class="w-full bg-default overflow-hidden text-white min-h-screen pb-40"
|
||||||
|
>
|
||||||
|
<div class="w-full flex h-full overflow-hidden">
|
||||||
|
<div
|
||||||
|
class="w-full relative flex justify-center items-center overflow-hidden"
|
||||||
|
>
|
||||||
|
{#if rawData?.length > 0}
|
||||||
|
<div class="sm:p-7 w-full m-auto mt-2 sm:mt-0">
|
||||||
|
<h2
|
||||||
|
class=" flex flex-row items-center text-white text-xl sm:text-2xl font-bold w-fit"
|
||||||
|
>
|
||||||
|
Gamma Exposure By Strike
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<div class="w-full overflow-hidden m-auto">
|
||||||
|
{#if options !== null}
|
||||||
|
<div class="app w-full relative">
|
||||||
|
<Chart {init} {options} class="chart" />
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
|
<div class="flex justify-center items-center h-80">
|
||||||
|
<div class="relative">
|
||||||
|
<label
|
||||||
|
class="bg-primary rounded-md h-14 w-14 flex justify-center items-center absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="loading loading-spinner loading-md sm:loading-[1rem] text-gray-400"
|
||||||
|
></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
<div class="w-full overflow-x-scroll text-white">
|
||||||
|
<table
|
||||||
|
class="w-full table table-sm table-compact bg-table border border-gray-800 rounded-none sm:rounded-md m-auto overflow-x-auto"
|
||||||
|
>
|
||||||
|
<thead>
|
||||||
|
<TableHeader {columns} {sortOrders} {sortData} />
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{#each displayList as item, index}
|
||||||
|
<tr
|
||||||
|
class="sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] odd:bg-odd border-b border-gray-800 {index +
|
||||||
|
1 ===
|
||||||
|
displayList?.slice(0, 3)?.length &&
|
||||||
|
data?.user?.tier !== 'Pro'
|
||||||
|
? 'opacity-[0.1]'
|
||||||
|
: ''}"
|
||||||
|
>
|
||||||
|
<td
|
||||||
|
class="text-white text-sm sm:text-[1rem] text-start whitespace-nowrap"
|
||||||
|
>
|
||||||
|
{item?.strike?.toFixed(2)}
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
class="text-white text-sm sm:text-[1rem] text-end whitespace-nowrap"
|
||||||
|
>
|
||||||
|
{@html abbreviateNumberWithColor(
|
||||||
|
item?.call_delta?.toFixed(2),
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
)}
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
class="text-white text-sm sm:text-[1rem] text-end whitespace-nowrap"
|
||||||
|
>
|
||||||
|
{@html abbreviateNumberWithColor(
|
||||||
|
item?.put_delta?.toFixed(2),
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
)}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td
|
||||||
|
class="text-white text-sm sm:text-[1rem] text-end whitespace-nowrap"
|
||||||
|
>
|
||||||
|
{@html abbreviateNumberWithColor(
|
||||||
|
item?.net_delta?.toFixed(2),
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
)}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td
|
||||||
|
class="text-white text-sm sm:text-[1rem] text-end whitespace-nowrap"
|
||||||
|
>
|
||||||
|
{#if item?.put_call_ratio <= 1 && item?.put_call_ratio !== null}
|
||||||
|
<span class="text-[#00FC50]"
|
||||||
|
>{item?.put_call_ratio?.toFixed(2)}</span
|
||||||
|
>
|
||||||
|
{:else if item?.put_call_ratio > 1 && item?.put_call_ratio !== null}
|
||||||
|
<span class="text-[#FF2F1F]"
|
||||||
|
>{item?.put_call_ratio?.toFixed(2)}</span
|
||||||
|
>
|
||||||
|
{:else}
|
||||||
|
n/a
|
||||||
|
{/if}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{/each}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<UpgradeToPro {data} />
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
|
<div class="sm:p-7 w-full m-auto mt-2 sm:mt-0">
|
||||||
|
<div class="mt-2">
|
||||||
|
<Infobox text="No data is available" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.app {
|
||||||
|
height: 1000px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 560px) {
|
||||||
|
.app {
|
||||||
|
width: 100%;
|
||||||
|
height: 500px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.chart {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -15,10 +15,10 @@
|
|||||||
|
|
||||||
if (state !== "overview" && subSectionMap[state]) {
|
if (state !== "overview" && subSectionMap[state]) {
|
||||||
displaySubSection = state;
|
displaySubSection = state;
|
||||||
//goto(`/stocks/${$etfTicker}${subSectionMap[state]}`);
|
//goto(`/etf/${$etfTicker}${subSectionMap[state]}`);
|
||||||
} else {
|
} else {
|
||||||
displaySubSection = state;
|
displaySubSection = state;
|
||||||
//goto(`/stocks/${$etfTicker}/statistics`);
|
//goto(`/etf/${$etfTicker}/statistics`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
monthNames,
|
monthNames,
|
||||||
} from "$lib/utils";
|
} from "$lib/utils";
|
||||||
import {
|
import {
|
||||||
stockTicker,
|
etfTicker,
|
||||||
screenWidth,
|
screenWidth,
|
||||||
numberOfUnreadNotification,
|
numberOfUnreadNotification,
|
||||||
displayCompanyName,
|
displayCompanyName,
|
||||||
@ -337,7 +337,7 @@
|
|||||||
<meta name="viewport" content="width=device-width" />
|
<meta name="viewport" content="width=device-width" />
|
||||||
<title>
|
<title>
|
||||||
{$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ""}
|
{$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ""}
|
||||||
{$displayCompanyName} ({$stockTicker}) Gamma Exposure · Stocknear
|
{$displayCompanyName} ({$etfTicker}) Gamma Exposure · Stocknear
|
||||||
</title>
|
</title>
|
||||||
<meta
|
<meta
|
||||||
name="description"
|
name="description"
|
||||||
@ -347,7 +347,7 @@
|
|||||||
<!-- Other meta tags -->
|
<!-- Other meta tags -->
|
||||||
<meta
|
<meta
|
||||||
property="og:title"
|
property="og:title"
|
||||||
content={`${$displayCompanyName} (${$stockTicker}) Gamma Exposure · Stocknear`}
|
content={`${$displayCompanyName} (${$etfTicker}) Gamma Exposure · Stocknear`}
|
||||||
/>
|
/>
|
||||||
<meta
|
<meta
|
||||||
property="og:description"
|
property="og:description"
|
||||||
@ -360,7 +360,7 @@
|
|||||||
<meta name="twitter:card" content="summary_large_image" />
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
<meta
|
<meta
|
||||||
name="twitter:title"
|
name="twitter:title"
|
||||||
content={`${$displayCompanyName} (${$stockTicker}) Gamma Exposure · Stocknear`}
|
content={`${$displayCompanyName} (${$etfTicker}) Gamma Exposure · Stocknear`}
|
||||||
/>
|
/>
|
||||||
<meta
|
<meta
|
||||||
name="twitter:description"
|
name="twitter:description"
|
||||||
|
|||||||
@ -103,13 +103,14 @@
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
grid: {
|
grid: {
|
||||||
left: $screenWidth < 640 ? "0%" : "0%",
|
left: $screenWidth < 640 ? "5%" : "1%",
|
||||||
right: $screenWidth < 640 ? "0%" : "0%",
|
right: $screenWidth < 640 ? "5%" : "0%",
|
||||||
bottom: "10%",
|
bottom: "10%",
|
||||||
containLabel: true,
|
containLabel: true,
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: "value",
|
type: "value",
|
||||||
|
name: "Gamma",
|
||||||
nameTextStyle: { color: "#fff" },
|
nameTextStyle: { color: "#fff" },
|
||||||
splitLine: { show: false },
|
splitLine: { show: false },
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
@ -255,22 +256,21 @@
|
|||||||
<meta name="viewport" content="width=device-width" />
|
<meta name="viewport" content="width=device-width" />
|
||||||
<title>
|
<title>
|
||||||
{$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ""}
|
{$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ""}
|
||||||
{$displayCompanyName} ({$etfTicker}) Gamma Exposure by Strike Price ·
|
{$displayCompanyName} ({$etfTicker}) Gamma Exposure by Expiry · Stocknear
|
||||||
Stocknear
|
|
||||||
</title>
|
</title>
|
||||||
<meta
|
<meta
|
||||||
name="description"
|
name="description"
|
||||||
content={`Explore historic volume & open interest of option chains & save individual contracts for later`}
|
content={`Analyze Gamma Exposure by expiry for ${$displayCompanyName} (${$etfTicker}). Access historical volume, open interest trends, and save options contracts for detailed analysis and insights.`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- Other meta tags -->
|
<!-- Other meta tags -->
|
||||||
<meta
|
<meta
|
||||||
property="og:title"
|
property="og:title"
|
||||||
content={`${$displayCompanyName} (${$etfTicker}) Gamma Exposure by Strike Price · Stocknear`}
|
content={`${$displayCompanyName} (${$etfTicker}) Gamma Exposure by Expiry · Stocknear`}
|
||||||
/>
|
/>
|
||||||
<meta
|
<meta
|
||||||
property="og:description"
|
property="og:description"
|
||||||
content={`Explore historic volume & open interest of option chains & save individual contracts for later`}
|
content={`Analyze Gamma Exposure by expiry for ${$displayCompanyName} (${$etfTicker}). Access historical volume, open interest trends, and save options contracts for detailed analysis and insights.`}
|
||||||
/>
|
/>
|
||||||
<meta property="og:type" content="website" />
|
<meta property="og:type" content="website" />
|
||||||
<!-- Add more Open Graph meta tags as needed -->
|
<!-- Add more Open Graph meta tags as needed -->
|
||||||
@ -279,11 +279,11 @@
|
|||||||
<meta name="twitter:card" content="summary_large_image" />
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
<meta
|
<meta
|
||||||
name="twitter:title"
|
name="twitter:title"
|
||||||
content={`${$displayCompanyName} (${$etfTicker}) Gamma Exposure by Strike Price · Stocknear`}
|
content={`${$displayCompanyName} (${$etfTicker}) Gamma Exposure by Expiry · Stocknear`}
|
||||||
/>
|
/>
|
||||||
<meta
|
<meta
|
||||||
name="twitter:description"
|
name="twitter:description"
|
||||||
content={`Explore historic volume & open interest of option chains & save individual contracts for later`}
|
content={`Analyze Gamma Exposure by expiry for ${$displayCompanyName} (${$etfTicker}). Access historical volume, open interest trends, and save options contracts for detailed analysis and insights.`}
|
||||||
/>
|
/>
|
||||||
<!-- Add more Twitter meta tags as needed -->
|
<!-- Add more Twitter meta tags as needed -->
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|||||||
@ -249,7 +249,7 @@
|
|||||||
</title>
|
</title>
|
||||||
<meta
|
<meta
|
||||||
name="description"
|
name="description"
|
||||||
content={`Explore historic volume & open interest of option chains & save individual contracts for later`}
|
content={`Discover detailed Gamma Exposure analysis by strike price for ${$displayCompanyName} (${$etfTicker}). Explore historical volume, open interest, and save individual options contracts for in-depth insights.`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- Other meta tags -->
|
<!-- Other meta tags -->
|
||||||
@ -259,7 +259,7 @@
|
|||||||
/>
|
/>
|
||||||
<meta
|
<meta
|
||||||
property="og:description"
|
property="og:description"
|
||||||
content={`Explore historic volume & open interest of option chains & save individual contracts for later`}
|
content={`Discover detailed Gamma Exposure analysis by strike price for ${$displayCompanyName} (${$etfTicker}). Explore historical volume, open interest, and save individual options contracts for in-depth insights.`}
|
||||||
/>
|
/>
|
||||||
<meta property="og:type" content="website" />
|
<meta property="og:type" content="website" />
|
||||||
<!-- Add more Open Graph meta tags as needed -->
|
<!-- Add more Open Graph meta tags as needed -->
|
||||||
@ -272,7 +272,7 @@
|
|||||||
/>
|
/>
|
||||||
<meta
|
<meta
|
||||||
name="twitter:description"
|
name="twitter:description"
|
||||||
content={`Explore historic volume & open interest of option chains & save individual contracts for later`}
|
content={`Discover detailed Gamma Exposure analysis by strike price for ${$displayCompanyName} (${$etfTicker}). Explore historical volume, open interest, and save individual options contracts for in-depth insights.`}
|
||||||
/>
|
/>
|
||||||
<!-- Add more Twitter meta tags as needed -->
|
<!-- Add more Twitter meta tags as needed -->
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|||||||
@ -132,8 +132,8 @@
|
|||||||
// Convert the expiration date to a Date object
|
// Convert the expiration date to a Date object
|
||||||
const expirationDate = new Date(dateExpiration);
|
const expirationDate = new Date(dateExpiration);
|
||||||
|
|
||||||
return data?.map((item) => {
|
return data.map((item) => {
|
||||||
const itemDate = new Date(item?.date); // Convert item.date to a Date object
|
const itemDate = new Date(item.date); // Convert item.date to a Date object
|
||||||
const timeDifference = expirationDate - itemDate; // Difference in milliseconds
|
const timeDifference = expirationDate - itemDate; // Difference in milliseconds
|
||||||
const dte = Math.ceil(timeDifference / (1000 * 60 * 60 * 24)); // Convert ms to days
|
const dte = Math.ceil(timeDifference / (1000 * 60 * 60 * 24)); // Convert ms to days
|
||||||
|
|
||||||
@ -427,7 +427,6 @@
|
|||||||
result += `${bidColor}Bid x ${askColor}Ask: ${bidValue} x ${askValue}<br/>`;
|
result += `${bidColor}Bid x ${askColor}Ask: ${bidValue} x ${askValue}<br/>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add DTE at the end if the data point exists
|
|
||||||
if (rawDataPoint?.dte !== undefined) {
|
if (rawDataPoint?.dte !== undefined) {
|
||||||
result += `Days to Expiration : ${rawDataPoint.dte}<br/>`;
|
result += `Days to Expiration : ${rawDataPoint.dte}<br/>`;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,64 +0,0 @@
|
|||||||
import { getCache, setCache } from "$lib/store";
|
|
||||||
|
|
||||||
export const load = async ({ locals }) => {
|
|
||||||
const { apiURL, apiKey } = locals;
|
|
||||||
|
|
||||||
const getSP500HeatMap = async () => {
|
|
||||||
const postData = { index: "sp500" };
|
|
||||||
|
|
||||||
// make the POST request to the endpoint
|
|
||||||
const response = await fetch(apiURL + "/heatmaps", {
|
|
||||||
method: "POST",
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
"X-API-KEY": apiKey,
|
|
||||||
},
|
|
||||||
body: JSON.stringify(postData),
|
|
||||||
});
|
|
||||||
|
|
||||||
const output = await response.json();
|
|
||||||
|
|
||||||
return output;
|
|
||||||
};
|
|
||||||
|
|
||||||
const getDowJonesHeatMap = async () => {
|
|
||||||
const postData = { index: "dowjones" };
|
|
||||||
// make the POST request to the endpoint
|
|
||||||
const response = await fetch(apiURL + "/heatmaps", {
|
|
||||||
method: "POST",
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
"X-API-KEY": apiKey,
|
|
||||||
},
|
|
||||||
body: JSON.stringify(postData),
|
|
||||||
});
|
|
||||||
|
|
||||||
const output = await response.json();
|
|
||||||
|
|
||||||
return output;
|
|
||||||
};
|
|
||||||
|
|
||||||
const getNasdaqHeatMap = async () => {
|
|
||||||
const postData = { index: "nasdaq" };
|
|
||||||
// make the POST request to the endpoint
|
|
||||||
const response = await fetch(apiURL + "/heatmaps", {
|
|
||||||
method: "POST",
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
"X-API-KEY": apiKey,
|
|
||||||
},
|
|
||||||
body: JSON.stringify(postData),
|
|
||||||
});
|
|
||||||
|
|
||||||
const output = await response.json();
|
|
||||||
|
|
||||||
return output;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Make sure to return a promise
|
|
||||||
return {
|
|
||||||
getSP500HeatMap: await getSP500HeatMap(),
|
|
||||||
getDowJonesHeatMap: await getDowJonesHeatMap(),
|
|
||||||
getNasdaqHeatMap: await getNasdaqHeatMap(),
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@ -1,86 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { onMount } from "svelte";
|
|
||||||
|
|
||||||
// Toy data structure representing market sectors and stocks
|
|
||||||
const data = {
|
|
||||||
labels: [
|
|
||||||
"Technology",
|
|
||||||
"Technology",
|
|
||||||
"Technology",
|
|
||||||
"Technology",
|
|
||||||
"Financials",
|
|
||||||
"Financials",
|
|
||||||
"Healthcare",
|
|
||||||
"Healthcare",
|
|
||||||
"Consumer",
|
|
||||||
"Consumer",
|
|
||||||
"Energy",
|
|
||||||
"Energy",
|
|
||||||
],
|
|
||||||
parents: ["", "", "", "", "", "", "", "", "", "", "", ""],
|
|
||||||
names: [
|
|
||||||
"NVDA",
|
|
||||||
"AAPL",
|
|
||||||
"MSFT",
|
|
||||||
"AMD",
|
|
||||||
"JPM",
|
|
||||||
"BAC",
|
|
||||||
"PFE",
|
|
||||||
"JNJ",
|
|
||||||
"AMZN",
|
|
||||||
"TSLA",
|
|
||||||
"XOM",
|
|
||||||
"CVX",
|
|
||||||
],
|
|
||||||
values: [300, 280, 250, 150, 200, 180, 120, 140, 260, 220, 130, 110],
|
|
||||||
changes: [
|
|
||||||
4.36, -3.28, 0.21, 5.41, 1.44, 4.85, 2.26, 1.11, 1.24, -2.35, 1.1, 3.28,
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
let plotlyDiv;
|
|
||||||
|
|
||||||
onMount(async () => {
|
|
||||||
// Dynamically import Plotly to avoid SSR issues
|
|
||||||
const Plotly = await import("plotly.js-dist");
|
|
||||||
|
|
||||||
// Calculate colors based on percentage changes
|
|
||||||
const colors = data.changes.map((change) =>
|
|
||||||
change >= 0
|
|
||||||
? `rgb(${Math.max(0, 255 - Math.floor(change * 20))}, 255, ${Math.max(0, 255 - Math.floor(change * 20))})`
|
|
||||||
: `rgb(255, ${Math.max(0, 255 + Math.floor(change * 20))}, ${Math.max(0, 255 + Math.floor(change * 20))})`,
|
|
||||||
);
|
|
||||||
|
|
||||||
// Create text labels with stock symbol and percentage change
|
|
||||||
const text = data.names.map(
|
|
||||||
(name, i) =>
|
|
||||||
`${name}<br>${data.changes[i] >= 0 ? "+" : ""}${data.changes[i].toFixed(2)}%`,
|
|
||||||
);
|
|
||||||
|
|
||||||
const layout = {
|
|
||||||
title: "Market Sectors Treemap",
|
|
||||||
width: 1000,
|
|
||||||
height: 800,
|
|
||||||
showlegend: false,
|
|
||||||
margin: { t: 30, l: 0, r: 0, b: 0 },
|
|
||||||
};
|
|
||||||
|
|
||||||
const trace = {
|
|
||||||
type: "treemap",
|
|
||||||
labels: data.labels,
|
|
||||||
parents: data.parents,
|
|
||||||
values: data.values,
|
|
||||||
text: text,
|
|
||||||
textinfo: "text",
|
|
||||||
hoverongaps: false,
|
|
||||||
marker: {
|
|
||||||
colors: colors,
|
|
||||||
line: { width: 1 },
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
Plotly.newPlot(plotlyDiv, [trace], layout);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div bind:this={plotlyDiv} class="w-full h-full"></div>
|
|
||||||
@ -337,7 +337,7 @@
|
|||||||
<meta name="viewport" content="width=device-width" />
|
<meta name="viewport" content="width=device-width" />
|
||||||
<title>
|
<title>
|
||||||
{$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ""}
|
{$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ""}
|
||||||
{$displayCompanyName} ({$stockTicker}) Gamma Exposure · Stocknear
|
{$displayCompanyName} ({$stockTicker}) Delta Exposure · Stocknear
|
||||||
</title>
|
</title>
|
||||||
<meta
|
<meta
|
||||||
name="description"
|
name="description"
|
||||||
@ -347,7 +347,7 @@
|
|||||||
<!-- Other meta tags -->
|
<!-- Other meta tags -->
|
||||||
<meta
|
<meta
|
||||||
property="og:title"
|
property="og:title"
|
||||||
content={`${$displayCompanyName} (${$stockTicker}) Gamma Exposure · Stocknear`}
|
content={`${$displayCompanyName} (${$stockTicker}) Delta Exposure · Stocknear`}
|
||||||
/>
|
/>
|
||||||
<meta
|
<meta
|
||||||
property="og:description"
|
property="og:description"
|
||||||
@ -360,7 +360,7 @@
|
|||||||
<meta name="twitter:card" content="summary_large_image" />
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
<meta
|
<meta
|
||||||
name="twitter:title"
|
name="twitter:title"
|
||||||
content={`${$displayCompanyName} (${$stockTicker}) Gamma Exposure · Stocknear`}
|
content={`${$displayCompanyName} (${$stockTicker}) Delta Exposure · Stocknear`}
|
||||||
/>
|
/>
|
||||||
<meta
|
<meta
|
||||||
name="twitter:description"
|
name="twitter:description"
|
||||||
|
|||||||
@ -256,22 +256,21 @@
|
|||||||
<meta name="viewport" content="width=device-width" />
|
<meta name="viewport" content="width=device-width" />
|
||||||
<title>
|
<title>
|
||||||
{$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ""}
|
{$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ""}
|
||||||
{$displayCompanyName} ({$stockTicker}) Gamma Exposure by Strike Price ·
|
{$displayCompanyName} ({$stockTicker}) Delta Exposure by Expiry · Stocknear
|
||||||
Stocknear
|
|
||||||
</title>
|
</title>
|
||||||
<meta
|
<meta
|
||||||
name="description"
|
name="description"
|
||||||
content={`Explore historic volume & open interest of option chains & save individual contracts for later`}
|
content={`Analyze Delta Exposure by expiry for ${$displayCompanyName} (${$stockTicker}). Access historical volume, open interest trends, and save options contracts for detailed analysis and insights.`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- Other meta tags -->
|
<!-- Other meta tags -->
|
||||||
<meta
|
<meta
|
||||||
property="og:title"
|
property="og:title"
|
||||||
content={`${$displayCompanyName} (${$stockTicker}) Gamma Exposure by Strike Price · Stocknear`}
|
content={`${$displayCompanyName} (${$stockTicker}) Delta Exposure by Expiry · Stocknear`}
|
||||||
/>
|
/>
|
||||||
<meta
|
<meta
|
||||||
property="og:description"
|
property="og:description"
|
||||||
content={`Explore historic volume & open interest of option chains & save individual contracts for later`}
|
content={`Analyze Delta Exposure by expiry for ${$displayCompanyName} (${$stockTicker}). Access historical volume, open interest trends, and save options contracts for detailed analysis and insights.`}
|
||||||
/>
|
/>
|
||||||
<meta property="og:type" content="website" />
|
<meta property="og:type" content="website" />
|
||||||
<!-- Add more Open Graph meta tags as needed -->
|
<!-- Add more Open Graph meta tags as needed -->
|
||||||
@ -280,11 +279,11 @@
|
|||||||
<meta name="twitter:card" content="summary_large_image" />
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
<meta
|
<meta
|
||||||
name="twitter:title"
|
name="twitter:title"
|
||||||
content={`${$displayCompanyName} (${$stockTicker}) Gamma Exposure by Strike Price · Stocknear`}
|
content={`${$displayCompanyName} (${$stockTicker}) Delta Exposure by Expiry · Stocknear`}
|
||||||
/>
|
/>
|
||||||
<meta
|
<meta
|
||||||
name="twitter:description"
|
name="twitter:description"
|
||||||
content={`Explore historic volume & open interest of option chains & save individual contracts for later`}
|
content={`Analyze Delta Exposure by expiry for ${$displayCompanyName} (${$stockTicker}). Access historical volume, open interest trends, and save options contracts for detailed analysis and insights.`}
|
||||||
/>
|
/>
|
||||||
<!-- Add more Twitter meta tags as needed -->
|
<!-- Add more Twitter meta tags as needed -->
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
@ -301,7 +300,7 @@
|
|||||||
<h2
|
<h2
|
||||||
class=" flex flex-row items-center text-white text-xl sm:text-2xl font-bold w-fit"
|
class=" flex flex-row items-center text-white text-xl sm:text-2xl font-bold w-fit"
|
||||||
>
|
>
|
||||||
Gamma Exposure By Expiry
|
Delta Exposure By Expiry
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<div class="w-full overflow-hidden m-auto">
|
<div class="w-full overflow-hidden m-auto">
|
||||||
|
|||||||
@ -249,7 +249,7 @@
|
|||||||
</title>
|
</title>
|
||||||
<meta
|
<meta
|
||||||
name="description"
|
name="description"
|
||||||
content={`Explore historic volume & open interest of option chains & save individual contracts for later`}
|
content={`Analyze Delta Exposure by strike price for ${$displayCompanyName} (${$stockTicker}). Access historical volume, open interest trends, and save options contracts for detailed analysis and insights.`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- Other meta tags -->
|
<!-- Other meta tags -->
|
||||||
@ -259,7 +259,7 @@
|
|||||||
/>
|
/>
|
||||||
<meta
|
<meta
|
||||||
property="og:description"
|
property="og:description"
|
||||||
content={`Explore historic volume & open interest of option chains & save individual contracts for later`}
|
content={`Analyze Delta Exposure by strike price for ${$displayCompanyName} (${$stockTicker}). Access historical volume, open interest trends, and save options contracts for detailed analysis and insights.`}
|
||||||
/>
|
/>
|
||||||
<meta property="og:type" content="website" />
|
<meta property="og:type" content="website" />
|
||||||
<!-- Add more Open Graph meta tags as needed -->
|
<!-- Add more Open Graph meta tags as needed -->
|
||||||
@ -272,7 +272,7 @@
|
|||||||
/>
|
/>
|
||||||
<meta
|
<meta
|
||||||
name="twitter:description"
|
name="twitter:description"
|
||||||
content={`Explore historic volume & open interest of option chains & save individual contracts for later`}
|
content={`Analyze Delta Exposure by strike price for ${$displayCompanyName} (${$stockTicker}). Access historical volume, open interest trends, and save options contracts for detailed analysis and insights.`}
|
||||||
/>
|
/>
|
||||||
<!-- Add more Twitter meta tags as needed -->
|
<!-- Add more Twitter meta tags as needed -->
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|||||||
@ -256,22 +256,21 @@
|
|||||||
<meta name="viewport" content="width=device-width" />
|
<meta name="viewport" content="width=device-width" />
|
||||||
<title>
|
<title>
|
||||||
{$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ""}
|
{$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ""}
|
||||||
{$displayCompanyName} ({$stockTicker}) Gamma Exposure by Strike Price ·
|
{$displayCompanyName} ({$stockTicker}) Gamma Exposure by Expiry · Stocknear
|
||||||
Stocknear
|
|
||||||
</title>
|
</title>
|
||||||
<meta
|
<meta
|
||||||
name="description"
|
name="description"
|
||||||
content={`Explore historic volume & open interest of option chains & save individual contracts for later`}
|
content={`Analyze Gamma Exposure by expiry for ${$displayCompanyName} (${$stockTicker}). Access historical volume, open interest trends, and save options contracts for detailed analysis and insights.`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- Other meta tags -->
|
<!-- Other meta tags -->
|
||||||
<meta
|
<meta
|
||||||
property="og:title"
|
property="og:title"
|
||||||
content={`${$displayCompanyName} (${$stockTicker}) Gamma Exposure by Strike Price · Stocknear`}
|
content={`${$displayCompanyName} (${$stockTicker}) Gamma Exposure by Expiry · Stocknear`}
|
||||||
/>
|
/>
|
||||||
<meta
|
<meta
|
||||||
property="og:description"
|
property="og:description"
|
||||||
content={`Explore historic volume & open interest of option chains & save individual contracts for later`}
|
content={`Analyze Gamma Exposure by expiry for ${$displayCompanyName} (${$stockTicker}). Access historical volume, open interest trends, and save options contracts for detailed analysis and insights.`}
|
||||||
/>
|
/>
|
||||||
<meta property="og:type" content="website" />
|
<meta property="og:type" content="website" />
|
||||||
<!-- Add more Open Graph meta tags as needed -->
|
<!-- Add more Open Graph meta tags as needed -->
|
||||||
@ -280,11 +279,11 @@
|
|||||||
<meta name="twitter:card" content="summary_large_image" />
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
<meta
|
<meta
|
||||||
name="twitter:title"
|
name="twitter:title"
|
||||||
content={`${$displayCompanyName} (${$stockTicker}) Gamma Exposure by Strike Price · Stocknear`}
|
content={`${$displayCompanyName} (${$stockTicker}) Gamma Exposure by Expiry · Stocknear`}
|
||||||
/>
|
/>
|
||||||
<meta
|
<meta
|
||||||
name="twitter:description"
|
name="twitter:description"
|
||||||
content={`Explore historic volume & open interest of option chains & save individual contracts for later`}
|
content={`Analyze Gamma Exposure by expiry for ${$displayCompanyName} (${$stockTicker}). Access historical volume, open interest trends, and save options contracts for detailed analysis and insights.`}
|
||||||
/>
|
/>
|
||||||
<!-- Add more Twitter meta tags as needed -->
|
<!-- Add more Twitter meta tags as needed -->
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|||||||
@ -249,7 +249,7 @@
|
|||||||
</title>
|
</title>
|
||||||
<meta
|
<meta
|
||||||
name="description"
|
name="description"
|
||||||
content={`Explore historic volume & open interest of option chains & save individual contracts for later`}
|
content={`Discover detailed Gamma Exposure analysis by strike price for ${$displayCompanyName} (${$stockTicker}). Explore historical volume, open interest, and save individual options contracts for in-depth insights.`}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- Other meta tags -->
|
<!-- Other meta tags -->
|
||||||
@ -259,7 +259,7 @@
|
|||||||
/>
|
/>
|
||||||
<meta
|
<meta
|
||||||
property="og:description"
|
property="og:description"
|
||||||
content={`Explore historic volume & open interest of option chains & save individual contracts for later`}
|
content={`Discover detailed Gamma Exposure analysis by strike price for ${$displayCompanyName} (${$stockTicker}). Explore historical volume, open interest, and save individual options contracts for in-depth insights.`}
|
||||||
/>
|
/>
|
||||||
<meta property="og:type" content="website" />
|
<meta property="og:type" content="website" />
|
||||||
<!-- Add more Open Graph meta tags as needed -->
|
<!-- Add more Open Graph meta tags as needed -->
|
||||||
@ -272,7 +272,7 @@
|
|||||||
/>
|
/>
|
||||||
<meta
|
<meta
|
||||||
name="twitter:description"
|
name="twitter:description"
|
||||||
content={`Explore historic volume & open interest of option chains & save individual contracts for later`}
|
content={`Discover detailed Gamma Exposure analysis by strike price for ${$displayCompanyName} (${$stockTicker}). Explore historical volume, open interest, and save individual options contracts for in-depth insights.`}
|
||||||
/>
|
/>
|
||||||
<!-- Add more Twitter meta tags as needed -->
|
<!-- Add more Twitter meta tags as needed -->
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user