Tag Archives: BTC

Blockchain example slide

Proof of Work why use it and why does it use energy

Proof of Work

Proof of work relates to mining of cryptocurrency. It uses computing resources to solve a mathematical puzzle of sorts that takes a lot of compute power to solve but a minimum amount of power to verify that it has been completed. It is an example of a one way function. Easy to go one way but hard to go in the other. Imagine throwing a glass of water in the ocean, now imagine getting all of that water and only that water back out, like running a film backwards, might be impossible. The closer the one way function is to the glass in the ocean example the more secure a blockchain can be made. Why is that? Because it would take so much effort to mutate or corrupt the blockchain that it is not even worth trying.

Brilliant Idea, from Anti-SPAM to Blockchain

In the case of Bitcoin, mining occurs across thousands of nodes that can easily verify that the “work’ has been done and as long as there is a > 50% consensus among mining nodes , then the block is deemed valid and the nodes accept it and move on to the next block of transactions. So it would take an enormous amount of computing power to ‘fake’ a block and create a duplicate spend or a spend that pays an entity some unearned (Bitcoin) BTC, stealing it effectively. That in essence is the brilliance of Bitcoin and it’s pseudonymous creator Satoshi Nakamoto. All the ideas are not original, there was once an idea to use proof of work to prevent spam in email in the mid 1990s when SPAM became a nuisance. For regular uses it would delay the email by a few seconds, for a spammer sending out 1000’s of emails their computer would slow down to much to make it worth it. Satoshi Nakamoto took this idea and applied it to Bitcoin.

The chain part of block chain

On top of this, proof of work  that secures a single block, every block contains the hash of the previous block making it extremely hard to ‘fake’ out and create old blocks over as many hashes would have to be faked. So the longer the chain the more secure older transactions become as they become harder and harder to undo , or fake out.

Hashing in Cryptocurrency

Hashing is the key. Hashing is used in several ways in cryptocurrency.(toward the end of this post a second use is covered) . When mining a block a hash is generated for that block, a SHA256 hash. But not just any hash works. It has to be lower than a specific number determined by the difficulty adjustment, the so called target hash. This changes periodically to keep the outputs of blocks on the block chain, a giant electronic ledger of transactions, blocks are produced very 10 minutes on average. This also limits how many transactions can occur in a given time period. Blocks contain a finite number of transactions and they come out at period intervals, so there are only so many made per day. For Bitcoin this limits the daily transaction to something like around 300000. Other cryptocurrencies do better in this regard (but, buyer beware, they are beholden to companies or individuals that created them,so not independent from control like Bitcoin), so do layer 2 solutions like the Lightning network for Bitcoin. in the future most likely only large infrequent transactions will occur on Bitcoin main chain. With other solutions like the Lightning network or other cryptocurrencies serving to move money like PayPal or a Point Of Sale network, or Swift for that matter.

To create the special hash know as the target hash that meets the difficulty requirement means creating a hash that is lower than a specific 256 bit number. It contains a bunch of zeros at the beginning. This is done by add what is called a nonce ( just a random string will work, used just once  to make the hash come out lower than the target) to the block of transactions and computing the hash. The nonce can be a completely random string or a sequence of numbers tried in order, it really doesn’t matter. The only requirement is that whatever it is it creates a hash output that is lower than the number, target hash, specified by the difficulty requirement. In mining the first node that obtains this number will broadcast the result on the BTC network, all mining nodes will check it (hash the block and see if they agree, quick and easy to do), if it’s OK, the block becomes accepted added to the chain and that miner, the one who solved the hash, gets the block reward along with the fees for all the transactions that have been validated in the block. And, all nodes move on to the next block.

The hash itself

A typical block hash would look something like this…

00000000000000000007cd983a54a4eaf969d79961681fa2fa41eff0aba4a168

Notice all the zeros. With 256 byte number, using SHA256, it is hexadecimal where every number is 0-15 it takes a while to arrive at a number like this. Basically all the nodes that handle the blockchain that are mining are trying to get a ‘low’ number by changing the nonce.

