Navigation


 Publications


 Go back to the forum

Forex Stock Exchange Forum    

Adam: A Neural Network-Based Trading Robot Version 1.21

gandra | Published on the fri Oct 11, 2024 3:07 pm | 47 Views



The development of Adam, a trading robot based on a custom neural network, represents a convergence of trading expertise and machine learning technology. In this topic, I will introduce the core components of Adam, share insights into its practical implementation, and provide an overview of its functionality, without delving into marketing claims. Instead, this is a technical exploration of the ideas behind Adam and how they fit within the broader world of algorithmic trading.

System Overview

Adam is a highly sophisticated neural network-driven trading robot that is built to adapt to market conditions through continuous learning. It leverages key technical indicators, namely Bollinger Bands, Triple Exponential Moving Average (TEMA), and Average Directional Index (ADX), to formulate decisions in both backtesting and live trading environments. The system employs an SQLite database to store key parameters and training data, which it uses to inform its trading strategy.

The core idea behind Adam is to apply machine learning techniques within a practical context of financial trading, using the power of neural networks for predictive analysis. The optimization process for Adam is resource-intensive, given the complexity of the system, but the balance between power and efficiency is designed to accommodate different hardware capabilities. The system aims for precision and adaptability, training the neural network on recent market data while minimizing the need for historical overfitting.


Neural Network Training and Data Management

A distinguishing feature of Adam is its use of an SQLite database. When the robot is attached to a chart, it automatically generates a database to store data from the neural network training process. The table's name reflects the trading symbol and the unique magic number assigned to the strategy. During training, Adam uses various sessions to identify the most promising model parameters. The training process is initiated when the robot is first activated on the chart or during backtesting.

The training uses several important input parameters, including epoch numbers, session counts, thresholds, and a global factor, which defines certain conditions under which trading is executed. The training is efficient but requires enough data to make robust predictions, typically going back one year and optimizing over the most recent market conditions. The selected training dataset is ultimately chosen to avoid redundancy and enhance the system's adaptability to live market dynamics.

For the convenience of monitoring, Adam provides a toggle for logging activities. This allows users to track operations directly from the MT5 platform. The full path to the database includes standard directories within the MetaTrader file system, and the stored data can be reviewed and analyzed to understand the training outcomes.


Trading Functionality

Adam offers standard functionality for placing orders, including configurable settings for order type and order expiration in bars, tailored to different trading timeframes. The robot supports Market, Limit, and Stop orders, providing a range of trading options. The expiration of pending orders can be defined according to user preferences, ensuring that trades remain aligned with the intended time frame.

The system's money management relies on ATR-based indicators to determine Take Profit, Stop Loss, Trailing Stop, and Break-even levels. Users can adjust coefficients to adapt the system to different volatility levels, and there is a built-in functionality to manage trades throughout the week. A configurable feature to close all trades on Friday at a predetermined time ensures that no positions are left open over the weekend, managing the risks associated with price gaps that may occur when markets reopen.

One of the key elements of Adam is the flexibility to choose trade modes, including buying, selling, or allowing both directions based on market analysis. Additionally, the maximum number of trades per day can be set, providing control over trading frequency and risk exposure.


Input Parameters for Neural Network

The neural network within Adam uses nine input parameters that guide its learning and performance. Here are some key aspects of these parameters:

1. Epoch: Defines the number of training iterations, with each epoch allowing the system to adjust and refine its understanding of the market patterns.

2. Session: Acts as a multiplier for the epoch, controlling the duration of the training.

3. Threshold: Sets the condition under which trades are executed. The cumulative weights must surpass the threshold for the system to be active.

4. Global Factor: This negative value is crucial for adjusting the system's overall decision-making process. Typically set between -1.0 and -10, it influences the trade filtering mechanism.

During the training phase, the neural network captures key market dynamics using the Bollinger Bands, TEMA, and ADX indicators. This dataset helps the robot evaluate the potential direction of future market movements, and parameters are fine-tuned during each session to enhance performance.


Conclusion

Adam's development has involved numerous iterations and a deep focus on system efficiency. The neural network is trained only during initialization, and its performance in both historical backtest and live trading is reliant on carefully structured input data. While optimization remains computationally demanding, the benefits of improved predictions and adaptive trading behavior outweigh these demands for those willing to invest in the necessary resources.

This technical exploration of Adam highlights its potential to adapt dynamically to evolving market conditions. By incorporating a sophisticated neural network, extensive database support, and customizable trading features, Adam represents a comprehensive approach to algorithmic trading that merges classical trading principles with the power of machine learning.



About the author