Class: SchwabRb::DataObjects::OptionQuote
- Inherits:
-
Object
- Object
- SchwabRb::DataObjects::OptionQuote
- Defined in:
- lib/schwab_rb/data_objects/quote.rb
Instance Attribute Summary collapse
-
#ask_price ⇒ Object
readonly
Returns the value of attribute ask_price.
-
#ask_size ⇒ Object
readonly
Returns the value of attribute ask_size.
-
#asset_main_type ⇒ Object
readonly
Returns the value of attribute asset_main_type.
-
#bid_price ⇒ Object
readonly
Returns the value of attribute bid_price.
-
#bid_size ⇒ Object
readonly
Returns the value of attribute bid_size.
-
#close_price ⇒ Object
readonly
Returns the value of attribute close_price.
-
#contract_type ⇒ Object
readonly
Returns the value of attribute contract_type.
-
#days_to_expiration ⇒ Object
readonly
Returns the value of attribute days_to_expiration.
-
#deliverables ⇒ Object
readonly
Returns the value of attribute deliverables.
-
#delta ⇒ Object
readonly
Returns the value of attribute delta.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#exchange ⇒ Object
readonly
Returns the value of attribute exchange.
-
#exchange_name ⇒ Object
readonly
Returns the value of attribute exchange_name.
-
#exercise_type ⇒ Object
readonly
Returns the value of attribute exercise_type.
-
#expiration_day ⇒ Object
readonly
Returns the value of attribute expiration_day.
-
#expiration_month ⇒ Object
readonly
Returns the value of attribute expiration_month.
-
#expiration_type ⇒ Object
readonly
Returns the value of attribute expiration_type.
-
#expiration_year ⇒ Object
readonly
Returns the value of attribute expiration_year.
-
#gamma ⇒ Object
readonly
Returns the value of attribute gamma.
-
#high_price ⇒ Object
readonly
Returns the value of attribute high_price.
-
#implied_yield ⇒ Object
readonly
Returns the value of attribute implied_yield.
-
#ind_ask_price ⇒ Object
readonly
Returns the value of attribute ind_ask_price.
-
#ind_bid_price ⇒ Object
readonly
Returns the value of attribute ind_bid_price.
-
#ind_time ⇒ Object
readonly
Returns the value of attribute ind_time.
-
#is_penny_pilot ⇒ Object
readonly
Returns the value of attribute is_penny_pilot.
-
#last_price ⇒ Object
readonly
Returns the value of attribute last_price.
-
#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_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.
-
#money_intrinsic_value ⇒ Object
readonly
Returns the value of attribute money_intrinsic_value.
-
#multiplier ⇒ Object
readonly
Returns the value of attribute multiplier.
-
#net_change ⇒ Object
readonly
Returns the value of attribute net_change.
-
#net_percent_change ⇒ Object
readonly
Returns the value of attribute net_percent_change.
-
#open_interest ⇒ Object
readonly
Returns the value of attribute open_interest.
-
#open_price ⇒ Object
readonly
Returns the value of attribute open_price.
-
#quote_52_week_high ⇒ Object
readonly
Returns the value of attribute quote_52_week_high.
-
#quote_52_week_low ⇒ Object
readonly
Returns the value of attribute quote_52_week_low.
-
#realtime ⇒ Object
readonly
Returns the value of attribute realtime.
-
#rho ⇒ Object
readonly
Returns the value of attribute rho.
-
#security_status ⇒ Object
readonly
Returns the value of attribute security_status.
-
#settlement_type ⇒ Object
readonly
Returns the value of attribute settlement_type.
-
#ssid ⇒ Object
readonly
Returns the value of attribute ssid.
-
#strike_price ⇒ Object
readonly
Returns the value of attribute strike_price.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
-
#theoretical_option_value ⇒ Object
readonly
Returns the value of attribute theoretical_option_value.
-
#theta ⇒ Object
readonly
Returns the value of attribute theta.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
-
#time_value ⇒ Object
readonly
Returns the value of attribute time_value.
-
#total_volume ⇒ Object
readonly
Returns the value of attribute total_volume.
-
#trade_time ⇒ Object
readonly
Returns the value of attribute trade_time.
-
#underlying ⇒ Object
readonly
Returns the value of attribute underlying.
-
#underlying_asset_type ⇒ Object
readonly
Returns the value of attribute underlying_asset_type.
-
#underlying_price ⇒ Object
readonly
Returns the value of attribute underlying_price.
-
#vega ⇒ Object
readonly
Returns the value of attribute vega.
-
#volatility ⇒ Object
readonly
Returns the value of attribute volatility.
Instance Method Summary collapse
-
#initialize(data) ⇒ OptionQuote
constructor
A new instance of OptionQuote.
- #zone ⇒ Object
Constructor Details
#initialize(data) ⇒ OptionQuote
Returns a new instance of OptionQuote.
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 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 29 def initialize(data) @symbol = data[:symbol] @asset_main_type = data[:assetMainType] @realtime = data[:realtime] @ssid = data[:ssid] @quote_52_week_high = data.dig(:quote, :"52WeekHigh") @quote_52_week_low = data.dig(:quote, :"52WeekLow") @ask_price = data.dig(:quote, :askPrice) @ask_size = data.dig(:quote, :askSize) @bid_price = data.dig(:quote, :bidPrice) @bid_size = data.dig(:quote, :bidSize) @close_price = data.dig(:quote, :closePrice) @delta = data.dig(:quote, :delta) @gamma = data.dig(:quote, :gamma) @high_price = data.dig(:quote, :highPrice) @ind_ask_price = data.dig(:quote, :indAskPrice) @ind_bid_price = data.dig(:quote, :indBidPrice) @ind_quote_time = data.dig(:quote, :indQuoteTime) @implied_yield = data.dig(:quote, :impliedYield) @last_price = data.dig(:quote, :lastPrice) @last_size = data.dig(:quote, :lastSize) @low_price = data.dig(:quote, :lowPrice) @mark = data.dig(:quote, :mark) @mark_change = data.dig(:quote, :markChange) @mark_percent_change = data.dig(:quote, :markPercentChange) @money_intrinsic_value = data.dig(:quote, :moneyIntrinsicValue) @net_change = data.dig(:quote, :netChange) @net_percent_change = data.dig(:quote, :netPercentChange) @open_interest = data.dig(:quote, :openInterest) @open_price = data.dig(:quote, :openPrice) @quote_time = data.dig(:quote, :quoteTime) @rho = data.dig(:quote, :rho) @security_status = data.dig(:quote, :securityStatus) @theoretical_option_value = data.dig(:quote, :theoreticalOptionValue) @theta = data.dig(:quote, :theta) @time_value = data.dig(:quote, :timeValue) @total_volume = data.dig(:quote, :totalVolume) @trade_time = data.dig(:quote, :tradeTime) @underlying_price = data.dig(:quote, :underlyingPrice) @vega = data.dig(:quote, :vega) @volatility = data.dig(:quote, :volatility) @contract_type = data.dig(:reference, :contractType) @days_to_expiration = data.dig(:reference, :daysToExpiration) @deliverables = data.dig(:reference, :deliverables) @description = data.dig(:reference, :description) @exchange = data.dig(:reference, :exchange) @exchange_name = data.dig(:reference, :exchangeName) @exercise_type = data.dig(:reference, :exerciseType) @expiration_day = data.dig(:reference, :expirationDay) @expiration_month = data.dig(:reference, :expirationMonth) @expiration_type = data.dig(:reference, :expirationType) @expiration_year = data.dig(:reference, :expirationYear) @is_penny_pilot = data.dig(:reference, :isPennyPilot) @last_trading_day = data.dig(:reference, :lastTradingDay) @multiplier = data.dig(:reference, :multiplier) @settlement_type = data.dig(:reference, :settlementType) @strike_price = data.dig(:reference, :strikePrice) @underlying = data.dig(:reference, :underlying) @underlying_asset_type = data.dig(:reference, :underlyingAssetType) end |
Instance Attribute Details
#ask_price ⇒ Object (readonly)
Returns the value of attribute ask_price.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def ask_price @ask_price end |
#ask_size ⇒ Object (readonly)
Returns the value of attribute ask_size.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def ask_size @ask_size end |
#asset_main_type ⇒ Object (readonly)
Returns the value of attribute asset_main_type.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def asset_main_type @asset_main_type end |
#bid_price ⇒ Object (readonly)
Returns the value of attribute bid_price.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def bid_price @bid_price end |
#bid_size ⇒ Object (readonly)
Returns the value of attribute bid_size.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def bid_size @bid_size end |
#close_price ⇒ Object (readonly)
Returns the value of attribute close_price.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def close_price @close_price end |
#contract_type ⇒ Object (readonly)
Returns the value of attribute contract_type.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def contract_type @contract_type end |
#days_to_expiration ⇒ Object (readonly)
Returns the value of attribute days_to_expiration.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def days_to_expiration @days_to_expiration end |
#deliverables ⇒ Object (readonly)
Returns the value of attribute deliverables.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def deliverables @deliverables end |
#delta ⇒ Object (readonly)
Returns the value of attribute delta.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def delta @delta end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def description @description end |
#exchange ⇒ Object (readonly)
Returns the value of attribute exchange.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def exchange @exchange end |
#exchange_name ⇒ Object (readonly)
Returns the value of attribute exchange_name.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def exchange_name @exchange_name end |
#exercise_type ⇒ Object (readonly)
Returns the value of attribute exercise_type.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def exercise_type @exercise_type end |
#expiration_day ⇒ Object (readonly)
Returns the value of attribute expiration_day.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def expiration_day @expiration_day end |
#expiration_month ⇒ Object (readonly)
Returns the value of attribute expiration_month.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def expiration_month @expiration_month end |
#expiration_type ⇒ Object (readonly)
Returns the value of attribute expiration_type.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def expiration_type @expiration_type end |
#expiration_year ⇒ Object (readonly)
Returns the value of attribute expiration_year.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def expiration_year @expiration_year end |
#gamma ⇒ Object (readonly)
Returns the value of attribute gamma.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def gamma @gamma end |
#high_price ⇒ Object (readonly)
Returns the value of attribute high_price.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def high_price @high_price end |
#implied_yield ⇒ Object (readonly)
Returns the value of attribute implied_yield.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def implied_yield @implied_yield end |
#ind_ask_price ⇒ Object (readonly)
Returns the value of attribute ind_ask_price.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def ind_ask_price @ind_ask_price end |
#ind_bid_price ⇒ Object (readonly)
Returns the value of attribute ind_bid_price.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def ind_bid_price @ind_bid_price end |
#ind_time ⇒ Object (readonly)
Returns the value of attribute ind_time.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def ind_time @ind_time end |
#is_penny_pilot ⇒ Object (readonly)
Returns the value of attribute is_penny_pilot.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def is_penny_pilot @is_penny_pilot end |
#last_price ⇒ Object (readonly)
Returns the value of attribute last_price.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def last_price @last_price end |
#last_size ⇒ Object (readonly)
Returns the value of attribute last_size.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def last_size @last_size end |
#last_trading_day ⇒ Object (readonly)
Returns the value of attribute last_trading_day.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def last_trading_day @last_trading_day end |
#low_price ⇒ Object (readonly)
Returns the value of attribute low_price.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def low_price @low_price end |
#mark ⇒ Object (readonly)
Returns the value of attribute mark.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def mark @mark end |
#mark_change ⇒ Object (readonly)
Returns the value of attribute mark_change.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def mark_change @mark_change end |
#mark_percent_change ⇒ Object (readonly)
Returns the value of attribute mark_percent_change.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def mark_percent_change @mark_percent_change end |
#money_intrinsic_value ⇒ Object (readonly)
Returns the value of attribute money_intrinsic_value.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def money_intrinsic_value @money_intrinsic_value end |
#multiplier ⇒ Object (readonly)
Returns the value of attribute multiplier.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def multiplier @multiplier end |
#net_change ⇒ Object (readonly)
Returns the value of attribute net_change.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def net_change @net_change end |
#net_percent_change ⇒ Object (readonly)
Returns the value of attribute net_percent_change.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def net_percent_change @net_percent_change end |
#open_interest ⇒ Object (readonly)
Returns the value of attribute open_interest.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def open_interest @open_interest end |
#open_price ⇒ Object (readonly)
Returns the value of attribute open_price.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def open_price @open_price end |
#quote_52_week_high ⇒ Object (readonly)
Returns the value of attribute quote_52_week_high.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def quote_52_week_high @quote_52_week_high end |
#quote_52_week_low ⇒ Object (readonly)
Returns the value of attribute quote_52_week_low.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def quote_52_week_low @quote_52_week_low end |
#realtime ⇒ Object (readonly)
Returns the value of attribute realtime.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def realtime @realtime end |
#rho ⇒ Object (readonly)
Returns the value of attribute rho.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def rho @rho end |
#security_status ⇒ Object (readonly)
Returns the value of attribute security_status.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def security_status @security_status end |
#settlement_type ⇒ Object (readonly)
Returns the value of attribute settlement_type.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def settlement_type @settlement_type end |
#ssid ⇒ Object (readonly)
Returns the value of attribute ssid.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def ssid @ssid end |
#strike_price ⇒ Object (readonly)
Returns the value of attribute strike_price.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def strike_price @strike_price end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def symbol @symbol end |
#theoretical_option_value ⇒ Object (readonly)
Returns the value of attribute theoretical_option_value.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def theoretical_option_value @theoretical_option_value end |
#theta ⇒ Object (readonly)
Returns the value of attribute theta.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def theta @theta end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def time @time end |
#time_value ⇒ Object (readonly)
Returns the value of attribute time_value.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def time_value @time_value end |
#total_volume ⇒ Object (readonly)
Returns the value of attribute total_volume.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def total_volume @total_volume end |
#trade_time ⇒ Object (readonly)
Returns the value of attribute trade_time.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def trade_time @trade_time end |
#underlying ⇒ Object (readonly)
Returns the value of attribute underlying.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def @underlying end |
#underlying_asset_type ⇒ Object (readonly)
Returns the value of attribute underlying_asset_type.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def @underlying_asset_type end |
#underlying_price ⇒ Object (readonly)
Returns the value of attribute underlying_price.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def @underlying_price end |
#vega ⇒ Object (readonly)
Returns the value of attribute vega.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def vega @vega end |
#volatility ⇒ Object (readonly)
Returns the value of attribute volatility.
26 27 28 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 26 def volatility @volatility end |
Instance Method Details
#zone ⇒ Object
90 91 92 93 94 95 96 97 98 |
# File 'lib/schwab_rb/data_objects/quote.rb', line 90 def zone if quote_delta.abs > 0.3 "DANGER" elsif quote_delta.abs > 0.15 "AT_RISK" else "SAFE" end end |