diff --git a/src/routes/options-flow/+page.svelte b/src/routes/options-flow/+page.svelte index 77c8bd7b..ad8f2623 100644 --- a/src/routes/options-flow/+page.svelte +++ b/src/routes/options-flow/+page.svelte @@ -839,6 +839,7 @@ function sendMessage(message) { price: "none", premium: "none", type: "none", + exec: "none", vol: "none", oi: "none", }; @@ -929,8 +930,8 @@ function sendMessage(message) { }, sentiment: (a, b) => { const sentimentOrder = { BULLISH: 1, NEUTRAL: 2, BEARISH: 3 }; - const sentimentA = sentimentOrder[a.sentiment?.toUpperCase()] || 4; - const sentimentB = sentimentOrder[b.sentiment?.toUpperCase()] || 4; + const sentimentA = sentimentOrder[a?.sentiment?.toUpperCase()] || 4; + const sentimentB = sentimentOrder[b?.sentiment?.toUpperCase()] || 4; return sortOrder === "asc" ? sentimentA - sentimentB : sentimentB - sentimentA; @@ -941,6 +942,13 @@ function sendMessage(message) { const typeB = typeOrder[b.option_activity_type?.toUpperCase()] || 3; return sortOrder === "asc" ? typeA - typeB : typeB - typeA; }, + exec: (a, b) => { + const tickerA = a?.execution_estimate?.toUpperCase(); + const tickerB = b?.execution_estimate?.toUpperCase(); + return sortOrder === "asc" + ? tickerA.localeCompare(tickerB) + : tickerB.localeCompare(tickerA); + }, }; // Sort using the appropriate comparison function @@ -999,9 +1007,9 @@ function sendMessage(message) {