## Trading Bitcoin

### An Algorithmatic Way

Created by James Cai

## Motivation 1

Traders recognize technical patterns to predict the market.

## Motivation 2

Traders also look at the order book.

## Strategy

- Recognize current pattern
- Capture current order book feature
- Predict future price based on pattern and order book

## Patterns

- I don't know what the patterns are.
- So I use k-means to cluster the patterns.
- Every price time series is a 57min long vector.
- Throw them into k-means.

#### Patterns (K-Means Centers)

x unit: timestamp/30s y: CNY
#### A Single Pattern and Its Surrounding Instances

x unit: timestamp/30s y: CNY
## Prediction Based on Pattern

- In Training Data, For every cluster c
_{i}, there are a_{i} instances, with average future price move p_{i}
- The probability that a given x belongs to a cluster is modeled as Gaussian.

## Modeling the Order Book

- v
_{bid} is the total volume of the highest 50 bids
- v
_{ask} is the total volume of the lowest 50 asks

## Final Prediction