Price and Sentiment Analysis: Why is Bitcoin Going Down?

Bitcoin Price and Sentiment Analysis with variable Moving Average: click to open interactive Tableau dashboard with annotations
Bitcoin Price and Sentiment Analysis with variable Moving Average: click to open interactive Tableau dashboard with annotations

Bitcoin has become one of the trendy investment assets in the recent years. Whenever bitcoin prices approach historical highs, every investor should watch the currency closely. Bitcoin rallied by more than 20% in the first days of 2017, crossing the $1000 mark for the first time since November 2013.

As many experienced bitcoin traders will remember, the first $1000 peak was a case of obvious over exuberance. Bitcoin was hot, plenty of money was pouring into it. Bitcoin investors got too excited, causing a price surge. Prices then rebounded and suffered a long-term collapse shortly after.

Moving Average Convergence/Divergence Indicator

Many traders rely on a Moving Average Convergence/Divergence (MACD) indicator. The MACD is a measure of the convergence and divergence between two EMAs (usually 12 and 26 days) and is calculated by subtracting the two of them. The signal line is constructed by creating an EMA (usually 10 days) of the signal line.

The signal line crossing the MACD from above is a buy signal. The signal line crossing the MACD from below is a sell signal. Relying only on momentum-based indicators (such as the MACD) and optimization-based models, however, will most certainly fail to indicate heavy price drops, as the drop in late 2016.

Predicting Fear with Sentiment Analysis

In late 2016 a lot of people began to pour money into bitcoin again. This time because they were worried that stock markets and other assets were due for a drop. For investors, it is essential to figure out whether or not these fears are actually founded. However, such „safe assets“ are prone to suffering from bubbles. People get scared, get invested into gold, or bitcoin, then realize that their fears were unfounded. As a result bitcoin prices could plummet.

So how to catch emotions such as fear in advance? Twitter is a valuable source of information and emotion. It certainly influences the stock market and can help to predict the market. Sentiment analysis can lead price movements by up to two days. Negative sentiment, however, is reflected in the market much more than positive sentiment. This is probably because most people tweet positive things about bitcoins most of the time. Even more positive news occurred after breaking the $1000 barrier.

This content is part of the session “Price and Sentiment Analysis: Why is Bitcoin Going Down?” that I deliver at the Frankfurt Bitcoin Colloquium. Have a look on my upcoming sessions!

[Update 14 Jun 2017]: Axis for Moving Average adjusted. Relative Date selector added with last 6 month as default. Screenshot updated.

Feel free to share the Bitcoin Price and Sentiment Analysis dashboard, which is also featured as Viz of the Day on Tableau Public:

Data Strategy: Steigern smarte Erkenntnisse den Business Impact?

Abbilding 2: Loth-Modell des Reifegrads von Advanced Analytics
Abbilding 2: Loth-Modell des Reifegrads von Advanced Analytics

Die voranschreitende digitale Transformation liefert Daten über nahezu jede Facette unseres Tuns. Jeder Besuch eine Webseite, jeder Klick, jede Suchanfrage und jeder Einkauf wird protokolliert und entweder mit unserer virtuellen Identität (wenn wir angemeldet sind) verknüpft, oder in einem System gespeichert, dass unsere Sitzung per Cookie oder digitalem Fingerabdruck verarbeitet.

Sind diese Daten erst einmal erhoben, werden sie für gewöhnlich in Silos der einzelnen Funktionen (vertikales Silo), Abteilungen (horizontales Silo), oder sogar in individuellen Projektsilos abgelegt. Um aus diesen Daten eine wertvolle und nützliche Ressource zu machen, müssen wir diese Silos aufbrechen. Dem stehen allerdings oft Fragen zur Inhaberschaft, Regularien und Governance im Weg.

Das Sammeln von Daten allein generiert aber keinen Mehrwert. Der tatsächliche Business Impact hängt davon ab, wie „smart“ die gewonnen Erkenntnisse sind. Und das wiederum wird von der Vollständigkeit der Advanced-Analytics-Lösung (siehe Abbildung 2) und der Komplexität der eingesetzten Modelle bestimmt. Präskriptive und Semantische Analysen sind unter Umständen nur sehr schwer umzusetzen, insbesondere wenn es zunächst gilt, semi-strukturierte Daten – wie etwa Social Media-Streams – zu klassifizieren.

Vergessen Sie also über die Umsetzung komplexer Modelle nicht, die leichte Beute einzusacken: lassen Sie all Ihre quantitativen Informationen einfließen (beispielsweise Umsatzdaten), um Ihre diagnostischen Möglichkeiten zu skalieren.

