Giter Club home page Giter Club logo

alpaca-terminal's Introduction

alpaca-terminal

version code build prettier

a command line terminal for trading with the Alpaca API

Contents

Features

  • View account information.
  • Buy and sell stocks.
  • Close positions with optional wildcards.
  • Cancel orders with optional wildcards.
  • View recent orders.
  • View positions.

Install

From NPM:

$ npm i -g alpaca-terminal

Usage

Contents

Launching

Open the terminal with the alpaca or alpaca-terminal command.

alpaca-terminal 2.0.0
type help or ? to view commands
> help
help      [command]
config    [key] [value]
account   [field]
buy       <symbol> <qty> [tif] [limit_price]
sell      <symbol> <qty> [tif] [limit_price]
cancel    <symbol|order_id|*>
close     <symbol|*>
orders    [status]
positions
quit
>

Config

To view all options type config.

> config
credentials.key    xxxxxxxxxxxx
credentials.secret xxxxxxxxxxxxxxxxxxxxxxxx

To view a specific option type config <key>.

> config credentials.key
credentials.key xxxxxxxxxxxx

To set an option type config <key> <value>.

> config credentials.key mykey
credentials.key mykey

Buy

To buy a stock simply provide the symbol and amount.

> buy SPY 1
placed with ID 1184e1b7-2aa9-471e-8ec0-0981d1c35e4e

Sell

To sell a stock simply provide the symbol and amount.

> sell TSLA 1
placed with ID 1184e1b7-2aa9-471e-8ec0-0981d1c35e4e

Orders

To view your recent orders type orders, optionally you can type orders [status] to see specific order types.

symbol side qty price status   id
TSLA   buy  1   -     accepted a92af801-2c27-4f07-b55f-4861c29333d2

Aliases

Below are the command aliases available.

Command Aliases
help h ?
config conf cfg
account acc a
buy b
sell s
orders o
close c
cancel ca
positions pos p
quit q

To Do

More is coming! This project is early in development.

Contributing

Feel free to contribute and PR to your ๐Ÿ’–'s content.

alpaca-terminal's People

Contributors

117 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

alpaca-terminal's Issues

Use advanced terminal lib to save time

@117 i have not used this, but seems like you the aim is a nice terminal style trading dashboard.

From my experience I know that terminal apps look deceptively simple and take more time than originally thought.

One suggestion I have in order to save time, is to use proper terminal library, with lots of high level ui elements ready e.g. tables/navigation/windows/forms and etc.

Something like terminal-kit or blessed could save a lot of time

config command raises error and settings require restart to take effect

I noticed that setting any of the config parameters results in the following error:

> config credentials.key xxxx
xxxx
TypeError: Cannot read property 'credentials' of undefined
    at prompt.config (/usr/local/lib/node_modules/alpaca-terminal/dist/src/main.js:105:35)
    at /usr/local/lib/node_modules/alpaca-terminal/dist/src/main.js:47:38
    at Interface._onLine (readline.js:335:5)
    at Interface._line (readline.js:666:8)
    at Interface._ttyWrite (readline.js:1010:14)
    at ReadStream.onkeypress (readline.js:213:10)
    at ReadStream.emit (events.js:314:20)
    at emitKeys (internal/readline/utils.js:335:14)
    at emitKeys.next (<anonymous>)
    at ReadStream.onData (readline.js:1144:36)

I got this with all parameters, but they are somehow saved because "config" lists them correctly. If you try to immediately get account status, it fails with the following error:

access key verification failed : access key not found (Code = 40110000)

However, after I exited and restarted alpaca-terminal, the commands seem to be working correctly.

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.