Method: Option#to_ticker_s

Defined in:
lib/option.rb

#to_ticker_sObject



53
54
55
56
57
58
59
60
61
62
# File 'lib/option.rb', line 53

def to_ticker_s
  return symbol if symbol

  call_or_put = call? ? "C" : "P"

  dollar  = (strike.to_i / 100).to_s.rjust(5, "0")
  decimal = (strike.to_i % 100).to_s.ljust(3, "0")

  [stock.symbol, expires.strftime("%y%m%d"), call_or_put, dollar, decimal].join.upcase
end