Do you want a system which can tell you the current price of Bitcoin and notify you when the current price of Bitcoin crosses the the selling price which you have set for the Bitcoin?
Then this the system you are looking for...
But before we start do guys actually Know what is a Bitcoin and why there is so much of buzz regarding Bitcoin? If you don't know, continue reading further then you will what I wanted to say...
What Is a Bitcoin?A software developer going by the name of Satoshi Nakamoto proposed Bitcoin in 2008, as an electronic payment system based on mathematical proof. The idea was to produce a means of exchange, independent of any central authority, that could be transferred electronically in a secure, verifiable and immutable way.
Since its launch in 2009, Bitcoin has been a controversial concept. Some people accept it as an anonymous currency, which protects their privacy and also provides a unified platform for all kinds of transactions online. Whereas there are others who shun it saying that it's the currency of the black market.
But, the recent upshoot of the Bitcoin price has made everyone want to invest in it. There are stories about people who paid 25, 000 Bitcoins for a pizza back in 2009-10 and are now regretting that decision. Whereas there are others who are running mining rigs and farms and making millions. But, it is not necessary that the Bitcoin price always stays high. Sometimes it rises and sometimes it falls so why not build a system that tells us when it rises and when it falls.
Steps:1) Get the Price of BitcoinTo build the Bitcoin Price Alerting system, we will require a method to find the current price of Bitcoin by writing a Python program. We will use the following website https://min-api.cryptocompare.com to get the price of Bitcoin.
2) Set Up a BuzzerConnect the buzzer to your Bolt module. The buzzer will be switched ON when the current price of the Bitcoin is greater than the selling price defined by you.
3) Flow of the Code- Fetch the current price of Bitcoin every 30 seconds using the single symbol price API in USD.
- Check if the current price returned by the API is greater than the selling price defined by you. You can define the selling price as a variable in your program.
- If the current price is greater than the selling price, the program should trigger the Bolt Cloud API to switch on the buzzer connected to the Bolt module for 5 seconds and then switches it off after 5 seconds.
- Your program should repeat the steps 1, 2, 3 continuously every 30 seconds.
- You will require some additional Python libraries to be installed to run this project. We will also provide you a reference of the Python function to get the current price of Bitcoin. You will need to use these resources listed below to complete this assignment.
NOTE: Make sure that your program checks the value of Bitcoin every 30 seconds or more and not any lesser time than 30 seconds as you can get rate limited on the Bolt Cloud if you make the API calls too fast. Then you will have to wait until your API calls are allowed. In order to prevent your API calls getting rate limited you can use pro version of Bolt Cloud
VideoOutput:This screenshot shows the output of the program.
Comments
Please log in or sign up to comment.