Sha256: 3166dc511be667ad80236d55b5b2a45194e3874a120aefac56f91122553d9680

Contents?: true

Size: 1.31 KB

Versions: 14

Compression:

Stored size: 1.31 KB

Contents

require 'message_helper'

# The API can receive frozen market data from Trader Workstation. Frozen market
# data is the last data recorded in our system. During normal trading hours,
# the API receives real-time market data. If you use this function, you are
# telling TWS to automatically switch to frozen market data AFTER the close.
# Then, before the opening of the next trading day, market data will automatically
# switch back to real-time market data.
# :market_data_type = 1 for real-time streaming, 2 for frozen market data

describe "Request Market Data Type", :connected => true, :integration => true do

  before(:all) do
    verify_account
    @ib = IB::Connection.new OPTS[:connection].merge(:logger => mock_logger)
  end

  after(:all) { close_connection }

  context "switching to real_time streaming after-hours" do
    before(:all) do
      @ib.send_message :RequestMarketDataType, :market_data_type => :real_time
      @ib.wait_for 2 # sec
    end

    after(:all) { clean_connection }

    it 'just works' do
    end
  end

  context "switching to frozen market data after-hours" do
    before(:all) do
      @ib.send_message :RequestMarketDataType, :market_data_type => :frozen
      @ib.wait_for 2 # sec
    end

    after(:all) { clean_connection }

    it 'just works' do
    end
  end

end # Request Market Data Type

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ib-ruby-0.9.2 spec/ib/messages/outgoing/market_data_type_spec.rb
ib-ruby-0.9.1 spec/ib/messages/outgoing/market_data_type_spec.rb
ib-ruby-0.9.0 spec/ib/messages/outgoing/market_data_type_spec.rb
ib-ruby-0.8.5 spec/ib/messages/outgoing/market_data_type_spec.rb
ib-ruby-0.8.4 spec/ib/messages/outgoing/market_data_type_spec.rb
ib-ruby-0.8.3 spec/ib/messages/outgoing/market_data_type_spec.rb
ib-ruby-0.8.1 spec/ib-ruby/messages/outgoing/market_data_type_spec.rb
ib-ruby-0.8.0 spec/ib-ruby/messages/outgoing/market_data_type_spec.rb
ib-ruby-0.7.12 spec/ib-ruby/messages/outgoing/market_data_type_spec.rb
ib-ruby-0.7.11 spec/ib-ruby/messages/outgoing/market_data_type_spec.rb
ib-ruby-0.7.10 spec/ib-ruby/messages/outgoing/market_data_type_spec.rb
ib-ruby-0.7.9 spec/ib-ruby/messages/outgoing/market_data_type_spec.rb
ib-ruby-0.7.8 spec/ib-ruby/messages/outgoing/market_data_type_spec.rb
ib-ruby-0.7.6 spec/ib-ruby/messages/outgoing/market_data_type_spec.rb