Introduction to the AI Foreign Exchange Forecasting System
I built a tool to predict the next 5 minutes of USD/JPY with AI
“I want to manage funds efficiently with as little hassle as possible.”
Starting from such a fairly honest wish, I developed this USDJPY-specific prediction tool, which I am introducing here.
It analyzes market data with machine learning and displays the predicted value for the next 5-minute bar. What the user needs to do is,When the notification sound plays, manually trade according to the rules.Building the mechanism was challenging, but I kept the usage as simple as possible.
First, I’ll explain the thinking behind it, what it can do, and how to use it.
The catalyst was “It would be easier if I could leave it to EA”
The first idea was, of course, automated trading via EA. It’s appealing that all trading can be left to it, isn’t it?
However, for the MT5-compatible account I was considering, the spread was larger than in my usual domestic account. In a style that captures small price movements, you can’t ignore this difference.
Another concern was whether it’s okay to continue using fixed rules and settings even as the market changes. Of course, EA has various designs, but for my operation,a mechanism to relearn recent market conditions regularlywas something I wanted to incorporate.
So I thought about pulling market data from MT5 and training it with external Python. For training,LightGBMis used.
It didn’t work perfectly from the start. I experimented from the question “What should I train it to learn?” and have settled on a configuration using 68 features. Features, in short, are numerical representations of price movement characteristics.
At first, leaving it completely idle would have been ideal, but ultimately, it took the shape of,delegate complex prediction calculations to the tool, and place orders with a low-cost account manuallyThis is the form that suited my operation. It only requires confirmation when the notification sounds, but this form fits what I want to do.
Features of this tool
- USDJPY only.Targets the 5-minute USDJPY interval.
- Predicts the price movement for the currently starting 5-minute bar at switching times.Predicted values update roughly every 10 seconds.
- Logs Buy, Sell, Hold, and Sell-off actions.If thresholds are exceeded, colors change and a notification sound plays.
- Trained model updated weekly.A latest model reflecting recent market data is distributed every week.
- The main unit is an HTML file.No need for users to prepare Python or train their own model.
- Average about 10 trades per day.There are days with zero trades, but also days with more than 30.
What’s needed is a Windows PC, MT5, a compatible browser like Chrome, and the distributed files.
Updating the model every week reflects the latest price movements in training data.
Results of prior validations
Here are the results after actually updating the model weekly and validating it in operation. There is some drawdown, but overall it trends upward.
2023 and 2024 were backtests; 2025 and 2026 were forward tests.
When the results first looked good, there was more relief than joy, wondering, “Is this really okay?” I’m also using it myself, and in the long term it’s fairly stable.
This graph shows results for trading with domestic brokers where USDJPY spreads are 0.2 pips. If spreads are larger, performance declines somewhat.
How to use
※For detailed usage, please refer to the accompanying manual
1.Install the distributed EX5
From “File” → “Open Data Folder” then go to MQL5 → Experts, andplace current_5m_browser.ex5.
2. Choose the model and CSV in the browser
Place current_5m_browser.ex5 on the USDJPY 5-minute chart, and the folderUSDJPY_Live will be created automatically on the desktop, and the CSV inside will be updated. Place the distributedUSDJPY_M5.htmlthere and open it in Chrome or Edge.
In “Select Model ZIP,” choose the distributedUSDJPY_ensemble50.zip, and with “Select CSV file” choose the CSV inside USDJPY_Live. Click “Start Prediction” to complete setup.USDJPY_ensemble50.zipshould be used without unzipping.
CSV filenames may be USDJPY.csv or USDJPY-.csv depending on your securities company’s MT5 updates. Please select the file your MT5 is using. MT5 can be kept running.
Trading rules
The rules when there is no existing position are these three:
- If the prediction isgreater than +1.0→ Buy entry
- If the prediction isless than -1.0→ Sell entry
- Otherwise → Wait
In this image it's -0.3814, so if there is no position, we wait.
And this part is the most important.Entry and exit are only made at the moment the 5-minute bar switches.
This shows a prediction of -1.4005 with a sell signal, but the time is 01:34:18. There are 42 seconds until the next bar, sowe do not enter yet.
The 10-second updates and notification sounds are only to prepare for trading. When the bar switches at 01:35:00, if the new prediction again falls below -1.0, it’s a sell entry. If it returns within the threshold at the switch, we skip it.
When the log records a “new sell” at that switch time, manually execute the sale from the broker’s trading screen. The image shows the state after the 01:35 switch. The remaining time will immediately revert to 5:00 at switch, so please compare the current time with the log.
Settlement rules
- If holding a long position:If the prediction is positive, hold; if it becomes <= 0, exit.
- If holding a short position:If the prediction is negative, hold; if it becomes >= 0, exit.
This judgment also only occurs at the 5-minute bar switch. Even if the prediction becomes -0.4 after entering short, if it’s still negative, keep holding. The entry threshold and exit condition are different, so please remember this.
Reading the log from the bottom shows the flow. 01:00 new sell, then continued selling. At 01:30 the prediction becomes positive and all positions are exited.
After taking a position, if the price crosses the opposite entry threshold, there is also a “reverse trading” option where you close and re-enter in the opposite direction. In that case, the log shows “New Buy” or “New Sell,” but this does not mean to keep both positions. Also “Continue Buy/Continue Sell” does not mean adding to the position; it means continuing to hold the position.
Points of focus
Constantly relearning recent markets and updating weekly
Rather than keeping a model for a long time, we redistribute a model retrained on weekend data. We value incorporating the latest data and not ignoring market changes.
Intentionally manual orders to reduce cost
MT5 is used to obtain data, but actual orders can be placed with another broker. In other words, you can use a non-MT5 domestic account as an order destination.
I operate under the assumption that USDJPY’s base spread is 0.2 pips. In other cases, performance declines, so this is not recommended. The focus on USDJPY also stems from its lower spreads.
Spreads matter in short-term trading. For example, trading 1,000 times with the same quantity, a 0.1-pip difference per trade sums to 100 pips total, which is not negligible when repeated many times.
If spreads are wider than 0.2 pips, it’s often due to fundamental factors moving the market, so it’s wiser to skip trading in those cases.
Minimize decision-making inputs
Even a seemingly good approach is meaningless if you can’t actually continue with it. This tool avoids requiring you to interpret chart patterns each time to decide buys or sells. What you look at is the predicted value output automatically by the AI.
Of course, you still need to verify order fills and your actual holdings, but the goal is to avoid judgments like “seems to go up” or “I want to make back losses,” and to repeat the same procedure reliably.
Things to be careful about when using
- This is not a completely hands-off tool.While you hold a position, you need to check every 5 minutes and place manual orders.
- Set a 30-second pre-alert to avoid forgetting.Initial setting is off. Turning it on after you hold a position helps you be aware of the next decision time.
- Do not minimize the browser; keep it visible on screen.If hidden or PC goes to sleep, notifications, predictions, or logs may be delayed or stopped.
- Trading hours are 08:00 to 04:00 the next day, according to the PC clock.Close holdings at 04:00 and do not initiate new trades until 08:00.
- Do not increase quantities just because you lost.Prepare for drawdowns, operate with surplus funds and reasonable position sizes.
In practice, there are good days and days when you feel you aren’t winning. It does not guarantee daily or weekly profits. If you cannot accept it, stopping is important.
Distribution of the AI Forex Forecast System
Every weekend, the latest model is distributed, so you’ll receive the latestUSDJPY_ensemble50.zipand that week’scurrent_5m_browser.ex5before the market opens on Monday, so you can replace to the latest version.
Just replace the EX5 and reload the new model ZIP from the browser. Simply overwriting the model ZIP on your PC will not reflect in the running screen; be sure to reload via “Select Model ZIP.”
The main screenUSDJPY_M5.htmlis also included in the distribution set, but as a rule weekly swaps are not required. We will announce separately if there are functional updates.
Purchase options areweekly paid articlesandmonthly serialized subscriptions. Monthly payments are a little cheaper. For current pricing and distribution details, please check my page on Investing Navi+ (https://www.gogojungle.co.jp/finance/navi/authors/112840).
If you’re interested in a simple, steady approach rather than complex chart interpretations, I’d be glad.
※This tool does not guarantee profit. Invest with surplus funds and at your own risk.