Creating an option property

Considering the market volatility, we need to be a bit more realistic, because any longer-term prediction is quite unreliable. The reason is that it would fall outside the constraint of the discrete Markov model. So, suppose we want to predict the price for next two days—that is, N= 2. That means the price of the option two days in the future is the value of the reward profit or loss. So, let us encapsulate the following four parameters:

  • timeToExp: Time left until expiration as a percentage of the overall duration of the option
  • Volatility normalized Relative volatility of the underlying security for a given trading session
  • vltyByVol: Volatility of the underlying security for a given trading session relative to a trading volume for the session
  • priceToStrike: Price of the underlying security relative to the Strike price for a given trading session

The OptionProperty class defines the property of a traded option on a security. The constructor creates the property for an option:

class OptionProperty(timeToExp: Double,volatility: Double,vltyByVol: Double,priceToStrike: Double) {
val toArray = Array[Double](timeToExp, volatility, vltyByVol, priceToStrike)
require(timeToExp > 0.01, s"OptionProperty time to expiration found $timeToExp required 0.01")
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset