Sha256: af7f7dc421b1554fa94e71d14022518b7db27c833064fd7638eff7d52c39146a

Contents?: true

Size: 1.53 KB

Versions: 3

Compression:

Stored size: 1.53 KB

Contents

class AddOrderStates < ActiveRecord::Migration

  def change
    # OrderState represents dynamic (changeable) info about a single Order
    create_table(:order_states) do |t|
      t.references :order
      t.integer :local_id #  int: Order id associated with client (volatile).
      t.integer :client_id # int: The id of the client that placed this order.
      t.integer :perm_id #   int: TWS permanent id, remains the same over TWS sessions.
      t.integer :parent_id # int: The order ID of the parent (original) order, used
      t.string :status # String: Displays the order status.Possible values include:
      t.integer :filled
      t.integer :remaining
      t.float :price #     double
      t.float :average_price #  double
      t.string :why_held # String: comma-separated list of reasons for order to be held.
      t.string :warning_text # String: Displays a warning message if warranted.
      t.string :commission_currency, :limit => 4 # String: Shows the currency of the commission.
      t.float :commission # double: Shows the commission amount on the order.
      t.float :min_commission # The possible min range of the actual order commission.
      t.float :max_commission # The possible max range of the actual order commission.
      t.float :init_margin # Float: The impact the order would have on your initial margin.
      t.float :maint_margin # Float: The impact the order would have on your maintenance margin.
      t.float :equity_with_loan # Float: The impact the order would have on your equity
      t.timestamps
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ib-ruby-0.8.1 db/migrate/121_add_order_states.rb
ib-ruby-0.8.0 db/migrate/121_add_order_states.rb
ib-ruby-0.7.12 db/migrate/121_add_order_states.rb