The triggering of sell bitcoin

  1. Initially, we should set the sell threshold as lower than the current price. So, for example, let's set the threshold for 6400 and execute the script again. The following code shows that the sell_thresh is set to 6400:
# define buy and sell thresholds for bitcoin
buy_thresh = 6400
sell_thresh = 6400

Now, the sell alert should execute. Verify it in the email again.

  1. After verifying this, we should see that we have received the email alert advising us to sell bitcoin because the current asking price is higher than what we are willing to sell for:

  1. The script is ready. You can now set it to run automatically on all kinds of operating systems. On Windows, use the Task Scheduler.
  2. From the Action menu, choose Create Task..., and give it the name Bitcoin trade alert, as shown in the following screenshot:

  1. From the Triggers tab, click on New..., as shown in the following screenshot:

  1. Choose the Daily radio button.
  1. Then, in Advanced settings, choose to repeat the task after the required number of minutes or hours. Here, we will set it to every 1 hour, as shown in the following screenshot:

  1. Next, from the Actions tab, click on the New... button.
  1. Choose the script that was created to be executed whenever the task runs by clicking on the Browse... button. Now, this task will run automatically every hour, and will check for bitcoin prices and send an email advising us whether to buy or sell bitcoin.

You can also choose to trigger the trade right from the script itself, using any of the bitcoin exchange APIs, such as coinbase.com. As it involves actual money, the user needs to be careful with it.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.94.190