Energy

This takes a lot of computing power and therefore energy. And, this is the complaint when it comes to cryptocurrency that are mined such as Bitcoin. The energy used to mine Bitcoin is equal to that of a small country. But, it has to be remembered that the whole financial technology sector of the economy still dwarfs the energy use of Bitcoin. Just imagine all of the ATMs alone that are plugged in all over the world, the computers running in the banks, heating, other electric and etc. Also, Bitcoin can be mined using energy that is otherwise orphaned. Meaning energy that can not be used for anything else. An example is natural gas and a petroleum well that might normally be flared off. Instead of flaring it off, it could be burned in a gas turbine turning a generator and run mining equipment. The mining equipment could be connected via Cell network or Satellite if no wire are available in a remote location. It is a way of burning a fuel at the source and generating value from it that otherwise would go to waste.

Proof of Work Example

Just a simple example of using a nonce along with a string ‘hello’ in this case and then printing out the resulting hashes of the new compound string of hello+nonce.

As more zeroes are required it gets harder and harder to find a nonce that will satisfy the requirement. To find the first hash with one zero at the start it takes 28 tries, ‘hello28’.

To get 8 leading zeroes it takes hello1202655595  = 1202655595 tries, on fairly regular computer it took from 2022-11-19 15:42 to 2022-11-19 16:48. Just over 1 hour.

Proof of Work Here it comes, ready…

I can give you the hash…

00000000e0d103722c6e172e145d15b9e909e109b47b30d741911bdb3cf3da84

and the string….

hello1202655595

….and this is proof that work was done. You can prove it. It took work to get this result, the computer ‘did’ something hard. It takes almost no energy and time to verify that the hash above is generated by hello1202655595, so it is cheap to verify but expensive to produce.

By ‘stamping’ this result into the blocks on the blockchain, hash of previous block into every block, it is very hard (glass of water back out the ocean hard) to create a forgery or do some other type of nastiness to the blockchain. Proof of Work secures the blockchain.

(Python code at the bottom of this post)

erick@OptiPlex-7010:~/python/hashing$ python3 multi-pow-hash-of-string.py 
Enter String to hash: hello
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
2022-11-19 15:42:15.173991 1 hello28 02a13c40ba00dc0fb199d3cbe5b01be59d937775890243fd411bdf001935ffc8
2022-11-19 15:42:15.175116 2 hello227 001b92541ed0a22b0cb89018b561d895503206c0082c0ecf2d0b7e5182191eed
2022-11-19 15:42:15.206154 3 hello10284 0006bc9ad4253c42e32b546dc17e5ea3fedaecdabef371b09906cea9387e8695
2022-11-19 15:42:15.350531 4 hello60067 0000e49eab06aa7a6b3aef7708991b91a7e01451fd67f520b832b89b18f4e7de
2022-11-19 15:42:15.771205 5 hello156056 0000037660ee0e22df67a053537e000325bbfad2cce9b8b7c795f6aa961d5cb7
2022-11-19 15:43:47.285252 6 hello33290382 000000865194de5c0744d72183dcce2eca2b69264b749a1798f1b6996baef7de
2022-11-19 15:49:22.363936 7 hello121001637 0000000bcd89bc714263460f7b1fc82562410b96eaeec5cc2175e83f2d215046
2022-11-19 16:48:46.136385 8 hello1202655595 00000000e0d103722c6e172e145d15b9e909e109b47b30d741911bdb3cf3da84

Keys and Addresses

To round it out, the other main use of cryptography in cryptocurrencies, the private key, secures your ‘coins’. If you aren’t careful to hide and not reveal your private key, you lose your coins. Your public key which is basically translated into an address for BTC (and others) it is a 160 byte number can be freely given out, posted online, in email, put it anywhere you wish. Why? Because all someone an ever do with the public key/address is send you some ‘coin’. So if they did, great. And, if it is a publicly transparent blockchain like Bitcoin and most others, privacy coins such as Zcash and Monero for example being the exception, you can trace the transactions. Just put a public address into the browser search bar and various tools will appear that allow you to trace transactions to an address. So the criminals that think cryptocurrency gives them some kind of magic cloaking mechanism for their transactions are getting it wrong. The cryptography in cryptocurrency has nothing to do with keeping a record of transactions securing hidden away, in fact the transactions are as transparent as they could possibly be.

 



