diff --git a/src/routes/etf/[tickerID]/holdings/+page.svelte b/src/routes/etf/[tickerID]/holdings/+page.svelte
index 9f00255b..54f4a1c8 100644
--- a/src/routes/etf/[tickerID]/holdings/+page.svelte
+++ b/src/routes/etf/[tickerID]/holdings/+page.svelte
@@ -127,8 +127,8 @@ $: {
No.
Symbol
- Name
- Shares
+ Name
+ Shares
% Weight
@@ -142,17 +142,22 @@ $: {
{index+1}
-
- {item?.asset}
+
+
+ {item?.asset}
+
+ {item?.name?.length > charNumber ? formatString(item?.name?.slice(0,charNumber)) + "..." : formatString(item?.name)}
+
+
-
+
{item?.name?.length > charNumber ? formatString(item?.name?.slice(0,charNumber)) + "..." : formatString(item?.name)}
-
+
{new Intl.NumberFormat("en", {
minimumFractionDigits: 0,
diff --git a/src/routes/etf/[tickerID]/options/+page.svelte b/src/routes/etf/[tickerID]/options/+page.svelte
index a571b2d2..42b6027b 100644
--- a/src/routes/etf/[tickerID]/options/+page.svelte
+++ b/src/routes/etf/[tickerID]/options/+page.svelte
@@ -67,26 +67,29 @@ function formatTime(timestamp) {
return formattedDate;
}
-function formatDate(timestamp) {
- // Convert timestamp to milliseconds and create a Date object
- var date = new Date(timestamp * 1000);
+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;
- // Format the date string in mm/dd/YYYY
var formattedDate = month + "/" + day + "/" + year;
return formattedDate;
}
+
function changeStatement(event)
{
displayData = event.target.value;
@@ -527,11 +530,11 @@ $: {
- {formatTime(item?.updated)}
+ {item?.time}
- {formatDate(item?.updated)}
+ {formatDate(item?.date)}
diff --git a/src/routes/etf/[tickerID]/stats/+page.svelte b/src/routes/etf/[tickerID]/stats/+page.svelte
index 779205b7..5f9fb4b7 100644
--- a/src/routes/etf/[tickerID]/stats/+page.svelte
+++ b/src/routes/etf/[tickerID]/stats/+page.svelte
@@ -25,30 +25,58 @@
let alpha = '-';
let beta = '-';
+ // Function to check if a date is today or yesterday, adjusting for weekends
+ function ongoingDD(dateString) {
+ const date = new Date(dateString);
+ const today = new Date();
+ const yesterday = new Date(today);
+ yesterday.setDate(yesterday.getDate() - 1);
-// Function to check if a date is today or yesterday, adjusting for weekends
-function ongoingDD(dateString) {
- const date = new Date(dateString);
- const today = new Date();
- const yesterday = new Date(today);
- yesterday.setDate(yesterday.getDate() - 1);
-
- // Adjust today to Friday if it's Saturday or Sunday
- if (today.getDay() === 6) { // Saturday
- today.setDate(today.getDate() - 1); // Set to Friday
- } else if (today.getDay() === 0) { // Sunday
- today.setDate(today.getDate() - 2); // Set to Friday
+ // Adjust today to Friday if it's Saturday or Sunday
+ if (today.getDay() === 6) { // Saturday
+ today.setDate(today.getDate() - 1); // Set to Friday
+ } else if (today.getDay() === 0) { // Sunday
+ today.setDate(today.getDate() - 2); // Set to Friday
+ }
+
+ return date.getDate() === today.getDate() &&
+ date.getMonth() === today.getMonth() &&
+ date.getFullYear() === today.getFullYear() ||
+ date.getDate() === yesterday.getDate() &&
+ date.getMonth() === yesterday.getMonth() &&
+ date.getFullYear() === yesterday.getFullYear();
}
-
- return date.getDate() === today.getDate() &&
- date.getMonth() === today.getMonth() &&
- date.getFullYear() === today.getFullYear() ||
- date.getDate() === yesterday.getDate() &&
- date.getMonth() === yesterday.getMonth() &&
- date.getFullYear() === yesterday.getFullYear();
-}
-
-
+
+ /*
+ let progressDayPriceValue = 0;
+ let progressYearPriceValue = 0;
+ let totalDuration = 500;
+
+ async function updateDayRange() {
+
+ const interval = 10; // interval between each update in ms
+ const increment = (currentPrice / (totalDuration / interval));
+
+ if (progressDayPriceValue < currentPrice) {
+ progressDayPriceValue = progressDayPriceValue + increment;
+ setTimeout(updateDayRange, interval);
+ }
+ };
+
+
+ async function updateYearRange() {
+
+ const interval = 10; // interval between each update in ms
+ const increment = (currentPrice / (totalDuration / interval));
+
+ if (progressYearPriceValue < currentPrice) {
+ progressYearPriceValue = progressYearPriceValue + increment;
+ setTimeout(updateYearRange, interval);
+ }
+ };
+
+ */
+
marketCap = '-';
yearHigh = '-';
yearLow = '-';
@@ -117,15 +145,12 @@ function ongoingDD(dateString) {
-
-
-
-
-
-
- Fundamental Data
-
-
+
+
+
+
+ Fundamental Data
+
@@ -139,12 +164,12 @@ function ongoingDD(dateString) {
-
+
{#if $screenWidth <= 550}
-
+
1-Day Range
-
+
{dayLow}
@@ -156,17 +181,17 @@ function ongoingDD(dateString) {
{:else}
-
+
1-Day Range
-
+
{dayLow}
-
+
-
+
{dayHigh}
{/if}
@@ -174,7 +199,7 @@ function ongoingDD(dateString) {
{#if $screenWidth < 640}
-
+
1-Year Range
@@ -189,7 +214,7 @@ function ongoingDD(dateString) {
{:else}
-
+
1-Year Range
@@ -218,46 +243,38 @@ function ongoingDD(dateString) {
-
- Market Cap
- ${marketCap}
- Volume
- {volume}
+
+ Mkt Cap
+ ${marketCap}
+ Volume
+ {volume}
-
- Price
- ${currentPrice}
- Prev. Close
- ${previousClose}
+
+ Price
+ ${currentPrice}
+ Prev. Close
+ ${previousClose}
-
- Alpha
-
- {#if typeof alpha !== 'undefined'}
- {alpha}
- {:else}
- -
- {/if}
+
+ Alpha
+
+ {typeof alpha !== 'undefined' ? alpha : '-'}
- Beta
-
- {#if typeof beta !== 'undefined' && !isNaN(beta)}
- {beta?.toFixed(2)}
- {:else}
- -
- {/if}
+ Beta
+
+ {typeof beta !== 'undefined' && !isNaN(beta) ? beta?.toFixed(2) : '-'}
-
- EPS
- {eps}
- PE
- {pe}
+
+ EPS
+ {eps}
+ PE
+ {pe}
@@ -272,30 +289,30 @@ function ongoingDD(dateString) {
-
- Started
- Recovered
- Drawdown
- Days
+
+ Started
+ Recovered
+ Drawdown
+ Days
{#each quantStats[$etfTicker?.toUpperCase()]['Worst 10 Drawdowns'] as item}
-
-
+
+
{new Date(item['Started']).toLocaleString('en-US', { month: 'short', day: 'numeric', year: 'numeric', daySuffix: '2-digit' })}
-
+
{#if ongoingDD(item['Recovered']) === true}
- continuing
+ continuing
{:else}
- {new Date(item['Recovered']).toLocaleString('en-US', { month: 'short', day: 'numeric', year: 'numeric', daySuffix: '2-digit' })}
+ {new Date(item['Recovered']).toLocaleString('en-US', { month: 'short', day: 'numeric', year: 'numeric', daySuffix: '2-digit' })}
{/if}
-
+
{item['Drawdown']?.toFixed(2)}%
-
+
{item['Days']}
@@ -313,668 +330,809 @@ function ongoingDD(dateString) {
Comparison of company stats against the S&P500 Index.
-
+
Time Period between {new Date(quantStats[$etfTicker?.toUpperCase()]["Start Period"]).toLocaleString('en-US', { month: 'long', day: 'numeric', year: 'numeric', daySuffix: '2-digit' })}
-
{new Date(quantStats[$etfTicker?.toUpperCase()]["End Period"]).toLocaleString('en-US', { month: 'long', day: 'numeric', year: 'numeric', daySuffix: '2-digit' })}
-
+
-
-
- Metric
-
-
- {$etfTicker}
-
-
- S&P500
-
-
-
-
+
+
+
+ Metric
+
+
+ {$etfTicker}
+
+
+ S&P500
+
+
+
-
-
+
+
Cumulative Return
-
- {quantStats[$etfTicker?.toUpperCase()]["Cumulative Return %"]}%
+
+ {#if quantStats[$etfTicker?.toUpperCase()]["Cumulative Return %"] >=0}
+ +{quantStats[$etfTicker?.toUpperCase()]["Cumulative Return %"]}%
+ {:else}
+ {quantStats[$etfTicker?.toUpperCase()]["Cumulative Return %"]}%
+ {/if}
-
- {quantStats['SPY']["Cumulative Return %"]} %
+
+ {#if quantStats['SPY']["Cumulative Return %"] >=0}
+ +{quantStats['SPY']["Cumulative Return %"]}%
+ {:else}
+ {quantStats['SPY']["Cumulative Return %"]}%
+ {/if}
-
-
+
+
Compound Annual Growth Rate (CAGR)
-
- {quantStats[$etfTicker?.toUpperCase()]["CAGR %"]}%
+
+ {#if quantStats[$etfTicker?.toUpperCase()]["CAGR %"] >=0}
+ +{quantStats[$etfTicker?.toUpperCase()]["CAGR %"]}%
+ {:else}
+ {quantStats[$etfTicker?.toUpperCase()]["CAGR %"]}%
+ {/if}
-
- {quantStats['SPY']["CAGR %"]}%
+
+ {#if quantStats['SPY']["CAGR %"] >=0}
+ +{quantStats['SPY']["CAGR %"]}%
+ {:else}
+ {quantStats['SPY']["CAGR %"]}%
+ {/if}
-
-
-
-
-
-
-
+
+
Sharpe
-
+
{quantStats[$etfTicker?.toUpperCase()]["Sharpe"]?.toFixed(2)}
-
+
{quantStats['SPY']["Sharpe"]?.toFixed(2)}
-
-
+
+
Sortino
-
+
{quantStats[$etfTicker?.toUpperCase()]["Sortino"]?.toFixed(2)}
-
+
{quantStats['SPY']["Sortino"]?.toFixed(2)}
-
-
-
-
-
-
-
-
-
- Max Drawdown
-
-
- {quantStats[$etfTicker?.toUpperCase()]["Max Drawdown"]}%
-
-
- {quantStats['SPY']["Max Drawdown"]}%
-
-
-
-
-
- Longest Drawdown Days
-
-
- {quantStats[$etfTicker?.toUpperCase()]["Longest DD Days"]}
-
-
- {quantStats['SPY']["Longest DD Days"]}
-
-
-
-
-
-
- Volatility (ann.)
-
-
- {quantStats[$etfTicker?.toUpperCase()]["Volatility (ann.) %"]}%
-
-
- {quantStats['SPY']["Volatility (ann.) %"]}%
-
-
-
-
-
- Correlation
-
-
- {quantStats[$etfTicker?.toUpperCase()]["Correlation"]}%
-
-
- {quantStats['SPY']["Correlation"]}
-
-
-
-
-
- R^2
-
-
- {quantStats[$etfTicker?.toUpperCase()]["R^2"]}
-
-
- {quantStats['SPY']["R^2"]}
-
-
-
-
-
- Calmar
-
-
- {quantStats[$etfTicker?.toUpperCase()]["Calmar"]}
-
-
- {quantStats['SPY']["Calmar"]}
-
-
+
+
+ Max Drawdown
+
+
+ {#if quantStats[$etfTicker?.toUpperCase()]["Max Drawdown"] >=0}
+ +{quantStats[$etfTicker?.toUpperCase()]["Max Drawdown"]}%
+ {:else}
+ {quantStats[$etfTicker?.toUpperCase()]["Max Drawdown"]}%
+ {/if}
+
+
+ {#if quantStats['SPY']["Max Drawdown"] >=0}
+ +{quantStats['SPY']["Max Drawdown"]}%
+ {:else}
+ {quantStats['SPY']["Max Drawdown"]}%
+ {/if}
+
+
+
+
+
+ Longest Drawdown Days
+
+
+ {quantStats[$etfTicker?.toUpperCase()]["Longest DD Days"]}
+
+
+ {quantStats['SPY']["Longest DD Days"]}
+
+
+
+
+
+
+ Volatility (ann.)
+
+
+ {quantStats[$etfTicker?.toUpperCase()]["Volatility (ann.) %"]}%
+
+
+ {quantStats['SPY']["Volatility (ann.) %"]}%
+
+
+
+
+
+ Correlation
+
+
+ {quantStats[$etfTicker?.toUpperCase()]["Correlation"]}%
+
+
+ {quantStats['SPY']["Correlation"]}
+
+
+
+
+
+ R^2
+
+
+ {quantStats[$etfTicker?.toUpperCase()]["R^2"]}
+
+
+ {quantStats['SPY']["R^2"]}
+
+
+
+
+
+ Calmar
+
+
+ {quantStats[$etfTicker?.toUpperCase()]["Calmar"]}
+
+
+ {quantStats['SPY']["Calmar"]}
+
+
+
+
+
+
+ Skew
+
+
+ {quantStats[$etfTicker?.toUpperCase()]["Skew"]?.toFixed(2)}
+
+
+ {quantStats['SPY']["Skew"]?.toFixed(2)}
+
+
+
+
+
+ Kurtosis
+
+
+ {quantStats[$etfTicker?.toUpperCase()]["Kurtosis"]?.toFixed(2)}
+
+
+ {quantStats['SPY']["Kurtosis"]?.toFixed(2)}
+
+
+
-
-
- Skew
-
-
- {quantStats[$etfTicker?.toUpperCase()]["Skew"]?.toFixed(2)}
-
-
- {quantStats['SPY']["Skew"]?.toFixed(2)}
-
-
-
-
-
- Kurtosis
-
-
- {quantStats[$etfTicker?.toUpperCase()]["Kurtosis"]?.toFixed(2)}
-
-
- {quantStats['SPY']["Kurtosis"]?.toFixed(2)}
-
-
-
-
-
-
-
-
-
-
-
+
+
Expected Daily
-
- {quantStats[$etfTicker?.toUpperCase()]["Expected Daily %"]}%
+
+ {#if quantStats[$etfTicker?.toUpperCase()]["Expected Daily %"] >=0}
+ +{quantStats[$etfTicker?.toUpperCase()]["Expected Daily %"]}%
+ {:else}
+ {quantStats[$etfTicker?.toUpperCase()]["Expected Daily %"]}%
+ {/if}
-
- {quantStats['SPY']["Expected Daily %"]}%
+
+ {#if quantStats['SPY']["Expected Daily %"] >=0}
+ +{quantStats['SPY']["Expected Daily %"]}%
+ {:else}
+ {quantStats['SPY']["Expected Daily %"]}%
+ {/if}
-
-
+
+
Expected Monthly
-
- {quantStats[$etfTicker?.toUpperCase()]["Expected Monthly %"]}%
+
+ {#if quantStats[$etfTicker?.toUpperCase()]["Expected Monthly %"] >=0}
+ +{quantStats[$etfTicker?.toUpperCase()]["Expected Monthly %"]}%
+ {:else}
+ {quantStats[$etfTicker?.toUpperCase()]["Expected Monthly %"]}%
+ {/if}
-
- {quantStats['SPY']["Expected Monthly %"]}%
+
+ {#if quantStats['SPY']["Expected Monthly %"] >=0}
+ +{quantStats['SPY']["Expected Monthly %"]}%
+ {:else}
+ {quantStats['SPY']["Expected Monthly %"]}%
+ {/if}
-
-
+
+
Expected Yearly
-
- {quantStats[$etfTicker?.toUpperCase()]["Expected Yearly %"]}%
+
+ {#if quantStats[$etfTicker?.toUpperCase()]["Expected Yearly %"] >=0}
+ +{quantStats[$etfTicker?.toUpperCase()]["Expected Yearly %"]}%
+ {:else}
+ {quantStats[$etfTicker?.toUpperCase()]["Expected Yearly %"]}%
+ {/if}
-
- {quantStats['SPY']["Expected Yearly %"]}%
+
+ {#if quantStats['SPY']["Expected Yearly %"] >=0}
+ +{quantStats['SPY']["Expected Yearly %"]}%
+ {:else}
+ {quantStats['SPY']["Expected Yearly %"]}%
+ {/if}
-
-
+
+
Kelly Criterion
-
+
{quantStats[$etfTicker?.toUpperCase()]["Kelly Criterion %"]}%
-
+
{quantStats['SPY']["Kelly Criterion %"]}%
-
-
+
+
Risk of Ruin
-
+
{quantStats[$etfTicker?.toUpperCase()]["Risk of Ruin %"]}%
-
+
{quantStats['SPY']["Risk of Ruin %"]}%
-
-
+
+
Daily Value-at-Risk
-
- {quantStats[$etfTicker?.toUpperCase()]["Daily Value-at-Risk %"]?.toFixed(2)}%
+
+ {#if quantStats[$etfTicker?.toUpperCase()]["Daily Value-at-Risk %"] >=0}
+ +{quantStats[$etfTicker?.toUpperCase()]["Daily Value-at-Risk %"]?.toFixed(2)}%
+ {:else}
+ {quantStats[$etfTicker?.toUpperCase()]["Daily Value-at-Risk %"]?.toFixed(2)}%
+ {/if}
-
- {quantStats['SPY']["Daily Value-at-Risk %"]?.toFixed(2)}%
+
+ {#if quantStats['SPY']["Daily Value-at-Risk %"] >=0}
+ +{quantStats['SPY']["Daily Value-at-Risk %"]?.toFixed(2)}%
+ {:else}
+ {quantStats['SPY']["Daily Value-at-Risk %"]?.toFixed(2)}%
+ {/if}
-
-
+
+
Expected Shortfall (cVaR)
-
- {quantStats[$etfTicker?.toUpperCase()]["Expected Shortfall (cVaR) %"]?.toFixed(2)}%
+
+ {#if quantStats[$etfTicker?.toUpperCase()]["Expected Shortfall (cVaR) %"] >=0}
+ +{quantStats[$etfTicker?.toUpperCase()]["Expected Shortfall (cVaR) %"]?.toFixed(2)}%
+ {:else}
+ {quantStats[$etfTicker?.toUpperCase()]["Expected Shortfall (cVaR) %"]?.toFixed(2)}%
+ {/if}
-
- {quantStats['SPY']["Expected Shortfall (cVaR) %"]?.toFixed(2)}%
+
+ {#if quantStats['SPY']["Expected Shortfall (cVaR) %"] >=0}
+ +{quantStats['SPY']["Expected Shortfall (cVaR) %"]?.toFixed(2)}%
+ {:else}
+ {quantStats['SPY']["Expected Shortfall (cVaR) %"]?.toFixed(2)}%
+ {/if}
-
-
-
-
-
-
-
+
+
Max Consecutive Wins
-
+
{quantStats[$etfTicker?.toUpperCase()]["Max Consecutive Wins"]}
-
+
{quantStats['SPY']["Max Consecutive Wins"]}
-
-
+
+
Max Consecutive Losses
-
+
{quantStats[$etfTicker?.toUpperCase()]["Max Consecutive Losses"]}
-
+
{quantStats['SPY']["Max Consecutive Losses"]}
-
-
+
+
Gain/Pain Ratio
-
+
{quantStats[$etfTicker?.toUpperCase()]["Gain/Pain Ratio"]?.toFixed(2)}
-
+
{quantStats['SPY']["Gain/Pain Ratio"]?.toFixed(2)}
-
-
+
+
Gain/Pain (1M)
-
+
{quantStats[$etfTicker?.toUpperCase()]["Gain/Pain (1M)"]?.toFixed(2)}
-
+
{quantStats['SPY']["Gain/Pain (1M)"]?.toFixed(2)}
-
-
+
+
Payoff Ratio
-
+
{quantStats[$etfTicker?.toUpperCase()]["Payoff Ratio"]?.toFixed(2)}
-
+
{quantStats['SPY']["Payoff Ratio"]?.toFixed(2)}
-
-
+
+
Profit Factor
-
+
{quantStats[$etfTicker?.toUpperCase()]["Profit Factor"]?.toFixed(2)}
-
+
{quantStats['SPY']["Profit Factor"]?.toFixed(2)}
-
-
+
+
Outlier Win Ratio
-
+
{quantStats[$etfTicker?.toUpperCase()]["Outlier Win Ratio"]?.toFixed(2)}
-
+
{quantStats['SPY']["Outlier Win Ratio"]?.toFixed(2)}
-
-
+
+
Outlier Loss Ratio
-
+
{quantStats[$etfTicker?.toUpperCase()]["Outlier Loss Ratio"]?.toFixed(2)}
-
+
{quantStats['SPY']["Outlier Loss Ratio"]?.toFixed(2)}
-
-
-
-
-
-
-
-
+
+
MTD
-
- {quantStats[$etfTicker?.toUpperCase()]["MTD %"]?.toFixed(2)}%
+
+ {#if quantStats[$etfTicker?.toUpperCase()]["MTD %"] >=0}
+ +{quantStats[$etfTicker?.toUpperCase()]["MTD %"]?.toFixed(2)}%
+ {:else}
+ {quantStats[$etfTicker?.toUpperCase()]["MTD %"]?.toFixed(2)}%
+ {/if}
-
- {quantStats['SPY']["MTD %"]?.toFixed(2)}%
+
+ {#if quantStats['SPY']["MTD %"] >=0}
+ +{quantStats['SPY']["MTD %"]?.toFixed(2)}%
+ {:else}
+ {quantStats['SPY']["MTD %"]?.toFixed(2)}%
+ {/if}
-
-
+
+
3M
-
- {quantStats[$etfTicker?.toUpperCase()]["3M %"]?.toFixed(2)}%
+
+ {#if quantStats[$etfTicker?.toUpperCase()]["3M %"] >=0}
+ +{quantStats[$etfTicker?.toUpperCase()]["3M %"]?.toFixed(2)}%
+ {:else}
+ {quantStats[$etfTicker?.toUpperCase()]["3M %"]?.toFixed(2)}%
+ {/if}
-
- {quantStats['SPY']["3M %"]?.toFixed(2)}%
+
+ {#if quantStats['SPY']["3M %"] >=0}
+ +{quantStats['SPY']["3M %"]?.toFixed(2)}%
+ {:else}
+ {quantStats['SPY']["3M %"]?.toFixed(2)}%
+ {/if}
-
-
+
+
6M
-
- {quantStats[$etfTicker?.toUpperCase()]["6M %"]?.toFixed(2)}%
+
+ {#if quantStats[$etfTicker?.toUpperCase()]["6M %"] >=0}
+ +{quantStats[$etfTicker?.toUpperCase()]["6M %"]?.toFixed(2)}%
+ {:else}
+ {quantStats[$etfTicker?.toUpperCase()]["6M %"]?.toFixed(2)}%
+ {/if}
-
- {quantStats['SPY']["6M %"]?.toFixed(2)}%
+
+ {#if quantStats['SPY']["6M %"] >=0}
+ +{quantStats['SPY']["6M %"]?.toFixed(2)}%
+ {:else}
+ {quantStats['SPY']["6M %"]?.toFixed(2)}%
+ {/if}
-
-
+
+
YTD
-
- {quantStats[$etfTicker?.toUpperCase()]["YTD %"]?.toFixed(2)}%
+
+ {#if quantStats[$etfTicker?.toUpperCase()]["YTD %"] >=0}
+ +{quantStats[$etfTicker?.toUpperCase()]["YTD %"]?.toFixed(2)}%
+ {:else}
+ {quantStats[$etfTicker?.toUpperCase()]["YTD %"]?.toFixed(2)}%
+ {/if}
-
- {quantStats['SPY']["YTD %"]?.toFixed(2)}%
+
+ {#if quantStats['SPY']["YTD %"] >=0}
+ +{quantStats['SPY']["YTD %"]?.toFixed(2)}%
+ {:else}
+ {quantStats['SPY']["YTD %"]?.toFixed(2)}%
+ {/if}
-
-
+
+
1Y
-
- {quantStats[$etfTicker?.toUpperCase()]["1Y %"]?.toFixed(2)}%
+
+ {#if quantStats[$etfTicker?.toUpperCase()]["1Y %"] >=0}
+ +{quantStats[$etfTicker?.toUpperCase()]["1Y %"]?.toFixed(2)}%
+ {:else}
+ {quantStats[$etfTicker?.toUpperCase()]["1Y %"]?.toFixed(2)}%
+ {/if}
-
- {quantStats['SPY']["1Y %"]?.toFixed(2)}%
+
+ {#if quantStats['SPY']["1Y %"] >=0}
+ +{quantStats['SPY']["1Y %"]?.toFixed(2)}%
+ {:else}
+ {quantStats['SPY']["1Y %"]?.toFixed(2)}%
+ {/if}
-
-
+
+
3Y (ann.)
-
- {quantStats[$etfTicker?.toUpperCase()]["3Y (ann.) %"]?.toFixed(2)}%
+
+ {#if quantStats[$etfTicker?.toUpperCase()]["3Y (ann.) %"] >=0}
+ +{quantStats[$etfTicker?.toUpperCase()]["3Y (ann.) %"]?.toFixed(2)}%
+ {:else}
+ {quantStats[$etfTicker?.toUpperCase()]["3Y (ann.) %"]?.toFixed(2)}%
+ {/if}
-
- {quantStats['SPY']["3Y (ann.) %"]?.toFixed(2)}%
+
+ {#if quantStats['SPY']["3Y (ann.) %"] >=0}
+ +{quantStats['SPY']["3Y (ann.) %"]?.toFixed(2)}%
+ {:else}
+ {quantStats['SPY']["3Y (ann.) %"]?.toFixed(2)}%
+ {/if}
-
-
-
-
-
-
-
-
+
+
Best Day
-
- {quantStats[$etfTicker?.toUpperCase()]["Best Day %"]?.toFixed(2)}%
+
+ {#if quantStats[$etfTicker?.toUpperCase()]["Best Day %"] >=0}
+ +{quantStats[$etfTicker?.toUpperCase()]["Best Day %"]?.toFixed(2)}%
+ {:else}
+ {quantStats[$etfTicker?.toUpperCase()]["Best Day %"]?.toFixed(2)}%
+ {/if}
-
- {quantStats['SPY']["Best Day %"]?.toFixed(2)}%
+
+ {#if quantStats['SPY']["Best Day %"] >=0}
+ +{quantStats['SPY']["Best Day %"]?.toFixed(2)}%
+ {:else}
+ {quantStats['SPY']["Best Day %"]?.toFixed(2)}%
+ {/if}
-
-
+
+
Worst Day
-
- {quantStats[$etfTicker?.toUpperCase()]["Worst Day %"]?.toFixed(2)}%
+
+ {#if quantStats[$etfTicker?.toUpperCase()]["Worst Day %"] >=0}
+ +{quantStats[$etfTicker?.toUpperCase()]["Worst Day %"]?.toFixed(2)}%
+ {:else}
+ {quantStats[$etfTicker?.toUpperCase()]["Worst Day %"]?.toFixed(2)}%
+ {/if}
-
- {quantStats['SPY']["Worst Day %"]?.toFixed(2)}%
+
+ {#if quantStats['SPY']["Worst Day %"] >=0}
+ +{quantStats['SPY']["Worst Day %"]?.toFixed(2)}%
+ {:else}
+ {quantStats['SPY']["Worst Day %"]?.toFixed(2)}%
+ {/if}
-
-
+
+
Best Month
-
- {quantStats[$etfTicker?.toUpperCase()]["Best Month %"]?.toFixed(2)}%
+
+ {#if quantStats[$etfTicker?.toUpperCase()]["Worst Day %"] >=0}
+ +{quantStats[$etfTicker?.toUpperCase()]["Worst Day %"]?.toFixed(2)}%
+ {:else}
+ {quantStats[$etfTicker?.toUpperCase()]["Worst Day %"]?.toFixed(2)}%
+ {/if}
-
- {quantStats['SPY']["Best Month %"]?.toFixed(2)}%
+
+ {#if quantStats['SPY']["Worst Day %"] >=0}
+ +{quantStats['SPY']["Worst Day %"]?.toFixed(2)}%
+ {:else}
+ {quantStats['SPY']["Worst Day %"]?.toFixed(2)}%
+ {/if}
-
-
+
+
Worst Month
-
- {quantStats[$etfTicker?.toUpperCase()]["Worst Month %"]?.toFixed(2)}%
+
+ {#if quantStats[$etfTicker?.toUpperCase()]["Worst Month %"] >=0}
+ +{quantStats[$etfTicker?.toUpperCase()]["Worst Month %"]?.toFixed(2)}%
+ {:else}
+ {quantStats[$etfTicker?.toUpperCase()]["Worst Month %"]?.toFixed(2)}%
+ {/if}
-
- {quantStats['SPY']["Worst Month %"]?.toFixed(2)}%
+
+ {#if quantStats['SPY']["Worst Month %"] >=0}
+ +{quantStats['SPY']["Worst Month %"]?.toFixed(2)}%
+ {:else}
+ {quantStats['SPY']["Worst Month %"]?.toFixed(2)}%
+ {/if}
-
-
+
+
Best Year
-
- {quantStats[$etfTicker?.toUpperCase()]["Best Year %"]?.toFixed(2)}%
+
+ {#if quantStats[$etfTicker?.toUpperCase()]["Best Year %"] >=0}
+ +{quantStats[$etfTicker?.toUpperCase()]["Best Year %"]?.toFixed(2)}%
+ {:else}
+ {quantStats[$etfTicker?.toUpperCase()]["Best Year %"]?.toFixed(2)}%
+ {/if}
-
- {quantStats['SPY']["Best Year %"]?.toFixed(2)}%
+
+ {#if quantStats['SPY']["Best Year %"] >=0}
+ +{quantStats['SPY']["Best Year %"]?.toFixed(2)}%
+ {:else}
+ {quantStats['SPY']["Best Year %"]?.toFixed(2)}%
+ {/if}
-
-
+
+
Worst Year
-
- {quantStats[$etfTicker?.toUpperCase()]["Worst Year %"]?.toFixed(2)}%
+
+ {#if quantStats[$etfTicker?.toUpperCase()]["Worst Year %"] >=0}
+ +{quantStats[$etfTicker?.toUpperCase()]["Worst Year %"]?.toFixed(2)}%
+ {:else}
+ {quantStats[$etfTicker?.toUpperCase()]["Worst Year %"]?.toFixed(2)}%
+ {/if}
-
- {quantStats['SPY']["Worst Year %"]?.toFixed(2)}%
+
+ {#if quantStats['SPY']["Worst Year %"] >=0}
+ +{quantStats['SPY']["Worst Year %"]?.toFixed(2)}%
+ {:else}
+ {quantStats['SPY']["Worst Year %"]?.toFixed(2)}%
+ {/if}
-
-
-
-
-
-
-
-
+
+
Avg. Drawdown
-
- {quantStats[$etfTicker?.toUpperCase()]["Avg. Drawdown"]?.toFixed(2)}%
+
+ {#if quantStats[$etfTicker?.toUpperCase()]["Avg. Drawdown"] >=0}
+ +{quantStats[$etfTicker?.toUpperCase()]["Avg. Drawdown"]?.toFixed(2)}%
+ {:else}
+ {quantStats[$etfTicker?.toUpperCase()]["Avg. Drawdown"]?.toFixed(2)}%
+ {/if}
-
- {quantStats['SPY']["Avg. Drawdown"]?.toFixed(2)}%
+
+ {#if quantStats['SPY']["Avg. Drawdown"] >=0}
+ +{quantStats['SPY']["Avg. Drawdown"]?.toFixed(2)}%
+ {:else}
+ {quantStats['SPY']["Avg. Drawdown"]?.toFixed(2)}%
+ {/if}
-
-
+
+
Avg. Drawdown Days
-
+
{quantStats[$etfTicker?.toUpperCase()]["Avg. Drawdown Days"]}
-
+
{quantStats['SPY']["Avg. Drawdown Days"]}
-
-
+
+
Recovery Factor
-
+
{quantStats[$etfTicker?.toUpperCase()]["Recovery Factor"]?.toFixed(2)}
-
+
{quantStats['SPY']["Recovery Factor"]?.toFixed(2)}
-
-
+
+
Ulcer Index
-
+
{quantStats[$etfTicker?.toUpperCase()]["Ulcer Index"]?.toFixed(2)}
-
+
{quantStats['SPY']["Ulcer Index"]?.toFixed(2)}
-
-
-
-
-
-
+
+
Avg. Up Month
-
- {quantStats[$etfTicker?.toUpperCase()]["Avg. Up Month %"]?.toFixed(2)}%
+
+ {#if quantStats[$etfTicker?.toUpperCase()]["Avg. Up Month %"] >=0}
+ +{quantStats[$etfTicker?.toUpperCase()]["Avg. Up Month %"]?.toFixed(2)}%
+ {:else}
+ {quantStats[$etfTicker?.toUpperCase()]["Avg. Up Month %"]?.toFixed(2)}%
+ {/if}
-
- {quantStats['SPY']["Avg. Up Month %"]?.toFixed(2)}%
+
+ {#if quantStats['SPY']["Avg. Up Month %"] >=0}
+ +{quantStats['SPY']["Avg. Up Month %"]?.toFixed(2)}%
+ {:else}
+ {quantStats['SPY']["Avg. Up Month %"]?.toFixed(2)}%
+ {/if}
-
-
+
+
Avg. Down Month
-
- {quantStats[$etfTicker?.toUpperCase()]["Avg. Down Month %"]?.toFixed(2)}%
+
+ {#if quantStats[$etfTicker?.toUpperCase()]["Avg. Down Month %"] >=0}
+ +{quantStats[$etfTicker?.toUpperCase()]["Avg. Down Month %"]?.toFixed(2)}%
+ {:else}
+ {quantStats[$etfTicker?.toUpperCase()]["Avg. Down Month %"]?.toFixed(2)}%
+ {/if}
-
- {quantStats['SPY']["Avg. Down Month %"]?.toFixed(2)}%
+
+ {#if quantStats['SPY']["Avg. Down Month %"] >=0}
+ +{quantStats['SPY']["Avg. Down Month %"]?.toFixed(2)}%
+ {:else}
+ {quantStats['SPY']["Avg. Down Month %"]?.toFixed(2)}%
+ {/if}
-
-
+
+
Win Days
-
+
{quantStats[$etfTicker?.toUpperCase()]["Win Days %"]?.toFixed(2)}%
-
+
{quantStats['SPY']["Win Days %"]?.toFixed(2)}%
-
-
+
+
Win Month
-
+
{quantStats[$etfTicker?.toUpperCase()]["Win Month %"]?.toFixed(2)}%
-
+
{quantStats['SPY']["Win Month %"]?.toFixed(2)}%
-
-
+
+
Win Quarter
-
+
{quantStats[$etfTicker?.toUpperCase()]["Win Quarter %"]?.toFixed(2)}%
-
+
{quantStats['SPY']["Win Quarter %"]?.toFixed(2)}%
-
-
+
+
Win Year
-
+
{quantStats[$etfTicker?.toUpperCase()]["Win Year %"]?.toFixed(2)}%
-
+
{quantStats['SPY']["Win Year %"]?.toFixed(2)}%
@@ -987,7 +1145,7 @@ function ongoingDD(dateString) {
{:else}
-
+
{/if}
@@ -1001,5 +1159,4 @@ function ongoingDD(dateString) {
{/if}
-
-
\ No newline at end of file
+
\ No newline at end of file