# Black-Scholes

The *Black-Scholes (BS)* widget in Thales OSS leverages the Black-Scholes model, a cornerstone in Options pricing theory. This widget allows traders to input key parameters and receive immediate calculations of an Option's theoretical price and its Greeks, facilitating more precise and informed trading strategies.

<figure><img src="https://2274672748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxoTgQmpmRHyiptQrHhG%2Fuploads%2F7QZGGNPQm0NIEApTdLQf%2FBS%20General.png?alt=media&#x26;token=5cf417c6-3eaa-4bb9-a9b5-5b922e981324" alt=""><figcaption><p>A Black-Scholes widget</p></figcaption></figure>

Input values for the *BS* can be entered in two ways: directly (manually) into the provided fields, or indirectly through the input interface (inlets) which can receive data from external widgets. The output interface (outlet) of the *BS* widget can then be used to send the calculated data to other widgets for further processing or visualization.

<figure><img src="https://2274672748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxoTgQmpmRHyiptQrHhG%2Fuploads%2F1Dg3Elf3hdnZq7ngKCig%2FBs%20widget.png?alt=media&#x26;token=9b0bda1a-7e56-4deb-abd9-83fe434055fe" alt="" width="526"><figcaption><p>A Black-Scholes Widget Ready to Import and Export data via its Sockets (Inlets &#x26; Outlets)</p></figcaption></figure>

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

Two input parameters in the *BS* require special attention: Option Price and IV (implied volatility) or Volatility.

It's crucial to understand the relationship between Option Price and IV or Volatility. The Black-Scholes model used by this widget accepts either *Option Price* or *Volatility* as input and calculates the other parameter as an output. This means you can input only one of these parameters at a time, and the widget automatically computes the other value.

By toggling between *Option Price* and *Volatility*, you can specify which parameter to input, and which to calculate.

<figure><img src="https://2274672748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxoTgQmpmRHyiptQrHhG%2Fuploads%2FDfSupDUCeSqYvJ3DCG3o%2FBS%20IV%20vs%20Price.png?alt=media&#x26;token=46d4e099-b0a7-4701-a74a-c484234bd981" alt=""><figcaption><p>Either the Option Price (left) or the Volatility (right) should be selected as Input and the other will automatically be calculated.</p></figcaption></figure>

When switching between *Option Price* and *Volatility* in the *BS*, it may be observed that *Volatility* is sometimes referred to as IV (implied volatility), depending on the chosen input parameter. If *Option Price* is entered, the implied volatility is calculated based on this price and other inputs by the widget. This calculated volatility from the Black-Scholes model is known as "implied volatility". On the other hand, if *Volatility* is directly input, it represents an estimated or specified volatility that is not implied by market prices.

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

#### Greeks and Contract Values

At the bottom of the *BS*, there are two expandable sections: "Greeks" and "Contract Values". These sections can be expanded or collapsed by clicking on the respective arrow <img src="https://2274672748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxoTgQmpmRHyiptQrHhG%2Fuploads%2F7e2Lo9yLZFb7NM5nUt5m%2Fimage.png?alt=media&#x26;token=94970091-ba6b-4d0a-9d99-f9101e0dd605" alt="" data-size="line"> icon. Additional parameters of the modeled option, including the important Option metrics known as the "Greeks", are displayed in these sections as calculated by the model. In the "Contract Values" the intrinsic and extrinsic values of the contract is shown.

<figure><img src="https://2274672748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxoTgQmpmRHyiptQrHhG%2Fuploads%2FrBuGCfeUFt5NtNrX7ouS%2FBS%20Greeks%20and%20Contract.png?alt=media&#x26;token=254d0aff-aaf3-4f92-adcb-0ca1c35a964d" alt="" width="348"><figcaption><p>Greeks and Contract Values in <em>BS</em> widget</p></figcaption></figure>

When an O*ptions* widget is connected to the *BS* (thorough the sockets), the parameters of the Option are automatically transferred to it. The *BS* then calculates its output values based on these parameters. A major advantage of this method is the ability to have real-time Options data received directly and utilized for analysis or passed on to other widgets in the dashboard.

<figure><img src="https://2274672748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxoTgQmpmRHyiptQrHhG%2Fuploads%2FNMcDdxF4YhWf6WWe1t2B%2FBS%20Connection%20to%20Option.avif?alt=media&#x26;token=8a885cc6-73ea-4ee8-a78e-b60c91b5e748" alt=""><figcaption><p>Getting Real-Time Data from Option Widget</p></figcaption></figure>

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

#### Displaying the *BS*

In the upper right corner of the *BS*, there is a graph icon <img src="https://2274672748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxoTgQmpmRHyiptQrHhG%2Fuploads%2FbpTJoixuNCiOQlcguMib%2Fimage.png?alt=media&#x26;token=ff2796f4-3813-44ae-a879-15e425e484fa" alt="" data-size="line">. If this icon is clicked, a graph widget is automatically opened, which is then connected to the *BS* and visualizes the corresponding calculated data.

<figure><img src="https://2274672748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxoTgQmpmRHyiptQrHhG%2Fuploads%2FjDWgLgmqq8swJaB1raKg%2FBS%20to%20Graph.png?alt=media&#x26;token=46710677-9f45-49a8-827e-b183e6a9a9f6" alt=""><figcaption><p>Displaying the Graph of the <em>BS</em></p></figcaption></figure>

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

#### *BS* to Position

Clicking on the two arrows <img src="https://2274672748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxoTgQmpmRHyiptQrHhG%2Fuploads%2FMDdKQqoj77znKjqc2ibT%2Fimage.png?alt=media&#x26;token=42b021a2-bed1-4deb-a535-eceb3e455730" alt="" data-size="line"> in the top right corner of the *Black-Scholes* widget opens a box. The user can enter the side and size of a position. Subsequently, a *Position* widget, a *Strategy* widget, and a *Graph* widget are automatically created, displaying the Black-Scholes data as a position.

<figure><img src="https://2274672748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxoTgQmpmRHyiptQrHhG%2Fuploads%2FsFuEbcLKddsbBRD5OBzQ%2FBS%20Position%20Icon.png?alt=media&#x26;token=8bc4ad99-e626-4261-985e-7a32f7531e99" alt="" width="375"><figcaption><p>BS Can turn into Position using Position Icon</p></figcaption></figure>

<figure><img src="https://2274672748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxoTgQmpmRHyiptQrHhG%2Fuploads%2F0p36LFy66cEEWXp2lv34%2FBS%20to%20Position.png?alt=media&#x26;token=fee7541c-3fd3-42b4-8a08-6fef0bf3eebc" alt=""><figcaption><p>Turning a BS to a Positon by its included shortcut</p></figcaption></figure>

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

#### Connection to Other Widgets

The connection of the *Black-Scholes* widget to other widgets, such as the *Graph* widget or the *Position* widget, can also be achieved without using those icons mentioned above. This can be done through the *outlet* sockets of the *BS*, which can be linked to the *inlet* sockets of other widgets in the standard manner. This enables the calculated results and model parameters to be directly transmitted to the *Graph* widget or the *Position* widget for further analysis or position management.

A context menu appears when the outlet of the *BS*is right-clicked, providing a selection of widgets to which it can be connected.

<figure><img src="https://2274672748-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxoTgQmpmRHyiptQrHhG%2Fuploads%2FPrLtXfsE4CIYANGlRIEZ%2FBS%20Outlet.png?alt=media&#x26;token=dbe87572-a3c4-4659-8f07-968a1c63b66c" alt="" width="563"><figcaption><p>Linkable Widgets Appear by Right-Click on BS Outlet</p></figcaption></figure>

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