class Alpaca::Trade::Api::Order

Attributes

asset_class[R]
asset_id[R]
canceled_at[R]
client_order_id[R]
created_at[R]
expired_at[R]
extended_hours[R]
failed_at[R]
filled_at[R]
filled_avg_price[R]
filled_qty[R]
id[R]
legs[R]
limit_price[R]
order_class[R]
qty[R]
replaced_at[R]
replaced_by[R]
replaces[R]
side[R]
status[R]
stop_price[R]
submitted_at[R]
symbol[R]
time_in_force[R]
type[R]
updated_at[R]

Public Class Methods

new(json) click to toggle source
# File lib/alpaca/trade/api/order.rb, line 13
def initialize(json)
  @id = json['id']

  @asset_class = json['asset_class']
  @asset_id = json['asset_id']
  @canceled_at = json['canceled_at']
  @client_order_id = json['client_order_id']
  @created_at = json['created_at']
  @expired_at = json['expired_at']
  @extended_hours = json['extended_hours']
  @failed_at = json['failed_at']
  @filled_at = json['filled_at']
  @filled_avg_price = json['filled_avg_price']
  @filled_qty = json['filled_qty']
  @legs = (json['legs'] || []).map {|leg| Order.new(leg)}
  @limit_price = json['limit_price']
  @order_class = json['order_class']
  @qty = json['qty']
  @replaced_at = json['replaced_at']
  @replaced_by = json['replaced_by']
  @replaces = json['replaces']
  @side = json['side']
  @status = json['status']
  @stop_price = json['stop_price']
  @submitted_at = json['submitted_at']
  @symbol = json['symbol']
  @time_in_force = json['time_in_force']
  @type = json['type']
  @updated_at = json['updated_at']
end