AI-Powered Bitcoin Trading - Eoghan Leahy - E-Book

AI-Powered Bitcoin Trading E-Book

Eoghan Leahy

0,0
32,99 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Survive and thrive amongst the professional traders using sophisticated cryptocurrency analysis and trading techniques The purpose of this book is to provide a concise yet comprehensive background of some effective methods for analyzing markets and creating fully automated AI-optimized trading systems. The book outlines some easy-to-replicate yet highly effective quant trading techniques that can be used for analyzing asset prices and then apply them to Bitcoin prices, showing how to generate actionable insights from data that can be used to create fully automated trading signals and systems. Big data analytics can be enhanced with artificial intelligence techniques. Back testing and optimization methods are presented with a special emphasis placed on the use of distributed genetic algorithms for parameter optimization. Finally, a case study of a fully automated trend-following trading strategy that leverages artificial intelligence is presented. Bitcoin AlphaBot(TM) combines human insight with AI-driven optimization to build profit table trend trading strategies.

Sie lesen das E-Book in den Legimi-Apps auf:

Android
iOS
von Legimi
zertifizierten E-Readern

Seitenzahl: 184

Veröffentlichungsjahr: 2024

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

Cover

Table of Contents

Title Page

Copyright

Chapter 1: The Block of Genesis

An Immutable Ledger

Bitcoin Mining

The Blockchain Trilemma

Security

Scalability

Decentralization

From Web 2.0 to Web 3.0

Chapter 2: How Bitcoin Works

Blockchain Technology

Elliptic Curve Cryptography

Cryptocurrency Storage

Hot vs. Cold Storage Wallets

Sybil Attacks

Consensus Method Mechanism

Proof of Work

The Proof‐of‐Work Energy Consumption Debate

Proof of Stake

Proof of Work vs. Proof of Stake

We Hate Forking Hackers!

Staking Rewards

Merge Right to Avoid Danger Ahead!

Stable Coins and CBDCs

Chapter 3: Valuing Bitcoin

To Own Crypto Is to Understand Crypto

So How Much Could One Bitcoin Eventually Be Worth?

Hal Finney's Ambitious Bitcoin Valuation

Bitcoin as Digital Gold

Bitcoin's Production Value

The Bitcoin Hash Rate

Value as a Multiple of Mining Cost

Relative Valuation

Bitcoin Transaction Volume

Stock‐to‐Flow

Metcalf's Law

From Long‐term Predictions to Short‐term Trading

Chapter 4: Price Analysis for Prediction

The Saga of Investors

Are Market Prices Random?

Trend Following

Dow Theory

Contrarian Theory

Chapter 5: Artificial Intelligence for Price Prediction

Prediction vs. Classification

Technical Analysis

Financial Market Prediction Models

ChatGPT and Price Prediction

Chapter 6: Traditional Trading Methods

Moving Averages

RSI

MACD

ATR

Putting It All Together

Chapter 7: Advanced Trading Techniques

Relative Strength Analysis

Bitcoin vs. the Total Cryptocurrency Market Cap

Bitcoin Dominance

Bitcoin Price Performance versus Dominance over Time

Market Breadth—Metadata Analysis

Seasonality and the Bitcoin Halving

Chapter 8: Automating Signals and Strategies

Quantitative Trading Strategies

The Triple Exponential Moving Average (TEMA) System

Using the False Breakout Finder (FBF) Study to Find Potential Reversals

Monitoring the Market Sell‐Off with Range Volatility Spike Alerts

Programming Signals to Identify 52‐Week Relative Highs and Lows

Backtesting Big Data—the RSI Breadth Entry Trigger (rsiBET)

Converting Signals into Fully Automated Strategies

Chapter 9: Backtesting and Optimization

Quantitative Trading Strategies and Parameter Optimization

The Technical Trading Strategy

The Test Data

Selecting and Optimizing a Trading Strategy

Chapter 10: The Evolution of Artificial Intelligence

Infinite Monkey Theorem

Beyond Brute Force

Genetic Algorithms for Parameter Optimization

The Traveling Salesman Problem

Darwinian Natural Selection

