Skip to content

Commit

Permalink
upload to PyPi
Browse files Browse the repository at this point in the history
  • Loading branch information
areed1192 committed Aug 28, 2020
1 parent 11b18a2 commit 608f4f9
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 27 deletions.
87 changes: 70 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,90 @@

## Overview

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:
Current Version: **0.1.0**

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.
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:

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.
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.

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.
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.

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.
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

Right now, the library is not hosted on **PyPi** so you will need to do a local install on your system if you plan to use it in other scrips you use.
**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.

First, clone this repo to your local system. After you clone the repo, 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.
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.

```console
pip install -e .
```

This will install all the dependencies listed in the `setup.py` file. Once done you can use the library wherever you want.
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.

```console
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](https://pypi.org/project/python-trading-robot/). To **install** the library,
run the following command from the terminal.

```bash
pip install python-trading-robot
```

**Setup - PyPi Upgrade:**

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

```bash
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:
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`.
- 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>
- 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`
- 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:
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:

```python
from pyrobot.robot import PyRobot
Expand All @@ -54,15 +105,17 @@ trading_robot = PyRobot(
)
```

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.
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](https://www.patreon.com/sigmacoding). 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.
Help support this project and future projects by donating to my [Patreon Page](https://www.patreon.com/sigmacoding). 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](https://www.youtube.com/c/SigmaCoding).

**Hire Me:**
If you have a project, you think I can help you with feel free to reach out at [[email protected]](mailto:[email protected]?subject=[GitHub]%20Project%20Proposal) or fill out the [contract request form](https://forms.office.com/Pages/ResponsePage.aspx?id=ZwOBErInsUGliXx0Yo2VfcCSWZSwW25Es3vPV2veU0pUMUs5MUc2STkzSzVQMFNDVlI5NjJVNjREUi4u)
<!-- **Hire Me:**
If you have a project, you think I can help you with feel free to reach out at [[email protected]](mailto:[email protected]?subject=[GitHub]%20Project%20Proposal) or fill out the [contract request form](https://forms.office.com/Pages/ResponsePage.aspx?id=ZwOBErInsUGliXx0Yo2VfcCSWZSwW25Es3vPV2veU0pUMUs5MUc2STkzSzVQMFNDVlI5NjJVNjREUi4u) -->
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
60 changes: 50 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,73 @@
from setuptools import setup, find_packages
from setuptools import setup
from setuptools import find_namespace_packages

# load the README file.
with open("README.md", "r") as fh:
with open(file="README.md", mode="r") as fh:
long_description = fh.read()

setup(
name='pyrobot',

name='python-trading-robot',

author='Alex Reed',

author_email='[email protected]',

version='0.1.0',

description='A trading robot built for Python that uses the TD Ameritrade API.',

long_description=long_description,

long_description_content_type="text/markdown",

url='https://github.com/areed1192/python-trading-robot',

install_requires=[
'td-ameritrade-python-api',
'pandas',
'numpy'
'td-ameritrade-python-api==0.3.0',
'pandas==1.0.5',
'numpy==1.19.0'
],

keywords='finance, td ameritrade, api, trading robot',
packages=find_packages(include=['pyrobot'], exclude=['*config.py']),

packages=find_namespace_packages(
include=['pyrobot', 'samples', 'tests'],
exclude=['configs*']
),

include_package_data=True,

python_requires='>=3.8',

classifiers=[

# I can say what phase of development my library is in.
'Development Status :: 3 - Alpha',

# Here I'll add the audience this library is intended for.
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'Intended Audience :: Financial and Insurance Industry',

# Here I'll define the license that guides my library.
'License :: OSI Approved :: MIT License',

# Here I'll note that package was written in English.
'Natural Language :: English',

# Here I'll note that any operating system can use it.
'Operating System :: OS Independent',
'Programming Language :: Python :: 3'
],
python_requires='>=3.7'

# Here I'll specify the version of Python it uses.
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',

# Here are the topics that my library covers.
'Topic :: Database',
'Topic :: Education',
'Topic :: Office/Business'

]
)

0 comments on commit 608f4f9

Please sign in to comment.