Infographic showing #3 a blockchain and a block consisting of it’s sequence number, the hash of the previous block and the nonce, plus a record of transactions.

The miner of the block gets the reward plus all the fees for the transactions. In 2021 when this was made the block reward was 6.25BTC per block mined. This is cut in half approximately every 4 years, until it drops off  altogether around the year 2140. By then the fees will be the only thing sustaining the miners financially. The fact that there is only a finite amount of Bitcoin that can be mined, ever, 21 Million of them, keeps inflation of Bitcoin at bay. This is not the case for all coins, some cryptocurrencies can create more and more coins at will, so they are inflationary. Bitcoin is a fixed supply of which most of it has been mined already. So most of the stock is already created and the flow of more coins gets lower and lower with each block reward halving, every 4 years. This concept of stock to flow is important because it is a measure of scarcity. If something can be made easily like fiat currency the flow can be a large input to the stock in existence. This is what is going on in 2022 with economies all over the world that have printed massive amounts of fiat money during the Covid crisis, when the stock to flow is not a good ratio, inflation results. The opposite occurs with gold for example, it is hard to increase the amount of gold pulled from the earth, so the flow of new gold into the current world stock of gold is less than 2% per year, (I think that I remember the max was just 2.2% somewhere in the WW2 time frame) so in essence the market is never flooded with new gold, which would debase gold against other stores of value.

Blockchain example slide

 

 

Blockchain example slide

'''
https://www.pythoncentral.io/hashing-strings-with-python/
'''
import hashlib
from datetime import datetime

mystring = input('Enter String to hash: ')
# Assumes the default UTF-8
hash_object = hashlib.sha256(mystring.encode())
print(hash_object.hexdigest())

for DIF in range(1,32):
    for n in range(1,1000000000000):

            x = mystring + str(n)
            hash_object = hashlib.sha256(x.encode())
            d = hash_object.hexdigest()

            #print(x,d)
            tally = 0

            for z in range(0,DIF):
                    if d[z] == '0':
                            tally += 1

            if tally == DIF:
                break

    timestamp = str(datetime.now())

    print(timestamp,DIF,x,d)

Resources

https://seekingalpha.com/article/4452010-bitcoin-energy-usage-isnt-a-problem-heres-why

https://ingoldwetrust.report/the-stock-to-flow-ratio-as-the-most-significant-reason-for-golds-monetary-importance/?lang=en

Intro to Cryprocurrency

This post is a bit of a quick rant on the basics of cryptocurrencies (crypto) and is just my opinions and not any advice on investing. It started as a response to someone that was interested in learning a bit of the basics of cryptocurrency. Then I got on a roll and covered a bit of ground. It does not contain many references to sources as I was working from memory of information that I have seen or heard.

Pros and Cons

One of the cons with cryptocurrencies is wading through the charlatans and hype out there. Scammers too, malware that tries to copy your crypto addresses as you cut and paste them, always visually confirm and never leak your private addresses in an unsecured environment, they are your money. hype and nonsense out there also applies to trading, investing and mining it. Lots of pros to it. But, it all really depends what you want to do with it. The options typically center around trading,investing,mining it and using it as a payment method. I’ll work through the list a bit and build my case for crypto as I move along. Mining a coin such as ETH ,is not profitable for most people at the moment, Currently electricity and equipment costs factor into this heavily. However this may change in the future as ETH will be moved from a proof of work to a proof of stake model (a bit much to explain in this intro, but if you go to the site name for the creator of Bitcoin, Nakamoto.com, there is a whole intro to cryptocurrency series of posts there), with ETH 2.0, along with other changes. Using it as a payment method is getting simpler every day, there are numerous apps for it, Cash App and Coinbase for example.  PayPal and Venmo will be integrating crypto purchases into there systems.