Financial Applications of Genetic Algorithms

These Three Operators Are Then Used as Part of a Five‐Step Process

Empirical Results and Conclusions

Unique Considerations of Cryptocurrency Trading

Putting It All Together—Bitcoin AlphaBot™

Chapter 11: Case Study: Bitcoin AlphaBot™

Bitcoin AlphaBot™: Performance Analysis

Bitcoin AlphaBot™: Risk Management

Bitcoin AlphaBot™: Statistical Analysis

Sharpe vs. Sortino Ratio

Chapter 12: Digital Asset Market Outlook—July 2023

1) Sum‐of‐the‐parts Valuation too Cheap

2) Regulation Is around the Corner

3) The Halving Is Coming

4) Synthetic Short Covering Rally Imminent

5) Spot ETF to Drive Bitcoin Price to 100k+

References

Author Bio

Index

End User License Agreement

List of Illustrations

Chapter 1

Figure 1.1 The original Bitcoin whitepaper.

Figure 1.2 The genesis block's hexadecimal code.

Figure 1.3 FRED: total assets.

Figure 1.4 US Debt Clock.

Figure 1.5 Bitcoin was designed to remove financial institutions from transa...

Figure 1.6 Scalability, decentralization, and security.

Figure 1.7 Cryptocurrency transaction speeds compared to Visa & Paypal.

Figure 1.8 Reachable Bitcoin nodes.

Figure 1.9 Top 10 countries with reachable Bitcoin nodes.

Chapter 2

Figure 2.1 Elliptic curves.

Figure 2.2 Elliptic curve secp256k1.

Figure 2.3 Sybil resistance mechanism overview.

Figure 2.4 Different types of consensus mechanisms.

Figure 2.5 Annual energy use.

Figure 2.6 Proof‐of‐work vs. proof‐of‐stake: Pros, cons, and differences exp...

Figure 2.7 No staking vs. staking—the power of compounding.

Figure 2.8 Bitcoin vs. Ethereum.

Chapter 3

Figure 3.1 Previously unpublished emails of Satoshi Nakamoto present a new p...

Figure 3.2 Bitcoin's production value.

Figure 3.3 Image: Bitcoin hash rate vs. bitcoin price.

Figure 3.4 Miner profitability ratio.

Figure 3.5 Paul Tudor Jones store of value scoring as of August 4, 2020.

Exhibit 3.1 Asset class value and money as of February 2022.

Figure 3.6 Putting the world's money into perspective.

Figure 3.7 NVT ratio vs. Bitcoin price.

Figure 3.8 Stock to flow of Bitcoin, gold, and silver.

Figure 3.9 Bitcoin stock‐to‐flow ratio.

Figure 3.10 X (formerly Twitter) post by Vitalik Buterin.

Figure 3.11 Metcalf's law.

Figure 3.12 Crypto users vs. Internet users over same time; log scale.

Chapter 4

Figure 4.1 The saga of an investor.

Figure 4.2 Primary, secondary, and minor trends.

Figure 4.3 Accumulation and distribution.

Figure 4.4 Points of maximum financial risk and maximum financial opportunit...

Chapter 5

Figure 5.1 Performance of ChatGPT has deteriorated.

Figure 5.2 ChatGPT can't predict market price movements—for now.

Chapter 6

Figure 6.1 The Average True Range (ATR).

Figure 6.2 The S&P 500 with two different measures of ATR.

Figure 6.3 SPX index and chandelier exits.

Chapter 7

Figure 7.1 Price of Apple and Apple/SPX.

Figure 7.2 Crypto total market.

Figure 7.3 Total market value of Bitcoin.

Figure 7.4 Market cap of Bitcoin vs. the rest of the market (excluding BTC)....

Figure 7.5 Bitcoin vs. USD.

Figure 7.6 NYSE advance‐decline line.

Figure 7.7 Market breadth measures.

Figure 7.8 BTC/USD.

Chapter 8

Figure 8.1 The TEMA system.

Figure 8.2 TEMA and MACD.

Figure 8.3 TEMA for Euro Stoxx 600.

Figure 8.4 The False Breakout Finder.

