Giter Site home page Giter Site logo

tradier.rb's Introduction

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.

tradier.rb's People

Contributors

stve avatar jcbarry avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.