Skip to main content

A trading robot written in Python utilizing the Lemon Markets API capable of maintaining a portfolio of instruments, displaying performance metrics, submitting orders, providing real-time & historical data and showcasing technical indicators.

Project description

Pyrobot

Table of Contents

Overview

Current Version: 1.0.6

A trading robot written in Python utilizing the Lemon Markets API designed to mimic a few common scenarios:

  1. Providing an interface for the user's trading account. The PyRobot object will initialize a new instance of the robot and provide general information regarding the user's account. It will also serve as main object connecting all other objects to provide easy access to other functionalities.

  2. Maintaining a portfolio of multiple instruments. The Portfolio object will be able to calculate common portfolio risk metrics, display order information, and provide both historical and real-time prices for instruments.

  3. Define an order that can be used to trade a financial instrument. With the Trade object, you can place, cancel and retrieve orders.

  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.

  5. Access new information daily. The MarketData,TradingPositions and TradingAccount objects will interact with the Lemon Markets API to ensure the trader is equipped with up-to-date information regarding the market and their portfolio.

Setup

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 trad-robo-python

Usage

To run the robot, you will need to provide a few pieces of information from your Lemon Markets Paper Trading Account The following items are need for authentication:

  • Market Data API Key: This will be provided when you register an account with the Lemon Markets website. An example of a Market Data API key could look like the following eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJh.

  • Paper Trading API Key: This will be provided when you register an account with the Lemon Markets website. An example of a Paper Trading API key could look like the following eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..

Once you've identified 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(
    market_api_key='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJh',
    paper-trading_api_key='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.'
)

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trad_robo_python-1.0.6-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file trad_robo_python-1.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for trad_robo_python-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 f4f9266677ad6352be592e604d38a4e92475d3816f67c91e906c962b5ccedebe
MD5 d631a318eed35bb5b05071c8094283f9
BLAKE2b-256 76f3226885dc031b37a67f34b24c79ebfce3e320342e82c2d203dd1aa4ca5b98

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page