Python library for cryptocurrency trading
Project description
crypto-alpine
Python library for cryptocurrency trading using the most common exchanges.
How to install
pip install -U crypto-alpine
Documentation
- Set environment variables (optional)
export API_SECRET_KEY=xxx
export API_ACCESS_KEY=yyy
export API_PASSPHRASE=zzz
- Initialize
from alpine.exchanges import Wrapper
w = Wrapper('bitget')
Note that if you don't want to use enviroment variables (if you wish to use the library within your code), you can define them during the initialization:
from alpine.exchanges import Wrapper
w = Wrapper('bitget', <access_key>, <secret_key>, <passphrase>)
- Set a leverage
w.set_leverage(leverage, position, symbol, margin_coin)
# Example: w.set_leverage(10, "long", "FETUSDT", "usdt")
- Create an order
w.create_order(position, symbol, price, amount, margin_coin, take_profit, stop_loss)
# Example: w.create_order("long", "FETUSDT", 2.5, 100, "usdt", 3, 2)
- Get order detail
w.get_order_detail(symbol, order_id)
# Example: w.get_order_detail("FETUSDT", "123456")
- Get current position detail
w.get_current_position(symbol, margin_coin)
# Example: w.get_current_position("FETUSDT", "usdt")
- Get historical position detail
w.get_historical_position(symbol, margin_coin)
# Example: w.get_historical_position("FETUSDT", "usdt")
Current supported cryptocurrency exchanges
- bitget
Need help
Please create an issue if you need a feature/exchange to be implemented.
Support
If you wish to support the project:
- Ethereum: 0xf11B49666d3386C96Af1A496bFA5688c83B25E8e
- Solana: C7USpoN4kxEm81w3mpK7FuNQ7zcMWY9fqyuacPafRqnk
- Bitcoin (segwit): bc1qcq7fdn4khlsc5ldmlf0ezks8p9r5q2hn04lyy5
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
crypto_alpine-0.1.3.tar.gz
(17.6 kB
view details)
Built Distribution
File details
Details for the file crypto_alpine-0.1.3.tar.gz
.
File metadata
- Download URL: crypto_alpine-0.1.3.tar.gz
- Upload date:
- Size: 17.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.3 Darwin/23.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94089286df8fe0e99f422bdabba7bffa73d718e7612518e4bc4b08fab958a5ae |
|
MD5 | 5ef655f577f99bbd623eccc5452b9ded |
|
BLAKE2b-256 | ec9bc178f7737439796127683f5b69b7553a256759bab1b5867586de8b009bd4 |
File details
Details for the file crypto_alpine-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: crypto_alpine-0.1.3-py3-none-any.whl
- Upload date:
- Size: 19.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.3 Darwin/23.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb7128239a8a2740c6e980d64d50ea4a39a13a46dd044c30b92cbaa0a9ac4266 |
|
MD5 | b88c97185558fbce44869696b7f015b7 |
|
BLAKE2b-256 | cb63cdd7dc024986bfe8b2a3ac95fad8adb3fe54d5866f186f4c42044a92b795 |