Sha256: 951c05e24f78e223e9d7d2cbe30176ec2012fa036091e8fa6eac22d3a95d49f2
Contents?: true
Size: 1.69 KB
Versions: 18
Compression:
Stored size: 1.69 KB
Contents
module IB module Messages module Incoming PortfolioValue = def_message [7, 7], [:contract, :con_id, :int], [:contract, :symbol, :string], [:contract, :sec_type, :string], [:contract, :expiry, :string], [:contract, :strike, :decimal], [:contract, :right, :string], [:contract, :multiplier, :string], [:contract, :primary_exchange, :string], [:contract, :currency, :string], [:contract, :local_symbol, :string], [:position, :int], [:market_price, :decimal], [:market_value, :decimal], [:average_cost, :decimal], [:unrealized_pnl, :decimal_max], # May be nil! [:realized_pnl, :decimal_max], # May be nil! [:account_name, :string] class PortfolioValue def contract @contract = IB::Contract.build @data[:contract] end def to_human "<PortfolioValue: #{contract.to_human} (#{position}): Market #{market_price}" + " price #{market_value} value; PnL: #{unrealized_pnl} unrealized," + " #{realized_pnl} realized; account #{account_name}>" end end # PortfolioValue end # module Incoming end # module Messages end # module IB
Version data entries
18 entries across 18 versions & 2 rubygems