You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+70-17
Original file line number
Diff line number
Diff line change
@@ -9,39 +9,90 @@
9
9
10
10
## Overview
11
11
12
-
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:
12
+
Current Version: **0.1.0**
13
13
14
-
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.
14
+
A trading robot written in Python that can run automated strategies using a technical analysis.
15
+
The robot is designed to mimic a few common scenarios:
15
16
16
-
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.
17
+
1. Maintaining a portfolio of multiple instruments. The `Portfolio` object will be able
18
+
to calculate common risk metrics related to a portfolio and give real-time feedback
19
+
as you trade.
17
20
18
-
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.
21
+
2. Define an order that can be used to trade a financial instrument. With the `Trade` object,
22
+
you can define simple or even complex orders using Python. These orders will also help similify
23
+
common scenarios like defining both a take profit and stop loss at the same time.
19
24
20
-
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.
25
+
3. A real-time data table that includes both historical and real-time prices as they change. The
26
+
`StockFrame` will make the process of storing your data easy and quick. Additionally, it will be
27
+
setup so that way you can easily select your financial data as it comes in and do further analysis
28
+
if needed.
29
+
30
+
4. Define and calculate indicators using both historical and real-time prices. The `Indicator` object
31
+
will help you easily define the input of your indicators, calculate them, and then update their values
32
+
as new prices come.
21
33
22
34
## Setup
23
35
24
-
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.
36
+
**Setup - Local Install:**
37
+
38
+
If you are planning to make modifications to this project or you would like to access it
39
+
before it has been indexed on `PyPi`. I would recommend you either install this project
40
+
in `editable` mode or do a `local install`. For those of you, who want to make modifications
41
+
to this project. I would recommend you install the library in `editable` mode.
25
42
26
-
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.
43
+
If you want to install the library in `editable` mode, make sure to run the `setup.py`
44
+
file, so you can install any dependencies you may need. To run the `setup.py` file,
45
+
run the following command in your terminal.
27
46
28
47
```console
29
48
pip install -e .
30
49
```
31
50
32
-
This will install all the dependencies listed in the `setup.py` file. Once done you can use the library wherever you want.
51
+
If you don't plan to make any modifications to the project but still want to use it across
52
+
your different projects, then do a local install.
53
+
54
+
```console
55
+
pip install .
56
+
```
57
+
58
+
This will install all the dependencies listed in the `setup.py` file. Once done
59
+
you can use the library wherever you want.
60
+
61
+
**Setup - PyPi Install:**
62
+
63
+
The project can be found at PyPI, if you'd like to view the project please use this
64
+
[link](https://pypi.org/project/python-trading-robot/). To **install** the library,
65
+
run the following command from the terminal.
66
+
67
+
```bash
68
+
pip install python-trading-robot
69
+
```
70
+
71
+
**Setup - PyPi Upgrade:**
72
+
73
+
To **upgrade** the library, run the following command from the terminal.
74
+
75
+
```bash
76
+
pip install --upgrade python-trading-robot
77
+
```
33
78
34
79
## Usage
35
80
36
-
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:
81
+
To run the robot, you will need to provide a few pieces of information from your TD Ameritrade Developer account.
82
+
The following items are need for authentication:
37
83
38
-
- 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`.
84
+
- Client ID: Also, called your consumer key, this was provided when you registered an app with the TD Ameritrade
85
+
Developer platform. An example of a client ID could look like the following `MMMMYYYYYA6444VXXXXBBJC3DOOOO`.
39
86
40
-
- 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>
87
+
- Redirect URI: Also called the callbakc URL or redirect URL, this was specified by you when you regiestered your app with
88
+
the TD Ameritrade Developer platform. Here is an example of a redirect URI <https://localhost/mycallback>
41
89
42
-
- 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`
90
+
- Credentials Path: This is a file path that will point to a JSON file where your state info will be saved. Keep in mind
91
+
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,
92
+
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`
43
93
44
-
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:
94
+
Once you've identfied those pieces of info, you can run the robot. Here is a simple example that will create a new instance
95
+
of it:
45
96
46
97
```python
47
98
from pyrobot.robot import PyRobot
@@ -54,15 +105,17 @@ trading_robot = PyRobot(
54
105
)
55
106
```
56
107
57
-
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.
108
+
For more detailed examples, go to the `trading_robot.py` file to see an example of how to use the library along with all
109
+
the different objects inside.
58
110
59
111
## Support these Projects
60
112
61
113
**Patreon:**
62
-
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.
114
+
Help support this project and future projects by donating to my [Patreon Page](https://www.patreon.com/sigmacoding). I'm always
115
+
looking to add more content for individuals like yourself, unfortuantely some of the APIs I would require me to pay monthly fees.
63
116
64
117
**YouTube:**
65
118
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).
66
119
67
-
**Hire Me:**
68
-
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)
120
+
<!--**Hire Me:**
121
+
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)-->
0 commit comments