Using AI to Predict Cryptocurrency Trading Returns and Develop Profitable Strategies

·

This research focuses on identifying reliable and profitable models that leverage publicly available historical data to forecast the future price movements of crypto assets. The goal is to predict the directional trends of blockchain-based asset prices and apply these predictions within practical trading strategies. The study demonstrates that technical analysis tools, when applied to large datasets, can identify patterns and improve the accuracy of price trend predictions.

Introduction

Algorithmic trading uses computer programs to execute orders based on a predefined set of rules. It is particularly effective in highly volatile markets, such as cryptocurrencies. This article introduces a neural network-based trading strategy for cryptocurrencies. The strategy utilizes a single dataset to learn universal price patterns and has been rigorously evaluated across extensive historical data.

The cryptocurrency market possesses unique characteristics that demand innovative research methods. Technical analysis can be effectively applied here due to the market's inefficiencies, which present numerous opportunities. The low fees on digital exchanges, especially cryptocurrency platforms, and the availability of free trading APIs have significantly lowered the barrier to entry for algorithmic trading. However, the rise of algorithmic trading may diminish the influence of human behavior. Transaction fees can be as low as 0.1% per trade.

The core of this approach is a Multilayer Perceptron (MLP) based trading algorithm. This algorithm categorizes the market into three classes: Buy, Hold, and Sell. It processes preprocessed price and volume time series through feature extraction and labeling, followed by training and testing on the MLP. The algorithm's performance has been validated across different market cycles and tested in both long-term and short-term simulated scenarios, demonstrating a strong return on investment (ROI).

Dataset and Feature Engineering

The foundation of any predictive model is high-quality data. This study utilizes a comprehensive dataset to train and evaluate the MLP model.

Data Collection

The dataset includes information on 402 different crypto assets. Data was collected from a popular cryptocurrency trading platform in the OHLC (Open, High, Low, Close) + Volume format, with a 4-hour time interval. All cryptocurrencies in the dataset are paired with the USDT stablecoin. After feature extraction, the dataset contained 1.5 million samples.

Feature Extraction

A set of straightforward technical indicators was chosen to allow the neural network to discover useful patterns autonomously. Selected features include:

The total feature vector consists of 36 distinct entries, providing the model with a rich set of inputs for pattern recognition.

Labeling Algorithm

A three-label classification system (Buy, Hold, Sell) was implemented to enhance the accuracy of the prediction process. The labeling algorithm incorporates two key parameters, 𝛼 and 𝛽, which set thresholds for return values to predict price changes.

The algorithm first updates the exponential moving average of the closing price. It then calculates the return and, based on the thresholds, assigns a Buy, Sell, or Hold signal. If the calculated return is too small or too large, the label is set to Hold to avoid insignificant or overly risky trades.

Model Architecture and Training

The choice of model and its configuration are critical to the strategy's success.

Multilayer Perceptron (MLP)

The MLP model comprises an input layer, two hidden layers, and a classification output layer with three nodes (Buy, Hold, Sell). Guided by the Universal Approximation Theorem and the principle of minimum neurons, layers with 128, 64, and 32 nodes were selected. The model was tuned to achieve slight overfitting on the training set while maximizing accuracy on the test set. Techniques like dropout layers or weight regularization were avoided in handling overfitting.

Parameter Optimization

The thresholds 𝛼 and 𝛽 were determined through statistical analysis of the open-close percentage price change across the entire dataset. 𝛼 was set at the 85th percentile, and 𝛽 at the 99.7th percentile. To address the class imbalance where the "Hold" class constituted roughly 70% of the data, random undersampling was applied.

A grid search was conducted to find the optimal combination of forward and backward window sizes. Models were trained and tested multiple times, with average results calculated. The top five window-size combinations with the highest accuracy were selected for further evaluation.

Model Comparison

Alternative models, including XGBoost, Logit, and SGDLinear, were tested using a One-vs-Rest strategy to compare binary and ternary classifiers. The results indicated that both MLP and XGBoost outperformed linear models, with MLP achieving the best overall performance. Consequently, MLP was chosen as the final classifier model.

👉 Explore advanced trading strategies

Backtesting and Performance Evaluation

The true test of a trading strategy lies in its simulated performance on historical data, a process known as backtesting.

The top five MLP models, selected for their high accuracy, were evaluated based on the profits generated through a simple trading strategy. Interestingly, the ranking of these models changed when profit became the primary metric, underscoring that profitability is a more critical measure of a trading strategy's success than pure accuracy.

The backtesting methodology simulates real trading scenarios using historical data. It does not open multiple long or short positions for the same asset simultaneously, and all positions are closed at the end of the simulation period to calculate the final profit.

