Watch how to download trading robots for free
Find us on Twitter!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Experts

The Nikkei EA That Checks GBPJPY Before It Buys - expert for MetaTrader 5

Tomasz Wojciech Forszpaniak
Tomasz Wojciech Forszpaniak
I started trading at 14 because I thought I had found an easy way to make money. Now 4 years later at 18, I’m an algorithmic trader obsessed with finding out whether an idea actually works.
Views:
25
Published:
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

The Nikkei EA That Checks GBPJPY Before It Buys

JPN225 Yen Check is a free, fully open EA for the Nikkei 225 on M30. It buys when the Nikkei is holding near the top of its recent range, but only if it hasn't run too far ahead of GBPJPY. Everything is closed by 17:00 server time. Four conditions, long only, one trade at a time, a stop loss on every trade.

Backtest results: 
Backtest Results

The strategy in more detail

A signal needs all four conditions on the bar that just closed:

  1. Not too far ahead of GBPJPY. The Nikkei's move over the last 20 bars, minus GBPJPY's move over the same bars, measured in Nikkei ATRs, must be below 2.5. The Nikkei can lead the yen cross, just not by an extreme amount.
  2. Closing high in its range. The close sits in the top 35% of the last 14 bars' range.
  3. No reclaim of a bearish gap on this bar. The rule skips the one bar where price closes back above the latest bearish fair value gap. It wants strength that's already established.
  4. No heavy recent drop. The close is not more than 1.5 ATR below where it was 20 bars ago.

Why GBPJPY? The yen moves both the Nikkei and GBPJPY. Comparing the two helps separate a move that belongs to the Nikkei itself from one that is mostly the yen moving. The EA never trades GBPJPY, it only reads it.

Trade management: it buys at the open of the next bar with a stop at 3 ATR and a target at 4.5 ATR. A trade closes after 20 bars at the latest, and everything is closed by 17:00 server time.

When it trades: Monday to Friday, entries between 11:30 and 16:30 server time, after Tokyo's cash session has closed. On the common MetaTrader server time of GMT+2 in winter and GMT+3 in summer:

  • Server: entries 11:30 to 16:30, close 17:00
  • New York: entries 04:30 to 09:30, close 10:00
  • London: entries 09:30 to 14:30, close 15:00
  • Stockholm: entries 10:30 to 15:30, close 16:00

If your broker uses a different server time, move the hours by the difference. The EA prints your server's GMT offset when it starts. 

Setup: attach it to your broker's Nikkei 225 chart (JPN225, JP225, NIKKEI225 and so on) on M30 and set your lot size. GBPJPY must exist at your broker. The EA finds it by itself, and if your broker names it differently you can type the name in the inputs. In the Strategy Tester, download GBPJPY M30 history for the same period first. The VALIDATION section at the bottom of the source exists only for MQL5's automatic tests and doesn't touch a trade on JPN225 M30.


Pros and cons

Pros

  • Four plain conditions in readable code
  • Uses another market as a filter, which few free EAs do
  • Stop loss on every trade, and flat every day with no swap
  • Free, with the full source

Cons

  • Long only, so it sits out falling markets
  • Needs GBPJPY at your broker and in your tester history
  • One market and one timeframe

I don't trade this EA myself. It's free research to read, test and build on. The EAs I do use are on my profile.



Shared for education and research. Backtest and stress test results do not guarantee future performance. Only trade with money you can afford to lose.


ATR Volatility Risk and Position Size Calculator HUD ATR Volatility Risk and Position Size Calculator HUD

Zero-DLL on-chart HUD that calculates ATR-based Stop-Loss/Take-Profit distances and broker-normalized lot sizes across 3 configurable risk tiers.

Channel Breakout EA with ATR trailing stop and risk-percent sizing Channel Breakout EA with ATR trailing stop and risk-percent sizing

Donchian channel breakout Expert Advisor with EMA trend filter, ATR stop, ATR trailing stop, break-even and position size from risk % of balance.

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

MACD Signals MACD Signals

Indicator edition for new platform.