Sha256: 0f321e263ed5ca8c85054f62a639d1bc6a926e9558345e0e95f74488c41dd93f

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 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 ||= {
          :wfc => IB::Contract.new(:symbol => "WFC",
                                   :exchange => "NYSE",
                                   :currency => "USD",
                                   :sec_type => :stock,
                                   :description => "Wells Fargo"),

          :aapl => IB::Contract.new(:symbol => "AAPL",
                                    :currency => "USD",
                                    :sec_type => :stock,
                                    :description => "Apple Inc."),

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

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ib-ruby-0.9.0 lib/ib/symbols/stocks.rb
ib-ruby-0.8.5 lib/ib/symbols/stocks.rb