Mean Machine G P T

Mean Machine G P T

3 September 2024, 02:25
William Brandon Autry
0
44

Welcome to the introduction of my Expert Advisor (EA), which I’ve named Mean Machine G P T. Let me walk you through the thought process behind this name and the intricate workings of this powerful tool.

Why "Mean Machine G P T"?

The name is quite deliberate. The term "mean" refers to the mean reversion strategy that the EA employs—a concept rooted in the belief that asset prices will eventually revert to their average over time. "Machine" represents the machine learning technology embedded within the EA. This isn't just a catchy name; it reflects the core mechanics driving the strategy.

About a year ago, I launched the first version of this EA, called Mean Machine Ai, and it exceeded my expectations in terms of performance. Since then, I've immersed myself in the world of machine learning and ChatGPT, constantly learning and refining my approach.

ChatGPT Integration: A Deeper Dive

ChatGPT integration has been surrounded by a lot of buzz, and not all of it is based on reality. Some have used the term simply to capitalize on the hype, without delivering true value. However, my integration is genuine, versatile, and beneficial for traders across different experience levels. My goal isn't just to provide a trading tool—it's to help users become better traders.

How Does It Work?

The ChatGPT module in Mean Machine G P T sends your chart data and upcoming news directly to the OpenAI API. You can choose from various models, including GPT-3.5 Turbo, GPT-4, GPT-4 Mini, GPT-4o, or GPT-4 Turbo, with more models being added as they are released.

                                                                                                                           


The default query sent to the API asks it to analyze market sentiment based on your data—Open, High, Low, Close (OHLC) data—and any upcoming news specific to the trading symbol. The accuracy of the results is truly impressive.

Users can customize how frequently the EA calls the API (default is every hour) and which chart data to send (daily, hourly, or even down to 5-minute intervals). You can select the time frame and the number of bars, tailoring it to your trading preferences.

The news data is sourced from Forex Factory, including currency, title, impact, forecast, and predicted values. This comprehensive data set allows the API to perform a thorough analysis.

Why an API Key Matters

The EA requires you to use your own OpenAI API key. This is crucial because without a valid key, users would lose access if the key provided by a third party becomes invalid. Setting up your own key is straightforward:

  1. Create an OpenAI API account.
  2. Navigate to "Settings" > "General."
  3. Create a project and name it as you wish.
  4. Add the necessary models to your project.
  5. Set up your billing information and add at least $10 to your account for token usage.

This process takes less than 10 minutes, though your experience may vary slightly.

A critical point to remember is that the ChatGPT API cannot be called during back testing. If an EA claims flawless back test results due to GPT, it’s likely not genuine. True GPT signals cannot be generated in a back test environment.

Beyond ChatGPT: The Neural Network

Mean Machine G P T also features a self-training Gene Evolution Neural Network with 12 neurons. This network trains in cycles, selecting and evolving "genes" similar to natural selection, learning from daily trading behavior, and continuously improving with each trading day.

                                                                                                                                

Training and Optimization Process Explained

  1. Initialization: The system initializes parameters like weights and fitness scores. If no pre-existing weights are available, default values are used.
  2. Population Generation: An initial population of solutions is generated, each with unique weights.
  3. Fitness Evaluation: Each solution is evaluated on performance metrics, such as trading profitability.
  4. Selection: The best-performing solutions are selected for reproduction.
  5. Reproduction: New solutions are created by combining the "genes" (weights) from selected individuals through crossover and occasional mutation to introduce variability.
  6. Iteration: This process repeats over several iterations, continuously evolving toward better solutions.
  7. Final Solution: The best solution is selected as the final optimized model.
  8. Weight Storage: The optimized weights are stored for future use.
  9. Signal Checking: The optimized model generates trading signals based on current market data.

This process is akin to a genetic algorithm, where populations evolve over time to optimize trading profitability.

Unique Features: Back testing with News Data

One of the standout features of Mean Machine G P T is its ability to download necessary news data for back testing, allowing you to simulate trading conditions as accurately as possible.

                                                                                                                                

Here’s how it works:

  1. In the EA inputs, scroll to "Download News Data Script For Backtesting."
  2. Set "Download Data?" to "true."
  3. Select the desired date range.
  4. Enter the currencies for which you want to download news data.
  5. Place the EA on a chart, and it will download the data and remove itself automatically when complete.

Conclusion

Mean Machine G P T has been a true labor of love. I’ve rigorously tested it on real tick data, ensuring that no back tests were manipulated. My commitment is to provide long-lasting value to my customers and trading friends.

Thank you for taking the time to learn about Mean Machine GPT. I’m confident it will be a valuable addition to your trading toolkit.