Class: OptionLab::Models::EngineData

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/option_lab/models.rb

Overview

Engine Data for intermediate calculations

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ EngineData

Returns a new instance of EngineData.



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/option_lab/models.rb', line 116

def initialize(attributes = {})
  # Initialize arrays
  @days_to_maturity = []
  @type = []
  @strike = []
  @premium = []
  @n = []
  @action = []
  @use_bs = []
  @previous_position = []
  @implied_volatility = []
  @itm_probability = []
  @delta = []
  @gamma = []
  @theta = []
  @vega = []
  @rho = []

  # Initialize other fields
  @profit_probability = 0.0
  @profit_target_probability = 0.0
  @loss_limit_probability = 0.0
  @expected_profit = 0.0
  @expected_loss = 0.0
  @profit_ranges = []
  @profit_target_ranges = []
  @loss_limit_ranges = []

  super(attributes)
end

Instance Attribute Details

#actionObject

Returns the value of attribute action.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def action
  @action
end

#costObject

Returns the value of attribute cost.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def cost
  @cost
end

#days_in_yearObject

Returns the value of attribute days_in_year.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def days_in_year
  @days_in_year
end

#days_to_maturityObject

Returns the value of attribute days_to_maturity.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def days_to_maturity
  @days_to_maturity
end

#days_to_targetObject

Returns the value of attribute days_to_target.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def days_to_target
  @days_to_target
end

#deltaObject

Returns the value of attribute delta.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def delta
  @delta
end

#expected_lossObject

Returns the value of attribute expected_loss.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def expected_loss
  @expected_loss
end

#expected_profitObject

Returns the value of attribute expected_profit.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def expected_profit
  @expected_profit
end

#gammaObject

Returns the value of attribute gamma.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def gamma
  @gamma
end

#implied_volatilityObject

Returns the value of attribute implied_volatility.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def implied_volatility
  @implied_volatility
end

#inputsObject

Returns the value of attribute inputs.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def inputs
  @inputs
end

#itm_probabilityObject

Returns the value of attribute itm_probability.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def itm_probability
  @itm_probability
end

#loss_limit_probabilityObject

Returns the value of attribute loss_limit_probability.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def loss_limit_probability
  @loss_limit_probability
end

#loss_limit_rangesObject

Returns the value of attribute loss_limit_ranges.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def loss_limit_ranges
  @loss_limit_ranges
end

#nObject

Returns the value of attribute n.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def n
  @n
end

#premiumObject

Returns the value of attribute premium.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def premium
  @premium
end

#previous_positionObject

Returns the value of attribute previous_position.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def previous_position
  @previous_position
end

#profitObject

Returns the value of attribute profit.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def profit
  @profit
end

#profit_mcObject

Returns the value of attribute profit_mc.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def profit_mc
  @profit_mc
end

#profit_probabilityObject

Returns the value of attribute profit_probability.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def profit_probability
  @profit_probability
end

#profit_rangesObject

Returns the value of attribute profit_ranges.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def profit_ranges
  @profit_ranges
end

#profit_target_probabilityObject

Returns the value of attribute profit_target_probability.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def profit_target_probability
  @profit_target_probability
end

#profit_target_rangesObject

Returns the value of attribute profit_target_ranges.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def profit_target_ranges
  @profit_target_ranges
end

#rhoObject

Returns the value of attribute rho.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def rho
  @rho
end

#stock_price_arrayObject

Returns the value of attribute stock_price_array.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def stock_price_array
  @stock_price_array
end

#strategy_profitObject

Returns the value of attribute strategy_profit.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def strategy_profit
  @strategy_profit
end

#strategy_profit_mcObject

Returns the value of attribute strategy_profit_mc.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def strategy_profit_mc
  @strategy_profit_mc
end

#strikeObject

Returns the value of attribute strike.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def strike
  @strike
end

#terminal_stock_pricesObject

Returns the value of attribute terminal_stock_prices.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def terminal_stock_prices
  @terminal_stock_prices
end

#thetaObject

Returns the value of attribute theta.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def theta
  @theta
end

#typeObject

Returns the value of attribute type.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def type
  @type
end

#use_bsObject

Returns the value of attribute use_bs.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def use_bs
  @use_bs
end

#vegaObject

Returns the value of attribute vega.



82
83
84
# File 'lib/option_lab/models.rb', line 82

def vega
  @vega
end