bugfixing
This commit is contained in:
parent
c5ba7a39fd
commit
1b516b3cfb
@ -67,12 +67,6 @@
|
|||||||
function computeOTM(strikePrice, optionType) {
|
function computeOTM(strikePrice, optionType) {
|
||||||
// Get the current stock price
|
// Get the current stock price
|
||||||
const currentPrice = data?.getStockQuote?.price;
|
const currentPrice = data?.getStockQuote?.price;
|
||||||
|
|
||||||
// Ensure the current price and strike price are valid numbers
|
|
||||||
if (typeof currentPrice !== "number" || typeof strikePrice !== "number") {
|
|
||||||
throw new Error("Invalid current price or strike price");
|
|
||||||
}
|
|
||||||
|
|
||||||
let otmPercentage = 0;
|
let otmPercentage = 0;
|
||||||
|
|
||||||
if (optionType === "C") {
|
if (optionType === "C") {
|
||||||
|
|||||||
@ -68,11 +68,6 @@
|
|||||||
// Get the current stock price
|
// Get the current stock price
|
||||||
const currentPrice = data?.getStockQuote?.price;
|
const currentPrice = data?.getStockQuote?.price;
|
||||||
|
|
||||||
// Ensure the current price and strike price are valid numbers
|
|
||||||
if (typeof currentPrice !== "number" || typeof strikePrice !== "number") {
|
|
||||||
throw new Error("Invalid current price or strike price");
|
|
||||||
}
|
|
||||||
|
|
||||||
let otmPercentage = 0;
|
let otmPercentage = 0;
|
||||||
|
|
||||||
if (optionType === "C") {
|
if (optionType === "C") {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user