Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Hands-On Bitcoin Programming with Python

You're reading from  Hands-On Bitcoin Programming with Python

Product type Book
Published in Aug 2018
Publisher
ISBN-13 9781789537000
Pages 90 pages
Edition 1st Edition
Languages
Author (1):
BignumWorks Software LLP BignumWorks Software LLP
Profile icon BignumWorks Software LLP

How to get a current bid and asking price for bitcoin

Google search is the simplest way to search for the current bid rate. In order to achieve the buying and selling of bitcoin, the triggering of both should be done accordingly.

The triggering of buy bitcoin

The following are the steps to go through to get the current bid:

  1. First, check the bitcoin price online.
  2. Modify the script so that the buy alert triggers first. Set the buy threshold to higher than the current price. Here, we set the buy threshold to 6500, as shown in the following code:
# define buy and sell thresholds for Bitcoin
buy_thresh = 6500
sell_thresh = 6500
  1. Save the script and execute it. The following screenshot shows the executed script:

The script has...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}