Time ZeroShot EA
- Experts
-
Mikoto Hamazono
AI Trader Kyo | MQL Developer & Forex Innovator
As an MQL developer and a passionate innovator in FX, I build cutting-edge trading solutions that make full use of artificial intelligence. - Version: 1.0
- Activations: 10
A real AI runs inside this EA. Time ZeroShot EA trades the USDJPY gotobi Tokyo fixing on about 6 mornings a month (up to 2 trades each) and holds a BTCUSD long for days to weeks when its multi-week momentum agrees. The panel always shows the date and time of the next trade.
The AI is Granite TTM-R2, a time-series model open-sourced by IBM Research (from a NeurIPS 2024 paper, pre-trained on about 700 million samples), built into the EA. At every gotobi trade it re-reads the last 512 hourly bars and forecasts how far price can move in the next 4 hours, and the stop-loss widens and narrows with that forecast. When it expects an unusually wild morning, the EA stays out. No API key, no server, no monthly fee — it runs in the Strategy Tester too, so you can watch it work.
Two rule sets decide WHEN and WHICH WAY
- USDJPY — gotobi Tokyo fixing. On Japanese settlement days (the 5th, 10th, 15th, 20th, 25th and the month-end, moved to the previous business day) it buys at 07:30 JST, closes at the 9:55 JST Tokyo fixing, then sells until 10:30 JST. Japanese bank holidays and the broker's time zone are handled inside the EA.
- BTCUSD — multi-week momentum, long only. Once a day it holds a long while BTCUSD is above its close of 2 weeks ago and of 8 weeks ago, and exits when they disagree. A trailing stop follows the best daily close.
The AI decides HOW FAR price may move
- The model is IBM Granite TimeSeries TTM-R2 (Tiny Time Mixers), an open zero-shot time-series model under the Apache License 2.0, converted to ONNX and embedded in the EA. It reads the last 512 H1 bars and forecasts the high-low range of the next 1, 4 and 24 hours. It does not forecast the direction.
- No API key, no WebRequest, no DLL, no external server, no monthly fee. It also runs in the Strategy Tester, so you can check everything yourself.
- Gotobi: the stop-loss is 1.5 x the AI's 4-hour range forecast, and the morning is skipped when the AI expects an unusually wild morning (1.25 x the usual forecast for that hour or more).
- In our tests the AI version of the gotobi rules had a lower drawdown than the same rules with ATR stops: profit factor 1.34 vs 1.22 and maximum drawdown 3.8% vs 6.5% in 2015–2021 (the period used to choose the settings), and 1.29 vs 1.28 and 4.9% vs 6.6% in 2022–2026 (after the settings were fixed).
- BTCUSD stops use ATR(14, D1): in our tests the AI version was not better there, so we kept ATR. The panel still shows the AI forecast for BTCUSD.
Protection
- Every trade has a stop-loss. No grid, no martingale, no averaging.
- Risk per trade in % of equity (default 1% for each rule set) and a daily loss limit (default 4%).
- Panel: pause new entries, close this EA's trades, next trade time, AI forecasts for both symbols.
Backtest (hypothetical)
IC Markets demo data, 2018-01 to 2026-10, 1-minute OHLC, commission included, both rule sets on one account, 1% risk per trade, start 10,000 USD:
- 1,065 trades, profit factor 1.59, net profit +91%, maximum drawdown 6.1% (closed trades), 2 losing years out of 9 (2018 and 2025).
- Gotobi part: 948 trades, profit factor 1.27. Momentum part: 117 trades, profit factor 3.35.
- The rules were fixed on 2015–2021 (gotobi) and 2018–2022 (momentum) and then run once on the later years. The gotobi edge was first published as Nakane USDJPY Gotobi and the momentum rules as Ikioi Bitcoin Momentum; this EA adds the AI and runs both on one chart.
Trading frequency (please read)
- Gotobi: about 6 mornings a month, up to 2 trades each (about 10 trades a month). No trades on other days.
- Momentum: about 10 BTCUSD trades a year; a position is often held for days to weeks.
- Quiet periods of several days are normal. The panel shows the next gotobi date and time.
Recommendations
- Attach to one USDJPY chart (any timeframe). The EA finds BTCUSD by itself (names with suffixes such as .raw are fine) or you can type the symbol names in the inputs.
- A broker with USDJPY and BTCUSD. Low spreads and commission matter for the gotobi trades.
- BTCUSD trades need about 3,000 USD or more: with the minimum lot the stop-loss would otherwise risk more than 3% and the EA skips the trade. The gotobi part works from about 300 USD.
- Keep the terminal running (a VPS is recommended). BTCUSD long positions pay the broker's swap.
Inputs
- UseGotobi / UseMomentum (true / true): turn each rule set on or off.
- SymbolUSDJPY / SymbolBTCUSD (empty): symbol names; empty = found automatically.
- RiskGotobi / RiskMomentum (1.0 / 1.0): risk per trade in % of equity, measured to the stop-loss (0 = use FixedLot).
- FixedLot (0.0), DailyLossLimit (4.0), TradeAfterFixing (true), MagicNumber (26101310; momentum uses +1), GMTOffsetHours (-99 = automatic).
Notes
- This EA does not use Nixtla's TimeGPT or any online AI service, and it is not affiliated with or endorsed by Nixtla or IBM.
- Third-party notice: this product includes the Granite-TimeSeries-TTM-R2 model by IBM, licensed under the Apache License, Version 2.0. The full text can be written to MQL5\Files from the Settings tab.
- All numbers describe a backtest of the past and depend on the broker's data and costs. They are not a promise of future results.
Support
If anything is unclear, please send me a private message on MQL5.
Trading leveraged products carries a high risk of loss.
