Class: OptionLab::Models::EngineData
- Defined in:
- lib/option_lab/models.rb
Overview
Engine Data for intermediate calculations
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#cost ⇒ Object
Returns the value of attribute cost.
-
#days_in_year ⇒ Object
Returns the value of attribute days_in_year.
-
#days_to_maturity ⇒ Object
Returns the value of attribute days_to_maturity.
-
#days_to_target ⇒ Object
Returns the value of attribute days_to_target.
-
#delta ⇒ Object
Returns the value of attribute delta.
-
#expected_loss ⇒ Object
Returns the value of attribute expected_loss.
-
#expected_profit ⇒ Object
Returns the value of attribute expected_profit.
-
#gamma ⇒ Object
Returns the value of attribute gamma.
-
#implied_volatility ⇒ Object
Returns the value of attribute implied_volatility.
-
#inputs ⇒ Object
Returns the value of attribute inputs.
-
#itm_probability ⇒ Object
Returns the value of attribute itm_probability.
-
#loss_limit_probability ⇒ Object
Returns the value of attribute loss_limit_probability.
-
#loss_limit_ranges ⇒ Object
Returns the value of attribute loss_limit_ranges.
-
#n ⇒ Object
Returns the value of attribute n.
-
#premium ⇒ Object
Returns the value of attribute premium.
-
#previous_position ⇒ Object
Returns the value of attribute previous_position.
-
#profit ⇒ Object
Returns the value of attribute profit.
-
#profit_mc ⇒ Object
Returns the value of attribute profit_mc.
-
#profit_probability ⇒ Object
Returns the value of attribute profit_probability.
-
#profit_ranges ⇒ Object
Returns the value of attribute profit_ranges.
-
#profit_target_probability ⇒ Object
Returns the value of attribute profit_target_probability.
-
#profit_target_ranges ⇒ Object
Returns the value of attribute profit_target_ranges.
-
#rho ⇒ Object
Returns the value of attribute rho.
-
#stock_price_array ⇒ Object
Returns the value of attribute stock_price_array.
-
#strategy_profit ⇒ Object
Returns the value of attribute strategy_profit.
-
#strategy_profit_mc ⇒ Object
Returns the value of attribute strategy_profit_mc.
-
#strike ⇒ Object
Returns the value of attribute strike.
-
#terminal_stock_prices ⇒ Object
Returns the value of attribute terminal_stock_prices.
-
#theta ⇒ Object
Returns the value of attribute theta.
-
#type ⇒ Object
Returns the value of attribute type.
-
#use_bs ⇒ Object
Returns the value of attribute use_bs.
-
#vega ⇒ Object
Returns the value of attribute vega.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ EngineData
constructor
A new instance of EngineData.
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
#action ⇒ Object
Returns the value of attribute action.
82 83 84 |
# File 'lib/option_lab/models.rb', line 82 def action @action end |
#cost ⇒ Object
Returns the value of attribute cost.
82 83 84 |
# File 'lib/option_lab/models.rb', line 82 def cost @cost end |
#days_in_year ⇒ Object
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_maturity ⇒ Object
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_target ⇒ Object
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 |
#delta ⇒ Object
Returns the value of attribute delta.
82 83 84 |
# File 'lib/option_lab/models.rb', line 82 def delta @delta end |
#expected_loss ⇒ Object
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_profit ⇒ Object
Returns the value of attribute expected_profit.
82 83 84 |
# File 'lib/option_lab/models.rb', line 82 def expected_profit @expected_profit end |
#gamma ⇒ Object
Returns the value of attribute gamma.
82 83 84 |
# File 'lib/option_lab/models.rb', line 82 def gamma @gamma end |
#implied_volatility ⇒ Object
Returns the value of attribute implied_volatility.
82 83 84 |
# File 'lib/option_lab/models.rb', line 82 def implied_volatility @implied_volatility end |
#inputs ⇒ Object
Returns the value of attribute inputs.
82 83 84 |
# File 'lib/option_lab/models.rb', line 82 def inputs @inputs end |
#itm_probability ⇒ Object
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_probability ⇒ Object
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_ranges ⇒ Object
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 |
#n ⇒ Object
Returns the value of attribute n.
82 83 84 |
# File 'lib/option_lab/models.rb', line 82 def n @n end |
#premium ⇒ Object
Returns the value of attribute premium.
82 83 84 |
# File 'lib/option_lab/models.rb', line 82 def premium @premium end |
#previous_position ⇒ Object
Returns the value of attribute previous_position.
82 83 84 |
# File 'lib/option_lab/models.rb', line 82 def previous_position @previous_position end |
#profit ⇒ Object
Returns the value of attribute profit.
82 83 84 |
# File 'lib/option_lab/models.rb', line 82 def profit @profit end |
#profit_mc ⇒ Object
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_probability ⇒ Object
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_ranges ⇒ Object
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_probability ⇒ Object
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_ranges ⇒ Object
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 |
#rho ⇒ Object
Returns the value of attribute rho.
82 83 84 |
# File 'lib/option_lab/models.rb', line 82 def rho @rho end |
#stock_price_array ⇒ Object
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_profit ⇒ Object
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_mc ⇒ Object
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 |
#strike ⇒ Object
Returns the value of attribute strike.
82 83 84 |
# File 'lib/option_lab/models.rb', line 82 def strike @strike end |
#terminal_stock_prices ⇒ Object
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 |
#theta ⇒ Object
Returns the value of attribute theta.
82 83 84 |
# File 'lib/option_lab/models.rb', line 82 def theta @theta end |
#type ⇒ Object
Returns the value of attribute type.
82 83 84 |
# File 'lib/option_lab/models.rb', line 82 def type @type end |
#use_bs ⇒ Object
Returns the value of attribute use_bs.
82 83 84 |
# File 'lib/option_lab/models.rb', line 82 def use_bs @use_bs end |
#vega ⇒ Object
Returns the value of attribute vega.
82 83 84 |
# File 'lib/option_lab/models.rb', line 82 def vega @vega end |