Building an AWS Trading System - Basic EC2 Operations (Part 3) (Python Tutorial)
Title image created with Cacoo.com
This post is part of a series of tutorials with the subject of building a scalable algorithmic trading system on the Amazon Web Services (AWS) cloud platform. Bear with me, as I’m learning AWS myself.
The advantage of using AWS is that it offers dozens of powerful, integrated software services that can be used to build a scalable, high-performance, low-cost production trading system.
In this post we are going to over basic operations using the AWS EC2 Computing Platform Service. This service can be used for example to quickly spin up VPS cloud servers for different purpose such as performing data loads, running backtests, running ML training and analysis, fetching data or running trading bots.
This story is solely for general information purposes, and should not be relied upon for trading recommendations or financial advice. Source code and information is provided for educational purposes only, and should not be relied upon to make an investment decision. Please review my full cautionary guidance before continuing.
Previous Tutorials
The following posts are suggested reading for this post to get you started:
Building an AWS Trading System - Registration & Environment Setup (Part 2)
Trade Ideas provides AI stock suggestions, AI alerts, scanning, automated trading, real-time stock market data, charting, educational resources, and more. Get a 15% discount with promo code ‘BOTRADING15’.
What is EC2?
AWS EC2 is Amazon’s cloud hardware platform service for building scalable systems. There are a wide variety and combinations of operating systems, processors, memory- and storage options available. For example, EC2 images include Linux flavors, Mac and Windows OS or Intel, AMD and Arm processors.
EC2 can be used a s building blocks for building scalable automated trading systems. For example, one could spin up one or multiple EC2 instances to support each process of the trading development and production system such as data import, data preparation and aggregation, backtesting, machine learning, live data analysis, and running bot farms.
Read more about AWS S3 here.
What is AWS Cloud 9?
AWS Cloud 9 is an Integrated Development Environment (IDE) that is accessed through a browser and can be used to write and debug source code using languages like JavaScript or Python.
In this series of tutorials we will be using AWS Cloud 9 IDE to write, execute and store all our code.
In order to be able to use Cloud 9, you will need to set up an EC2 instance that can be used to run Cloud 9.
Read more about Cloud 9 here.
What is Boto3?
AWS functionality can be accessed in different ways, e.g. AWS Console, AWS Command-line Interface (CLI), or different SDKs. In this series of tutorials we will be using the Boto3 library to interact with the different AWS services.
Boto3 is a Python SDK provided by Amazon to interface with services such as EC2, S3, Amazon Athena, etc.
Read more about Boto3 here.
Here the boto3 AWS API documentation.
Tutorial Outline
In this tutorial we will go over the basic operations for managing EC2 instances:
List all EC2 instances
Describe an EC2 image
Create a EC2 instance
Get an EC2 instance by id
Start an EC2 instance
Check the EC2 instance state
Reboot an EC2 instance
Stop a EC2 instance
Terminate an EC2 instance.