{$indexTicker} Stock Price History

Select time frame (timePeriod = "Daily")} class="cursor-pointer hover:bg-primary" > Daily (timePeriod = "Weekly")} class="cursor-pointer hover:bg-primary" > Weekly {#if data?.user?.tier !== "Pro"} {#each ["Monthly", "Quarterly", "Annual"] as entry} goto("/pricing")} class="cursor-pointer hover:bg-primary" > {entry} {/each} {:else} (timePeriod = "Monthly")} class="cursor-pointer hover:bg-primary" > Monthly (timePeriod = "Quarterly")} class="cursor-pointer hover:bg-primary" > Quarterly (timePeriod = "Annual")} class="cursor-pointer hover:bg-primary" > Annual {/if}
{#if isLoaded} {#if rawData?.length !== 0}
{#each stockList as item, index} {/each}
{#if timePeriod === "Weekly"} Week of {new Date(item?.time).toLocaleString( "en-US", { month: "short", day: "numeric", year: "numeric", daySuffix: "2-digit", }, )} {:else} {new Date(item?.time).toLocaleString("en-US", { month: "short", day: "numeric", year: "numeric", daySuffix: "2-digit", })} {/if} {item?.open?.toFixed(2)} {item?.high?.toFixed(2)} {item?.low?.toFixed(2)} {item?.close?.toFixed(2)} {item?.change !== null ? item?.change : "n/a"} {item?.changesPercentage !== null ? item?.changesPercentage + "%" : "n/a"} {item?.volume ? item?.volume?.toLocaleString("en-US") : "n/a"}
{:else} {/if} {:else}
{/if}