Automatically and effortlessly deploy this bitcoin trading algorithm to EC2 in under two minutes using Python

Running your code in the cloud can be a big barrier for beginners. The whole process is very high friction, requires many steps, and is prone to a lot of errors. You have to log into AWS, navigate to EC2, launch an instance, select a security group, create a keypair…

Here is a simple algorithm you can implement immediately for BTC-USD, using the Coinbase Pro API and python. This is just a jumping-off point (but includes ideas for improvement in the future).

Clone repo here:

Here’s what to do to get started

Step 1.) git clone

Step 2.) Open and replace credentials for api_key

Disclaimer: This article is for entertainment purposes only. It discusses risk in terms of distance and size, while purposely ignoring percentage risk (to be discussed later). By reading this article, you take full responsibility for all your decisions as a trader.

This article shows how you can make money more…

Setting up AWS with Python with Alpaca Trade API

It is always challenging for a new quant trader to get an algorithm up and running live in the cloud. In my last post, I wrote an instruction for using PythonAnywhere.

This walkthrough focuses on the basics of setting up AWS with Python, the Alpaca Trade API, and running a…

Using PythonAnywhere When Running an Algorithm Live in the Cloud

After first getting into quant trading and writing algos on your local machine, the biggest area of resistance for newbie quant traders is running an algorithm live in the cloud.

There are many cloud services on the market, including AWS, Google Cloud, Heroku, Digital Ocean, and PythonAnywhere. …

Defining Technical Chart Patterns Programmatically

Ever wondered how to programmatically define technical patterns in price data?

At the fundamental level, technical patterns come from local minimum and maximum points in price. From there, the technical patterns may be defined by relative comparisons in these min/max points.

Let’s see if we could have played this by…

In this article, I will show how you can make “roll-your-own” visualizations, using the Alpaca API with Python.

See the final code on GitHub here.

Visualizing your portfolio correlation by heatmap in Python (jupyter notebook)

Step 1: Setup

For this tutorial, I used Python 3 in jupyter notebook, some basic libraries, and the Alpaca trade API. …

Keras is fun. Keras is nice.

Manually tweaking hyperparameters, forgetting to save the results, and running your models again is bad practice. It wastes time, energy, and makes your laptop’s fans tired.

Here’s a quick code snippet that saves your Keras models (as well as the results) for later reference:

Code adapted from

Ever wondered how to apply your machine learning/data science skills to algorithmic trading?

If you already know Python and basic statistical principles of data science (like train-test-split, over-fitting, etc), you’re already way ahead of the curve.

Translating machine learning models into trading algorithms is pretty simple…

# Plot two lines with different scales on the same plotfig = plt.figure(figsize=(8, 5))line_weight = 3
alpha = .5
ax1 = fig.add_axes([0, 0, 1, 1])
ax2 = fig.add_axes()
# This is the magic that joins the x-axis
ax2 = ax1.twinx()
lns1 = ax1.plot(wnv3['mosq'], color='blue', lw=line_weight, alpha=alpha, label='Mosquitos')
lns2 =…

Sam Chakerian

Python, trading, data viz. Get access to samchaaa++ for ready-to-implement algorithms and quantitative studies:

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store