Class: SchwabRb::DataObjects::Option
- Inherits:
-
Object
- Object
- SchwabRb::DataObjects::Option
- Defined in:
- lib/schwab_rb/data_objects/option.rb
Instance Attribute Summary collapse
-
#ask ⇒ Object
readonly
Returns the value of attribute ask.
-
#ask_size ⇒ Object
readonly
Returns the value of attribute ask_size.
-
#bid ⇒ Object
readonly
Returns the value of attribute bid.
-
#bid_ask_size ⇒ Object
readonly
Returns the value of attribute bid_ask_size.
-
#bid_size ⇒ Object
readonly
Returns the value of attribute bid_size.
-
#close_price ⇒ Object
readonly
Returns the value of attribute close_price.
-
#days_to_expiration ⇒ Object
readonly
Returns the value of attribute days_to_expiration.
-
#deliverable_note ⇒ Object
readonly
Returns the value of attribute deliverable_note.
-
#delta ⇒ Object
readonly
Returns the value of attribute delta.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#exchange_name ⇒ Object
readonly
Returns the value of attribute exchange_name.
-
#exercise_type ⇒ Object
readonly
Returns the value of attribute exercise_type.
-
#expiration_date ⇒ Object
readonly
Returns the value of attribute expiration_date.
-
#expiration_type ⇒ Object
readonly
Returns the value of attribute expiration_type.
-
#extrinsic_value ⇒ Object
readonly
Returns the value of attribute extrinsic_value.
-
#gamma ⇒ Object
readonly
Returns the value of attribute gamma.
-
#high_52_week ⇒ Object
readonly
Returns the value of attribute high_52_week.
-
#high_price ⇒ Object
readonly
Returns the value of attribute high_price.
-
#in_the_money ⇒ Object
readonly
Returns the value of attribute in_the_money.
-
#intrinsic_value ⇒ Object
readonly
Returns the value of attribute intrinsic_value.
-
#last ⇒ Object
readonly
Returns the value of attribute last.
-
#last_size ⇒ Object
readonly
Returns the value of attribute last_size.
-
#last_trading_day ⇒ Object
readonly
Returns the value of attribute last_trading_day.
-
#low_52_week ⇒ Object
readonly
Returns the value of attribute low_52_week.
-
#low_price ⇒ Object
readonly
Returns the value of attribute low_price.
-
#mark ⇒ Object
readonly
Returns the value of attribute mark.
-
#mark_change ⇒ Object
readonly
Returns the value of attribute mark_change.
-
#mark_percent_change ⇒ Object
readonly
Returns the value of attribute mark_percent_change.
-
#multiplier ⇒ Object
readonly
Returns the value of attribute multiplier.
-
#net_change ⇒ Object
readonly
Returns the value of attribute net_change.
-
#non_standard ⇒ Object
readonly
Returns the value of attribute non_standard.
-
#open_interest ⇒ Object
readonly
Returns the value of attribute open_interest.
-
#open_price ⇒ Object
readonly
Returns the value of attribute open_price.
-
#option_deliverables_list ⇒ Object
readonly
Returns the value of attribute option_deliverables_list.
-
#option_root ⇒ Object
readonly
Returns the value of attribute option_root.
-
#percent_change ⇒ Object
readonly
Returns the value of attribute percent_change.
-
#put_call ⇒ Object
readonly
Returns the value of attribute put_call.
-
#quote_time_in_long ⇒ Object
readonly
Returns the value of attribute quote_time_in_long.
-
#rho ⇒ Object
readonly
Returns the value of attribute rho.
-
#settlement_type ⇒ Object
readonly
Returns the value of attribute settlement_type.
-
#strike ⇒ Object
readonly
Returns the value of attribute strike.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
-
#theoretical_option_value ⇒ Object
readonly
Returns the value of attribute theoretical_option_value.
-
#theoretical_volatility ⇒ Object
readonly
Returns the value of attribute theoretical_volatility.
-
#theta ⇒ Object
readonly
Returns the value of attribute theta.
-
#time_value ⇒ Object
readonly
Returns the value of attribute time_value.
-
#total_volume ⇒ Object
readonly
Returns the value of attribute total_volume.
-
#trade_time_in_long ⇒ Object
readonly
Returns the value of attribute trade_time_in_long.
-
#underlying_symbol ⇒ Object
readonly
Returns the value of attribute underlying_symbol.
-
#vega ⇒ Object
readonly
Returns the value of attribute vega.
-
#volatility ⇒ Object
readonly
Returns the value of attribute volatility.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(symbol:, underlying_symbol:, description:, strike:, put_call:, exchange_name:, bid:, ask:, last:, mark:, bid_size:, ask_size:, bid_ask_size:, last_size:, high_price:, low_price:, open_price:, close_price:, total_volume:, trade_time_in_long:, quote_time_in_long:, net_change:, volatility:, delta:, gamma:, theta:, vega:, rho:, open_interest:, time_value:, theoretical_option_value:, theoretical_volatility:, option_deliverables_list:, expiration_date:, days_to_expiration:, expiration_type:, last_trading_day:, multiplier:, settlement_type:, deliverable_note:, percent_change:, mark_change:, mark_percent_change:, intrinsic_value:, extrinsic_value:, option_root:, exercise_type:, high_52_week:, low_52_week:, non_standard:, in_the_money:) ⇒ Option
constructor
A new instance of Option.
- #strike_price ⇒ Object
Constructor Details
#initialize(symbol:, underlying_symbol:, description:, strike:, put_call:, exchange_name:, bid:, ask:, last:, mark:, bid_size:, ask_size:, bid_ask_size:, last_size:, high_price:, low_price:, open_price:, close_price:, total_volume:, trade_time_in_long:, quote_time_in_long:, net_change:, volatility:, delta:, gamma:, theta:, vega:, rho:, open_interest:, time_value:, theoretical_option_value:, theoretical_volatility:, option_deliverables_list:, expiration_date:, days_to_expiration:, expiration_type:, last_trading_day:, multiplier:, settlement_type:, deliverable_note:, percent_change:, mark_change:, mark_percent_change:, intrinsic_value:, extrinsic_value:, option_root:, exercise_type:, high_52_week:, low_52_week:, non_standard:, in_the_money:) ⇒ Option
Returns a new instance of Option.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/schwab_rb/data_objects/option.rb', line 67 def initialize( symbol:, underlying_symbol:, description:, strike:, put_call:, exchange_name:, bid:, ask:, last:, mark:, bid_size:, ask_size:, bid_ask_size:, last_size:, high_price:, low_price:, open_price:, close_price:, total_volume:, trade_time_in_long:, quote_time_in_long:, net_change:, volatility:, delta:, gamma:, theta:, vega:, rho:, open_interest:, time_value:, theoretical_option_value:, theoretical_volatility:, option_deliverables_list:, expiration_date:, days_to_expiration:, expiration_type:, last_trading_day:, multiplier:, settlement_type:, deliverable_note:, percent_change:, mark_change:, mark_percent_change:, intrinsic_value:, extrinsic_value:, option_root:, exercise_type:, high_52_week:, low_52_week:, non_standard:, in_the_money: ) @symbol = symbol @underlying_symbol = @description = description @strike = strike @put_call = put_call @exchange_name = exchange_name @bid = bid @ask = ask @last = last @mark = mark @bid_size = bid_size @ask_size = ask_size @bid_ask_size = bid_ask_size @last_size = last_size @high_price = high_price @low_price = low_price @open_price = open_price @close_price = close_price @total_volume = total_volume @trade_time_in_long = trade_time_in_long @quote_time_in_long = quote_time_in_long @net_change = net_change @volatility = volatility @delta = delta @gamma = gamma @theta = theta @vega = vega @rho = rho @open_interest = open_interest @time_value = time_value @theoretical_option_value = theoretical_option_value @theoretical_volatility = theoretical_volatility @option_deliverables_list = option_deliverables_list @expiration_date = expiration_date @days_to_expiration = days_to_expiration @expiration_type = expiration_type @last_trading_day = last_trading_day @multiplier = multiplier @settlement_type = settlement_type @deliverable_note = deliverable_note @percent_change = percent_change @mark_change = mark_change @mark_percent_change = mark_percent_change @intrinsic_value = intrinsic_value @extrinsic_value = extrinsic_value @option_root = option_root @exercise_type = exercise_type @high_52_week = high_52_week @low_52_week = low_52_week @non_standard = non_standard @in_the_money = in_the_money end |
Instance Attribute Details
#ask ⇒ Object (readonly)
Returns the value of attribute ask.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def ask @ask end |
#ask_size ⇒ Object (readonly)
Returns the value of attribute ask_size.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def ask_size @ask_size end |
#bid ⇒ Object (readonly)
Returns the value of attribute bid.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def bid @bid end |
#bid_ask_size ⇒ Object (readonly)
Returns the value of attribute bid_ask_size.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def bid_ask_size @bid_ask_size end |
#bid_size ⇒ Object (readonly)
Returns the value of attribute bid_size.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def bid_size @bid_size end |
#close_price ⇒ Object (readonly)
Returns the value of attribute close_price.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def close_price @close_price end |
#days_to_expiration ⇒ Object (readonly)
Returns the value of attribute days_to_expiration.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def days_to_expiration @days_to_expiration end |
#deliverable_note ⇒ Object (readonly)
Returns the value of attribute deliverable_note.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def deliverable_note @deliverable_note end |
#delta ⇒ Object (readonly)
Returns the value of attribute delta.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def delta @delta end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def description @description end |
#exchange_name ⇒ Object (readonly)
Returns the value of attribute exchange_name.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def exchange_name @exchange_name end |
#exercise_type ⇒ Object (readonly)
Returns the value of attribute exercise_type.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def exercise_type @exercise_type end |
#expiration_date ⇒ Object (readonly)
Returns the value of attribute expiration_date.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def expiration_date @expiration_date end |
#expiration_type ⇒ Object (readonly)
Returns the value of attribute expiration_type.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def expiration_type @expiration_type end |
#extrinsic_value ⇒ Object (readonly)
Returns the value of attribute extrinsic_value.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def extrinsic_value @extrinsic_value end |
#gamma ⇒ Object (readonly)
Returns the value of attribute gamma.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def gamma @gamma end |
#high_52_week ⇒ Object (readonly)
Returns the value of attribute high_52_week.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def high_52_week @high_52_week end |
#high_price ⇒ Object (readonly)
Returns the value of attribute high_price.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def high_price @high_price end |
#in_the_money ⇒ Object (readonly)
Returns the value of attribute in_the_money.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def in_the_money @in_the_money end |
#intrinsic_value ⇒ Object (readonly)
Returns the value of attribute intrinsic_value.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def intrinsic_value @intrinsic_value end |
#last ⇒ Object (readonly)
Returns the value of attribute last.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def last @last end |
#last_size ⇒ Object (readonly)
Returns the value of attribute last_size.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def last_size @last_size end |
#last_trading_day ⇒ Object (readonly)
Returns the value of attribute last_trading_day.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def last_trading_day @last_trading_day end |
#low_52_week ⇒ Object (readonly)
Returns the value of attribute low_52_week.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def low_52_week @low_52_week end |
#low_price ⇒ Object (readonly)
Returns the value of attribute low_price.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def low_price @low_price end |
#mark ⇒ Object (readonly)
Returns the value of attribute mark.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def mark @mark end |
#mark_change ⇒ Object (readonly)
Returns the value of attribute mark_change.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def mark_change @mark_change end |
#mark_percent_change ⇒ Object (readonly)
Returns the value of attribute mark_percent_change.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def mark_percent_change @mark_percent_change end |
#multiplier ⇒ Object (readonly)
Returns the value of attribute multiplier.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def multiplier @multiplier end |
#net_change ⇒ Object (readonly)
Returns the value of attribute net_change.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def net_change @net_change end |
#non_standard ⇒ Object (readonly)
Returns the value of attribute non_standard.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def non_standard @non_standard end |
#open_interest ⇒ Object (readonly)
Returns the value of attribute open_interest.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def open_interest @open_interest end |
#open_price ⇒ Object (readonly)
Returns the value of attribute open_price.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def open_price @open_price end |
#option_deliverables_list ⇒ Object (readonly)
Returns the value of attribute option_deliverables_list.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def option_deliverables_list @option_deliverables_list end |
#option_root ⇒ Object (readonly)
Returns the value of attribute option_root.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def option_root @option_root end |
#percent_change ⇒ Object (readonly)
Returns the value of attribute percent_change.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def percent_change @percent_change end |
#put_call ⇒ Object (readonly)
Returns the value of attribute put_call.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def put_call @put_call end |
#quote_time_in_long ⇒ Object (readonly)
Returns the value of attribute quote_time_in_long.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def quote_time_in_long @quote_time_in_long end |
#rho ⇒ Object (readonly)
Returns the value of attribute rho.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def rho @rho end |
#settlement_type ⇒ Object (readonly)
Returns the value of attribute settlement_type.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def settlement_type @settlement_type end |
#strike ⇒ Object (readonly)
Returns the value of attribute strike.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def strike @strike end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def symbol @symbol end |
#theoretical_option_value ⇒ Object (readonly)
Returns the value of attribute theoretical_option_value.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def theoretical_option_value @theoretical_option_value end |
#theoretical_volatility ⇒ Object (readonly)
Returns the value of attribute theoretical_volatility.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def theoretical_volatility @theoretical_volatility end |
#theta ⇒ Object (readonly)
Returns the value of attribute theta.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def theta @theta end |
#time_value ⇒ Object (readonly)
Returns the value of attribute time_value.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def time_value @time_value end |
#total_volume ⇒ Object (readonly)
Returns the value of attribute total_volume.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def total_volume @total_volume end |
#trade_time_in_long ⇒ Object (readonly)
Returns the value of attribute trade_time_in_long.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def trade_time_in_long @trade_time_in_long end |
#underlying_symbol ⇒ Object (readonly)
Returns the value of attribute underlying_symbol.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def @underlying_symbol end |
#vega ⇒ Object (readonly)
Returns the value of attribute vega.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def vega @vega end |
#volatility ⇒ Object (readonly)
Returns the value of attribute volatility.
131 132 133 |
# File 'lib/schwab_rb/data_objects/option.rb', line 131 def volatility @volatility end |
Class Method Details
.build(underyling_symbol, data) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/schwab_rb/data_objects/option.rb', line 10 def build(underyling_symbol, data) Option.new( symbol: data.fetch(:symbol), underlying_symbol: underyling_symbol, description: data.fetch(:description), strike: data.fetch(:strikePrice), put_call: data.fetch(:putCall), exchange_name: data.fetch(:exchangeName, nil), bid: data.fetch(:bid), ask: data.fetch(:ask), last: data.fetch(:last), mark: data.fetch(:mark), bid_size: data.fetch(:bidSize, nil), ask_size: data.fetch(:askSize, nil), bid_ask_size: data.fetch(:bidAskSize, nil), last_size: data.fetch(:lastSize, nil), high_price: data.fetch(:highPrice, nil), low_price: data.fetch(:lowPrice, nil), open_price: data.fetch(:openPrice, nil), close_price: data.fetch(:closePrice, nil), total_volume: data.fetch(:totalVolume, nil), trade_time_in_long: data.fetch(:tradeTimeInLong, nil), quote_time_in_long: data.fetch(:quoteTimeInLong, nil), net_change: data.fetch(:netChange, nil), volatility: data.fetch(:volatility, nil), delta: data.fetch(:delta, nil), gamma: data.fetch(:gamma, nil), theta: data.fetch(:theta, nil), vega: data.fetch(:vega, nil), rho: data.fetch(:rho, nil), open_interest: data.fetch(:openInterest, nil), time_value: data.fetch(:timeValue, nil), theoretical_option_value: data.fetch(:theoreticalOptionValue, nil), theoretical_volatility: data.fetch(:theoreticalVolatility, nil), option_deliverables_list: data.fetch(:optionDeliverablesList, nil), expiration_date: Date.parse(data.fetch(:expirationDate)), days_to_expiration: data.fetch(:daysToExpiration, nil), expiration_type: data.fetch(:expirationType, nil), last_trading_day: data.fetch(:lastTradingDay, nil), multiplier: data.fetch(:multiplier, nil), settlement_type: data.fetch(:settlementType, nil), deliverable_note: data.fetch(:deliverableNote, nil), percent_change: data.fetch(:percentChange, nil), mark_change: data.fetch(:markChange, nil), mark_percent_change: data.fetch(:markPercentChange, nil), intrinsic_value: data.fetch(:intrinsicValue, nil), extrinsic_value: data.fetch(:extrinsicValue, nil), option_root: data.fetch(:optionRoot, nil), exercise_type: data.fetch(:exerciseType, nil), high_52_week: data.fetch(:high52Week, nil), low_52_week: data.fetch(:low52Week, nil), non_standard: data.fetch(:nonStandard, nil), in_the_money: data.fetch(:inTheMoney, nil) ) end |
Instance Method Details
#strike_price ⇒ Object
144 145 146 |
# File 'lib/schwab_rb/data_objects/option.rb', line 144 def strike_price strike end |