Sha256: 10f9638e8d4bde0c4b8b81deffe7a1cc7e84ebf6ad315dabc7e4033eb88af455

Contents?: true

Size: 1.4 KB

Versions: 6

Compression:

Stored size: 1.4 KB

Contents

# Frequently used stock contracts definitions
# TODO: auto-request :ContractDetails from IB if unknown symbol is requested?
module IB
  module Symbols
    module Stocks
      extend Symbols

      def self.contracts
        @contracts ||= {
          :aapl => IB::Contract.new(:symbol => "AAPL",
                                    :currency => "USD",
                                    :sec_type => :stock,
                                    :description => "Apple Inc."),

          :vxx => IB::Contract.new(:symbol => "VXX",
                                   :exchange => "ARCA",
                                   # :currency => "USD",
                                   :sec_type => :stock,
                                   :description => "iPath S&P500 VIX short term Futures ETN"),

          :wfc => IB::Contract.new(:symbol => "WFC",
                                   :exchange => "NYSE",
                                   :currency => "USD",
                                   :sec_type => :stock,
                                   :description => "Wells Fargo"),

          :wrong => IB::Contract.new(:symbol => "QEEUUE",
                                     :exchange => "NYSE",
                                     :currency => "USD",
                                     :sec_type => :stock,
                                     :description => "Non-existent stock"),
        }
      end

    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
my-ib-api-0.0.4 lib/ib/symbols/stocks.rb
my-ib-api-0.0.3 lib/ib/symbols/stocks.rb
my-ib-api-0.0.2 lib/ib/symbols/stocks.rb
my-ib-api-0.0.1 lib/ib/symbols/stocks.rb
ib-ruby-0.9.2 lib/ib/symbols/stocks.rb
ib-ruby-0.9.1 lib/ib/symbols/stocks.rb