Skip to content
This repository has been archived by the owner on May 25, 2020. It is now read-only.

A basic implementation of ETrade API for Node JS. This is useful for algorithmic trading.

License

Notifications You must be signed in to change notification settings

shikhirsingh/ETrade-API-Robo-Trading-Monkey-4-NodeJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trading Robo Monkey for Node.js using ETrade API

This Node app interfaces with the ETrade API to create a template necessary to implement your own intelligent automatic trading algorithms.

Author

Why Node?

IMHO, given the async nature and event loop architecture of Node.js, it is the best programming language for algorithmic trading. Don't be surprised if it outperforms your multithreaded C++/Java code.

Dependencies

  1. Node JS
  2. ETrade OAuth Credentials - obtain this from ETrade by contacting them via secure message prior to install steps
  3. E*Trade Brokerage Account

How to install app

  1. Extract the app in a directory of your choice
  2. Run: sudo npm install
  3. Rename the config/credential-sample.json to config/credential.json
  4. Edit config/credential.json and add your OAuth key and secret. You should leave callback as "oob". If your oauth is not working, first check this.

Version

0.0.2 - Alpha Release

License

Apache 2.0 License.

Usage

  1. After installing app, run it using : node app.js
  2. Using your browser, goto localhost:3001/login . If your etrade oauth keys are valid, it should redirect you to etrade to verify oauth
  3. Read E*Trade agreements and proceed to the last page which will give you a 5 letter oauth verifier code.
  4. Use the code by giving it to the callback function, like so: http://localhost:3001/oauth/etrade/callback?oauth_verifier=MX9ES
  5. You should see an account listing if step 4 worked! Try some of the other functions - ie. http://localhost:3001/account/balance?accountId=83405188

Known Issues

  1. The app crashes if oauth is not verified. This is not a problem as long as you get the right credentials from E*Trade
  2. I don't use MS Windows so I don't know if this code works in Windows.
  3. ETrade's OAuth callback has some issues. Just leave it as "oob" in credentials.json until I hear back from ETrade. Hopefully a fix for this is coming soon.
  4. There is some mysql references in code. It's not being used as of yet so there is no dependency on MySql. Although, it's coming in future versions.
  5. If this code isn't running for you, recheck the install and usage instructions. Chances are you changed something I didn't ask you to(ie. callback)

Future Development in progress

  • Implement other major components of ETrade REST API
  • Write a sample code that buys SPY with excess funds if cash account balance exceeds $20k at 3:55pm EST each day.

Why is it called Robo Trading Monkey

To emphasize that no matter how good the software gets, it will never exceed the intellect of a monkey. Use it accordingly, as a human is not included.

Thanks E*Trade

Special thanks to E*Trade for providing a REST API. Please keep maintaining it as well as developer.etrade.com

High-frequency trading

ETrade's servers are slow. Don't expect to compete with High-frequencing traders using E*Trade. Most my requests on a 30 Mbps connection are taking around half a second round trip. That's way too slow.

Warning

There probably are many bugs in this software. Run at your own risk(see disclaimer). I'm not responsible if you lose your money. Do not run this code if you don't understand how it works. Using algorithmic trading software is a really bad idea unless done by professionals.

Disclaimer

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

A basic implementation of ETrade API for Node JS. This is useful for algorithmic trading.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published