App development
IntelliCoin is a mobile app for trading cryptocurrency with AI-based buying/selling recommendations. It is Python/Kivy-based app with a unique UI design that has been integrated with a free crypto API, CoinGecko, receiving crypto prices in real-time. It is also connected to two different exchanges, Kraken and OkCoin, and gets data from related accounts. So it uses real account with real money in it! Not only can it show information regarding balances and assets from the exchange accounts, but it can be used for buying and selling different coins within the app. (You don’t need to go to Kraken and Okcoin to trade crypto. You can buy and sell inside the app!).
To get into the app, first you need to create an account to sign in.
The app has three tabs: suggestion, exchange, and home screens. Once you get in, you’ll see the suggestion screen where there is a list of popular cryptocurrencies and their important info, which are price and price change. Other than those two, there is the AI’s trading suggestion in relation to the cryptos. The AI algorithm suggests buying or selling or no action for a crypto based on data it receives from the API. The algorithm predicts if the price may go up or down in real time. It is currently using linear regression for prediction-making, which gives pretty decent results.
On the suggestion screen, if you tap on any widget, it will navigate you into the asset’s view, which shows more detailed information (market cap, total supply, etc) along with hourly, daily, weekly, monthly and yearly graphs of the prices. There you can also decide if you want to buy/sell the coin. If you tap on the BUY or Sell buttons you will see a nice pop up where you can enter the amount you would like to trade, and then choose the exchange you want to use.
Exchange screen
The middle tab brings you to the exchanges screen, where you can connect your Kraken and/or OkCoin accounts to the app. This allows you to buy and sell whatever you would like to based on the info you get from the AI and related graphs. Obviously, you will have to create exchange accounts to get the API key and API secret, if you do not have them already. Once you get connected to an exchange account by an IntelliCoin account, you will remain connected any time you use the IntelliCoin account unless you disconnect.
###
You can download the code from my GitHub account here.
The app class is the very first class in the main.py file that runs the app.
All screens are in the view folder of the project. For each screen, there is a package with two Python files and a Kivy file. One of the tasks of the Python files is to specify the class of the screen. The Kivy files contain the layouts and styles applied to the related Python class. For example, the signup class is a BoxLayout and its styles are specified within the signup.kv file, which is loaded within the Python file. A screen might have various widgets such as buttons, text fields, etc, defined in the Python classes in the files of the widgets folder. The required widgets are imported to the main.kv file which allows them to be used on any of the screens. A .kv file also specifies the events that a widget can handle. For instance, the on_release event in homeview.kv which is used to release/press a button, references the screen_manager with the id: screen_mngr. So, by using the “current” feature of the screen_mngr, the on_release event changes the screen from the current default screen (e.g. log-in) to the other screens (e.g. sign-up).
The Python file of a screen may also contain functions that receive or update data from the API. For example, the render function in the Suggestion class, which is run in a separate thread from the kivy’s main thread, gets the data of the coins. It also uses some (kivy.)properties, ListProperty, to render the information on the Suggestion screen. But, the updating functions, e.g. on_coins, are run on the main thread. The data comes from CoinGecko API’s URL. Python file may also connect the app to the exchanges, like what add_account function does in the exchanges.py. Furthermore, some .py files include classes, e.g. AssetOrder that handle buying or selling.
This project is still under development but I have made a demo of how it works and how it looks like. Check out its YouTube video here!