The primary data analyzed on this site is Bitcoin's closing price. However, we recognize that various factors, also known as features, influence its price and can enhance the model's prediction accuracy.
Bitcoin is unique due to the computations it requires. More interestingly, Bitcoin undergoes regular halving events, where the rate of new Bitcoin creation is halved. This mechanism is designed to control inflation, and it’s reasonable to expect that it may influence Bitcoin prices.
The year is a valuable feature for this reason. However, instead of using all four digits, e.g., '2', '0', '1', '4', we aim to capture periodicity by using just the last digit, e.g., '4'. This approach helps prevent data leakage or overfitting. A model with access to full digits might memorize past events as precise indicators, resulting in poor generalization to new data.
Price data typically includes OHLC (Open, High, Low, Close) values. By calculating ratios between them, we can create new features. For example, $(Open - Close) / Close$ represents the percentage change between open and close prices. These ratios can be extended across various data fields.
Previous values can be useful as features, such as the closing price of the previous day or the average price over the last 7 days.
Instead of using today’s price as a raw value (e.g., 300 USD), we can represent it as a ratio relative to a previous price, such as a 1.02% increase from yesterday.
Many machine learning models benefit from normalized data, typically within a certain range like $0 \leq value \leq 1$. Ratios are particularly useful for normalization and are related to transforming time series data to stationary form, often involving differencing.
Differencing connects to log transformation, where the difference $log(x_1) - log(x_2)$ equals $log(\frac{x1}{x_2})$, representing the log of the ratio.
Comparisons aren’t limited to adjacent rows; they could also reference earlier points, like 7 or 14 days prior.
Technical indicators are derived from price and volume data, such as moving averages, relative strength index (RSI), Bollinger Bands, MACD, and stochastic oscillator.
The goal of these indicators is to predict future price movements, although none alone is conclusive. They are often used as filters or as components within a broader prediction model.
Technical analysis often incorporates specific patterns. For example, the head and shoulders pattern, shown below, suggests a price drop after reaching a peak.
Source: image by Altafqadir, shared under Creative Commons Attribution 3.0 Unported
Identifying patterns like head and shoulders can be subjective. Some patterns, however, are easier to recognize. For instance, a candlestick with a closing price higher than its opening indicates a price increase for the day. Some traders focus on the wick—the difference between the opening and lowest prices, or between the closing and highest prices—as it reflects buying or selling pressure.
Two candlesticks with (closing price) > (opening price), showing different wick types
Deep learning not only improves data fitting but also enables automatic feature extraction. For example, in image classification, the lower layers detect basic features like edges, while upper layers recognize more complex patterns like shapes and objects.
Image by Sven Behnke, CC BY-SA 4.0
Features can also be generated programmatically by combining existing ones. For instance, we could create features such as feature 1 * feature 2, feature 1 + feature 2, feature 1 / feature 2, etc., and then evaluate which ones contribute effectively to model performance.