Figure 8.5 S&P 500 with the RVS study.

Figure 8.6 52‐week relative highs and lows for Apple.

Figure 8.7 12‐month daily chart of the S&P 500 with rsiBET signals.

Figure 8.8 SPX index and ATR exits long.

Figure 8.9 The rsiBET long‐only strategy.

Figure 8.10 The rsiBEt long‐only strategy outperformed buy and hold and seve...

Chapter 9

Figure 9.1 Bloomberg Professional Terminal Trading Signals: Signal Definitio...

Figure 9.2 Bloomberg parameter optimization 3D surface graph.

Figure 9.3 The multi‐strategy optimization page in the Bloomberg Terminal.

Figure 9.4 Parameter optimization in the Bloomberg Terminal.

Figure 9.5 Backtesting in the Bloomberg Terminal.

Figure 9.6 Generating a 3D surface of the entire dataset in the Bloomberg Te...

Figure 9.7 3D surface in the Bloomberg Terminal.

Chapter 10

Figure 10.1 The infinite monkey theorem.

Figure 10.2 Bloomberg Professional Terminal backtesting and optimization res...

Figure 10.3 The traveling salesman problem.

Figure 10.4 Components of a genetic algorithm.

Figure 10.5 An example of a chromosome.

Figure 10.6 Crossovers and mutations.

Figure 10.7 Initial population of values.

Figure 10.8 Visualization of genetic algorithm convergence from iteration 60...

Figure 10.9 The Bitcoin trading system profit fitness function solved using ...

Chapter 11

Figure 11.1 Bitcoin AlphaBot

TM

Cumulative Returns vs. Bitcoin.

Figure 11.2 Performance of the Eurakehedge Crypto Hedge Fund Index and BTC....

Figure 11.3 Bitcoin Alphabot

TM

monthly total BTC returns.

Figure 11.4 Performance of the Bitcoin Alphabot

TM

for 2015–2023.

Figure 11.5 Bitcoin Alphabot

TM

cumulative returns vs. Bitcoin (Kraken) for 2...

Figure 11.6 Bitcoin Alphabot

TM

: performance analysis.

Figure 11.7 Bitcoin AlphaBot™ annual drawdown (%) vs. Bitcoin.

Figure 11.8 Bitcoin AlphaBot™: risk management.

Figure 11.9 Distribution of monthly returns.

Figure 11.10 Daily returns.

Figure 11.11 Bitcoin AlphaBot™: statistical analysis.

Figure 11.12 Rolling Sharpe.

Figure 11.13 Rolling Sortino.

Chapter 12

Figure 12.1 Crypto total market cap.

Figure 12.2 Market cap of Bitcoin, Ethereum, and Tether.

Figure 12.3 Crypto total market cap excluding BTC and ETH.

Figure 12.4 Bitcoin/USD.

Figure 12.5 FRED total assets.

Figure 12.6 Bitcoin/USD.

Guide

Cover

Table of Contents

Title Page

Copyright

Begin Reading

References

Author Bio

Index

End User License Agreement

Pages

iii

iv

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

105

106

107

108

109

110

111

112

113

114

115

116

117

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

161

162

163

164

165

166

167

168

169

AI‐Powered Bitcoin Trading

Developing an Investment Strategy with Artificial Intelligence

 

 

Eoghan Leahy

 

 

 

 

 

Copyright © 2024 by John Wiley & Sons, Inc. All rights reserved.

Published by John Wiley & Sons, Inc., Hoboken, New Jersey.Published simultaneously in Canada.

No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per‐copy fee to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, (978) 750‐8400, fax (978) 750‐4470, or on the web at www.copyright.com. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748‐6011, fax (201) 748‐6008, or online at http://www.wiley.com/go/permission.

Trademarks: Wiley and the Wiley logo are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates in the United States and other countries and may not be used without written permission. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc. is not associated with any product or vendor mentioned in this book.

Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their best efforts in preparing this book, they make no representations or warranties with respect to the accuracy or completeness of the contents of this book and specifically disclaim any implied warranties of merchantability or fitness for a particular purpose. No warranty may be created or extended by sales representatives or written sales materials. The advice and strategies contained herein may not be suitable for your situation. You should consult with a professional where appropriate. Further, readers should be aware that websites listed in this work may have changed or disappeared between when this work was written and when it is read. Neither the publisher nor authors shall be liable for any loss of profit or any other commercial damages, including but not limited to special, incidental, consequential, or other damages.

