Coder Social home page Coder Social logo

cr4shov3rrid3 / coinbase-advancedtrade-python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rhettre/coinbase-advancedtrade-python

0.0 0.0 0.0 68 KB

This is the unofficial Python client for the Coinbase Advanced Trade API. It allows users to interact with the API to manage their cryptocurrency trading activities on the Coinbase platform.

Home Page: https://rhett.blog/youtube

License: MIT License

Python 100.00%

coinbase-advancedtrade-python's Introduction

Coinbase Advanced Trade API Python Client

This is the unofficial Python client for the Coinbase Advanced Trade API. It allows users to interact with the API to manage their cryptocurrency trading activities on the Coinbase platform.

Features

  • Easy-to-use Python wrapper for the Coinbase Advanced Trade API
  • Supports all endpoints and methods provided by the official API
  • Lightweight and efficient wrapper
  • Added support for trading strategies covered on the YouTube channel

Setup

  1. Clone this repository or download the source files by running
       pip install coinbase-advancedtrade-python
    
  2. Set your API key and secret in config.py. To obtain your API key and secret, follow the steps below:
    • Log in to your Coinbase account.
    • Navigate to API settings.
    • Create a new API key with the appropriate permissions.
    • Copy the API key and secret to config.py.

Authentication

Here's an example of how to authenticate:

from coinbase_advanced_trader.config import set_api_credentials

# Set your API key and secret
API_KEY = "ABCD1234"
API_SECRET = "XYZ9876"

# Set the API credentials once, and it updates the CBAuth singleton instance
set_api_credentials(API_KEY, API_SECRET)

Usage of Strategies

Here's an example of how to use the strategies package to buy $20 worth of Bitcoin:

from coinbase_advanced_trader.strategies.limit_order_strategies import fiat_limit_buy

# Define the trading parameters
product_id = "BTC-USD"  # Replace with your desired trading pair
usd_size = 20  # Replace with your desired USD amount to spend``

# Perform a limit buy
limit_buy_order = fiat_limit_buy(product_id, usd_size)

Usage of Fear and Greed Index

from coinbase_advanced_trader.strategies.fear_and_greed_strategies import trade_based_on_fgi_simple

# Define the product id
product_id = "BTC-USD"

# Implement the strategy
trade_based_on_fgi_simple(product_id, 10)

Usage of Fear and Greed Index (Pro)

from coinbase_advanced_trader.strategies.fear_and_greed_strategies import trade_based_on_fgi_pro

# Define the product id
product_id = "BTC-USD"

# Define the custom schedule
custom_schedule = [
    {"threshold": 20, "factor": 1, "action": "buy"},
    {"threshold": 80, "factor": 0.5, "action": "buy"},
    {"threshold": 100, "factor": 1, "action": "sell"},
]

# Implement the strategy
response = trade_based_on_fgi_pro(product_id, 10, custom_schedule)

Documentation

For more information about the Coinbase Advanced Trader API, consult the official API documentation.

License

This project is licensed under the MIT License. See the LICENSE file for more information.

Author

Rhett Reisman

Email: [email protected]

GitHub: https://github.com/rhettre/coinbase-advancedtrade-python

Disclaimer

This project is not affiliated with, maintained, or endorsed by Coinbase. Use this software at your own risk. Trading cryptocurrencies carries a risk of financial loss. The developers of this software are not responsible for any financial losses or damages incurred while using this software. Nothing in this software should be seen as an inducement to trade with a particular strategy or as financial advice.

coinbase-advancedtrade-python's People

Contributors

rhettre avatar davidmkcodes avatar thomaslc66 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.