Sha256: 4bb4858d6ef7aa4b063493482e18d1825ac22590154eb540596fc148a21ac787
Contents?: true
Size: 1.73 KB
Versions: 18
Compression:
Stored size: 1.73 KB
Contents
require 'integration_helper' describe 'Request Market Data for Options', :if => :us_trading_hours, :connected => true, :integration => true do before(:all) do verify_account @ib = IB::Connection.new OPTS[:connection].merge(:logger => mock_logger) @ib.send_message :RequestMarketData, :id => 456, :contract => IB::Symbols::Options[:aapl500] @ib.wait_for :TickPrice, :TickSize, :TickString, :TickOption, 5 # sec end after(:all) do @ib.send_message :CancelMarketData, :id => 456 close_connection end it_behaves_like 'Received Market Data' context "received :TickOption message" do subject { @ib.received[:TickOption].first } it { should be_an IB::Messages::Incoming::TickOption } its(:type) { should_not be_nil } its(:data) { should be_a Hash } its(:tick_type) { should be_an Integer } its(:type) { should be_a Symbol } its(:under_price) { should be_a Float } its(:option_price) { should be_a Float } its(:pv_dividend) { should be_a Float } its(:implied_volatility) { should be_a Float } its(:gamma) { should be_a Float } its(:vega) { should be_a Float } its(:theta) { should be_a Float } its(:ticker_id) { should == 456 } its(:to_human) { should =~ /TickOption/ } end context "received :TickString message" do subject { @ib.received[:TickString].first } it { should be_an IB::Messages::Incoming::TickString } its(:type) { should_not be_nil } its(:data) { should be_a Hash } its(:tick_type) { should be_an Integer } its(:type) { should be_a Symbol } its(:value) { should be_a String } its(:ticker_id) { should == 456 } its(:to_human) { should =~ /TickString/ } end end # Request Options Market Data
Version data entries
18 entries across 18 versions & 1 rubygems