For general information on our other products and services or for technical support, please contact our Customer Care Department within the United States at (800) 762‐2974, outside the United States at (317) 572‐3993 or fax (317) 572‐4002.

Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic formats. For more information about Wiley products, visit our web site at www.wiley.com.

Library of Congress Cataloging‐in‐Publication Data is Available:

ISBN 9781119661177 (Hardback)ISBN 9781119661221 (ePDF)ISBN 9781119661160 (ePub)

Cover Design: WileyCover Image: © grafius/Adobe Stock

Chapter 1The Block of Genesis

“The Times 03/Jan/2009 Chancellor on brink of second bailout for banks.”

—Satoshi Nakamoto

The birth of Bitcoin, like many religious movements, is a story for the ages. Bitcoin was founded by one mythical individual whose impact may last centuries. While there have been many false idols and pretenders to the crown, Bitcoin has remained the core of the cryptocurrency movement.

The exact birth date of Bitcoin can be disputed. The initial whitepaper was published on an online cryptographic forum on Halloween 2008. However, the timestamp of the first block is technically at 18:15:15 UTC on January 3, 2009, yet the Bitcoin network did not go live until January 8.

Satoshi Nakamoto is a pseudonym adopted by Bitcoin's creator, whose real identity has never been publicly revealed. There is something magical about a new disruptive financial ecosystem being launched by a single unknown operator who has never claimed the wealth they created.

Figure 1.1 The original Bitcoin whitepaper.

Many books have been written trying to decipher the real identity of Satoshi. Exhaustive analysis of the original emails between Satoshi and early adopters from the cryptocurrency community reveals some critical information.

Studying the email time zones, the writing styles, and comments made by counterparties offers clues. Early messages question whether Satoshi is even Japanese, as the name would suggest. Some have claimed to be Satoshi, and some still do, but to date, no irrefutable proof has been tabled.

While the “who” of Bitcoin is uncertain, the why is much more obvious. Encoded by Satoshi in the first‐ever Bitcoin transaction was the following message:

The Times 03/Jan/2009 Chancellor on brink of second bailout for banks.

The above statement is a reference to the bailout of the global banking industry during the financial crisis of 2008/2009. The decision by governments to socialize the losses of private institutions marked the death of the fiat currency system. The profits of banks are private; however, the government covered their losses. In doing so, it passed the burden on to the public citizens through taxes and inflation caused by reckless money printing.

Figure 1.2 The genesis block's hexadecimal code.

Bitcoin supply is finite. This means that no person or entity can create more to benefit themselves at the expense of all that rely on the currency as a store of value. This is a key feature of Bitcoin relative to most other cryptocurrency projects.

This means that no government can print more Bitcoin to bail out corporations or fund wars. Essentially, the fiat money system allows politicians to write checks that the rest of the population needs to pay for, a problem that has now become so severe that for the debt to be repaid in full, it may be that future generations will have to pay the price for the financial recklessness of a few.

The chart of the total assets of the US Federal Reserve shows a parabolic rise, growing ten times from an initial base of under $1 trillion (USD) since 2013. The growth in the US national debt when compared to national GDP is reaching dangerous levels.

Paul Tudor Jones laid out the investment case for investors in the May 2020 BVI Macro Outlook. He discussed the inflationary pressures caused by the FED's money‐printing policies, stating that:

Figure 1.3 FRED: total assets.

Source: FRED / https://fred.stlouisfed.org/series/WALCL / Public Domain.

The current economic environment presents a compelling opportunity to explore how Bitcoin can be part of a resilient portfolio. As demand for stores of value grows during this regime of monetary inflation, Bitcoin may be well‐positioned given that it is a scarce digital asset. (Paul Tudor Jones, 2020)

The current levels of debt have passed the event horizon. There is no realistic way for this debt to be repaid. A new financial reset is likely, and Bitcoin may well be at the core of the eventual solution.

