I predicted Tesla’s stock price trend post Cybertruck launch..

Nimish Rao
DataSeries

--

..in 30 minutes or less using Microsoft Azure

I like cars. I cannot lie. I saw Cybertruck launch video and it reminded me of the movie Terminator. It also reminded me of a post-apocalyptic movie.

My imginative Tesla truck
image WWW

I thought it was funny when the windows broke.

There seem to be articles suggesting that the market is uncertain about the Truck. There are predictions that the stock price can be be at an all-time high. Or even low. Fair enough.

Tesla stock prices

The launch happened at 8 PM. Tesla ended yesterday on the NASDAQ, which is before the Cybertruck announcement. Stock prices are interesting as they sometimes show linear behavior with the general consensus around a company’s actions in the public domain. I want to see the general sentiment around the Cybertruck and see if it has any correlation to the stock prices of Tesla.

Things I am going to do:

Create a logic app that will read twitter feeds every 10 seconds, analyze the sentiment( with 1 being positive, 0.5 being neutral and 0 being negative) of the tweets using the Azure text analytics service, ingest it through an event hub and then use Azure Data Explorer(ADX) to run real time analytics on the streaming data to understand the general sentiment

Just to confirm what is trending in New Zealand and I can see the Cybertruck hashtag is trending.

Development of the logic app

This is how the logic app is going to look like. The above is a sequence of steps wherein I am :

  1. Build an Azure Logic App to invoke the Twitter API and retrieve Tweets with the hashtag #Cybertruck

2. For each Tweet, invoke the Azure Text Analytics Cognitive service to detect its sentiment

3. The next steps are to format the Tweet’s JSON message

4. The next step is to send the JSON message to the event hubs. Feel free to call it whatever I just like giving cool names :)

Now let’s enable the logic app that we just created: (I did misspell the name of my logic app, don’t be like me in this case )

Now let’s start our already setup ADX cluster:

It will take some time for it to start up, go and grab a quick bite.

Once the cluster is up and running. Go to the new query window.

And run the following Kusto Query Language statement :

Tweets | where * has “Cybertruck”

The above basically gets all the data where Cybertruck is mentioned in any column.

The below shows the timestamp, the tweetid, the tweettext, and the sentiment score for each tweet

The above gives the output, so if you notice the logic app is reading the data in real-time as is evident from the logic app logs:

Let’s run another Kusto SQL statement and have a look at the trends:

The average seems to be leaning towards the not very positive side and I think the share prices will go down as from the above analysis.

Let’s check the stock price trend for Tesla on Friday morning.

Exciting! Our high-level analysis is actually right! The market hasn’t responded well to last night’s Cybertruck announcement!

The share prices have actually gone down and the Twitter sentiment is in line with our analysis.

While this is in no way an exhaustive analysis it does help to understand the perception of your prospective customers which in turn might an indication of how well or not well your product/ service is doing/ will do in the market and for a company to take corrective measures.

Note: The opinions expressed herein are mine alone and do not represent the opinions of my employer.

NR

--

--