Fundamentals

What is going on that may cause prices to rise

People in Europe that work on the underpinnings of the banking system that allows money to move around under the hood, kind of like our ACH system here in the US are working with the folks who developed the crypto called LINK. This has leaked out, I saw the presentation where the guy giving it slipped and said the name that LINK uses in it’s code instead of the secret project name that they were using to cover up LINK’s involvement. These projects are typically secret with NDA’s and all but, human error and a slip of the tongue can happen. The US Gov’t, Treasury Dept. has hired the person that developed the stable coin called USDC for Coinbase. He worked for a bank prior to Coinbase, the name I can’t remember, but there is a picture of him with 2 other co workers that now work in the Treasury Dept. so he was most likely hired because he was the lead in developing the USDC stable coin for Coinbase. A stable coin is a coin that attempts to stay in lockstep with a fiat currency. USDC is always $1, some others ary a little bit around $1, like a range a few pennies up and down at most. Examples are Tether and DAI. On top the Gov’t reserach into an electronic coin, there was initial language in the draft for the stimulus package that was removed that reference disbursing payments using electronic coins developed by the US Gov’t. I saw copies of this, it was interesting to see a reference to an electronic coin in a gov’t doc. Also, large banks are starting to work to become custodians for crypto currencies as well, they are entering into agreements with exchanges to be the custodians of large amount of crypto. BTC futures are traded on the Chicago exchange (Chicago Mercantile Exchange), something the big boys in the investment banks are interested in. There is something called BAKKT that the investment banks are working on, I forgot the details but, it relates to cryptocurrencies Why does this matter? This is all a big pro. Because governments adopting blockchain technology, Investment banks are starting to use crypto as an investment vehicle and considering being custodians of it and integrating blockchain tech into transactions. All of this validates it’s existence, which means only more growth in the future as people (investors really and end users eventually) realize it is not some kind of fad and a toy for tech hobbyists. Remember the curve of other tech. The first home computers were also “toys” and now we can’t live without (several of them, think phones too) them, the same will happen with crypto currencies in time. As far as investing in it. A big pro is that it is a new asset class in the world. Every time a new asset class comes into being it makes for a great investment opportunity as new asset classes don’t some along often.

Cryptocurrencies as Technology

Trading and Investing

Cryptocurrencies behave a lot like a new technology in that there is an exponential growth curve which is reflected in the price. ETH could be bought for around $10 in 2016-17 and today it is worth over $300 with recent highs above $400. Weekly time-frame Ichimoku chart has a target at $750 within the next year most likely. Trading and investing are similar but, two different animals. A con with trading in general that does not occur as easy with investing is that it is easy to lose money trading for a lot of reasons, as a beginner. Most of them have less to do with proficiency and the mechanics of trading and more to do with emotional factors, especially how we view money itself. The market it a brutal but honest teacher at times and it will teach you how to look at your belief system. And, it is always your fault when you lose, the market never lies, only we can lie to ourselves. In the beginning I wish I would have spent a bit more time learning this versus spending most of my allotted learning time on technical analysis. I have found quite a few good time tested resources on the trading topic if you are interested. Always start with a few hundred $ and work up slowly until the charts stop looking like just a bunch of lines and start to intuitively make sense and your heart no longer drops every time the prices go red. It’s as if you have to develop a Zen or Taoist attitude to the market. Start with something really simple for a trading rule and stick to it. The more simple and boring the better until you get experience. And, on a longer time frame, daily and weekly charts, not less than hourly charts to start. In the limit as time –> 0 the charts become just noise which can cause confusion at best. Crypto has much more volatility than many other asset classes, so more noise there too. Especially the small cap coins, up 100% one day, down the next and as usual it takes double the gain to make up for a loss of half, so losses mount fast in downward price shocks. BTC and ETH, being large cap are less volatile than the rest, about 3000 of them, some of which are a joke (literally DOGE and Siraj coin are memes) and really have no future at all, Big pro. Investing for the long haul is one of the easiest easy options to start that can even be combined with trading/active investing. One of the best methods to invest in an asset with exponential growth is to accumulate the asset when the price is below the 1 year to 2 year average price and then distribute out at a price that is a multiple (2,3,5) of the 1-2 year moving average. Golden Ratio Multiplier Chart. This is an almost foolproof way to actively invest and could be used to dollar cost average in at the best times. Feel free to reach out to me for any more and research. I would highly recommend listening the Lex Fridman podcast where he interviews Vitalik Buterin the co-creator of ETH to get a flavor of the mind of who is behind it.