Bitcoin was not just created to control the destruction of value by central bank money printing. It attacks the core of the financial system. Money is created as debt, and debt incurs interest. So as soon as money is created and interest is owed, there is no longer enough money in the system to settle all debts. Furthermore, with charges placed on financial transactions, this pool of money shrinks further.

In the past, financial security was an important issue. Individuals needed a place to keep their money safe from theft, while international transactions were complicated and took considerable time.

Advances such as the Internet, artificial intelligence, faster computer processing speeds, cryptography, cybersecurity, and international commerce are now more effective and efficient at keeping money safe and transacting quickly and securely. Satoshi clearly highlights that the core purpose of Bitcoin is to remove the financial sector involvement from the money system using digital currencies built on blockchain technology that use mathematics for security rather than physical vaults.

Figure 1.4 US Debt Clock.

Source: https://www.usdebtclock.org/.

Figure 1.5 Bitcoin was designed to remove financial institutions from transactions.

The above graphic taken from the original Bitcoin whitepaper written by Satoshi unceremoniously cuts “trusted third parties” and “counterparties” out of the financial transaction process.

“What is needed is an electronic payment system based on cryptographic proof instead of trust, allowing any two willing parties to transact directly with each other without the need for a trusted third party” (Satoshi, Bitcoin whitepaper).

It is clear to see why the traditional financial sector views Bitcoin and cryptocurrency as an existential threat to the current global payments system—because it is!

An Immutable Ledger

The blockchain ledger is like a Bible that can't be rewritten. In the past decade, the language of some versions of the Bible has changed from describing the interactions of Jesus with “lepers” to the more socially acceptable “people with rare skin conditions.” This increased social awareness, while likely in line with the sentiment of the original authors, is not the exact word‐for‐word writings of the original author.

What if there was a way to secure data so that it can never be changed in the future? That is exactly how an immutable ledger works. This provides the security authentication layer that underlies blockchain technology.

Bitcoin Mining

The first Bitcoin block was mined in January 2009. Like any sector, cryptocurrency has a high level of obfuscation (a word that often does what it means), as it is heavy with jargon taken from several different disciplines such as trading, finance, technology, gaming, and coding, to name a few. The sector has also created its own new set of terms to increase the “FUD” (fear, uncertainty, and doubt) that deters traders from “HODLing” (holding on for dear life).

The key is to stay humble and not let a lack of knowledge discourage your investment in the cryptocurrency space. Instead, dedicate yourself to learning. In fact, it is the early adopters who take the most risk early in projects that get rewarded the most. The future of cryptocurrency definitely favors the brave.

The earliest of those adopters that are constantly rewarded are the miners. So what is Bitcoin mining, and how does it work?

Bitcoin supply is fixed at 21 million Bitcoin—no more can ever be created. It is this finite supply that directly addresses the central bank currency debasement issue. Each Bitcoin is divisible by eight places after the decimal point (0.00000001 BTC), while the smallest unit is called a Satoshi, or sat for brevity.

There are several problems to be solved to launch and maintain a digital currency such as Bitcoin. How do you mint the currency over time in a controlled way that will not lead to liquidity issues that affect price stability? How do you incentivize others to help you maintain the immutable ledger and process transactions on the blockchain 24/7/365? How do you keep the network secure from hackers and bad operators?

The problems above are addressed by the intricate details involved in the mining process. Bitcoin uses a mining mechanism called proof of work, which requires miners to apply computer processing power to try and solve complex mathematical problems to earn newly minted Bitcoin. While mining to earn Bitcoin, they simultaneously settle Bitcoin transactions, communicate periodically with other miners to “validate” the transactions are correct, and add them to the immutable ledger of transactions on the Bitcoin blockchain.

Imagine a college lecturer in an auditorium with 100 students. Not the most tech‐savvy operator, they write lecture notes by hand, copying verbatim what is written by the professor on a chalkboard. Occasionally, the lecturer makes spelling errors, as do some of the students. One day the lecturer's notebook gets stolen! The sole centralized storage of all vital information is lost forever—what a disaster!