# getFeasibleOptionFlags

Function taking all out-of-the-money (OTM) options with an absolute delta of 0.5 or less, applying standard filters to exclude options with negative bid-ask spreads, zero bids, or zero volume, and then retaining the maximum number of options that satisfy no-arbitrage constraints.

{% tabs %}
{% tab title="dbbpy" %}

```
dbbpy.getFeasibleOptionFlags(sp, strike, bid, ask, pFlag, spotsP, spbid, spask)
```

Parameters:

* &#x20;`sp` (numpy.ndarray): A 1D array of floats representing the spot prices in different states of the world&#x20;
* `bid` (numpy.ndarray): A 1D array of floats representing the bid prices for different options&#x20;
* `ask` (numpy.ndarray): A 1D array of floats representing the ask prices for different options&#x20;
* `strike` (numpy.ndarray): A 1D array of floats representing the strike prices of different options&#x20;
* `pFlag` (numpy.ndarray): A 1D array of booleans indicating whether each option is a call (`True`) or a put (`False`) option &#x20;
* `spotsP` (float): A scaling factor used to adjust the magnitude of the spot prices and pricing constraints
* `spbid` (float): The bid price related to the spot prices, used to define the lower bound of the pricing constraints&#x20;
* `spask` (float): The ask price related to the spot prices, used to define the upper bound of the pricing constraints

Output:&#x20;

* (numpy.ndarray): A 1D array of booleans representing whether each option is feasible according to the optimization constraints
  {% endtab %}

{% tab title="rdbb" %}

```
rdbb::getFeasibleOptionFlags(sp, strike, bid, ask, pFlag, spotsP, spbid, spask)
```

Parameters:

* `sp` (numeric vector): A vector of floats representing the spot prices in different states of the world
* `bid` (numeric vector): A vector of floats representing the bid prices for different options
* `ask` (numeric vector): A vector of floats representing the ask prices for different options
* `strike` (numeric vector): A vector of floats representing the strike prices of different options
* `pFlag` (logical vector): A vector of booleans indicating whether each option is a call (`TRUE`) or a put (`FALSE`) option
* `spotsP` (numeric): A scaling factor used to adjust the magnitude of the spot prices and pricing constraints
* `spbid` (numeric): The bid price related to the spot prices, used to define the lower bound of the pricing constraints
* `spask` (numeric): The ask price related to the spot prices, used to define the upper bound of the pricing constraints

Output:&#x20;

* (logical vector): A vector of booleans indicating whether each option is feasible according to the optimization constraints
  {% endtab %}
  {% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pietro-zanottas-organization.gitbook.io/dbb/api-reference/getfeasibleoptionflags.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
