Logo

AdjustedBarrier

Updated 2023-11-14 19:40:14.267000

Syntax

SELECT [westclintech].[wct].[AdjustedBarrier](
  <@AssetPrice, float,>
 ,<@BarrierPrice, float,>
 ,<@Volatility, float,>
 ,<@Frequency, nvarchar(4000),>)

Description

Use the scalar function AdustedBarrier to convert an hourly, daily, weekly, or monthly barrier value to a continuous barrier value.

Arguments

@BarrierPrice

For a knock-in option, @BarrierPrice is the value at which the option comes into existence if the @AssetPrice crosses the barrier. For a knock-out option, @BarrierPrice is the value at which the option is extinguished if the @AssetPrice crosses the barrier. @BarrierPrice must be of a type float or of a type that implicitly converts to float.

@Frequency

identifies the monitoring frequency for the barrier. @Frequency is an expression of type nvarchar or of a type that can be implicitly converted to nvarchar. Use 'H' for hourly, 'D' for daily, 'W' for weekly, and 'M' for monthly.

@Volatility

the volatility of the relative price change of the underlying asset. @Volatility is an expression of type float or of a type that can be implicitly converted to float.

@AssetPrice

the price of the underlying asset. @AssetPrice is an expression of type float or of a type that can be implicitly converted to float.

Return Type

float

Remarks

@Volatility must be greater than zero (@Volatility > 0).

@AssetPrice must be greater than zero (@AssetPrice > 0).

@BarrierPrice must be greater than 0.

Examples

SELECT wct.AdjustedBarrier(   100, --AssetPrice
                              97,  --BarrierPrice
                              .20, --Volatility
                              'D'  --Frequency
                          ) as AdjustedBarrier;

This produces the following result.

{"columns":[{"field":"AdjustedBarrier","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"AdjustedBarrier":"96.4102036452333"}]}