From aa9b9af89e0361407d032bd1d464352f23c1f7ce Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Tue, 15 Apr 2025 15:02:45 +0200 Subject: [PATCH] bugfixing --- src/routes/options-calculator/+page.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/routes/options-calculator/+page.svelte b/src/routes/options-calculator/+page.svelte index e794a88f..5a1b590f 100644 --- a/src/routes/options-calculator/+page.svelte +++ b/src/routes/options-calculator/+page.svelte @@ -417,6 +417,7 @@ ); const output = await getContractHistory(optionSymbol); + selectedOptionPrice = output?.history?.at(-1)?.mark ? output?.history?.at(-1)?.mark : output?.history?.at(-1)?.close || 0; @@ -454,7 +455,9 @@ ); const output = await getContractHistory(optionSymbol); - selectedOptionPrice = output?.history?.at(-1)?.mark || 0; + selectedOptionPrice = output?.history?.at(-1)?.mark + ? output?.history?.at(-1)?.mark + : output?.history?.at(-1)?.close || 0; // Update user strategy if necessary userStrategy = [