Class: OandaAPI::Resource::Transaction

Inherits:
OandaAPI::ResourceBase show all
Defined in:
lib/oanda_api/resource/transaction.rb

Overview

Transaction value object. See the Oanda Developer Guide for information about Transactions.

Defined Under Namespace

Classes: TradeOpened, TradeReduced

Constant Summary

Constants inherited from OandaAPI::ResourceBase

OandaAPI::ResourceBase::NOT_PLURALIZED

Instance Attribute Summary collapse

Attributes inherited from OandaAPI::ResourceBase

#location

Instance Method Summary collapse

Methods inherited from OandaAPI::ResourceBase

class_from_symbol, labs_resource?, pluralize, #to_json

Constructor Details

#initialize(attributes = {}) ⇒ Transaction

Returns a new instance of Transaction.



33
34
35
36
37
# File 'lib/oanda_api/resource/transaction.rb', line 33

def initialize(attributes = {})
  self.trade_opened  = {}
  self.trade_reduced = {}
  super
end

Instance Attribute Details

#account_balanceObject

Returns the value of attribute account_balance.



6
7
8
# File 'lib/oanda_api/resource/transaction.rb', line 6

def 
  @account_balance
end

#account_idObject

Returns the value of attribute account_id.



6
7
8
# File 'lib/oanda_api/resource/transaction.rb', line 6

def 
  @account_id
end

#amountObject

Returns the value of attribute amount.



6
7
8
# File 'lib/oanda_api/resource/transaction.rb', line 6

def amount
  @amount
end

#expiryObject

Returns the value of attribute expiry.



6
7
8
# File 'lib/oanda_api/resource/transaction.rb', line 6

def expiry
  @expiry
end

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/oanda_api/resource/transaction.rb', line 6

def id
  @id
end

#instrumentObject

Returns the value of attribute instrument.



6
7
8
# File 'lib/oanda_api/resource/transaction.rb', line 6

def instrument
  @instrument
end

#interestObject

Returns the value of attribute interest.



6
7
8
# File 'lib/oanda_api/resource/transaction.rb', line 6

def interest
  @interest
end

#lower_boundObject

Returns the value of attribute lower_bound.



6
7
8
# File 'lib/oanda_api/resource/transaction.rb', line 6

def lower_bound
  @lower_bound
end

#margin_rateObject

Returns the value of attribute margin_rate.



6
7
8
# File 'lib/oanda_api/resource/transaction.rb', line 6

def margin_rate
  @margin_rate
end

#order_idObject

Returns the value of attribute order_id.



6
7
8
# File 'lib/oanda_api/resource/transaction.rb', line 6

def order_id
  @order_id
end

#plObject

Returns the value of attribute pl.



6
7
8
# File 'lib/oanda_api/resource/transaction.rb', line 6

def pl
  @pl
end

#priceObject

Returns the value of attribute price.



6
7
8
# File 'lib/oanda_api/resource/transaction.rb', line 6

def price
  @price
end

#rateObject

Returns the value of attribute rate.



6
7
8
# File 'lib/oanda_api/resource/transaction.rb', line 6

def rate
  @rate
end

#reasonObject

Returns the value of attribute reason.



6
7
8
# File 'lib/oanda_api/resource/transaction.rb', line 6

def reason
  @reason
end

#sideObject

Returns the value of attribute side.



6
7
8
# File 'lib/oanda_api/resource/transaction.rb', line 6

def side
  @side
end

#stop_loss_priceObject

Returns the value of attribute stop_loss_price.



6
7
8
# File 'lib/oanda_api/resource/transaction.rb', line 6

def stop_loss_price
  @stop_loss_price
end

#take_profit_priceObject

Returns the value of attribute take_profit_price.



6
7
8
# File 'lib/oanda_api/resource/transaction.rb', line 6

def take_profit_price
  @take_profit_price
end

#timeObject

Returns the value of attribute time.



6
7
8
# File 'lib/oanda_api/resource/transaction.rb', line 6

def time
  @time
end

#trade_idObject

Returns the value of attribute trade_id.



6
7
8
# File 'lib/oanda_api/resource/transaction.rb', line 6

def trade_id
  @trade_id
end

#trade_openedObject

Returns the value of attribute trade_opened.



6
7
8
# File 'lib/oanda_api/resource/transaction.rb', line 6

def trade_opened
  @trade_opened
end

#trade_reducedObject

Returns the value of attribute trade_reduced.



6
7
8
# File 'lib/oanda_api/resource/transaction.rb', line 6

def trade_reduced
  @trade_reduced
end

#trailing_stop_loss_distanceObject

Returns the value of attribute trailing_stop_loss_distance.



6
7
8
# File 'lib/oanda_api/resource/transaction.rb', line 6

def trailing_stop_loss_distance
  @trailing_stop_loss_distance
end

#typeObject

Returns the value of attribute type.



6
7
8
# File 'lib/oanda_api/resource/transaction.rb', line 6

def type
  @type
end

#unitsObject

Returns the value of attribute units.



6
7
8
# File 'lib/oanda_api/resource/transaction.rb', line 6

def units
  @units
end

#upper_boundObject

Returns the value of attribute upper_bound.



6
7
8
# File 'lib/oanda_api/resource/transaction.rb', line 6

def upper_bound
  @upper_bound
end