Real-Time Bitcoin Monitoring and Prediction with Bokeh and Twisted

In this article the implementation of real-time bitcoin prediction and monitoring is going to be explained.

The project for this story has been developed in this repository.

Getting Bitcoin Value

For this job I use one of the cool open api and I am very thankful to them.


I want to ask for the price of bitcoin every 200 sec and I want to generate the predictive model every 24 hours, also I want that bokeh application get updated every 250 sec. Then I develop this docker image for it.

Twisted APP

In this app first bitcoin prices will be inserted into csv file:

Then every 24 hours a random forest predictor will be developed to predict bitcoin price at 10 hours later.

Bokeh APP

This app will be gather information every 250 sec, this information involves the bitcoin values inside the csv file and prediction of next 10 hours for last data in csv file.

Deployment on heroku

This app also has been deployed on heroku and the process has been explained in my previous articles.


doing some data engineering