BTC Gains

BTC versus Stock Bull Run

Stock Bull Run
Stock Bull Run to Bust, 2009-2020

This post is an addition to the series on DMAC algorithm trading, which is simple algo trading example. I was wondering now that the S&P500 and etc, legacy market has dropped out of it’s long bull run, how would Bitcoin gains compare against the stock market?

First Post in Series to Learn More Background

Code to run this model on Github

BTC Buy and Hold -v- S&P 500 Buy and Hold

The plan: Comparing  Bitcoin (BTC) gains from January 1,2010 to December 31,2019 against the bottom for stocks on March 9, 2009 to Feb 19,2020, the 400% bull run for the S&P 500. But, for some reason the Yahoo data for Bitcoin is only going back to 2014-09-16. So we are basically getting a bit short changed here on BTC and giving the S&P a long head start for nearly 5 years. (I am sure at one point in the past, I think this used to work and go back all the way to 2010 but Yahoo must have cutoff the data since I first tried this code.)

So with 5 years head start for S&P

S&P500 4x gain across history shown in the above chart 03-09-2009 to 2-19-2020

BTC 16.96x gain from 9-16-2014 to 2-19-2020

Now for a true side by side comparison

S&P 500 on 9-16-2014 closed at 1998.98

S&P 500 on 2-19-2020 closed at 3386.15

S&P 500 gain 1.69x from 9-16-2014 to 2-19-2020

So Bitcoin beats the S&P using by and hold across the same time frame by 10x.

Buy and Hold -v- DMAC Algo Trading on BTC

OK, now what about BTC HODL (Buy and Hold) gains versus optimized DMAC algorithm trading from 9-16-2014 to 2-19-2020?

HODL Gains: 16.96393901373665

Algo gains for a 1 day short and 4 day long average. This is wicked tight and it will trade like mad, so in real life, the transaction fees and slippage would eat away at this number after 10 years.

Short AVG,Long AVG,Best Bank 1 4 2244962.564086914 which is 22.4x

which is 22.4x gains. But, with fees/slippage  and HODL at ~17x , HODL is really great. Beats the 4x or 1.69x depending on the time frame of the S&P 500!

It could do better

This is a simple algorithm, one of the simplest ones that can be thought of. Also, remember that the algorithm only tuned once across the entire time period. If the time  period was cut up into smaller periods and the algorithm learned the market as it changed over time instead of trying to get a best fit across 5 years it would have produced more gains. The example the initial post which has it trade from Jan 1 to Dec 31 of 2019 shows in making 900K alone in one year. So an algorithm that could in theory re-optimize periodically as the market conditions change would easily beat the results of this simple algorithm. The best thing that I can think of would be a machine learning algorithm that would use differential evolution to change the parameters as time goes on. It would learn on an ensemble of random sections of random lengths of data from the past and tune the algorithm’s parameters based on learning from the data ensembles. That is just one way that comes to mind.

