A simple program for remotely connecting to cryptocurrency exchanges and retrieving information from them.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
I started working on ConnectToExchange
in 2017 during the last big bitcoin hype. Its purpose is to create the initial connection with an exchange, and to fetch basic information from the exchange, such as public price data or one's own personal trading history.
ConnectToExchange
can be used on its own to gather information. It can also be imported into other modules to grant them the ability to communicate with exchanges, such as a module for executing trades. ConnectToExchange
has no function for actually executing a trade itself.
-
Python 3.6
-
Pandas
-
CCXT
- The fantasticCCXT
library is critical toConnectToExchange
. Huge thanks to @kroitor and the many otherCCXT
contributors that made this program possible. -
GetCurrentTime
- This program is imported to help collect time data in a legible fashion. It also allows for the translation of time stamps. You can read more about it here: github.com/EvanGottschalk/GetCurrentTime -
AudioPlayer
- This is a simple program for playing custom audio alerts. It can be used withConnectToExchange
to warn you if an error occurs. You can read more about it here: github.com/EvanGottschalk/AudioPlayer
OperateExchange
is easy to get up and running. Let me know if you have any trouble! I'm always trying to make installation as smooth as possible.
Before using ConnectToExchange
, you must first obtain an API key and secret from the cryptocurrency exchange of their choosing. You also need to install the CCXT
library.
-
Install the
pandas
andCCXT
libraries, which are listed inrequirements.txt
. The easiest way to do this to downloadrequirements.txt
and usepip
:pip install -r requirements.txt
-
Download the
.py
files in from this repository (ConnectToExchange.py
,GetCurrentTime.py
, and optionallyAudioPlayer.py
). -
In the same folder as
ConnectToExchange.py
, create a.txt
file to store your API information. Its name should start with the exchange you are using, followed by an underscore, followed by the name of the account you're using, and ending with_API.txt
.For example, if you are using your Main account on Coinbase, you would name the
.txt
fileCoinbase_Main_API.txt
If your API key is
view-only
, you can save your cryptocurrency exchange API key on the 1st line, and your API secret on the 2nd. However, if your API key hastrade
priveleges, you should save an encrypted version of both your key and secret on those lines instead.To encrypt your API information, I recommend using
CustomEncryptor.py
-
Run
ConnectToExchange.py
-
Congratulations! You can now use
ConnectToExchange
to connect to your favorite exchanges and retrieve information from them!
Checking Prices - A quick, simple, and handy feature of ConnectToExchange
is its ease of acquiring the current price of an asset of your desire. This can be incorporated into all sorts of other programs.
Checking Orders - You can use ConnectToExchange
to check the status of your orders to see if they are open or have been filled. If they have been filled, you can then use the closing information to calculate profits/losses.
Accumulating OHCLVs - If you run ConnectToExchange
on a regular basis, it will accumulate OHLCV information in a Master OHLCV. This is handy if you want to really analyze granular price action over the long term. Normally, exchanges limit how many data points you can retrieve all at once. On Binance, for example, you are limited to only 500 data points. So, if you want to know the price every minute for the past 600 minutes, you're out of luck - unless you ran ConnectToExchange
the previous day. Based on how granular you need the information to be, so long as you run ConnectToExchange
regularly, you can completely overcome the limits set by the exchanges.
A Whole Lot More - The breadth of ways ConnectToExchange
can be used in other programs is limitless. Any module that could benefit from accessing cryptocurrency prices and their relationships to each other can use ConnectToExchange
to quickly attain that feature.
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the GNU GPL-3 License. See LICENSE
for more information.
Evan Gottschalk - @Fort1Evan - [email protected]
Project Link: https://github.com/EvanGottschalk/ConnectToExchange
- Huge thanks to @kroitor and the many other CCXT contributors that made this program possible.
- Thanks to @bartmassi for working with me to improve the program's security, and for answering numerous other questions, and also for always being a helpful, available, and informative teacher (and friend).
Thinking about contributing to this project? Please do! Your Github username will then appear here.