Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Bitcoin Programming with Python

You're reading from   Hands-On Bitcoin Programming with Python Build powerful online payment centric applications with Python

Arrow left icon
Product type Paperback
Published in Aug 2018
Publisher
ISBN-13 9781789537000
Length 90 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Harish Garg Harish Garg
Author Profile Icon Harish Garg
Harish Garg
Arrow right icon
View More author details
Toc

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 $19.99/month. Cancel anytime