Package: python-trading-robot
Python Trading RobotTable of ContentsOverviewSetupUsageSupport These ProjectsOverviewCurrent Version:0.1.1A trading robot written in Python that can run automated strategies using a technical analysis.
The robot is designed to mimic a few common scenarios:Maintaining a portfolio of multiple instruments. ThePortfolioobject will be able
to calculate common risk metrics related to a portfolio and give real-time feedback
as you trade.Define an order that can be used to trade a financial instrument. With theTradeobject,
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.A real-time data table that includes both historical and real-time prices as they change. TheStockFramewill 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.Define and calculate indicators using both historical and real-time prices. TheIndicatorobject
will help you easily define the input of your indicators, calculate them, and then update their values
as new prices come.SetupSetup - Local Install:If you are planning to make modifications to this project or you would like to access it
before it has been indexed onPyPi. I would recommend you either install this project
ineditablemode or do alocal install. For those of you, who want to make modifications
to this project. I would recommend you install the library ineditablemode.If you want to install the library ineditablemode, make sure to run thesetup.pyfile, so you can install any dependencies you may need. To run thesetup.pyfile,
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 thesetup.pyfile. 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 thislink. Toinstallthe library,
run the following command from the terminal.pipinstallpython-trading-robotSetup - PyPi Upgrade:Toupgradethe library, run the following command from the terminal.pipinstall--upgradepython-trading-robotUsageTo 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 followingMMMMYYYYYA6444VXXXXBBJC3DOOOO.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 URIhttps://localhost/mycallbackCredentials 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.jsonOnce 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:frompyrobot.robotimportPyRobot# Initialize the robottrading_robot=PyRobot(client_id='XXXXXX111111YYYY22',redirect_uri='https://localhost/mycallback',credentials_path='path/to/td_state.json')For more detailed examples, go to thetrading_robot.pyfile to see an example of how to use the library along with all
the different objects inside.Support these ProjectsPatreon:Help support this project and future projects by donating to myPatreon 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 channelSigma Coding.