Für die meisten Entscheidungsträger besteht die Herausforderung nicht in einem Mangel an Daten oder Datenquellen, sondern dass die zur Verfügung stehenden Datenquellen oftmals unterschiedliche Ergebnisse liefern oder schlichtweg nicht geeignet sind, die jeweils anstehende Entscheidung sinnvoll zu informieren.

Leider wird die Rolle der IT dabei oft unterschätzt. Die größte Herausforderung für Entscheidungsträger im Analytics-Zeitalter ist die eingefahrene Sichtweise, dass Unternehmen ihrer eigenen Datenbasis bestehend aus Interaktionen mit potentiellen Kunden, Kunden, Lieferanten und Partnern weniger vertrauen können, als externen Erkenntnisquellen.

Dieser Beitrag ist der zweite Teil der Datenstrategie-Serie:

Teil 1: Die Notwendigkeit einer modernen Datenstrategie im Zuge der digitalen Transformation
Teil 2: Steigern smarte Erkenntnisse den Business Impact?
Teil 3: 10 BI & Analytics Trends, die in keiner Datenstrategie fehlen dürfen
Teil 4: Wie unterstützen Analysen Ihre Entscheidungsfindung?
Teil 5: Erstickt Innovation zwischen Berichtswesen und Data Discovery?

Monkey Business: Always be Ready to Demo

The famous Tableau Superstore demo data set
The famous Tableau Superstore demo data set

Usually, I really don’t like looking on the screens of other passengers. On this early morning train from Frankfurt to Cologne, however, the screen of my seatmate caught my attention. Where have I seen the logo on his slide deck before? Two coffee sips later, it came to me: it was the logo of Monkey 47, a very delicious gin, distilled in the heart of the Black Forest. So I asked my neighbor: “Is that the Monkey 47 logo?”

He was happy that I recognized his brand and we had a small chat about gin and the Black Forest. Turns out his name is Thomas, and he is the head of Sales and Marketing for Monkey 47. Thomas mentioned that his team is planning a tour to promote Monkey 47 in a number of cities. That sounds similar to what we are doing with the Tableau Cinema Tour, so I showed him our Cinema Tour landing page and explained briefly who we are and what our mission is.

I asked him how he is organizing his data. Thomas revealed that he lives in Excel hell: “spreadsheets with thousands of rows and way too many columns”. This also sounded familiar. I opened up our Superstore.xlsx in Excel and asked: “Do your Excel sheets look like this?” Thomas replied: “Yes!”

Here we go! I drag’n’dropped the file on my Tableau desktop icon and paced through a 7-minute-demo ending with an interactive dashboard. Thomas was flabbergasted. To polish things off, I showed him the interactive Twitter Sentiment Dashboard embedded in my blog. Thomas grabbed his jacket and gave me a business card, saying: “We need Tableau!”

Monkey 47 business card (back side)
Monkey 47 business card (back side)

This story was originally written for Tableau’s EMEA Sales Newsletter. I think it’s a good read for the holidays, and wish you all Merry Christmas!

Data Strategy: Die Notwendigkeit einer modernen Datenstrategie im Zuge der digitalen Transformation

Abbildung 1: Analysten schätzen, dass das Datenvolumen in den kommenden Jahren rasant steigend wird
Abbildung 1: Analysten schätzen, dass das Datenvolumen in den kommenden Jahren rasant steigend wird

Traditionell sind es die Mitarbeiter, die gute – oder zumindest glückliche – Entscheidungen treffen, die die Karriereleiter innerhalb von Unternehmen erklimmen. Und diese Kultur des Respekts gegenüber guten Instinkten durchdringt auch heutzutage noch die Entscheidungsfindung in vielen Unternehmen.

In manchen Fällen werden Berater hinzugezogen, um unliebsamen oder rein präferentiellen Entscheidungen den Anschein externer Validierung zu geben; in anderen Fällen verlässt man sich auf die Weisheit von Vorgesetzten, Mentoren oder Gurus. Es zeichnet sich jedoch ab, dass bei Entscheidungen, die ein Unternehmen von sich aus nicht ohne weiteres unterstützen kann, immer mehr das Kollektiv herangezogen wird und man sich bei Entscheidungsfindung und Problemlösung der Kraft großer Zahlen bedient.

In unserer digital vernetzten Welt fallen jeden Tag Unmengen von Daten an (siehe Abbildung 1). Das exponentielle Wachstum der Menge an generierten Daten führt unweigerlich zur digitalen Transformation ganzer Geschäftsmodelle. Nur Unternehmen, die große Datenmengen aus unterschiedlichen Quellen in umsetzbare Erkenntnisse verwandeln können, werden langfristig wettbewerbsfähig bleiben. Dazu bedarf es einer modernen Strategie, die den Fokus auf Daten legt und weit über deren reine Erhebung hinausgeht.

