GithubHelp home page GithubHelp logo

webclinic017 / whispertrades Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aliencaocao/whispertrades

0.0 0.0 0.0 3.08 MB

Python API wrapper for the options automated trading platform Whispertrades

Home Page: https://whispertrades.readthedocs.io/

License: Apache License 2.0

Python 100.00%

whispertrades's Introduction

Whispertrades API Python Wrapper

PyPI version PyPI - Python Version PyPI - Downloads Documentation Status

About

Whispertrades is an advanced automated options trading and backtesting platform. This is an unofficial Python wrapper for its API. It builds on Pydantic for strong typing support to ease development, and requests library for HTTP requests.

Installation

Using pip

pip install whispertrades

From source (for latest features and development)

pip install git+https://github.com/aliencaocao/whispertrades

Quick Start

Create an account at Whispertrades and follow the documentation here to apply for an API key.

To ensure security of your API key, it is recommended to store it in an environment variable. You can do this by using WHISPERTRADES_API_KEY=your_api_key in your terminal. Else, you can also pass it in when initializing the client.

from whispertrades import WTClient

client = WTClient(token='YOUR_API_KEY_OR_DO_NOT_PASS_THIS_IF_YOU_HAVE_SET_ENV_VAR')
print(client.bots)
print(client.orders)
print(client.positions)
print(client.reports)
print(client.variables)

bot1 = client.bots['YOUR BOT NUMBER']
print(bot1.orders)  # orders made from this bot
print(bot1.positions)  # positions of this bot
print(bot1.reports)  # reports generated from this bot

# Enable bot
bot1.enable()

# Disable bot
bot1.disable()

# Close all positions of this bot
bot1.close_all_positions()

# Close a particular position by number
client.positions['YOUR POSITION NUMBER'].close()
# OR (making sure the provided position number belongs to the bot)
bot1.positions['YOUR POSITION NUMBER'].close()

This project has rate limiting built-in using requests-ratelimiter and set to 30 requests per minute, the maximum as stated by Whispertrades documentation.

Documentation

https://whispertrades.readthedocs.io/

Disclaimer

This project is strictly provided as-is with absolutely no guarantee. Neither this project nor Whispertrades is an approved financial advisor or broker. The author is not responsible for any financial loss or damages caused by the use of this project or Whispertrades.

License

Copyright 2024 Billy Cao

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

whispertrades's People

Contributors

aliencaocao avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.