Class: Alpaca::Trade::Api::Account
- Inherits:
-
Object
- Object
- Alpaca::Trade::Api::Account
- Defined in:
- lib/alpaca/trade/api/account.rb
Instance Attribute Summary collapse
-
#account_blocked ⇒ Object
readonly
Returns the value of attribute account_blocked.
-
#buying_power ⇒ Object
readonly
Returns the value of attribute buying_power.
-
#cash ⇒ Object
readonly
Returns the value of attribute cash.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#daytrade_count ⇒ Object
readonly
Returns the value of attribute daytrade_count.
-
#equity ⇒ Object
readonly
Returns the value of attribute equity.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#initial_margin ⇒ Object
readonly
Returns the value of attribute initial_margin.
-
#last_equity ⇒ Object
readonly
Returns the value of attribute last_equity.
-
#long_market_value ⇒ Object
readonly
Returns the value of attribute long_market_value.
-
#maintenance_margin ⇒ Object
readonly
Returns the value of attribute maintenance_margin.
-
#multiplier ⇒ Object
readonly
Returns the value of attribute multiplier.
-
#pattern_day_trader ⇒ Object
readonly
Returns the value of attribute pattern_day_trader.
-
#portfolio_value ⇒ Object
readonly
Returns the value of attribute portfolio_value.
-
#short_market_value ⇒ Object
readonly
Returns the value of attribute short_market_value.
-
#shorting_enabled ⇒ Object
readonly
Returns the value of attribute shorting_enabled.
-
#sma ⇒ Object
readonly
Returns the value of attribute sma.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#trade_suspended_by_user ⇒ Object
readonly
Returns the value of attribute trade_suspended_by_user.
-
#trading_blocked ⇒ Object
readonly
Returns the value of attribute trading_blocked.
-
#transfers_blocked ⇒ Object
readonly
Returns the value of attribute transfers_blocked.
Instance Method Summary collapse
-
#initialize(json) ⇒ Account
constructor
A new instance of Account.
Constructor Details
#initialize(json) ⇒ Account
Returns a new instance of Account.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/alpaca/trade/api/account.rb', line 14 def initialize(json) @id = json['id'] @status = json['status'] @currency = json['currency'] @buying_power = BigDecimal(json['buying_power']) @cash = BigDecimal(json['cash']) @portfolio_value = BigDecimal(json['portfolio_value']) @pattern_day_trader = json['pattern_day_trader'] @trade_suspended_by_user = json['trade_suspended_by_user'] @trading_blocked = json['trading_blocked'] @transfers_blocked = json['transfers_blocked'] @created_at = json['created_at'] @shorting_enabled = json['shorting_enabled'] @multiplier = json['multiplier'] @long_market_value = BigDecimal(json['long_market_value']) @short_market_value = BigDecimal(json['short_market_value']) @equity = BigDecimal(json['equity']) @last_equity = BigDecimal(json['last_equity']) @initial_margin = BigDecimal(json['initial_margin']) @maintenance_margin = BigDecimal(json['maintenance_margin']) @daytrade_count = json['daytrade_count'] @sma = json['sma'] end |
Instance Attribute Details
#account_blocked ⇒ Object (readonly)
Returns the value of attribute account_blocked.
7 8 9 |
# File 'lib/alpaca/trade/api/account.rb', line 7 def account_blocked @account_blocked end |
#buying_power ⇒ Object (readonly)
Returns the value of attribute buying_power.
7 8 9 |
# File 'lib/alpaca/trade/api/account.rb', line 7 def @buying_power end |
#cash ⇒ Object (readonly)
Returns the value of attribute cash.
7 8 9 |
# File 'lib/alpaca/trade/api/account.rb', line 7 def cash @cash end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
7 8 9 |
# File 'lib/alpaca/trade/api/account.rb', line 7 def created_at @created_at end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
7 8 9 |
# File 'lib/alpaca/trade/api/account.rb', line 7 def currency @currency end |
#daytrade_count ⇒ Object (readonly)
Returns the value of attribute daytrade_count.
7 8 9 |
# File 'lib/alpaca/trade/api/account.rb', line 7 def daytrade_count @daytrade_count end |
#equity ⇒ Object (readonly)
Returns the value of attribute equity.
7 8 9 |
# File 'lib/alpaca/trade/api/account.rb', line 7 def equity @equity end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/alpaca/trade/api/account.rb', line 7 def id @id end |
#initial_margin ⇒ Object (readonly)
Returns the value of attribute initial_margin.
7 8 9 |
# File 'lib/alpaca/trade/api/account.rb', line 7 def initial_margin @initial_margin end |
#last_equity ⇒ Object (readonly)
Returns the value of attribute last_equity.
7 8 9 |
# File 'lib/alpaca/trade/api/account.rb', line 7 def last_equity @last_equity end |
#long_market_value ⇒ Object (readonly)
Returns the value of attribute long_market_value.
7 8 9 |
# File 'lib/alpaca/trade/api/account.rb', line 7 def long_market_value @long_market_value end |
#maintenance_margin ⇒ Object (readonly)
Returns the value of attribute maintenance_margin.
7 8 9 |
# File 'lib/alpaca/trade/api/account.rb', line 7 def maintenance_margin @maintenance_margin end |
#multiplier ⇒ Object (readonly)
Returns the value of attribute multiplier.
7 8 9 |
# File 'lib/alpaca/trade/api/account.rb', line 7 def multiplier @multiplier end |
#pattern_day_trader ⇒ Object (readonly)
Returns the value of attribute pattern_day_trader.
7 8 9 |
# File 'lib/alpaca/trade/api/account.rb', line 7 def pattern_day_trader @pattern_day_trader end |
#portfolio_value ⇒ Object (readonly)
Returns the value of attribute portfolio_value.
7 8 9 |
# File 'lib/alpaca/trade/api/account.rb', line 7 def portfolio_value @portfolio_value end |
#short_market_value ⇒ Object (readonly)
Returns the value of attribute short_market_value.
7 8 9 |
# File 'lib/alpaca/trade/api/account.rb', line 7 def short_market_value @short_market_value end |
#shorting_enabled ⇒ Object (readonly)
Returns the value of attribute shorting_enabled.
7 8 9 |
# File 'lib/alpaca/trade/api/account.rb', line 7 def shorting_enabled @shorting_enabled end |
#sma ⇒ Object (readonly)
Returns the value of attribute sma.
7 8 9 |
# File 'lib/alpaca/trade/api/account.rb', line 7 def sma @sma end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
7 8 9 |
# File 'lib/alpaca/trade/api/account.rb', line 7 def status @status end |
#trade_suspended_by_user ⇒ Object (readonly)
Returns the value of attribute trade_suspended_by_user.
7 8 9 |
# File 'lib/alpaca/trade/api/account.rb', line 7 def trade_suspended_by_user @trade_suspended_by_user end |
#trading_blocked ⇒ Object (readonly)
Returns the value of attribute trading_blocked.
7 8 9 |
# File 'lib/alpaca/trade/api/account.rb', line 7 def trading_blocked @trading_blocked end |
#transfers_blocked ⇒ Object (readonly)
Returns the value of attribute transfers_blocked.
7 8 9 |
# File 'lib/alpaca/trade/api/account.rb', line 7 def transfers_blocked @transfers_blocked end |