Class: OptionLab::Models::Outputs
- Defined in:
- lib/option_lab/models.rb
Overview
Strategy outputs model
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#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.
-
#in_the_money_probability ⇒ Object
Returns the value of attribute in_the_money_probability.
-
#inputs ⇒ Object
Returns the value of attribute inputs.
-
#loss_limit_ranges ⇒ Object
Returns the value of attribute loss_limit_ranges.
-
#maximum_return_in_the_domain ⇒ Object
Returns the value of attribute maximum_return_in_the_domain.
-
#minimum_return_in_the_domain ⇒ Object
Returns the value of attribute minimum_return_in_the_domain.
-
#per_leg_cost ⇒ Object
Returns the value of attribute per_leg_cost.
-
#probability_of_loss_limit ⇒ Object
Returns the value of attribute probability_of_loss_limit.
-
#probability_of_profit ⇒ Object
Returns the value of attribute probability_of_profit.
-
#probability_of_profit_target ⇒ Object
Returns the value of attribute probability_of_profit_target.
-
#profit_ranges ⇒ Object
Returns the value of attribute profit_ranges.
-
#profit_target_ranges ⇒ Object
Returns the value of attribute profit_target_ranges.
-
#rho ⇒ Object
Returns the value of attribute rho.
-
#strategy_cost ⇒ Object
Returns the value of attribute strategy_cost.
-
#theta ⇒ Object
Returns the value of attribute theta.
-
#vega ⇒ Object
Returns the value of attribute vega.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Outputs
constructor
A new instance of Outputs.
- #to_s ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Outputs
Returns a new instance of Outputs.
448 449 450 451 452 453 454 455 456 |
# File 'lib/option_lab/models.rb', line 448 def initialize(attributes = {}) # Set defaults @probability_of_profit_target = 0.0 @profit_target_ranges = [] @probability_of_loss_limit = 0.0 @loss_limit_ranges = [] super(attributes) end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
426 427 428 |
# File 'lib/option_lab/models.rb', line 426 def data @data end |
#delta ⇒ Object
Returns the value of attribute delta.
426 427 428 |
# File 'lib/option_lab/models.rb', line 426 def delta @delta end |
#expected_loss ⇒ Object
Returns the value of attribute expected_loss.
426 427 428 |
# File 'lib/option_lab/models.rb', line 426 def expected_loss @expected_loss end |
#expected_profit ⇒ Object
Returns the value of attribute expected_profit.
426 427 428 |
# File 'lib/option_lab/models.rb', line 426 def expected_profit @expected_profit end |
#gamma ⇒ Object
Returns the value of attribute gamma.
426 427 428 |
# File 'lib/option_lab/models.rb', line 426 def gamma @gamma end |
#implied_volatility ⇒ Object
Returns the value of attribute implied_volatility.
426 427 428 |
# File 'lib/option_lab/models.rb', line 426 def implied_volatility @implied_volatility end |
#in_the_money_probability ⇒ Object
Returns the value of attribute in_the_money_probability.
426 427 428 |
# File 'lib/option_lab/models.rb', line 426 def in_the_money_probability @in_the_money_probability end |
#inputs ⇒ Object
Returns the value of attribute inputs.
426 427 428 |
# File 'lib/option_lab/models.rb', line 426 def inputs @inputs end |
#loss_limit_ranges ⇒ Object
Returns the value of attribute loss_limit_ranges.
426 427 428 |
# File 'lib/option_lab/models.rb', line 426 def loss_limit_ranges @loss_limit_ranges end |
#maximum_return_in_the_domain ⇒ Object
Returns the value of attribute maximum_return_in_the_domain.
426 427 428 |
# File 'lib/option_lab/models.rb', line 426 def maximum_return_in_the_domain @maximum_return_in_the_domain end |
#minimum_return_in_the_domain ⇒ Object
Returns the value of attribute minimum_return_in_the_domain.
426 427 428 |
# File 'lib/option_lab/models.rb', line 426 def minimum_return_in_the_domain @minimum_return_in_the_domain end |
#per_leg_cost ⇒ Object
Returns the value of attribute per_leg_cost.
426 427 428 |
# File 'lib/option_lab/models.rb', line 426 def per_leg_cost @per_leg_cost end |
#probability_of_loss_limit ⇒ Object
Returns the value of attribute probability_of_loss_limit.
426 427 428 |
# File 'lib/option_lab/models.rb', line 426 def probability_of_loss_limit @probability_of_loss_limit end |
#probability_of_profit ⇒ Object
Returns the value of attribute probability_of_profit.
426 427 428 |
# File 'lib/option_lab/models.rb', line 426 def probability_of_profit @probability_of_profit end |
#probability_of_profit_target ⇒ Object
Returns the value of attribute probability_of_profit_target.
426 427 428 |
# File 'lib/option_lab/models.rb', line 426 def probability_of_profit_target @probability_of_profit_target end |
#profit_ranges ⇒ Object
Returns the value of attribute profit_ranges.
426 427 428 |
# File 'lib/option_lab/models.rb', line 426 def profit_ranges @profit_ranges end |
#profit_target_ranges ⇒ Object
Returns the value of attribute profit_target_ranges.
426 427 428 |
# File 'lib/option_lab/models.rb', line 426 def profit_target_ranges @profit_target_ranges end |
#rho ⇒ Object
Returns the value of attribute rho.
426 427 428 |
# File 'lib/option_lab/models.rb', line 426 def rho @rho end |
#strategy_cost ⇒ Object
Returns the value of attribute strategy_cost.
426 427 428 |
# File 'lib/option_lab/models.rb', line 426 def strategy_cost @strategy_cost end |
#theta ⇒ Object
Returns the value of attribute theta.
426 427 428 |
# File 'lib/option_lab/models.rb', line 426 def theta @theta end |
#vega ⇒ Object
Returns the value of attribute vega.
426 427 428 |
# File 'lib/option_lab/models.rb', line 426 def vega @vega end |
Instance Method Details
#to_s ⇒ Object
458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 |
# File 'lib/option_lab/models.rb', line 458 def to_s result = "Probability of profit: #{probability_of_profit}\n" result += "Expected profit: #{expected_profit}\n" if expected_profit result += "Expected loss: #{expected_loss}\n" if expected_loss result += "Strategy cost: #{strategy_cost}\n" result += "Min return: #{minimum_return_in_the_domain}\n" result += "Max return: #{maximum_return_in_the_domain}\n" if probability_of_profit_target > 0.0 result += "Probability of reaching profit target: #{probability_of_profit_target}\n" end if probability_of_loss_limit > 0.0 result += "Probability of reaching loss limit: #{probability_of_loss_limit}\n" end result end |