<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by BarclayJames on Medium]]></title>
        <description><![CDATA[Stories by BarclayJames on Medium]]></description>
        <link>https://medium.com/@sunnyday.james?source=rss-94ed40f7ac9d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*VfKKWgv6RG_XhmTx.</url>
            <title>Stories by BarclayJames on Medium</title>
            <link>https://medium.com/@sunnyday.james?source=rss-94ed40f7ac9d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 20:15:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sunnyday.james/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Make a Bitcoin Paper Wallet Offline with a Little Python]]></title>
            <link>https://medium.com/@sunnyday.james/how-to-make-a-bitcoin-paper-wallet-offline-with-a-little-python-440035f50a2?source=rss-94ed40f7ac9d------2</link>
            <guid isPermaLink="false">https://medium.com/p/440035f50a2</guid>
            <category><![CDATA[self-custody]]></category>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[BarclayJames]]></dc:creator>
            <pubDate>Sat, 10 Dec 2022 08:26:39 GMT</pubDate>
            <atom:updated>2022-12-10T08:41:06.408Z</atom:updated>
            <content:encoded><![CDATA[<h4>Use bitcoinlib to generate a public Bitcoin address &amp; private key pair</h4><p>Yep, the self-custody meme is back again. Still, it is one of the main reasons to hold Bitcoin as it gives ultimate control to the defacto owner of the funds, the private key holder. And in the wake of recent, high-profile hacks/ scams in the cryptoworld, as well as denial of banking services for political activists and journalists by the governments of so-called liberal democracies, Bitcoin self-custody as freedom from financial censorship is more relevant than ever. (Just wait until CBDCs arrive.)</p><p>But this post assumes you know all that. So how do we make a paper wallet? The easiest way is simply to go to <a href="https://www.bitaddress.org/">https://www.bitaddress.org/</a> and generate one. The web app is written in javascript and can be run completely offline, but where’s the fun in that?</p><p>So without further ado:</p><pre>pip install bitcoinlib<br>pip install qrcode</pre><p>We will use the extensive bitcoinlib module (<a href="https://bitcoinlib.readthedocs.io/en/latest/">https://bitcoinlib.readthedocs.io/en/latest/</a>) and the qrcode module to generate, well, qr codes to store our key and address pair.</p><p>Bitcoinlib offers a lot of functionality, but we’re only interested in generating public-private key pairs for our paper wallets. So to create a new wallet:</p><pre>from bitcoinlib.wallets import Wallet<br><br>w = Wallet.create(label, witness_type=None) </pre><p>Here label is a string with which we will identify the wallet, i.e. a name ;) and witness_type allows us to choose between legacy or segwit wallets. For legacy choose None (default setting) or ‘segwit’ for segregated witness.</p><p>And that’s it really. You just created a Bitcoin wallet that is stored locally in a database. If you now try to create a new wallet with the same name, you will return an error, even after you close and restart the IDE. But as I keep saying, we’re just interested in generating key pairs here, so how to access that data?</p><pre>keys = w.get_key().as_dict(include_private=True)<br>address = keys[&#39;address&#39;]<br>private = keys[&#39;key_private&#39;]<br><br>print (&#39;Address: {}&#39;.format(address))<br>print (&#39;Print: {}&#39;.format(private))</pre><p>Running this after previously creating our wallet returns the wallet’s Bitcoin address and private key in human readable format. For example</p><pre>&gt;&gt;&gt; Address: bc1q8uzwwdd24yjw6w4f8vhpr9wya2q7sxrukdvkg7<br>&gt;&gt;&gt; Private: 52472fe29a331286c9f954145b6469741b355d8a8dfde211df881bd4ea38e459 </pre><p>You can then store these keys however you want. If you’re working on an offline PC, i.e. no modem, then you may decide to keep them there, but of course always, always, always make a backup or two… don’t be Craig Wright. How you do this is up to you, be inventive :)</p><p>To convert these alphanumeric strings to a QR code is simple in Python using the qrcode module (<a href="https://pypi.org/project/qrcode/">https://pypi.org/project/qrcode/</a>).</p><pre>from qrcode import QRCode<br><br>qrAddress = QRCode(version=1, box_size=10, border=5)<br>qrAddress.add_data(self.address)<br>qrAddress.make(fit=True)<br>imgAddress = qrAddress.make_image(fill=&#39;black&#39;, back_color=&#39;white&#39;)<br><br>qrPrivate = QRCode(version=1, box_size=10, border=5)<br>qrPrivate.add_data(self.private)<br>qrPrivate.make(fit=True)<br>imgPrivate = qrPrivate.make_image(fill=&#39;black&#39;, back_color=&#39;white&#39;)<br>        <br>imgAddress<br>imgPrivate</pre><p>Depending on your IDE, you may have to run the last two lines directly in the console to return the images (at least I have to in Spyder). In this example, the version parameter is set to 1. This means that QRCode() will generate the smallest possible 2D barcode for the input data. So for the address and private key shown above I get</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/1*KRXMgs8bfEX43-hhP1CE-g.png" /><figcaption>Bitcoin address (share this!!!)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/1*m78-QMu5iy-qX94W2jNApQ.png" /><figcaption>Private key for the above Bitcoin address (DO NOT SHARE THIS!!! oops)</figcaption></figure><p>As you can see the private key is bigger because it encodes more data, so you have no excuse for confusing them lol.</p><p>So now you have a public Bitcoin address with which to receive funds and a private key that will allow you to spend those funds. That part is pretty simple and I will cover it in a future post on Medium.</p><p><strong>Briefly, some other functionality that you may find useful:</strong></p><p>To retrieve a list (actually a list of dictionaries) of all wallets stored in your local database, run</p><pre>from bitcoinlib.wallets import wallets_list<br><br>wallets_list()</pre><p>To access data from an old wallet, run</p><pre>from bitcoinlib.wallets import Wallet<br><br>w = Wallet(label)</pre><p>and follow the first example in this post to retrieve the keys.</p><p>To see if a wallet exists, run</p><pre>from bitcoinlib.wallets import wallet_exists<br><br>wallet_exists(label)</pre><p>This will return a bool (i.e. True or False).</p><p>To delete a wallet, run</p><pre>from bitcoinlib.wallets import wallet_delete<br><br>wallet_delete(label)</pre><p>And to delete all wallets stored on the local database, run</p><pre>from bitcoinlib.wallets import wallets_list<br>from bitcoinlib.wallets import wallet_delete<br><br>for wallet in wallets_list():<br>    wallet_delete(wallet[&#39;name&#39;])</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=440035f50a2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mining Revenue Signals Bitcoin Market Bottoms]]></title>
            <link>https://medium.com/@sunnyday.james/mining-revenue-signals-bitcoin-market-bottoms-dae27b609488?source=rss-94ed40f7ac9d------2</link>
            <guid isPermaLink="false">https://medium.com/p/dae27b609488</guid>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[BarclayJames]]></dc:creator>
            <pubDate>Wed, 03 Jul 2019 09:50:20 GMT</pubDate>
            <atom:updated>2019-07-03T10:42:27.600Z</atom:updated>
            <content:encoded><![CDATA[<p>A lot has been made about the importance of Bitcoin mining over the years, with many people trying to use the cost of production to set a price floor in a similar fashion to the gold market. A simple glance at the mining revenue chart from Blockchain reveals that mining is indeed significant for such estimates.</p><p>It is obvious on examination that all structural gaps are closed by mining revenue, even when this does not happen on the price chart. In addition, these bottoms in revenue occur exactly when the price of Bitcoin bottoms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*h3JZsinNWTdaPxcf" /><figcaption>Mining revenue (candles) and Bitcoin price (orange area plot). The mining revenue always closes the structural gap to the previous revenue high (green horizontal line). This indicates that the Bitcoin market has reached a price bottom.</figcaption></figure><p><strong>It is also possible to use this chart on intercycle swings as those structural gaps are also closed! </strong>This has been the case since day 1.</p><p>The data is available from Blockchain, the chart from Quandl. At tradingview enter QUANDL:BCHAIN/MIREV to call it up.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dae27b609488" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bitcoin, Estimating Network Growth Through Efficiency Distributions]]></title>
            <link>https://medium.com/thecapital/bitcoin-estimating-network-growth-through-efficiency-distributions-83e651b6a3f?source=rss-94ed40f7ac9d------2</link>
            <guid isPermaLink="false">https://medium.com/p/83e651b6a3f</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[BarclayJames]]></dc:creator>
            <pubDate>Tue, 16 Apr 2019 09:59:55 GMT</pubDate>
            <atom:updated>2019-04-21T09:23:40.396Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*dwKpIw0ZzA7plFTeBj0spQ.png" /></figure><h4>By <a href="https://medium.com/@sunnyday.james">BarclayJames</a> on <a href="https://medium.com/altcoin-magazine">ALTCOIN MAGAZINE</a></h4><p>It’s been a long-time interest of mine to estimate the electricity consumption of Bitcoin’s Proof of Work algorithm. As you will no doubt know, Bitcoin transactions are verified by for-profit miners in a computationally expensive process, so the task basically boils down to knowing the total number of computations per unit time (hash rate) of the network, how many mining machines are operational globally and what their particularly specs are.</p><p>My previous attempts were limited to back of the envelope minimum consumption estimates based on assuming everyone was running the latest, most efficient machine. Obviously these are both very unreliable and also do not allow us to chart energy consumption over time. In addition, a good model should also allow us to make predictions about the future.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JNTsH-QIQKkirm8g4mKdbw.png" /><figcaption>Left: The growth in hashing efficiency in megahashes per joule of new ASIC mining units displays a possible logistic distribution. Three logistic trendlines representing three different maximum efficiency levels are shown. Right: These trendlines are used to calculate energy consumption in gigawatt hours per year from which future energy requirements are predicted to also follow a logistic trend. This assumes that the previous historic growth trends of Bitcoin will continue into the future but it does not really consider the development timescale of semiconductor downscaling.</figcaption></figure><p>So such a model should take account of efficiency trends in mining technology. Now into the sixth year of ASIC (application-specific integrated circuit) mining technology, there is enough data to make a decent stab at this as long as we make some important assumptions. The most important being that the mining industry self-selects for efficiency; in other words, as newer mining machines are released, less efficient machines are replaced by their operators.</p><p>By plotting the hashing efficiency of new ASIC machines against their release dates, we can develop an efficiency trend for the Proof of Work algorithm. In general, manufacturers release the following nominal specifications: power (in W) and hash rate (in TH/s). Now watts are just joules per second (J/s), so we can calculate hashing efficiency as follows</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/0*s-DAjCq9eWGLoWIu.png" /></figure><p>This gives us hashing efficiency for each new mining machine in TH/J, which is converted to MH/J here by multiplying with 1 million.</p><h3>Logistic Trends</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mtr80zXX87O3dRtRE_X0qQ.png" /><figcaption>Mining efficiency trend mapped from the release of new mining machines over time. Here logistic growth is assumed.</figcaption></figure><p>As you can see, the advance in mining efficiency indicates a potential trend. In fact the shape of the curve hints at exponential growth , i.e. the rate of change is proportional to the value of the parameter itself. However, exponential growth is unbounded, that means it can grow indefinitely and, as a long-time skeptic of Bitcoin’s core technology, this makes little sense to me.</p><p>A logistic function would better suit the data, in my opinion, as this represents growth with limited resources. In the case of biological populations, these may be limits arising from a finite food supply or limited physical space in which to grow (think island populations or bacteria in your fridge, yum). But how does this apply to Bitcoin?</p><p>Currently, the latest mining machines feature 7 nm ASIC chips. These were a long time coming and arrived with much fanfare and, indeed, over the last year we’ve seen a doubling in efficiency as new machines have been released. But we know that, when measured over the history of Bitcoin, a 70 % correlation exists between network hash rate and price. The basic tenets of adoption-economics tell us that the price should increase as more users come to the network. This means that 7 nm will not suffice in the long-term, and we are still far from mass adoption and efficiency must grow in line with increasing network hash rate.</p><p>But this is somewhat besides the point. Even if smaller order chips are produced (and initial production runs of 5 nm nodes have been announced by Taiwan Semiconductor for April 2019) we will soon run up against some serious problems. Not only is Moore’s Law already starting to break down (5 nm will take longer than usual to reach the market) but quantum tunneling effects in these tiny transistors are starting to become a problem. At some point, quite soon, it will no longer be possible to gain efficiency by downsizing transistors. At that point semiconductor manufacturers will move to stacking chips and reducing conduction pathways (called interconnects; you wouldn’t believe how many <em>miles </em>of interconnects there are in standard IC chips), but while this will allow for greater power, it won’t lead to significant increases in efficiency.</p><p>Hence the growth cap on the Proof of Work algorithm is provided by the limits of silicon technology, and this is why a logistic trend fit is appropriate. Therefore, the following function of time <em>t</em> was assumed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/359/0*K2_MGn86JXr0QpuG.png" /></figure><p>where K is the maximum hashing efficiency, r is just some positive constant and t0 represents the point of inflection (where the logistic curve shifts from exponential growth to decay). A least squares process was used to fit this trend to the data for three different efficiency saturation levels of <em>K</em> = 45000, 60000 and 80000 MH/J.</p><p>Current maximum efficiencies are around 20,000 and 24,000 MH/J. So a doubling to around 45,000 MH/J may correspond to a new 5 nm node size. This seems feasible to me, although I have no idea what the actual timescale will be (some years I should think). However, another doubling to 80,000 MH/J seems unlikely given our present understanding.</p><h3>Electricity Consumption</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*B7ZqfgpIcm0pE3nRJxdG7A.png" /><figcaption>Estimated electricity consumption of global ASIC mining network for Bitcoin based on assumption of logistic trend for hashing efficiency.</figcaption></figure><p>Once we are happy we have selected a suitable efficiency trend, we are ready to calculate electricity consumption over time. The maths is very simple</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/0*oZuxwi-ub4h3kaW5.png" /></figure><p>In other words we just have to divide the network hash rate by our hashing efficiency trend fit. This gives us power in watts. Let’s convert to gigawatt hours per year (GWh/yr) just to sound fancy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6KgbDSal4rkR5me5.png" /></figure><p>In a similar fashion, a logistic trend is assumed for the change in energy consumption. A least squares method was used to calculate the trend lines shown in the chart. This, of course, assumes that Bitcoin’s historic growth will continue into the future and that the mining industry will continue to function as normal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*27PVvYx1vg-IcL1JNzHaxQ.png" /><figcaption>Electricity consumption trends corresponding to the calculated trends in hashing efficiency. The greater the maximum hashing efficiency the less the final energy level will be at adoption.</figcaption></figure><h3>Conclusions</h3><p>Firstly we need to admit we’re making a lot of assumptions here. Although I believe that the logistic trend is the most appropriate in this case, there are definitely other factors which need to be accounted for. The most important being developments in the semiconductor industry. As mentioned, the next level of downsizing should produce 5 nm transistors. Achieving this will be critical for doubling hashing efficiency to above 40 MH/J.</p><p>At present it is not possible for me to know how long this will take (if at all). It may well take longer than the trends here indicate and I think this is not at all unrealistic. Immediately this invalidates the orange and green trends shown here as these push efficiency way beyond doubling within the same timespan. The red trend corresponds to a doubling of efficiency within the next three years. Let’s put this into perspective: this means that Bitmain must release new hardware with specs along the lines of 100 TH/s @ 2500 W to achieve 40 MH/J. It can’t do this without semiconductor manufacturers reducing the size of their transistors and, as was already mentioned, there are physical limits to how small we can go.</p><p>I think the model is a good step in the right direction and the red trend is not too improbable seeing as 5 nm node development has been ongoing for a while, yet more data regarding developments in integrated circuits is necessary to make it more robust. However, this industry is also reaching a watershed moment as Moore’s Law (governing the rate at which the number of transistors doubles on chips) seemingly starts to fail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7faPAwQ92KPl911N9VHBUw.jpeg" /></figure><p>Follow us on <a href="https://twitter.com/Alt__Magazine">Twitter</a>, <a href="https://www.investfeed.com/Altcoinmagazine?rec=90e98ef">InvestFeed</a>, <a href="https://www.facebook.com/Altcoin-Magazine-302454903822750/">Facebook</a>, <a href="https://www.instagram.com/altcoin_magazine/">Instagram</a>, <a href="https://www.linkedin.com/company/altcoin-magazine/">LinkedIn</a>, and join our <a href="https://discord.gg/DkwPvH5">Discord</a> and <a href="https://t.me/AltcoinMagazine">Telegram</a>.</p><p>Read about our upcoming Altcoin Magazine Mastermind Event <a href="https://altcoinmagazinemastermindevent.eventbrite.com/">here</a>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2F3c1144%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2F3c1144%2F&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/4b37fd61c8660dc2cbfe8232dfa683e2/href">https://medium.com/media/4b37fd61c8660dc2cbfe8232dfa683e2/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=83e651b6a3f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/thecapital/bitcoin-estimating-network-growth-through-efficiency-distributions-83e651b6a3f">Bitcoin, Estimating Network Growth Through Efficiency Distributions</a> was originally published in <a href="https://medium.com/thecapital">The Capital</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bitcoin Predictive Price Modeling with Facebook’s Prophet]]></title>
            <link>https://medium.com/data-science/bitcoin-predictive-price-modeling-with-facebooks-prophet-b66efd0169a0?source=rss-94ed40f7ac9d------2</link>
            <guid isPermaLink="false">https://medium.com/p/b66efd0169a0</guid>
            <category><![CDATA[facebook]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[prophet]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[BarclayJames]]></dc:creator>
            <pubDate>Sun, 14 Apr 2019 16:56:01 GMT</pubDate>
            <atom:updated>2021-04-30T16:15:49.398Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*ruStI0aFLhrvBsT0zrqEDg.png" /><figcaption>Two Bitcoin price predictions (blue and red lines) generated using Facebook’s Prophet package. The actual price data is in green, while the shaded areas denote the respective uncertainty in the estimate. As you can the uncertainty increases into the future. This is particularly the case with the tighter fitting price model (red).</figcaption></figure><p>This is a quick look at Facebook’s Prophet machine learning package using the example of Bitcoin. It assumes basic Python knowledge and some familiarity with pandas.</p><p>Prophet is Facebook’s open source forecasting procedure for time series data. The idea is that it should make fully automatic forecasting easy even with messy data and it’s currently available in R and Python. I shall be using Python 2.7 in this post.</p><p><strong><em>Note from Towards Data Science’s editors:</em></strong><em> While we allow independent authors to publish articles in accordance with our </em><a href="https://towardsdatascience.com/questions-96667b06af5"><em>rules and guidelines</em></a><em>, we do not endorse each author’s contribution. You should not rely on an author’s works without seeking professional advice. See our </em><a href="https://towardsdatascience.com/readers-terms-b5d780a700a4"><em>Reader Terms</em></a><em> for details.</em></p><h3>Installing Prophet</h3><p>If you have pip installed, all you need to do to get Prophet is open a console and type</p><pre>pip install fbprophet</pre><p>On Windows I ran into some Anaconda-related dependency issue and had to run first</p><pre>conda clean --all<br>conda update pystan</pre><h3>Downloading &amp; Preparing the Data</h3><p>Once you have it installed we shall import the modules we’ll need</p><pre>import quandl as qd<br>import pandas as pd<br>import numpy as np</pre><pre>import fbprophet<br>import matplotlib.pyplot as plt</pre><p>Quandl is an amazing repository with a massive number of extremely varied datasets. You’ll need to register a free account and generate an API. Then we’re ready to start. First download the Bitcoin market data from Quandl and get rid of the zero values (the price data contains zeros in the initial rows for some reason)</p><pre>KEY = &quot;YOUR_API_KEY&quot;<br>qd.ApiConfig.api_key = KEY</pre><pre>bitcoin = qd.get(&quot;BCHAIN/MKPRU&quot;)<br>bitcoin = bitcoin.loc[(bitcoin !=0).any(1)]</pre><p>This puts the price data in a pandas dataframe called bitcoin. To inspect the first few rows type</p><pre>bitcoin.head()</pre><p>You should end up with one column called ‘Value’ and a datetime index</p><pre>           Value<br>Date <br>2010–08–17 0.076900<br>2010–08–18 0.074000<br>2010–08–19 0.068800<br>2010–08–20 0.066700<br>2010–08–21 0.066899</pre><p>Now we would like to plot logged data on a linear chart (the reason will become apparent later), so make a new column in bitcoin for the logged price values</p><pre>bitcoin[&quot;log_y&quot;] = np.log(bitcoin[&quot;Value&quot;])</pre><h3>Working with Prophet</h3><p>The first thing we need to do is a little house keeping. Prophet requires us to change the name of the ‘Date’ column to ‘ds’ and our y-column should simply be called ‘y’</p><pre>bitcoin = bitcoin.rename(columns={&quot;Date&quot;: &quot;ds&quot;, &quot;log_y&quot; : &quot;y&quot;})</pre><p>Most of what Prophet does takes place behind the scenes, but there are some hyperparameters that allow us to easily fine tune our models. We will adjust the <em>changepoint_prior_scale </em>parameter only.</p><p>Changepoints are basically points where the trend makes a sudden change in direction, e.g. reversal. Prophet can find these points for you automatically, although it is possible to define them yourself, though for large and idiosyncratic datasets this is impractical. Hey that’s what machines are for, right? The <em>changepoint_prior_scale </em>parameter basically allows you to choose how tightly you want the changepoints to match the data.</p><p>The goal of building any model is to be able to generalise it to other data/scenarios and achieve similar results. So we don’t want our model to follow the training data too much, this is called overfitting. Likewise underfitting can also produce models that generalise poorly.</p><p>So we will use this one hyperparameter to do all our fine tuning. The higher the value the tighter the fit, and likewise the lower the value the looser the fit. For this demo I have chosen to values (0.0015 and 0.015) separated by an order of magnitude.</p><pre>priors = [0.0015, 0.015]<br>prophets, labels = [], []<br>for prior in priors:<br>    prophet = fbprophet.Prophet(changepoint_prior_scale=prior)<br>    prophet.fit(bitcoin)<br> <br>    prophets.append(prophet)<br>    labels.append(r&quot;CP Prior = &quot; + str(prior))</pre><p>At this point you should have a list of two prophet objects and a list of labels for plotting. The next step is to use those prophet objects to generate forecast objects. (We’ll also rename the ‘ds’ columns with the <em>changepoint_prior_scale </em>value prefix just to keep track of the data.)</p><pre>forecasts = []<br>for prophet in prophets:<br>    forecast = prophet.make_future_dataframe(periods=365 * 2,                                                    freq=&quot;D&quot;)<br>    forecast = prophet.predict(forecast)<br> <br>    forecast = forecast.rename(columns={&quot;ds&quot; : str(priors[prophets.index(prophet)]) + &quot;_ds&quot;})<br>    forecasts.append(forecast)</pre><p>And that’s pretty much it. If all went well, you should have generated a list of two forecast objects (really just pandas dataframes). Let’s merge these into a single dataframe and rename one of the ‘_ds’ columns to ‘Date’ and drop the other.</p><pre>output = pd.merge(forecasts[0], forecasts[1], how = &quot;inner&quot;, left_on = &quot;0.0015_ds&quot;, right_on = &quot;0.015_ds&quot;)<br>output = output.rename(columns={&quot;0.0015_ds&quot;: &quot;Date&quot;}).drop(&quot;0.015_ds&quot;, axis=1)</pre><p>Finally we set the index to the ‘Date’ column</p><pre>output = output.set_index(‘Date’)</pre><p>We’ll now plot everything on one chart</p><pre>fig, ax = plt.subplots(1, 1, figsize=(10, 8))<br>ax.plot(output.index, output[&quot;yhat_x&quot;], label=labels[0])<br>ax.fill_between(output.index, output[&quot;yhat_upper_x&quot;], output[&quot;yhat_lower_x&quot;], alpha=0.6, edgecolor = &quot;k&quot;)</pre><pre>ax.plot(output.index, output[&quot;yhat_y&quot;], &quot;r&quot;, label=labels[1]);<br>ax.fill_between(output.index, output[&quot;yhat_upper_y&quot;], output[&quot;yhat_lower_y&quot;], alpha=0.6, edgecolor = &quot;k&quot;)<br>ax.plot(bitcoin.ds, bitcoin.y, color=&quot;green&quot;, linewidth=3, label=r&quot;Bitcoin price (logged)&quot;)<br>a=ax.get_yticks().tolist()<br>ax.set_yticklabels(np.round(np.exp(a), 1))<br>plt.legend(loc=&quot;upper left&quot;)<br>plt.ylabel(r&quot;Price /$&quot;)<br>plt.show()</pre><p>The ‘y_hat’ labels are the estimates provided by Prophet and the x or y suffix denotes which dataframe the data originally came from (here x are the 0.0015 parameter values, and y the 0.015).</p><h3>Conclusions</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*ruStI0aFLhrvBsT0zrqEDg.png" /></figure><p>The goal here was simply to mess around with the Prophet package and I thought Bitcoin would make an interesting dataset.</p><p>Just by eyeballing, I think both predictions are pretty sane from a Bitcoin maximalist point of view, by which I mean they match what many bullish investors believe will happen to the price.</p><p>The blue fit is perhaps slightly underfitting but you can see that the uncertainty on the estimate remains fairly constant over time, even into the future. In general, it offers more scope for generalisation but it may respond too slowly to trend changes. Hence I think it is unreliable. I would not expect the price to maintain that trend for long.</p><p>The red fit on the other hand seems to overfit the data. It follows the historical price action tightly and responds quickly to trend changes, however the uncertainty really blows up into the future making this prediction unreliable too, although the red trend is somewhat more believable.</p><p>Personally I do not feel that this kind of price prediction is particularly useful, but it will be interesting to follow this and see how the Facebook algorithms pan out.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b66efd0169a0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/bitcoin-predictive-price-modeling-with-facebooks-prophet-b66efd0169a0">Bitcoin Predictive Price Modeling with Facebook’s Prophet</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A mosquito the size of Mt. Fuji is bigger than you think!]]></title>
            <link>https://medium.com/@sunnyday.james/a-mosquito-the-size-of-mt-fuji-is-bigger-than-you-think-7220805e044c?source=rss-94ed40f7ac9d------2</link>
            <guid isPermaLink="false">https://medium.com/p/7220805e044c</guid>
            <category><![CDATA[tech-bubble]]></category>
            <category><![CDATA[amzn]]></category>
            <category><![CDATA[aapl]]></category>
            <category><![CDATA[investing]]></category>
            <category><![CDATA[technical-analysis]]></category>
            <dc:creator><![CDATA[BarclayJames]]></dc:creator>
            <pubDate>Tue, 05 Feb 2019 11:07:51 GMT</pubDate>
            <atom:updated>2019-02-05T13:10:50.923Z</atom:updated>
            <content:encoded><![CDATA[<h3>Celebrating 50 Years of the Tech Bubble</h3><p>Did you know that coastline of Great Britain is infinite in length? That’s right, well at least it is to some people. The point is coastlines, like many things in nature such as, oh I don’t know, financial markets say, are fractal. That means they can be subdivided into increasingly smaller, but similarly-shaped parts. Mathematically at least, if you can split a line into infinitely small parts, then its total length is also infinite… in truth it is unknown whether <em>real </em>space can be divided like this…. but the point is… fractals dammit!</p><p>How do you know that nasty looking bubble isn’t part of a much larger structure with a similar shape? A much bigger fractal? You don’t, and that’s why picking tops (and bottoms) is so hard.</p><p>The chart here shows the aggregated price of several well-known tech stocks dating back to 1968’s listing of IBM. It’s not meant as a prediction or a warning of impending doom, Lord knows there are enough of them around already. But it should make you pause for thought if you are invested in this sector.</p><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fplot.ly%2F%7Estrangeattractor%2F27%2F&amp;src=https%3A%2F%2Fplot.ly%2F%7Estrangeattractor%2F27.embed%3Fautosize%3Dtrue&amp;type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=plot" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/0b698a011a668ad1f8d3ce848fe34ad7/href">https://medium.com/media/0b698a011a668ad1f8d3ce848fe34ad7/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7iAcoBXrQIndBRE3" /><figcaption>Gold, silver and Bitcoin bubbles.</figcaption></figure><p>Personally, I think the structure looks very similar to the gold and silver bubbles of 1980, as well as the 10-year history of Bitcoin.</p><p>It’s interesting to compare the current bubble (really the same bubble let’s face it) with the dotcom era which burst in the year 2000.</p><p>Are tech stocks in a gigantic bubble? Yes, absolutely. But is this the top? Who can really say? How can these companies continue to scale? How can they move to profit-making enterprises? What new tech areas can be developed (new companies)?</p><p>As long as their is general upward momentum in this space, the bubble will continue to grow.</p><p><strong>Image file</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*1JSihizyNbdYOVF4ClR8wQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7220805e044c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bitcoin-Altcoin Ratio]]></title>
            <link>https://medium.com/@sunnyday.james/bitcoin-altcoin-ratio-39d5ec97f1a7?source=rss-94ed40f7ac9d------2</link>
            <guid isPermaLink="false">https://medium.com/p/39d5ec97f1a7</guid>
            <category><![CDATA[altcoins]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[BarclayJames]]></dc:creator>
            <pubDate>Sat, 02 Feb 2019 17:08:29 GMT</pubDate>
            <atom:updated>2019-02-05T07:20:40.147Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever asked yourself what happens if you graph the spot price of Bitcoin divided by the cumulative number of altcoins? Yeah, I know. Who would do that….</p><p>Well, I was wondering if there was maybe a relationship between the rate that altcoins are launched and Bitcoin’s price action and that maybe it wasn’t as trivial as it sounded.</p><p>But I’m not sure what I found, so see for yourself.</p><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fplot.ly%2F%7Estrangeattractor%2F62%2F&amp;src=https%3A%2F%2Fplot.ly%2F%7Estrangeattractor%2F62.embed%3Fautosize%3Dtrue&amp;type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=plot" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/c4d190d3da9591ba2115730ba88fea25/href">https://medium.com/media/c4d190d3da9591ba2115730ba88fea25/href</a></iframe><p>The process was straightforward: for the Bitcoin price I used the Brave New Coin Liquid Index and for the altcoin launch data I scraped the first trading date listed on coinmarketcap.com. At the time of writing that’s 2113 altcoins. Whilst all these are <em>active</em>, there are also many dead coins, some of which (ahem, Bitconneeeeeect) have been more significant than others. Finding out the precise list of altcoins in the universe is a thankless task, believe me, so I will just stick with the CMC data. Also I don’t claim that the first recorded trading day, according to CMC, always matches the actually launch date. In fact, since CMC starts its records from 2013 onwards, I know this isn’t the case for early alts like Namecoin and Litecoin (these dates I adjusted by manually). The whole thing is meant to be viewed qualitatively as much as it is quantitative.</p><p>Anyway, the chart is pretty interesting. You can clearly see how the first (2011 to 2013) and second (2015 to 2017) bullruns dominate the ratio and how it dips in 2015. Interesting here is that the bottom of the ratio occurs some months after the price bottoms. In fact the ratio bottoms (just under 1) exactly when Bitcoin starts it 2015 breakout run. Coincidence? Very possibly, but still interesting nonetheless.</p><p>Of course for crypto gamblers, the question is whether this cycle, or something, similar will repeat. That remains to be seen. I keep an open mind, but I’m not a zealot on this. Sure the hype is noticeably less than last year, that’s to be expected. The question is whether it is also less than in 2015. And something inside of me says, yes.</p><p>Anyway, back to the shitcoins. Maximalists I know, have often told me that Bitcoin will rise again once the altcoins die off. And there is a logic to this. Just check out the dominance chart courtesy of coinmarketcap.com</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tRXUJN2wBBCnOxnRA_AJEQ.png" /><figcaption>Bitcoin dominance (orange) broke considerably in 2017, at the same time as a new wave of interest came into crypto. Many people supported these new projects because of the promises they made, and without really understanding the potential and limitations of blockchain. Many who missed it the first time, just wanted another opportunity to buy crypto “for cheap”.</figcaption></figure><p>Bitcoin broke out from the 2013 resistance at the end of 2016. At the same time there was another explosion in altcoin launches. Looking at the dominance chart something appears to have changed with respect to pre-2017 crypto.</p><p>Is it possible for Bitcoin to regain 80% dominance again? Quite frankly, who knows. Does it even matter? Well, maybe not. One thing that the Bitcoin-Altcoin ratio shows is that these shitcoins are not going away quietly. Despite the current bear market, the rate at which altcoins were being launched just prior to the November drop was never greater in my estimation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ibx3HhFCVhT_veKPD8awYA.png" /><figcaption>The rate of altcoin launches was steepest just prior to the November 2018 crash.</figcaption></figure><p>There’s even a Bitcoiin (<a href="https://www.bitcoiin.com/">https://www.bitcoiin.com</a>)</p><p>:’(</p><p>So if there is to be a crypto resurgence under present conditions, then, at least in my opinion, it will have to occur amidst the burst sewer pipe spewing forth shitcoins like a flatulent Yellowstone geyser, which is post-2017 altcoin industry.</p><p>Somehow, it doesn’t really seem plausible, does it?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39d5ec97f1a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Whale Watching]]></title>
            <link>https://medium.com/@sunnyday.james/whale-watching-51e818b78dcb?source=rss-94ed40f7ac9d------2</link>
            <guid isPermaLink="false">https://medium.com/p/51e818b78dcb</guid>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[BarclayJames]]></dc:creator>
            <pubDate>Mon, 29 Oct 2018 21:27:10 GMT</pubDate>
            <atom:updated>2018-12-08T13:51:19.669Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>UPDATE: The addresses featured in this post were all liquidated within 24 hours of each other on the 3rd and 4th of December 2018. The beauty of Bitcoin is that transactions are visible, so anyone can trace the movement of this coin. The owner has spread them over numerous addresses each containing 8000 BTC, he/she/it used segwit mixing to do it. Bitupper.com is a block explorer that allows you to explore segwit transactions.</strong></h3><p><a href="https://bitupper.com/">Unified crypto and blockchain portal</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/316/1*pnZLu0f2yVqZbKlzl1UnKg.jpeg" /></figure><p>Take a look at <a href="https://bitinfocharts.com/top-100-richest-bitcoin-addresses.html">The Top 100 Richest Bitcoin addresses</a> and you’ll notice that the Top 5 belong to the exchanges Binance, Bitfinex, Bittrex, Huobi and Bitstamp. These are their cold (offline)wallets and together account for 3.24% of all Bitcoin.</p><p>The rest are unspecified. Most of the addresses listed aren’t more than two years old, yet interestingly of the first 10 non-exchange addresses 8 were created between 2011 and 2016. Compared to the rest of the list, this is a relatively high proportion of older addresses. In addition, 7 of them have never made a pay out. This is also above average.</p><p>If you have a poke around you might notice something interesting about about a few of these.</p><h3>Dead Whale</h3><p>The richest 10 non-exchange addresses contain three very interesting examples:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*_aE0roBHLkdvtYXUthDzHQ.png" /></figure><p>As you can see all of these addresses were first used within 24 hours of each other, either on 22 or 23 Nov 2013. For the next year after that, they averaged deposits, several times a month, of 658, 602 and 581 Bitcoins respectively, until 15 Nov 2014. This was the last date all three wallets received such significant amounts. Since then all further deposits have been negligible (on average approx 1/10000 BTC) yet fairly regular.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*q_BP6G9vxyoRMPTAi9rnJw.png" /><figcaption>The changing balances of the three ‘dead’ addresses show almost 1-to-1 correspondence with each other. All received their first deposit over a one day period in 2013 and none of them have ever made a payment.</figcaption></figure><p>To my mind the above table and chart make it clear these addresses belong to the same entity! This is further confirmed by plotting the running average of the deposit amounts over time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*NEwMxhxl8HXv8Tqa8h62Sg.png" /><figcaption>Running average of deposit amounts for the three addresses. The dashed line represents an assumed projection based on naive symmetry considerations.</figcaption></figure><p>Interestingly, they have contained close to 200,000 Bitcoins since the end of 2014 and not once have they been touched. Not even during the Mania last December. In fact at a nominal BTC price of $20k, the holder of these addresses would have controlled assets valued at close to $4bn at the last All Time High. Yet this whale did not sell any! Why?</p><p>How to explain this? You might think the owner is simply playing a very long game, but surely even the most ardent Bitcoin maximalist would have taken profit at this point? Another reason might be that the owner has passed away or has lost their private keys (both of which a tragedy).</p><p>Perhaps they too then are cold wallets. In which case it is very unlikely that they belong to an exchange, because if you look at <a href="https://bitinfocharts.com/top-100-richest-bitcoin-addresses.html">The Top 100 Richest Bitcoin addresses</a> again you’ll notice the first five addresses make periodic payouts, as one might expect from a working exchange. But for all intents and purposes, these addresses have been inactive for almost 4 years!</p><p>Inactive, that is, except for periodic deposits in the intervening years totaling less than 0.5 BTC. These micropayments, sometimes as little as 0.000001 BTC, have been received several times a month since Nov 2014 on seemingly random days. Could these be payments sent by Bitcoin developers testing their apps? Unlikely. But whatever the nature of these deposits, their small size makes it clear they are neither investments nor sales from any successful business. What’s more, looking at the last chart with the average deposits, there seems to be a trend forming (dashed line). This is being painted by these small deposits that I just mentioned. They are obviously getting less with time. But why?</p><p>More mystery then…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51e818b78dcb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bitcoin Mining Efficiency Set to Double by 2020]]></title>
            <link>https://medium.com/@sunnyday.james/bitcoin-mining-efficiency-set-to-double-by-2020-e2abb1052c2f?source=rss-94ed40f7ac9d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2abb1052c2f</guid>
            <category><![CDATA[bitmain]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[gmo-internet]]></category>
            <category><![CDATA[mining]]></category>
            <category><![CDATA[bitfury]]></category>
            <dc:creator><![CDATA[BarclayJames]]></dc:creator>
            <pubDate>Wed, 10 Oct 2018 16:16:34 GMT</pubDate>
            <atom:updated>2018-10-10T16:26:58.314Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/396/0*z7mO5ZTJum4jkw9y.png" /><figcaption>Bitfury’s new 14nm ASIC Clarke which claims an efficiency of around 18 GH/J.</figcaption></figure><p>After a distinct lull in innovation within the crypto mining sector since 2016, this year has seen a flurry of new developments largely driven by new chip technologies. In addition several new manufacturers have entered the industry. How will this effect the network and where is the trend going?</p><p>In the first half of the year Japanese tech company GMO Internet announced their entry into Bitcoin mining as well as the retail launch of their B-series miners. These devices, now sold out, feature 7nm ASIC chips making them potentially much more efficient than the previous 16nm state of the art.</p><h3>**The Science Bit**</h3><p>But how does chip size make a difference? Well, essentially the chip sizes stated here refer to the size of the smallest component etched onto the chip (probably a transistor). Some of you may remember from physics class that transistors are made of positively and negatively doped semiconductor material and effectively act as switches allowing electricity to pass or blocking it depending on whether a certain voltage is applied. This works because the semiconductor material allows positive and negative charges to gather at the p/n interface and form a barrier and this is overcome, i.e. the transistor is switched, by applying a voltage. When we make smaller chips, we mean the transistors are smaller. In other words the interface is smaller and therefore is made up of fewer charges (electrons and holes). And of course this barrier requires less voltage (energy) to overcome. As an added bonus it also switches faster meaning more computations are possible for less energy.</p><h3>Anyway…</h3><p>In addition to the GMO news, Innosilicon and Ebang also released their new T and Ebit series miners based on 10nm technology. So are these new ASICs actually more efficient? The honest answer is marginally. However they are promising. Although their efficiency isn’t much better than Bitmain’s Antminer S9 from 2016, these companies are relatively new to the sector. We should expect that the quality of their rigs will improve over the next few models. And let’s not forget that Bitmain also announced a new, still unreleased 7nm chip in 2018, which on paper at least is by far and a way the most efficient ASIC to date.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*CiAM_-DUgmZiJDA-DDUC_Q.png" /><figcaption>Logarithmic chart of efficiency in Megahashes per Joule of various popular sha256 miners including the latest 7nm chip from Bitmain, which is yet to be packaged in a new Antminer model.</figcaption></figure><p>What we see from the above chart is that the energy efficiency trend is growing exponentially. In fact, if it holds Bitcoin mining efficiency should double by 2020. So does that means we will cut our electricity consumption in half? Probably not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DfV60f5VJM5Velg7" /><figcaption>Bitcoin price (yellow) and hash rate (blue). Note the very rough correlation between the two.</figcaption></figure><p>As the logarithmic chart on the left shows, hash rate continues to grow exponentially. There seems to be a real arms race among miners, which has continued unabated despite the market correction. And we can expect this to continue into the future. In fact this year’s new miners also push the bar higher in terms of computational power and seem to be making 20 TH/s the de facto standard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*NFewm2YskL_FGosssoTsmw.png" /><figcaption>Logarithmic chart of the hashing power of the various mining units examined above (minus Bitfury’s Tardis as it features multiple ASICS and the new Bitmain chip as it is yet to be rated). The trend is looser but still exponential.</figcaption></figure><p>From the above chart it is clear that the power of mining units is also growing exponentially to match demand. Again, if this trend continues, we can expect standard miners to offer 70 TH/s by 2020. This also corresponds to a doubling of our most powerful, contemporaneous miners.</p><p>So it seems that the current trend will only stave off the inevitable. Or will it? What about even smaller chips? The next gen chips currently being researched are TSMC’s 5nm and Samsung’s 4nm chips. (Btw Taiwan Semiconductor also make Bitmain’s ASIC chips — that’s food for thought now.) Well, making any chips smaller than the current 7nm requires overcoming quantum tunneling effects, whereby electrons effectively move through potential barriers (insulation) due to statistical effects leading to short circuits. However both the above companies report that planned production should commence in 2020.</p><p>And 2nm? Well it should be obvious that, at some point, a different solution will be needed. But I guess the community will have to cross that bridge when we get to it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2abb1052c2f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Straightforward Guide to the Mayer Multiple]]></title>
            <link>https://medium.com/@sunnyday.james/a-straightforward-guide-to-the-mayer-multiple-2add52e90602?source=rss-94ed40f7ac9d------2</link>
            <guid isPermaLink="false">https://medium.com/p/2add52e90602</guid>
            <category><![CDATA[trace-mayer]]></category>
            <category><![CDATA[barclay-james]]></category>
            <category><![CDATA[ripple]]></category>
            <category><![CDATA[mayer-multiple]]></category>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[BarclayJames]]></dc:creator>
            <pubDate>Mon, 08 Oct 2018 16:20:45 GMT</pubDate>
            <atom:updated>2018-10-08T17:13:35.840Z</atom:updated>
            <content:encoded><![CDATA[<p>While many indicators exist to help technical analysts plan investment strategies, I like to keep my trading toolbox as tidy as possible. RSI, stoch, MACD and even Ichimoku clouds all get a look in, but by far and a way my favourite is the simple moving average (MA). These often get overlooked or derided as lagging indicators but, used correctly, they can help you map out dynamic support and resistances or the flow of your asset, if you like.</p><p>MAs are periodic. That means for a given period, say 50, the average is calculated over the preceding 49 candles plus the present one. Some are also given more significance than others. For example the 200 daily MA, which is taken over the previous 40 weeks, is considered to be a major support/resistance level. In fact, many people consider an asset to be turning bearish once it dips below it. Consequently, buying below the 200 daily MA is considered good practice for long-term strategies.</p><p>The <strong>Mayer Multiple </strong>(µ), developed by analyst and investor Trace Mayer, is a statistical estimator that allows you to see how common a given price level is in relation to the history of your asset. It is simple to calculate</p><p>µ = price / 200 daily MA.</p><p>It returns a value µ &gt; 0 which is a multiple of your asset’s 200 daily moving average. For example, the current Bitcoin price is $6660 and its 200 daily MA is $7270. This means that</p><p>µ = $6660 / $7270 = 0.92,</p><p>therefore today’s µ is 0.92 times today’s 200 daily MA (that’s why you’ll often see µ = 0.92x, but the <em>x</em> is poor notation if you ask me).</p><p>That’s all great but is it a buy (and WEN MUUN BRUH)? Well, this is where the statistical analysis comes in. I will now show you how I analyse an asset using the cryptocurrency called Ripple as our model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*drMHo8SvmkN0cPDysK2HNQ.png" /><figcaption>Mayer Multiple calculated for Ripple/USD (blue) shown together with its 200 daily moving average (orange), i.e. the average of µ not of the currency.</figcaption></figure><p>Take a look at the above chart. You’ll notice that the Mayer Multiple often remains at or close to µ = 1. That means for most of its history, Ripple has generally remained near its 200 daily moving average, in other words it moved sideways in a fairly narrow range. Sojourns above µ = 2 are rare although the maximum recorded value is approx. µ = 16. Likewise the Mayer Multiple rarely drops below µ = 0.5. These extremes, of course, represent the tops and bottoms of market cycles.</p><p>Now I’ve used some qualitative statements like <em>rare</em> and <em>often, </em>which we can gather by just eyeballing the chart. But what about some hard numbers?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yoZmAxzrTdWOphB9fANOZA.png" /><figcaption>Histogram of Mayer Multiple values for the entire history of Ripple. We see that almost 3/4 of the time, the Mayer Multiple remained between 0.50 and 1.50. Try making your own charts with even narrower bin width!</figcaption></figure><p>The above chart is a histogram. It’s basically a fancy bar chart. Each column (known as a bin) represents the percentage of days when µ was in the given range, e.g. the first column tells us that over Ripple’s entire history, the Mayer Multiple was between 0 and 0.50 just 8.45% of the time. Likewise at the other end µ &gt; 6.0 occurred just 2.13% of the time.</p><p>Today’s Mayer Multiple has a value of µ = 0.91 which tells that the relationship between Ripple’s spot price and its 200 daily moving average is pretty average, seeing as 0.50 &lt; µ &lt; 1.50 for almost 75% of the currency’s history. And indeed, eyeballing the first chart again we see that the distance between the Mayer Multiple and <em>its</em> 200 daily moving average is similar to much of the back history. (Remember: the 200 daily MA in the first chart is the moving average of the indicator, not the price!)</p><p>Another useful way to look at all this is by plotting the cumulative percentage. This is just a running tally of the percentages calculated for the bins above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y7mix_DpKpKwiAjs2f2SoQ.png" /></figure><p>It shows us that 100% of all daily µ values were less than 16 and none were less than zero. For today’s value of 0.91, we can read that about 63% of the time µ &lt; 0.91.</p><p>So if we naively think of these percentages as probabilities, we can say that there is a 63% likelihood that the Mayer Multiple will decrease and a 37% likelihood that it will increase from here. Of course, rising µ means that the price action is becoming increasingly bullish with respect to the 200 daily moving average, e.g. the trading activity of the previous 40 weeks.</p><h3>SO WEN MUUN? WEN LAMBO?</h3><p>Obviously it’s not about maximising µ or you’ll just end up buying the top. Likewise low µ does not necessarily mean you are buying the bottom, you could be part of a larger down trend. The Mayer Multiple doesn’t work like that, you’ll still need to apply your trading acumen BRUH. However, anyone that appreciates moving averages and understands the power of the 200 daily MA over the market’s collective psyche will find it a great tool for examining the back history within a simple statistical framework.</p><h3>Resources</h3><p><strong>Spreadsheet for above example</strong> <a href="https://drive.google.com/open?id=1BP1M_8BPy6ACz_kS7Lx1NvwOq5OUqyIG">https://drive.google.com/open?id=1BP1M_8BPy6ACz_kS7Lx1NvwOq5OUqyIG</a></p><p><strong>The Investors Podcast</strong> <a href="https://www.theinvestorspodcast.com/bitcoin-mayer-multiple/">https://www.theinvestorspodcast.com/bitcoin-mayer-multiple/</a></p><p><a href="https://www.youtube.com/watch?v=3IFht_sUYGM">https://www.youtube.com/watch?v=3IFht_sUYGM</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2add52e90602" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Interest in Bitcoin is Booming Again Around the World, but Where and Why?]]></title>
            <link>https://medium.com/@sunnyday.james/google-trends-is-your-friend-45ee3277fe20?source=rss-94ed40f7ac9d------2</link>
            <guid isPermaLink="false">https://medium.com/p/45ee3277fe20</guid>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[BarclayJames]]></dc:creator>
            <pubDate>Sun, 09 Sep 2018 16:57:14 GMT</pubDate>
            <atom:updated>2019-02-05T10:00:46.391Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ORiUQhzL8Gq_OTI_.png" /></figure><p>As soon as I learned about <a href="https://trends.google.com/trends/">Google Trends</a> I was instantly fascinated. You could peer into the collective consciousness of the human herd in both time and space, searching keywords by individual country or the world as a whole and over custom date ranges.</p><p>But like most things we encounter on the interwebs, it didn’t manage to achieve anything more than curiosity status with me, that is, until I actually found a use for it. To be clear I’m definitely not the first person to advocate using Google Trends for trading and investment purposes, but I certainly wouldn’t use it even a tenth as much as I do, without a real recuperative reason.</p><p>And isn’t this typical of most of the weird and wonderful tech gadgetry that we find ourselves confronted with in the Information Age? Facebook addiction aside, it’s only when these incredibly useful tools actually offer us solutions to real world problems that we actually adopt them as a group.</p><p>And this is exactly the case with Bitcoin.</p><h3>Bitcoin Interest in the Major Economies</h3><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fplot.ly%2F%7Estrangeattractor%2F41%2F&amp;src=https%3A%2F%2Fplot.ly%2F%7Estrangeattractor%2F41.embed%3Fautosize%3Dtrue&amp;type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=plot" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/85a7eac6ef8ef7c2847b28cb3914f0eb/href">https://medium.com/media/85a7eac6ef8ef7c2847b28cb3914f0eb/href</a></iframe><p>Since the 2017 All-Time High, cryptocurrency-related interest in many countries has plummeted. The chart on the left makes this very clear.</p><p>Now immediately some very interesting things come to light. You’ll see that in two of the largest crypto-trading nations, the USA and China, interest has been hurtling down, inline with price action, since the end of last year. This really indicates that adoption in the <strong>USA </strong>was fueled overwhelmingly by price and, as such, the interest trend looks to be continuing down. The situation is similar in other similar nations such as the <strong>UK</strong>.</p><p>The same could also be said for <strong>China</strong>, except that this is not in keeping with other Asian countries. In fact few entities in the world have moved so aggressively against Bitcoin and permissionless blockchain technologies than the Communist Party of China. This might have something to do with the ever weakening Yuan, having lost 10% of its value since 2013, and China’s paranoid anal introspection when it comes to its own economic policy (please take that literally :P). China’s unceasing pressure on cryptocurrencies, which has now moved from a ban on exchange to a complete outlawing of even mentioning them in any kind of public forum (yes really, <em>crypto now unword double plus bad brother</em>) is mostly likely based on it’s gut wrenching fear of capital flight. In trying to keep its currency low in order to strengthen exports, China risks triggering an exodus of wealth. This eagerness of Chinese investors to park their money abroad is well known. The last thing Beijing needs is a cheap, peer-to-peer, sha-256-encrypted network which allows almost instantaneous monetary transactions anywhere in the world. As such domestic policy in China has driven down interest within the country.</p><p><strong>Japan </strong>on the other hand is a completely different story! In contrast to China, Japan has adopted a pro-active approach to Bitcoin &amp; Co. and it probably has the highest levels of consumer adoption than any other industrialised nation. This is also evidenced by the sudden upswing in interest in the Google Trends results since the end of Q2 2018.</p><p><strong>India </strong>is a mixture of the two. It is a country caught between two policy poles. It shares many of the concerns of China, but also looks to harness the potential benefits of the blockchain. As such it’s crypto policy has been up and down since forever. Recently though an alleged ban was ruled out and this was accompanied by a renewed uptrend in interest at the start of the second half of the year.</p><p>In contrast to many European countries, interest in <strong>Germany </strong>remains strong and contrary to the worldwide search trend.</p><p>So we see how interest in the major economies is highly influenced by price (USA/Europe) or legislation (China/India) or innovation (Germany/Japan). Now let’s look at those countries which are deep in hyperinflation already or are teetering on the brink of a looming currency crisis.</p><h3>Interest in the High-Inflation Economies</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8PzDXgW3xka1Pei-" /><figcaption>Percentage change since April 2014 of selected world currencies.</figcaption></figure><p>Percentage change of selected currencies against the US dollar since April 2013. Poor Venezuela, the crisis is real kid.</p><p>Without getting into the whys and wherefores (yes, the USA and it’s evil European satraps probably have as much to answer for as Chavismo, but god poor, poor Venezuela…), there is a currency crisis brewing in many parts of the world. The decline of fiat money carries on apace and these market cycles become unavoidable on large enough time frames. Last time I looked, inflation on the Bolivar was running at 4,000,000% and as such there is a real, existential need for alternative currencies and stores of value in these countries… right… now. Looking at Google Trends, we see a completely different picture from the one presented by the <em>rich </em>countries.</p><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fplot.ly%2F%7Estrangeattractor%2F43%2F&amp;src=https%3A%2F%2Fplot.ly%2F%7Estrangeattractor%2F43.embed%3Fautosize%3Dtrue&amp;type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=plot" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/9b65f3f42aa124c05284a8064365428c/href">https://medium.com/media/9b65f3f42aa124c05284a8064365428c/href</a></iframe><p>Looking at the chart on the left, we see immediately that interest has already bounced hard in 2018 and continues to rally. Currently Bitcoin is trading for close to 900,000,000 Iranian Rials on localbitcoins.com (<a href="https://medium.com/p/45ee3277fe20/edit">screengrab</a>), that’s over $23,000 using the official exchange rate.</p><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fplot.ly%2F%7Estrangeattractor%2F45%2F&amp;src=https%3A%2F%2Fplot.ly%2F%7Estrangeattractor%2F45.embed%3Fautosize%3Dtrue&amp;type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=plot" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/03f5cb0f876b1311058f119177147664/href">https://medium.com/media/03f5cb0f876b1311058f119177147664/href</a></iframe><p>Of course it’s overvalued given the level of adoption, the point is that whilst interest has waned in countries where the primary motivation for crypto was speculation, in countries where the people have a real need for it, interest is booming! Let’s compare the previous two charts. We can see that in the beginning, prior to 2014, interest in both categories was relatively similar. Hey, crypto was new, better check it out, looks fun, what’s it all about, oh look I can make a buck kind of stuff. But as the currency crisis started to take root around the world, people in affected regions started showing increasing interest in Bitcoin and their searches overtook the selected major economies. In fact, when interest starts to lag behind in the strong economies, it often begins to pick up in the weaker ones. Clearly the Google trend for high-inflation economies is up.</p><h3>Yeah but… wen mewn, wen lambo?</h3><p>The current market correction is overwhelming. The price suppression is massive. The whale manoeuvres unknowably deep and cryptic. Honestly, the manipulation is massive on both sides, but the trend remains down. Is that really a descending wedge in the price action and what will happen if it breaks down? Which exchanges will fold first and which will get <em>hacked</em>? Hmmm…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q0uOnSWUg-jdfhya" /><figcaption>The inevitability of boom and bust?</figcaption></figure><p>Whatever happens to the current market landscape, cryptocurrencies are going nowhere! Central bank fiat money is ailing, sure. But let’s avoid the armageddon scenarios. In the 1970s, during the last period of hyperinflation, the world population was half what it is now! Our food, water and fuel resources seemed limitless. This time there is the potential for things to be far worse for people in general and, while the elites who understand market cycles all too well have been preparing for decades, the rest of us have little to no idea what the coming decade has instore. Likely it will be harder than the 2008 crisis for many people. The countries in that first chart I gave will probably be less affected than those in the second chart.</p><p>One thing I am confident about is that deflationary cryptocurrencies will have already gained a permanent foothold in many regions around the world, both online and in the physical world as secondary means of payment to legal tender. Indeed in some countries it may even become legal tender. Japan for instance passed the Virtual Currency Act in 2017, which paves the way for such adoption in the future. Even if it is only an additional means of payment, it will be people’s silver, not the silver currently controlled by JP Morgan.</p><p>Going on the basis that human behaviour is essentially the same the world over, eventually a real adoption trend should overtake speculation on a global level. And the spark that lights the match may not come from the strong economies, which are often mired in complacency, but from those countries that have a real need for alternative currencies.</p><p>First there was the gold economy, then the oil economy, now we are entering the information economy. An Age where companies that essentially make next to no profit (Amazon loses around 95% of all its receivables in overheads) can be valued at 1 trillion dollars, because of their access to the goldmine that is personal information and the potential that it offers for manipulating both society and economy.</p><p>Cryptocurrencies have appeared at the right time in history. Was this really an accident?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45ee3277fe20" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>