All Projects → areed1192 → Python Trading Robot

areed1192 / Python Trading Robot

Licence: mit
A trading robot, that can submit basic orders in an automated fashion using the TD API.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Python Trading Robot

AIPortfolio
Use AI to generate a optimized stock portfolio
Stars: ✭ 28 (-88.09%)
Mutual labels:  portfolio, finance, stocks
FinanceKit
FinanceKit is a Framework for iOS and Mac to build apps working with financial data, like money, currencies, stocks, portfolio, transactions and other concepts.
Stars: ✭ 15 (-93.62%)
Mutual labels:  portfolio, finance, stocks
Algobot
A C++ stock market algorithmic trading bot
Stars: ✭ 78 (-66.81%)
Mutual labels:  finance, stocks
Portfolio
A simple tool to calculate the overall performance of an investment portfolio.
Stars: ✭ 1,326 (+464.26%)
Mutual labels:  portfolio, stocks
Fast arrow
(no longer maintained) A simple yet robust (stock+options) API client for Robinhood
Stars: ✭ 127 (-45.96%)
Mutual labels:  portfolio, stocks
Reddit Hyped Stocks
A web application to explore currently hyped stocks on Reddit
Stars: ✭ 173 (-26.38%)
Mutual labels:  finance, stocks
Iex Api
The IEX API provides any individual or academic, public or private institution looking to develop applications that require stock market data to access near real-time quote and trade data for all stocks trading on IEX.
Stars: ✭ 683 (+190.64%)
Mutual labels:  finance, stocks
Mop
Stock market tracker for hackers.
Stars: ✭ 1,534 (+552.77%)
Mutual labels:  finance, stocks
Pyex
Python interface to IEX and IEX cloud APIs
Stars: ✭ 311 (+32.34%)
Mutual labels:  finance, stocks
Tiingo Python
Python REST Client for interacting with the Tiingo Financial Data API
Stars: ✭ 152 (-35.32%)
Mutual labels:  finance, stocks
Sec Edgar Downloader
Download SEC filings from the EDGAR database using Python
Stars: ✭ 146 (-37.87%)
Mutual labels:  finance, stocks
Investments
Helps you with managing your investments
Stars: ✭ 213 (-9.36%)
Mutual labels:  finance, stocks
Alphapy
Automated Machine Learning [AutoML] with Python, scikit-learn, Keras, XGBoost, LightGBM, and CatBoost
Stars: ✭ 564 (+140%)
Mutual labels:  portfolio, stocks
Stocksharp
Algorithmic trading and quantitative trading open source platform to develop trading robots (stock markets, forex, crypto, bitcoins, and options).
Stars: ✭ 4,601 (+1857.87%)
Mutual labels:  finance, stocks
Tradestation
EasyLanguage indicators and systems for TradeStation
Stars: ✭ 65 (-72.34%)
Mutual labels:  finance, stocks
Financeops
Research in investment finance with Python Notebooks
Stars: ✭ 378 (+60.85%)
Mutual labels:  finance, stocks
Node Finance
Module for portfolio optimization, prices and options
Stars: ✭ 101 (-57.02%)
Mutual labels:  portfolio, finance
tuneta
Intelligently optimizes technical indicators and optionally selects the least intercorrelated for use in machine learning models
Stars: ✭ 77 (-67.23%)
Mutual labels:  finance, stocks
Yahoo Finance Api
PHP client for Yahoo Finance API 📈
Stars: ✭ 179 (-23.83%)
Mutual labels:  finance, stocks
Turingtrader
The Open-Source Backtesting Engine/ Market Simulator by Bertram Solutions.
Stars: ✭ 132 (-43.83%)
Mutual labels:  finance, stocks

Python Trading Robot

Table of Contents

Overview

Current Version: 0.1.1

A trading robot written in Python that can run automated strategies using a technical analysis. The robot is designed to mimic a few common scenarios:

  1. Maintaining a portfolio of multiple instruments. The Portfolio object will be able to calculate common risk metrics related to a portfolio and give real-time feedback as you trade.

  2. Define an order that can be used to trade a financial instrument. With the Trade object, you can define simple or even complex orders using Python. These orders will also help similify common scenarios like defining both a take profit and stop loss at the same time.

  3. A real-time data table that includes both historical and real-time prices as they change. The StockFrame will make the process of storing your data easy and quick. Additionally, it will be setup so that way you can easily select your financial data as it comes in and do further analysis if needed.

  4. Define and calculate indicators using both historical and real-time prices. The Indicator object will help you easily define the input of your indicators, calculate them, and then update their values as new prices come.

Setup

Setup - Local Install:

If you are planning to make modifications to this project or you would like to access it before it has been indexed on PyPi. I would recommend you either install this project in editable mode or do a local install. For those of you, who want to make modifications to this project. I would recommend you install the library in editable mode.

If you want to install the library in editable mode, make sure to run the setup.py file, so you can install any dependencies you may need. To run the setup.py file, run the following command in your terminal.

pip install -e .

If you don't plan to make any modifications to the project but still want to use it across your different projects, then do a local install.

pip install .

This will install all the dependencies listed in the setup.py file. Once done you can use the library wherever you want.

Setup - PyPi Install:

The project can be found at PyPI, if you'd like to view the project please use this link. To install the library, run the following command from the terminal.

pip install python-trading-robot

Setup - PyPi Upgrade:

To upgrade the library, run the following command from the terminal.

pip install --upgrade python-trading-robot

Usage

To run the robot, you will need to provide a few pieces of information from your TD Ameritrade Developer account. The following items are need for authentication:

  • Client ID: Also, called your consumer key, this was provided when you registered an app with the TD Ameritrade Developer platform. An example of a client ID could look like the following MMMMYYYYYA6444VXXXXBBJC3DOOOO.

  • Redirect URI: Also called the callbakc URL or redirect URL, this was specified by you when you regiestered your app with the TD Ameritrade Developer platform. Here is an example of a redirect URI https://localhost/mycallback

  • Credentials Path: This is a file path that will point to a JSON file where your state info will be saved. Keep in mind that it is okay if it points to a non-existing file as once you run the script the file will be auto generated. For example, if I want my state info to be saved to my desktop, then it would look like the following: C:\Users\Desktop\ts_state.json

Once you've identfied those pieces of info, you can run the robot. Here is a simple example that will create a new instance of it:

from pyrobot.robot import PyRobot

# Initialize the robot
trading_robot = PyRobot(
    client_id='XXXXXX111111YYYY22',
    redirect_uri='https://localhost/mycallback',
    credentials_path='path/to/td_state.json'
)

For more detailed examples, go to the trading_robot.py file to see an example of how to use the library along with all the different objects inside.

Support these Projects

Patreon: Help support this project and future projects by donating to my Patreon Page. I'm always looking to add more content for individuals like yourself, unfortuantely some of the APIs I would require me to pay monthly fees.

YouTube: If you'd like to watch more of my content, feel free to visit my YouTube channel Sigma Coding.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].