Using this simulation, the model with the maximum return was selected and backtested on data from Bitcoin, Ethereum, and Algorand. The results demonstrated the model's strong generalization capability, showing it could be effectively applied to different cryptocurrencies. The model achieved high returns in practical simulations, with particularly outstanding performance in long-term backtesting on Ethereum.

A protective stop-loss mechanism was also implemented to manage risk. Short-term backtests revealed the strategy's behavior during market crashes, such as the TerraLuna collapse. The MLP model handled these events more smoothly compared to a dummy model, a behavior also observed during the FTX crash. Analysis showed that the MLP classifier's outputs were primarily influenced by lagging indicators.

Comparison with Recent Methods

Comparing different price prediction and trading strategies is complex, requiring consistent experimental setups and evaluation metrics.

This study was compared against five related papers that used 2-class labels and various time frames (1 minute, 1 hour, 4 hours, 24 hours). Data sources were predominantly OHLC+V, though some incorporated additional data like Twitter sentiment or blockchain metrics. A comparison of the best-reported accuracies was summarized. Furthermore, backtest comparisons with two of these papers showed that the strategy presented here performed favorably.

One comparable study used technical indicators and moving averages as features with different neural networks for prediction. Another employed five classical models for forecasting and backtesting. While the system described in this article executes trades less frequently, it demonstrates robust performance in sideways markets and during short-term bullish trends.

Other notable research efforts include:

Understanding Feature Importance

Interpreting why a model makes a specific prediction is crucial for trust and further improvement. SHAP (SHapley Additive exPlanations) is a method that explains the output of any machine learning model by calculating feature importance attributions.

SHAP values can provide local explanations for each individual prediction. Overall feature importance can be inferred by calculating the mean of the absolute SHAP values for each feature across the dataset. The analysis revealed that technical indicators, moving average crossovers, and time-based information were among the top ten most valuable features for the model's predictions. In contrast, candlestick patterns were found to be relatively ineffective.

👉 View real-time market analysis tools

Conclusion and Future Directions

This article presents a straightforward yet powerful predictive model for forecasting the trend direction of blockchain asset prices. It leverages large datasets and an intelligent labeling algorithm to be applied within practical trading strategies.

Key findings indicate that technical analysis tools can identify patterns in large datasets, significantly enhancing the accuracy of price trend predictions. The backtesting process confirms that this technical analysis approach can provide a statistical advantage over random trading or a simple "buy and hold" strategy. The study also identifies technical indicators, moving average crossovers, and time information as the most valuable features, while candlestick patterns proved less effective.

Future research could explore the integration of multi-timeframe price action analysis to extract new information. This could be combined with existing large datasets, labeling algorithms, optimized feature sets, and neural network architectures. Furthermore, applying this trading system to other financial markets, such as forex, individual stocks, stock indices, commodities, and Contracts for Difference (CFDs), presents an exciting avenue for exploration. It is important to note that CFDs are leveraged derivatives and carry a high level of risk.

Frequently Asked Questions

How does AI predict cryptocurrency prices?
AI models, particularly neural networks like MLPs, analyze vast historical datasets of price and volume information. They identify complex, non-linear patterns and relationships within this data that are often invisible to human analysts. These patterns are then used to make probabilistic forecasts about future price movements.

What are the main benefits of using AI for trading crypto?
The primary advantages include the ability to process immense amounts of data 24/7, the removal of emotional decision-making from trading, the execution of trades at high speeds, and the potential to discover unique and profitable market inefficiencies that manual traders might miss.

What data is most important for an AI trading model?
Based on feature importance analysis, technical indicators (e.g., RSI, Bollinger Bands), moving average crossovers, and time-based information are highly valuable. While other data sources like social media sentiment can be incorporated, the core price and volume data often provide the most significant predictive signals.

Can these models guarantee profits?
No model can guarantee profits in any market, especially one as volatile as cryptocurrency. All trading involves risk. AI models are tools that can improve the probability of successful trades based on historical patterns, but they are not infallible and can experience losses, particularly during unprecedented market events.

How do transaction fees impact an AI strategy's performance?
Transaction fees have a substantial impact, particularly on high-frequency strategies. A model might show high accuracy in predictions, but if it generates a large number of trades, the accumulated fees can easily erase all profits and lead to significant losses. Any realistic backtest must account for trading fees.

Is this approach suitable for beginners?
While the concepts are powerful, implementing a robust AI trading system requires a strong understanding of both machine learning and financial markets. Beginners are advised to focus first on education and risk management before considering the development or use of sophisticated algorithmic strategies.