Eine unternehmensweite Bereitstellung von Advanced Analytics und Data Science as a Service (DSaaS) kann hier einen Wettbewerbsvorteil bedeuten, insbesondere wenn sie den Schwerpunkt darauf legt, die Mitarbeiter mit den richtigen analytischen Werkzeugen auszustatten. Sind diese Werkzeuge einfach zu verwenden und gut in die tägliche Arbeit integriert, lässt sich die Akzeptanz – und somit Wirkung – maximieren.

Dieser Beitrag ist der erste Teil der Datenstrategie-Serie. In den kommenden Wochen folgen weitere Beiträge, die Fragen zur modernen Datenstrategie näher beleuchten werden:

Teil 1: Die Notwendigkeit einer modernen Datenstrategie im Zuge der digitalen Transformation
Teil 2: Steigern smarte Erkenntnisse den Business Impact?
Teil 3: 10 BI & Analytics Trends, die in keiner Datenstrategie fehlen dürfen
Teil 4: Wie unterstützen Analysen Ihre Entscheidungsfindung?
Teil 5: Erstickt Innovation zwischen Berichtswesen und Data Discovery?

[Update 8 Feb 2017]: Eine längere Fassung dieses Beitrags, ist in der IWP-Zeitschrift erschienen: Information – Wissenschaft & Praxis. Band 68, Heft 1, Seiten 75–77, ISSN (Online) 1619-4292, ISSN (Print) 1434-4653

TabPy Tutorial: How to Integrate Python with Tableau for Advanced Analytics

Python in Tableau: TabPy allows Tableau to execute Python code on the fly
Python in Tableau: TabPy allows Tableau to execute Python code on the fly

In 2013, Tableau introduced R Integration, the ability to call R scripts in calculated fields. This opened up possibilities such as K-means clustering, Random Forest models, and sentiment analysis. With the release of Tableau 10.2, we can enjoy a new, fancy addition to this feature: the Python Integration through TabPy, the Tableau Python Server.

Python in Tableau: The Perfect Blend

Python is a widely used general-purpose programming language, popular among academia and industry alike. It provides a wide variety of statistical and machine-learning techniques and is highly extensible. Together, Python and Tableau are the data science dream team to cover any organization’s data analysis needs.

In this tutorial, I’m going to walk you through the installation and connecting Tableau with TabPy. I will also give you an example of calling a Python function from Tableau to calculate correlation coefficients for a trellis chart.

Step by Step: Integrating Python in Tableau

1. Install and start Python and TabPy

Start by clicking on the Clone or download button in the upper right corner of the TabPy repository page, downloading the zip file, and extracting it.

TabPy download via GitHub web page

Protip: If you are familiar with Git, you can download TabPy directly from the repository:

> git clone git://github.com/tableau/TabPy

TabPy download via Git command line interface

Within the TabPy directory, execute setup.sh (or setup.bat if you are on Windows). This script downloads and installs Python, TabPy, and all necessary dependencies. After completion, TabPy is starting up and listens on port 9004.

2. Connecting Tableau to TabPy

In Tableau 10.2 (and later versions), a connection to TabPy can be added in Help > Settings and Performance > Manage External Service Connection:

Tableau main menu
Tableau main menu

Set port to 9004:

External Service Connection dialogue
External Service Connection dialogue

3. Adding Python code to a Calculated Field

You can invoke Calculated Field functions called SCRIPT_STR, SCRIPT_REAL, SCRIPT_BOOL, and SCRIPT_INT to embed your Python script in Tableau:

SCRIPT_REAL('
import numpy as np
return np.corrcoef(_arg1,_arg2)[0,1]
',
SUM([Sales]), SUM([Profit]))
Python script within Tableau
Python script within Tableau

4. Use Calculated Field in Tableau

Now you can use your Python calculation as Calculated Field in your Tableau worksheet:

Tableau workbook featuring a Python calculation
Tableau workbook featuring a Python calculation

Feel free to download the Tableau Packaged Workbook (twbx) here.

Further Reading: Visual Analytics with Tableau

Join the data science conversation and follow me on Twitter and LinkedIn for more tips, tricks, and tutorials on Python in Tableau and other data analytics topics. If you’re looking to master Tableau, don’t forget to preorder your copy of my upcoming book, Visual Analytics with Tableau (Amazon). It offers an in-depth exploration of data visualization techniques and best practices.

Also, feel free to comment and share my TabPy Tutorial tweet:

Blog post updates: