remove options zero flow page
This commit is contained in:
parent
c411725a95
commit
bfa13794c4
@ -440,38 +440,7 @@ $: {
|
||||
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center w-full">
|
||||
|
||||
<Accordion.Root class="w-full">
|
||||
|
||||
<Accordion.Item value="item-1">
|
||||
|
||||
<Accordion.Trigger class="">
|
||||
<Option class="h-5.5 w-5.5 mr-3 text-white ml-1"/>
|
||||
<span class="text-white ml-1 mr-auto">Options</span>
|
||||
</Accordion.Trigger>
|
||||
<Accordion.Content class="border-l border-gray-500 ml-2 mt-5">
|
||||
|
||||
<Sheet.Close asChild let:builder>
|
||||
<div class="flex flex-col items-start">
|
||||
<Button builders={[builder]} type="submit" class="w-full bg-[#141417] hover:bg-[#141417]">
|
||||
<a href="/options-flow" class="text-start w-full text-[1rem] text-white ml-4 mt-2">Options Flow</a>
|
||||
</Button>
|
||||
<Button builders={[builder]} type="submit" class="w-full bg-[#141417] hover:bg-[#141417]">
|
||||
<a href="/options-zero-dte" class="text-start w-full text-[1rem] text-white ml-4 mt-4">0DTE Flow</a>
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
</Sheet.Close>
|
||||
|
||||
|
||||
</Accordion.Content
|
||||
>
|
||||
</Accordion.Item>
|
||||
</Accordion.Root>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex flex-row items-center w-full">
|
||||
|
||||
<Accordion.Root class="w-full">
|
||||
@ -544,21 +513,19 @@ $: {
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
<Sheet.Close asChild let:builder>
|
||||
<Sheet.Close asChild let:builder>
|
||||
<Button builders={[builder]} type="submit" class="bg-[#141417] hover:bg-[#141417] -ml-4 w-full">
|
||||
<a href="/dark-pool-flow" class="flex flex-row items-center w-full -mt-2">
|
||||
<a href="/options-flow" class="flex flex-row items-center w-full -mt-2">
|
||||
<div class="flex flex-row items-center mr-auto">
|
||||
<div class="flex h-9 w-9 items-center justify-center rounded-lg text-white transition-colors hover:text-white md:h-8 md:w-8">
|
||||
<Box class="h-5.5 w-5.5" />
|
||||
<Option class="h-5.5 w-5.5"/>
|
||||
</div>
|
||||
<span class="ml-3 text-white text-[1rem]">Dark Pool</span>
|
||||
<span class="ml-3 text-white text-[1rem]">Options Flow</span>
|
||||
</div>
|
||||
</a>
|
||||
</Button>
|
||||
</Sheet.Close>
|
||||
-->
|
||||
|
||||
</Sheet.Close>
|
||||
|
||||
<Sheet.Close asChild let:builder>
|
||||
<Button builders={[builder]} type="submit" class="bg-[#141417] hover:bg-[#141417] -ml-4 w-full">
|
||||
<a href="/hedge-funds" class="flex flex-row items-center w-full -mt-2">
|
||||
@ -824,29 +791,6 @@ $: {
|
||||
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row items-center ml-9 w-full mt-3">
|
||||
|
||||
<Accordion.Root class="w-full">
|
||||
|
||||
<Accordion.Item value="item-1">
|
||||
|
||||
<Accordion.Trigger class="">
|
||||
<Option class="h-5.5 w-5.5 mr-3 text-white ml-1"/>
|
||||
<span class="text-white ml-1 mr-auto">Options</span>
|
||||
</Accordion.Trigger>
|
||||
<Accordion.Content class="border-l border-gray-500 ml-2 mt-5">
|
||||
<div class="flex flex-col items-start">
|
||||
<a href="/options-flow" class="text-[1rem] text-white ml-4 mt-4">Options Flow</a>
|
||||
<a href="/options-zero-dte" class="text-[1rem] text-white ml-4 mt-4">0DTE Flow</a>
|
||||
</div>
|
||||
|
||||
</Accordion.Content
|
||||
>
|
||||
</Accordion.Item>
|
||||
</Accordion.Root>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex flex-row items-center ml-9 w-full mt-3">
|
||||
|
||||
@ -899,17 +843,15 @@ $: {
|
||||
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<a href="/dark-pool-flow" class="flex flex-row items-center ml-9 w-full mt-3">
|
||||
<a href="/options-flow" class="flex flex-row items-center ml-9 w-full mt-3">
|
||||
<div
|
||||
class="flex h-9 w-9 items-center justify-center rounded-lg text-white transition-colors hover:text-white md:h-8 md:w-8"
|
||||
>
|
||||
<Box class="h-5.5 w-5.5" />
|
||||
<Option class="h-5.5 w-5.5"/>
|
||||
|
||||
</div>
|
||||
<span class="ml-3 text-white">Dark Pool</span>
|
||||
<span class="ml-3 text-white">Options Flow</span>
|
||||
</a>
|
||||
-->
|
||||
|
||||
<a href="/hedge-funds" class="flex flex-row items-center ml-9 w-full mt-3">
|
||||
<div
|
||||
|
||||
@ -29,7 +29,7 @@ const allRules = {
|
||||
sentiment: { label: 'Sentiment', step: ["Bullish","Neutral", "Bearish"], defaultValue: 'any' },
|
||||
execution_estimate: { label: 'Execution', step: ["At Ask","At Bid", "Below Ask", "Below Bid"], defaultValue: 'any' },
|
||||
option_activity_type: { label: 'Option Type', step: ["Sweep","Trade"], defaultValue: 'any' },
|
||||
date_expiration: { label: 'Date Expiration', step: ["1 day","1 Week","2 Weeks","1 Month","3 Months","6 Months","1 Year","3 Years"], defaultValue: 'any' },
|
||||
date_expiration: { label: 'Date Expiration', step: ["Today", "1 day","1 Week","2 Weeks","1 Month","3 Months","6 Months","1 Year","3 Years"], defaultValue: 'any' },
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -63,6 +63,14 @@ function isAny(value: string | string[]): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
function isSameDay(date1: Date, date2: Date): boolean {
|
||||
return (
|
||||
date1.getFullYear() === date2.getFullYear() &&
|
||||
date1.getMonth() === date2.getMonth() &&
|
||||
date1.getDate() === date2.getDate()
|
||||
);
|
||||
}
|
||||
|
||||
function isDateWithinRange(dateString: string, range: string): boolean {
|
||||
const now = new Date();
|
||||
const expirationDate = new Date(dateString);
|
||||
@ -70,6 +78,9 @@ function isDateWithinRange(dateString: string, range: string): boolean {
|
||||
const daysDiff = timeDiff / (1000 * 60 * 60 * 24);
|
||||
|
||||
switch (range.toLowerCase()) {
|
||||
case "today":
|
||||
// Check if the current date and expiration date are the same
|
||||
return isSameDay(now, expirationDate);
|
||||
case "1 day":
|
||||
return daysDiff >= 0 && daysDiff <= 1;
|
||||
case "1 week":
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,43 +0,0 @@
|
||||
import {isOpen} from '$lib/store';
|
||||
|
||||
|
||||
const checkMarketHour = async () => {
|
||||
const holidays = ['2024-01-01', '2024-01-15','2024-02-19','2024-03-29','2024-05-27','2024-06-19','2024-07-04','2024-09-02','2024-11-28','2024-12-25'];
|
||||
const currentDate = new Date().toISOString().split('T')[0];
|
||||
|
||||
// Get the current time in the ET time zone
|
||||
const etTimeZone = 'America/New_York';
|
||||
const currentTime = new Date().toLocaleString('en-US', { timeZone: etTimeZone });
|
||||
|
||||
// Determine if the NYSE is currently open or closed
|
||||
const currentHour = new Date(currentTime).getHours();
|
||||
const isWeekendValue = new Date(currentTime).getDay() === 6 || new Date(currentTime).getDay() === 0;
|
||||
const isBeforeMarketOpenValue = currentHour < 9 || (currentHour === 9 && new Date(currentTime).getMinutes() < 30);
|
||||
const isAfterMarketCloseValue = currentHour >= 16;
|
||||
|
||||
isOpen.set(!(isWeekendValue || isBeforeMarketOpenValue || isAfterMarketCloseValue || holidays?.includes(currentDate)));
|
||||
}
|
||||
|
||||
|
||||
export const load = async ({parent}) => {
|
||||
await checkMarketHour();
|
||||
const { apiURL, apiKey } = await parent();
|
||||
|
||||
const getOptionsZeroDTE = async () => {
|
||||
// make the POST request to the endpoint
|
||||
const response = await fetch(apiURL + '/options-zero-dte', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
"Content-Type": "application/json", "X-API-KEY": apiKey
|
||||
},
|
||||
});
|
||||
const output = await response.json();
|
||||
|
||||
return output;
|
||||
};
|
||||
|
||||
// Make sure to return a promise
|
||||
return {
|
||||
getOptionsZeroDTE: await getOptionsZeroDTE()
|
||||
};
|
||||
};
|
||||
@ -34,7 +34,6 @@ const pages = [
|
||||
//{title: "/portfolio"},
|
||||
{ title: "/newsletter" },
|
||||
{ title: "/options-flow" },
|
||||
{ title: "/options-zero-dte" },
|
||||
{ title: "/ipos" },
|
||||
{ title: "/list" },
|
||||
{ title: "/list/dividend-kings" },
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user