But, at the end of the day this is just an example. It is not always possible to predict future results from past data. It is also well known and Covid-19, The Great Recession and Black Monday in 1987 serve as examples, there will be price shocks that can upend any model in practice. The statistics of price action do not fall neatly under a bell curve but have fat tails that lead to excursions far away from the mean on occasion. One only has to look to history for this lesson and one example is the firm Long-Term Capital Management (LTCM) led by a brilliant team of folks including Nobel prize winners Merton and Scholes, two out of the men that invented the Black-Scholes option pricing formula. Fischer Black, the other man was not alive at the time that the prize was awarded. Some credit for  the formula rests with Ed Thorp as well, at least a way in the backstory. Ed Thorp had basically the same kind of formula running on convertible bonds, not a far jump to options pricing. This is all outlined in the great book The Quants by Scott Patterson. Quants was one of the seeds that led me to pursue trading, specifically algorithmic trading a few years after I read it.

Lessons To Be Learned

So there were brilliant guys were at the heart of LTCM but, due to high leverage and a divergence of their models from reality when the Russian government defaulted on their debt, the firm crashed and burned financially. It happened fast as they and others holding similar positions in the market all simultaneously unwound those positions. LTCM was stuck holding a lot of positions trying to offload into a market without many buyers, low liquidity, and the worst part of it, being leveraged heavily 30-40:1 was the real problem. They were effectively running backwards selling off, what normally one would not want to be forced to sell off, being highly leveraged it quickly ran out of margin and went effectively bankrupt. The pieces of LTCM were bought up by 13 banks and this averted a disaster that  could have been equal to 2008 if the banks had not carved up the LTCM carcass among themselves. It could have easily had a domino effect on the rest of the banks and the global market much like what happened in 2008. LTCM as brilliant as it began, ended as a good lesson for the future, if only heeded and rocked the markets for a while and the shock cascaded. Then the lesson seems to get lost in general, although I imagine some took it to heart, in general  history repeated itself about a decade later in terms of the next financial crisis which was the same thing only an order of magnitude larger. 2008 was not containable by some short term heroics between the Fed and 13 banks as in the case of LTCM.

https://www.pbs.org/wgbh/nova/transcripts/2704stockmarket.html

https://www.pbs.org/wgbh/nova/stockmarket/

https://www.pbs.org/wgbh/pages/frontline/warning/themes/ltcm.html

 

BTC Algo Traded Using DMAC algo
BTC Algo Traded Using DMAC algo.
Bitcoin Buy and Hold: How much was made?
Bitcoin Buy and Hold: How much $ was made? 100K to 2.2M
Maximum draw-down for the algo for the time period.
Maximum draw-down for the algo for the time period.

Raw Dump

(base) erick@OptiPlex-790 ~/python/simple-strat $ python simple-strat-loop-backtest-2010-2019.py
Get Data
Run Model
Short AVG,Long AVG,Best Bank 1 1 100000.0
Short AVG,Long AVG,Best Bank 1 2 1495120.7946777344
Short AVG,Long AVG,Best Bank 1 3 1845316.8991088867
Short AVG,Long AVG,Best Bank 1 4 2244962.564086914
 signal short_mavg long_mavg positions
