Project

tradier

0.03
No release in over 3 years
Low commit activity in last 3 years
There's a lot of open issues
Rubygem for interacting with the Tradier API.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

Tradier

Gem Version Build Status Dependency Status Coverage Status

Rubygem for interacting with the Tradier API.

Installation

gem install tradier

Usage

Create an instance of a Tradier::Client:

require 'tradier'

client = Tradier::Client.new(:access_token => 'token')

Placing Orders

Orders can be placed using the create_order method. Here are some basic examples:

Place an equity order:

client.create_order({
  :account  => '123456789'
  :class    => 'equity',
  :symbol   => 'AAPL',
  :duration => 'day',
  :side     => 'buy',
  :quantity => '100',
  :type     => 'market'
})

Placing an option order:

client.create_order({
  :account       => '123456789'
  :class         => 'option',
  :symbol        => 'AAPL',
  :option_symbol => 'AAPL140118C00195000',
  :duration      => 'day',
  :side          => 'buy',
  :quantity      => '100',
  :type          => 'market'
})

For a complete list of the types of orders accepted, refer to Tradier's trading API documentation

Interacting with Accounts

Obtain a user's profile/accounts:

client.profile

Balances

Obtain an account's balances:

client.balance('12345678')

Positions

Obtain an account's positions

client.positions('12345678')

Obtain positions for all of a user's accounts:

client.positions

Orders

Obtain an account's order

client.orders('12345678')

Obtain order for all of a user's accounts:

client.orders

Market Data

To obtain a quote, simply request:

client.quote('SYMBOL')

Or multiple quotes at one time:

client.quote(['SYMBOL', 'SYMBOL2'])

Option chains can be requested using a symbol and expiration:

client.chain('SYMBOL', :expiration => '2013-11-14')

Refer to the complete documentation for a complete listing of methods and classes.

Copyright

Copyright (c) 2013 Tradier Inc. See LICENSE for detail.