DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • How I Fixed a Silent Production Bug in Apache Airflow That Affected Thousands of Deployments
  • Accelerating Your Software Engineering Career With Open Source and Jakarta EE
  • Deterministic AI With OpenSymbolicAI
  • Automating Behavioral Evaluations for LLMs: A Practical Guide to Bloom

Trending

  • Jakarta EE 12: Entering the Data Age of Enterprise Java
  • Liquid Glass, Material 3, and a Lot of Plumbing
  • Is the Data Warehouse Dead? 3 Patterns From Enterprise Architecture That Answer This Question
  • Pragmatica Aether: Let Java Be Java
  1. DZone
  2. Data Engineering
  3. IoT
  4. How to Turn a Raspberry Pi Into a Crypto Trading Bot

How to Turn a Raspberry Pi Into a Crypto Trading Bot

Learn how to set up the Raspberry to optimize the use of the limited resources by using it as a backend server, avoiding running the software GIU on the Pi.

By 
Julian Molina user avatar
Julian Molina
·
Updated Feb. 20, 21 · Tutorial
Likes (5)
Comment
Save
Tweet
Share
33.9K Views

Join the DZone community and get the full member experience.

Join For Free

This tutorial goes through the steps required to install the open-source software that deals with mining data from a crypto exchange, run backtests, and run live trading sessions. The key teaching focuses on setting up the Raspberry Pi the smart way to optimize the use of the limited resources by avoiding running the software GIU on the Pi itself, instead, providing the solution to run the GIU from a regular machine on the Local Area Network.

This Is What You'll Need

  • Raspberry Pi 2GB RAM ($40) - If you plan to run long (multi-year) backtests, you will likely need the 4GB or 8GB version (2 GB is enough for shorter backtests and trading live).
  • Flash-card, 16Gb ($7)
  • Raspberry Pi OS / Raspbian / Ubuntu ($0, open-source)
  • Node.JS ($0, open-source)
  • Git ($0, open-source)
  • Superalgos (0$, open-source)

Let's Start!

I'll assume your Raspberry is fully set up with the native OS or Ubuntu. If it's not, just follow the manufacturer's instructions.

Let's get on with the rest of the software set up:

  1. Download and install Node.JS.
  2. Download and install Git.
  3. Download and install Superalgos.

You don't want to run the Superalgos GUI on your Raspberry… the 2GB RAM version won't be able to cope with the visual environment.

The clever setup is to use the Pi as a backend service that you access from your regular machine's browser. That way you can leave the PI on, trading 24/7, while you do whatever you do in your main PC.

So, run Superalgos with the noBrowser option. If your Pi is less than 8GB RAM, then add minMemo too (to prevent the RPI from running out of memory): 

HTTP
 




x


 
1
node run minMemo noBrowser



The command will start Superalgos backend servers on your Pi!

Then, in your regular machine, open Chrome or Safari on Mac (the only tested browsers) to access the Superalgos Client web server via HTTP.

You will go to the Raspberry on port 34248. Like this:

HTTP
 




x


 
1
http://raspberrypi:34248



If your router can’t resolve that URL, then replace raspberrypi with the IP address of your RPI in the network.
It takes a while to load the GIU and index the built-in documentation. Once in, an interactive tutorial pops up!


Interactive tutorial

Start doing the tutorial!
Don't stop the tutorial even if you see an error!

Instead, start doing the tutorial. It will guide you to fix the issue, which has to do with a configuration you must edit when you access the Client from a remote machine.

Once the issue is solved, keep doing the tutorial. It will take you through all the basics and help you run your first data-mining operation, your first backtest using a demo trading system, and even your first live trading session on Binance or Binance US.

The demo uses the BTC-USDT market, but once you know how to use the app, you may switch to any other market in the supported exchanges.

The tutorial answers all of your questions about what Superalgos is and how it works... it's fun, and it's fully interactive... you start fiddling with the app as you go and learn all the basics right then and there.

It'd be too long to explain everything the app does, but I can say it covers an impressive stretch of what is required to do some big-time trading, including pro data-mining, data visualization, visual strategy design, visual strategy debugging, coordinated deployments of multiple bots, etc. You can find the details on the website or just give it a go and see for yourself!

Once you go through the first experience, you may learn to design your own strategies or use the ones shared by the Community.

This is how the backtesting simulation in the tutorial looks like!

Backtesting simulation

The set up you just created is the minimum expression of a trading farm. If you have more Raspberries, or even old laptops or desktops gathering dust in the closet, pull them out, and set them up as new nodes on the Network!

A trading farm setup may run distributed and coordinated tasks across multiple machines, and each machine may run as many trading sessions as the hardware can cope with! 

Have fun!

raspberry pi Open source

Published at DZone with permission of Julian Molina. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • How I Fixed a Silent Production Bug in Apache Airflow That Affected Thousands of Deployments
  • Accelerating Your Software Engineering Career With Open Source and Jakarta EE
  • Deterministic AI With OpenSymbolicAI
  • Automating Behavioral Evaluations for LLMs: A Practical Guide to Bloom

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook