[R-sig-finance] Accessing the Option Price in CashorNothingOption

Diethelm Wuertz wuertz at itp.phys.ethz.ch
Thu May 4 08:05:53 CEST 2006


CashOrNothingOption() returns as all other options an S4
object.

CashOrNothingOption("p",100,30,50,5,.05,0,.2)@parameters

returns a list of all parameters

CashOrNothingOption("p",100,30,50,5,.05,0,.2)@parameters$sigma

returns a specific parameter, here sigma

The price has its own slot

CashOrNothingOption("p",100,30,50,5,.05,0,.2)@price

returns the price of the option.


DW





Wojciech Slusarski wrote:

>Hi,
>
>Try the one below:
>
>CashOrNothingOption("p",100,30,50,5,.05,0,.2)@price
>
>should work.
>
>Best regards,
>Wojtek
>
>2006/5/2, Uzuner, Tolga <tolga.uzuner at credit-suisse.com>:
>  
>
>>>Dear R-sig-finance members,
>>>
>>>I am trying to use the CashorNothingOption , and would like to access the Option Price directly.
>>>
>>>When I use CashorNothingOption, I am being given back the following:
>>>
>>>      
>>>
>>>>CashOrNothingOption("p",100,30,50,5,.05,0,.2)
>>>>        
>>>>
>>>Title:
>>>Cash Or Nothing Option
>>>
>>>Call:
>>>CashOrNothingOption(TypeFlag = "p", S = 100, X = 30, K = 50,
>>>    Time = 5, r = 0.05, b = 0, sigma = 0.2)
>>>
>>>Parameters:
>>>         Value:
>>>TypeFlag p
>>>S        100
>>>X        30
>>>K        50
>>>Time     5
>>>r        0.05
>>>b        0
>>>sigma    0.2
>>>
>>>Option Price:
>>>0.2641278
>>>
>>>Description:
>>>Tue May 02 12:46:07 2006
>>>
>>>How can I access the Option Price by assigning it's value to a variable so that I can multiply it by something else ?
>>>
>>>Assuming the formula returned a list, I tried a number of things, none of which worked:
>>>
>>>      
>>>
>>>>CashOrNothingOption("p",100,30,50,5,.05,0,.2)$par
>>>>        
>>>>
>>>NULL
>>>      
>>>
>>>>CashOrNothingOption("p",100,30,50,5,.05,0,.2)$price
>>>>        
>>>>
>>>NULL
>>>      
>>>
>>>>CashOrNothingOption("p",100,30,50,5,.05,0,.2)$OptionPrice
>>>>        
>>>>
>>>NULL
>>>      
>>>
>>>The documentation just says:
>>>
>>>...
>>>Value:
>>>
>>>     The option price, a numeric value.
>>>....
>>>
>>>which is not very revealing, neither does it seem to be true !
>>>
>>>Many thanks in advance,
>>>Tolga
>>>
>>>      
>>>
>>==============================================================================
>>Please access the attached hyperlink for an important electr...{{dropped}}
>>
>>_______________________________________________
>>R-sig-finance at stat.math.ethz.ch mailing list
>>https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>>
>>    
>>
>
>_______________________________________________
>R-sig-finance at stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>
>  
>



More information about the R-sig-finance mailing list