Date 
2014-09-16 0.0 457.334015 457.334015 NaN
2014-09-17 0.0 424.440002 440.887009 0.0
2014-09-18 0.0 394.795990 425.523336 0.0
2014-09-19 0.0 408.903992 421.368500 0.0
2014-09-20 0.0 398.821014 406.740250 0.0
2014-09-21 1.0 402.152008 401.168251 1.0
2014-09-22 1.0 435.790985 411.417000 0.0
2014-09-23 1.0 423.204987 414.992249 0.0
2014-09-24 0.0 411.574005 418.180496 -1.0
2014-09-25 0.0 404.424988 418.748741 0.0
2014-09-26 0.0 399.519989 409.680992 0.0
2014-09-27 0.0 377.181000 398.174995 0.0
2014-09-28 0.0 375.467010 389.148247 0.0
2014-09-29 1.0 386.944000 384.778000 1.0
2014-09-30 1.0 383.614990 380.801750 0.0
2014-10-01 0.0 375.071991 380.274498 -1.0
2014-10-02 0.0 359.511993 376.285744 0.0
2014-10-03 0.0 328.865997 361.766243 0.0
2014-10-04 0.0 320.510010 345.989998 0.0
2014-10-05 0.0 330.079010 334.741753 0.0
2014-10-06 1.0 336.187012 328.910507 1.0
2014-10-07 1.0 352.940002 334.929008 0.0
2014-10-08 1.0 365.026001 346.058006 0.0
2014-10-09 1.0 361.562012 353.928757 0.0
2014-10-10 1.0 362.299011 360.456757 0.0
2014-10-11 1.0 378.549011 366.859009 0.0
2014-10-12 1.0 390.414001 373.206009 0.0
2014-10-13 1.0 400.869995 383.033005 0.0
2014-10-14 1.0 394.773010 391.151505 0.0
2014-10-15 0.0 382.556000 392.153252 -1.0
... ... ... ... ...
2019-12-03 0.0 7320.145508 7409.014038 0.0
2019-12-04 0.0 7252.034668 7329.615234 0.0
2019-12-05 1.0 7448.307617 7335.619019 1.0
2019-12-06 1.0 7546.996582 7391.871094 0.0
2019-12-07 1.0 7556.237793 7450.894165 0.0
2019-12-08 1.0 7564.345215 7528.971802 0.0
2019-12-09 0.0 7400.899414 7517.119751 -1.0
2019-12-10 0.0 7278.119629 7449.900513 0.0
2019-12-11 0.0 7217.427246 7365.197876 0.0
2019-12-12 0.0 7243.134277 7284.895142 0.0
2019-12-13 1.0 7269.684570 7252.091431 1.0
2019-12-14 0.0 7124.673828 7213.729980 -1.0
2019-12-15 0.0 7152.301758 7197.448608 0.0
2019-12-16 0.0 6932.480469 7119.785156 0.0
2019-12-17 0.0 6640.515137 6962.492798 0.0
2019-12-18 1.0 7276.802734 7000.525024 1.0
2019-12-19 1.0 7202.844238 7013.160645 0.0
2019-12-20 1.0 7218.816406 7084.744629 0.0
2019-12-21 0.0 7191.158691 7222.405518 -1.0
2019-12-22 1.0 7511.588867 7281.102051 1.0
2019-12-23 1.0 7355.628418 7319.298096 0.0
2019-12-24 0.0 7322.532227 7345.227051 -1.0
2019-12-25 0.0 7275.155762 7366.226318 0.0
2019-12-26 0.0 7238.966797 7298.070801 0.0
2019-12-27 1.0 7290.088379 7281.685791 1.0
2019-12-28 1.0 7317.990234 7280.550293 0.0
2019-12-29 1.0 7422.652832 7317.424561 0.0
2019-12-30 0.0 7292.995117 7330.931641 -1.0
2019-12-31 0.0 7193.599121 7306.809326 0.0
2020-01-01 0.0 7200.174316 7277.355347 0.0

[1933 rows x 4 columns]
 BTC-USD holdings cash total returns
Date 
2014-09-16 0.0 0.0 100000.0 100000.0 NaN
2014-09-17 0.0 0.0 100000.0 100000.0 0.0
2014-09-18 0.0 0.0 100000.0 100000.0 0.0
2014-09-19 0.0 0.0 100000.0 100000.0 0.0
2014-09-20 0.0 0.0 100000.0 100000.0 0.0
 BTC-USD holdings cash total returns
Date 
2019-12-28 731799.023438 731799.023438 1.515663e+06 2.247462e+06 0.001243
2019-12-29 742265.283203 742265.283203 1.515663e+06 2.257928e+06 0.004657
2019-12-30 0.000000 0.000000 2.244963e+06 2.244963e+06 -0.005742
2019-12-31 0.000000 0.000000 2.244963e+06 2.244963e+06 0.000000
2020-01-01 0.000000 0.000000 2.244963e+06 2.244963e+06 0.000000
Portfolio Plot
Sharpe Ratio 1.5767602439593071
Compound Annual Growth Rate (CAGR) 0.7067353770154898
HODL Gains: 16.96393901373665