> For the complete documentation index, see [llms.txt](https://thales-mfi.gitbook.io/app-documentation-en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://thales-mfi.gitbook.io/app-documentation-en/operational-widgets/option/strategy-builder.md).

# Strategy Builder

### Overview

*Strategy Builder* (SB) is a widget which simplifies the creation of strategies including positions which can be a mixture of cash, Options, and underlying asset. Individual positions can be added in the widget to develop and analyze various strategies.

While advanced methods like using *Black-Scholes* widget together with *Position* and *Strategy* widgets exist in OSS, the *SB* offers a simpler, more user-friendly alternative. It consolidates multiple features into one place, allowing for efficient strategy management. Once the strategy is built, it can be easily exported to other widgets, such as Graph, for detailed analysis and visualization.

<figure><img src="/files/MvcW0CT7uOpZx0VYs1db" alt=""><figcaption><p>A SB widget and some widgets connected to it</p></figcaption></figure>

[*Launch the App*](https://oss.thales-mfi.com/)

### Accessing the Widget

The widget can be found in the menu under ***Options*****.**&#x20;

<figure><img src="/files/A9yUBUbap8gJxS2uS1yu" alt="" width="348"><figcaption><p>SB in the Menu</p></figcaption></figure>

{% hint style="info" %}
This widget, like other ones, can simply be searched. you just need to type its abbreviation ("sb") in the search box.
{% endhint %}

<figure><img src="/files/oIJlNaVsCA3TIt7hitai" alt="" width="375"><figcaption><p>Shortcut</p></figcaption></figure>

[*Launch the App*](https://oss.thales-mfi.com/)

### Adding Positions and Their Parameters

As many individual positions cab be added to the Strategy Builder (SB) by clicking on the plus (+) symbol below the last row (see the figure).

<figure><img src="/files/rLDnGBPcD9GmEHjHjNXD" alt="" width="563"><figcaption><p>Adding Position(s)</p></figcaption></figure>

Subsequently, the parameters of each position should be entered either manually or through the input interface (**inlet**). The parameter fields are listed below:

* *Type*&#x20;
* *Underlying Price*
* *Expiry*&#x20;
* *Strike*&#x20;
* *Option Price* and *(Implied) Volatility*&#x20;
* *Side*&#x20;
* *Size*&#x20;
* *Entry Price*&#x20;

### *Type*&#x20;

In this field the following alternatives can be chosen:

* *Call*&#x20;
* *Put*&#x20;
* *Underlying*
* *Cash*

<figure><img src="/files/yr3lo8zvAnUiDZhkZgdG" alt="" width="305"><figcaption><p>Type in SB</p></figcaption></figure>

{% hint style="info" %}
The default value for *Type* is *Call*.
{% endhint %}

For *Call* and *Put* all parameter fields need to be filled.

<figure><img src="/files/TEUi00rpeAkleGcINAFJ" alt=""><figcaption><p>For Type Call / Put in SB all the parameters should be filled.</p></figcaption></figure>

&#x20;Note that *Option Price* represents the current price of the contract which, based on the entry or input, can be the *mark price*, *best ask*, or *best bid* price of the market, while the *Entry Price* represents the average buy or sell price of the contract traded by the user.

{% hint style="info" %}
For example, you buy a Call Option for $100 and fill that amount in *Entry Price* and *Option Price* (supposing that you bought the contract at the mark price). Later, the Price of the contract becomes $105 (now in the field of *Option Price*). Since your *Entry Price* is $100 and *Option Price* is $ 105 your profit would be $5.
{% endhint %}

{% hint style="info" %}
If the *Entry Price* field is left empty and a value is entered into the *Option Price* field, the entered value will automatically be transferred to the *Entry Price* field as well.
{% endhint %}

The field *Underlying* (Type = Underlying) allows users to represent their positions in spot or futures markets. For example, if you hold 100 shares with an average purchase price of $20 in your portfolio, you can represent them as an *Underlying* position with *Side* = Long, *Size* = 100, and *Entry Price* = 20. This way you can see the effect of this position in your overall portfolio output as well.

{% hint style="info" %}
&#x20;When *Underlying* is selected, all other non-relevant input fields are automatically deactivated.
{% endhint %}

<figure><img src="/files/eVT1kpexMuCY4yWjmDnf" alt=""><figcaption><p>For <em>Underlying</em> non-relevant fields are deactivated.</p></figcaption></figure>

In certain cases, it is possible to add so-called perpetual futures positions to the overall strategy by using Type = Underlying. For example, if there is a short position on a stock with a size of 10 contracts and a leverage of 3 at an average selling price of USD 25, this position can be represented in the strategy as follows:\
*Type* = *Underlying*, *Side* = *Short*, *Size* = 30, *Entry Price* = 25.

Depending on how many shares correspond to a futures contract and your leverage, you should adjust the *Size* parameter accordingly. To check it, you can simply connect the outlet of the position individually to the inle**t** of a *graph* and monitor how the position's value changes for a one-unit change in the underlying asset.

&#x20;Alternatively, you can connect the outlet of the position to a *data selector* widget and check the delta value. This value should correspond to the total leverage of your futures position.

<figure><img src="/files/U8sLDObYzOXfutNoiEib" alt=""><figcaption><p>Each position's data can exported out to Data Selector widget.</p></figcaption></figure>

*Cash* positions allow you to incorporate positive and negative cash offsets into your strategies. An example of such a use case is the cash-secured put strategy. You can simulate the risk profile of your strategy based on the combination of cash and put positions and examine it in more detail (see figure).

<figure><img src="/files/9fpeM1oQnsFgmsy6A1tx" alt=""><figcaption><p>Cash secured put strategy including a cash position</p></figcaption></figure>

[*Launch the App*](https://oss.thales-mfi.com/)

### *Underlying Price*

When trading Options on the spot market, the *underlying* value of your options refers to the current spot price of the underlying asset. This price remains constant across different option expiries. However, there are situations where the underlying price for certain options may vary.

One example is Options that are based on futures contracts. Since futures contracts have different prices depending on their expiration dates, the *underlying* prices of options based on them also vary. Another example is trading the same options derived from  the same underlying asset but on different spot markets, where slight price differences may exist.

In such cases, it is crucial to consider different underlying prices for each option to ensure accurate calculation of other parameters.

<figure><img src="/files/Y5FYBjKwT6YTFAjaQRTo" alt=""><figcaption><p>Different underlying prices of the positions</p></figcaption></figure>

In case there are different underlying prices for different positions in *SB*, the outcome will be shown separately in the *Graph* widget connected to the *SB*. Dashed lines mark the different underlying prices.

<figure><img src="/files/1ziVIbSPEqzQbQCIDp7X" alt=""><figcaption><p>Display of the different underlying prices on the graph widget</p></figcaption></figure>

[*Launch the App*](https://oss.thales-mfi.com/)

### *Expiry*

<figure><img src="/files/cSw8J9Tf6j9F7AcilmdZ" alt=""><figcaption><p>Expiration date of the contract</p></figcaption></figure>

If the data of the position gets imported via the inlet, this field will automatically be filled according its source, otherwise you should set the Option's expiration date manually by clicking on the calendar symbol <img src="/files/c0F3QFnJh5EzhD6bT1I7" alt="" data-size="line"> or by clicking on the date or time and adjusting it using arrow keys of your keyboard.

{% hint style="info" %}
The default value for Expiry is set to 30 days in the future.
{% endhint %}

[*Launch the App*](https://oss.thales-mfi.com/)

### *Strike*

<figure><img src="/files/ML2cMpgVmXWXvbiFmcaz" alt=""><figcaption><p>The Strike Price of the contract</p></figcaption></figure>

The strike price of an Option (also known as the exercise price) is the predetermined price at which the Option buyer can buy or sell the underlying asset (such as stocks, commodities, or currencies) when exercising the Option. If the data is imported to the position via its inlet, the field will automatically be filled; otherwise, it must be filled manually.

[*Launch the App*](https://oss.thales-mfi.com/)

### *Option Price and (Implied) Volatility*

<figure><img src="/files/vWzjByftV8pTa6MdQW6C" alt=""><figcaption><p>Option Price and (Implied) Volatility</p></figcaption></figure>

If *Option Price* is specified as the **input** parameter for the position, the *volatility* is automatically calculated using this price and other input parameters. This volatility, calculated by the Black-Scholes model, is called "implied volatility" (IV). On the other hand, if *volatility* is specified as the **input** parameter, it is no longer implied volatility but rather volatility estimated or calculated independently. In this case, the *option price* is calculated using the Black-Scholes model and the specified volatility as the input parameter.

<figure><img src="/files/t2yaA0gYG4rOnztlrRwn" alt="" width="375"><figcaption><p>Option Price as input</p></figcaption></figure>

<figure><img src="/files/jgzkj4deW93Fk6nizu4U" alt="" width="375"><figcaption><p>Volatility as input</p></figcaption></figure>

{% hint style="warning" %}
It's important to understand the interdependency between the two fields, *Option Price* and (Implied) *Volatility*. The Black-Scholes model used for Option simulations in this widget accepts either the *Option* *price* or *volatility* as an *input* parameter and calculates the other parameter as an *output* value, depending on the chosen input parameter. This means that you can enter only one of these two parameters in the *input* field at a time, and the other value will be automatically calculated.
{% endhint %}

{% hint style="success" %}
It's worth reminding that the parameters *Expiry*, *Strike*, *Option Price*, and (*Implied*) *Volatility* must be filled only when the type is selected as Call or Put, for other cases, namely *Underlying* and *Cash* these parameters will be deactivated.
{% endhint %}

<figure><img src="/files/o2KMYb4Y0qFCVpMjHjFm" alt=""><figcaption><p>Deactivated fields for Underlying position</p></figcaption></figure>

[*Launch the App*](https://oss.thales-mfi.com/)

### *Side*

<figure><img src="/files/zM0fKTsp8sNcfFlYD8Cr" alt=""><figcaption></figcaption></figure>

The direction or type of position, *Long* or *Short*, can be selected in this field. *Long* is the buy position, and *Short* is the sell positon.

### *Size*

<figure><img src="/files/NnOcFPnxadlENtBz4b3S" alt=""><figcaption></figcaption></figure>

The *Size* parameter refers to the number of Options or Futures contracts, or the volume of the underlying asset traded. By default, this parameter is set at 1, so it must be modified manually based on the user's position size.

[*Launch the App*](https://oss.thales-mfi.com/)

### *Entry Price*

<figure><img src="/files/EV9RU60ZWKGLhXOc9fVT" alt=""><figcaption><p>Entry Price in SB</p></figcaption></figure>

The *Entry Price* is the average unit price at which the trade is executed. This entry, basically, should be entered by the user. This price can differ from the current price, i.e., the Option Price  when the *Type* is set to *Call* or *Put*, or the Underlying Price when the type is set to *Underlying*. In other words, the difference between the *Entry Price* and the current price determines the current unrealized profit or loss of the position.

{% hint style="info" %}
When a position is fed from another widget through its inlet, the option price is automatically imported into the corresponding field. This can lead to differences in the calculated implied volatility between the widgets. One reason for this is that exchanges often use their own models for calculating option parameters, which can lead to discrepancies. The same applies when the input option is switched to *implied volatility*: the Option price of the source widget can differ from the option price calculated in the SB (see the figure below).
{% endhint %}

<figure><img src="/files/EptBy1tEG3GJQa2pjbEL" alt=""><figcaption></figcaption></figure>

[*Launch the App*](https://oss.thales-mfi.com/)

### Feeding the *SB*

Each position in the Strategy Builder has an receiving socket  (Inlet) which is an input interface through which the position's parameters can be fed from outside, i.e., through the outlet  of another appropriate widgets (e.g., *Option w*idget or *Position w*idget). The automatically filled parameters of the linked positions remain unchanged and can only be manually changed  once the link is unplugged.

The following widgets can be connected to *Strategy Builder* via its inlet:

### Importing Data from *Option Chain*

It is possible to import the data of a certain Option contract right from the market via [*Option Chain* ](/app-documentation-en/market-data/option-chains.md)widget.

&#x20;This will automatically populate the Option's parameters into the corresponding fields in the position row. This offers the advantage of continuously updating real-time data, such as the Option price.

<figure><img src="/files/i6P06XNy1pqDlo9tyffk" alt=""><figcaption><p>Choosing a Contract from Option Chain</p></figcaption></figure>

<figure><img src="/files/ENcFLpNovoHRzH0g0sbr" alt="" width="563"><figcaption><p>Selected Contract</p></figcaption></figure>

<figure><img src="/files/WvzwbA6cNKxOqmNw4OOB" alt=""><figcaption><p>Connecting The Option to SB</p></figcaption></figure>

{% hint style="info" %}
Please note that when an Option Widget is connected to a *position* row, the *Side*, *Size*, and *Entry Price* details must still be entered manually.
{% endhint %}

[*Launch the App*](https://oss.thales-mfi.com/)

### *Black-Scholes* and *Position* Widgets

After creating an Option position using the combination of *Black-Scholes* and *Position* widgets, you can link the output of the *Position* widget to a *position* row in the *SB* to automatically transfer all the parameters of your *position* to the *SB*. One significant advantage of this method is that if the *Black-Scholes* or *Position* Widget themselves are fed with dynamic values from external sources, these parameters are dynamically transferred to the position rows of the *SB*.

<figure><img src="/files/LupUALssALHI9BNj7ZbC" alt=""><figcaption><p>Linking a combined <em>Black-Scholes</em> and <em>Position</em> to a position in the SB</p></figcaption></figure>

[*Launch the App*](https://oss.thales-mfi.com/)

### Output Interfaces

### *SB* Output

The top outlet interface of the *SB* widget is the strategy output interface. Through this interface, all selected (i.e. those whose selection box in the left is checked) data from the combined individual positions are transmitted as a coherent strategy to other suitable widgets such as *Graph* and *Data Selector*.

<figure><img src="/files/PCFyNS2JI6SB1RcN2eHM" alt=""><figcaption><p>SB Outlet exports its overall data to another widget(s).</p></figcaption></figure>

[*Launch the App*](https://oss.thales-mfi.com/)

### Individual Position Output

For each individual *position* in the *SB*, an outlet is available, allowing the respective data to be linked out to other suitable widgets.

<figure><img src="/files/L9uq2SRhauxB7rXrHzwz" alt=""><figcaption><p>Individual strategies' data can be transferred out through their own outlets.</p></figcaption></figure>

### Deleting or Deactivating Positions

By deleting a *position* row in the *Strategy Builder*, that *position* is removed from the overall strategy, and all related data is deleted. An alternative way to temporarily disable an individual position is to deactivate it by unchecking the corresponding box to the left of the position row.

<figure><img src="/files/t1EOQn3cMExhKF4YVJQ5" alt=""><figcaption><p>Activation / Deactivation vs. Deleting a position</p></figcaption></figure>

It's important to note that deactivating a position only affects the output of the overall strategy. yet, the position's data remains available at its own outlet and can still be linked with other widgets.

<figure><img src="/files/vvncxeWv4LJmBF0ytQra" alt=""><figcaption><p>Output of a deactivated position</p></figcaption></figure>

[*Launch the App*](https://oss.thales-mfi.com/)

### Scenario Analysis

In the upper part of the widget, various mini-tools for shaping and analyzing scenarios for your strategy can be found.

### Underlying Price

To correctly calculate all strategy parameters, a uniform underlying asset price is required for all positions. It's important to note that changes in the underlying asset price can have different effects on the results of calculations, depending on whether *Option Price* or *Volatility* was set as input parameters for all positions.

For example, if you want to examine the impact of changes in the *Underlying Price* on the *Option prices* in the positions, you should have *Option Price* as the **output** and *Volatility* as the (constant) **input**. This takes changes in the underlying asset price into account while considering volatility as constant, and the *Option price* is calculated based on these parameters.

<figure><img src="/files/fgvllDjoW9uarHMqg4wC" alt=""><figcaption><p>Volatility as input for examining the impact of change in UP on Option Price</p></figcaption></figure>

Conversely, by setting *Option Price* as the (constant) input, you can examine the effects of changes in the *Underlying Price* on the *Implied Volatility*.

<figure><img src="/files/NFmLuyTkOmG1HvcTN9JY" alt=""><figcaption><p>Option Price as input for examining the impact of change in UP on IV</p></figcaption></figure>

{% hint style="info" %}
To dynamically adjust the underlying asset price, you can use a *Numeric Slider* Widget and link it to the input of *Underlying Price*.
{% endhint %}

[*Launch the App*](https://oss.thales-mfi.com/)

### Analyzing Volatility Changes

The impact of changes in volatility on the strategy can be easily and quickly examined using the *Volatility (% change)* slider.

<figure><img src="/files/zQwR93sJmlEZ7P9B1x9p" alt="" width="260"><figcaption></figcaption></figure>

The Strategy Builder widget includes a Volatility Adjustment feature that allows users to see how changes in implied volatility affect their overall strategy. By using the volatility slider, located in the upper part of the widget, users can adjust the implied volatility percentage. Moving the *Volatility Slider* makes the IV of all Option positions in the widget change between -99% (near-zero volatility) and 100% (twice the current value). Simultaneously, the Option prices for each position are calculated based on the new input parameters and displayed as output. This effect is best visualized using the *Graph* Widget.

<figure><img src="/files/pyfNnxwcpkYOkg9PEF1n" alt=""><figcaption><p>Examining the impacts of IV change on the Strategy is as simple as moving the slider.</p></figcaption></figure>

It's important to note that even if the parameters of a position are supplied from external widget(s), changing implied volatility by the slider makes recalculation in the option price.

The refresh button in the *Volatility slider* resets the implied volatility changes back to zero, restoring all values to their original state.

<figure><img src="/files/rLa4HGhMdk8MemLAyJEF" alt="" width="367"><figcaption><p>Resetting th IV changes</p></figcaption></figure>

{% hint style="info" %}
By clicking the slider once, you can subsequently make the smallest tick of change, namely 1%, using the up (∧) and down (∨) symbols, or the arrow keys on your keyboard.
{% endhint %}

<figure><img src="/files/Ld6fvJmszovBBkZHyXkv" alt="" width="253"><figcaption><p>Volatility Slider</p></figcaption></figure>

[*Launch the App*](https://oss.thales-mfi.com/)

### Changing Days Till Expiry

<figure><img src="/files/6NmH1IbLJxZOi6mZsDIO" alt=""><figcaption><p>Days Till Expiry Slider in SB</p></figcaption></figure>

By the *Days till expiry* slider, the number of days remaining until the Option's expiry date can be manually changed. This way, the changes in other parameters can be examined as the number of days till expiry changes.

The current date of the slider, known as the Valuation Date, is the date and time at which the current Option prices and the current unrealized profit or loss of the positions in a strategy are determined. The default value for the Valuation Date is the current date and time.

<figure><img src="/files/hzS0HgRcPSr1JDgImU9p" alt=""><figcaption><p>Changin Number of Days to Expiry to Examine its impacts on the strategy</p></figcaption></figure>

{% hint style="info" %}
The difference between the Valuation Date and the Expiry (Days till Expiry) is one of the input parameters of the Black-Scholes model for calculating option prices. This number is displayed under the slider as (xxx d xx h)
{% endhint %}

The farthest date on the slider is automatically set and cannot be adjusted manually. This date is determined by the earliest expiration date among the selected options in the positions within the strategy.

{% hint style="info" %}
If one of the positions in the widget is disabled (by unchecking the box at its right side) then the expiry of that position is excluded from the calculation of the slider.
{% endhint %}

The earliest date on the slider can be manually set using the calendar symbol<img src="/files/zZFNNWdbiayvh1WywOvG" alt="" data-size="line">.

&#x20;Valuation Date can also be manually changed by clicking on the calendar symbol <img src="/files/p2W2OgUuRIa0mfIZ2K9h" alt="" data-size="line"> below the slider. This will open a calendar that allows you to set the date and time.

Using the Reset symbol <img src="/files/jBuu6IXTvTyBGlfr0n1T" alt="" data-size="line"> the changes can simply be undone.

{% hint style="info" %}
By clicking the slider once, you can subsequently make the smallest tick of change, which is 1 day, using the arrow keys on your keyboard.
{% endhint %}

[*Launch the App*](https://oss.thales-mfi.com/)

### Some Errors in *SB*

### Input Fields

As with all other widgets, red-framed fields indicate that they need to be filled in for the widget to calculate its outputs correctly.

<figure><img src="/files/hykZw1vClRDcLjuBdxHb" alt=""><figcaption><p>Input fields</p></figcaption></figure>

### Error Message in Minimized State

If you notice an error message on the minimized widget, it means that an error or warning message has occurred in the widget. To identify and resolve the widget needs to be opened.

<figure><img src="/files/WdsmXjI10Ykh9MGrta9J" alt=""><figcaption><p>Error on Minimized Widget</p></figcaption></figure>

[*Launch the App*](https://oss.thales-mfi.com/)
