Gotobi Days: Japanese Payment Date Calculation Utility

Gotobi Days: Japanese Payment Date Calculation Utility
Download ALL MT5 experts (1837)
YouTube Video Thumbnail



Similar MetaTrader Tools

Gotobi Days: Japanese Payment Date Calculation Utility

Info

The Gotobi Days: Japanese Payment Date Calculation Utility is a Expert Advisor for MetaTrader 5 that in japan, many companies settle payments on specific dates known as gotobi days, which occur on the 5th, 10th, 15th, 20th, and 25th of each month, as well as the last day of the month. When a Gotobi day falls on a weekend or a bank holiday, the payment is adjusted to the preceding business day.

Usage

This tool is typically used for automated trading on major forex pairs and gold.

Platform

This Expert Advisor works exclusively on MetaTrader 5 (both build 600+ and newer versions).

Setup

Place the downloaded file in MQL5/Experts folder via File ? Open Data Folder in MetaTrader 5.


How to Install and Use Gotobi Days: Japanese Payment Date Calculation Utility

1. Installation: Open the "File" menu, select "Open Data Folder," navigate to MQL/Experts, paste your file, and restart the terminal.

2. Activation: Drag the EA from the Navigator onto a chart, ensure "Allow live trading" is checked in the Common tab, and verify the AutoTrading button is green.

3. Optimization: Right-click your chart, choose "Expert List," click "Properties" to adjust inputs, and save your preferred setup as a set file for future use.

4. Maintenance: Regularly check the "Experts" tab in the terminal window to monitor trade logs and potential execution errors.

Frequently Asked Questions

Q: Why is my EA not opening trades? A: Check the "AutoTrading" button, ensure "Allow live trading" is enabled, and verify your broker allows automated trading on your account type.

Q: Can I run multiple EAs on one chart? A: No, each chart can only host one active EA; however, you can open multiple charts for different currency pairs to run several EAs.

Q: What does the "smiley face" icon mean? A: A smiley face in the top-right corner of the chart indicates the EA is successfully running; a frowny face means it is disabled.

What this tool does

In Japan, many companies settle payments on specific dates known as Gotobi days, which occur on the 5th, 10th, 15th, 20th, and 25th of each month, as well as the last day of the month.

Typical Use Case

This Expert Advisor excels in automated trading and technical analysis on MetaTrader 5.

Compatible Platform & Setup

This Expert Advisor works on MetaTrader 5. Place the file in the MQL5/Experts folder and restart the terminal.

Description & Settings

Related: Next Bar Trading EA - another powerful expert for MetaTrader 5 traders.

In Japan, many companies settle payments on specific dates known as Gotobi days, which occur on the 5th, 10th, 15th, 20th, and 25th of each month, as well as the last day of the month.

Also recommended: EXP Instantaneous Trend Filter - similar expert with strong performance on MetaTrader 5.

When a Gotobi day falls on a weekend or a bank holiday, the payment is adjusted to the preceding business day.
Traders interested in JPY pairs, particularly around Tokyo fixing times, often require a calendar for these dates. This include file provides that functionality.

The file is self-contained, with no inputs or dependencies. It does not utilize trading functions, DLLs, or web requests, making it compatible with indicators, scripts, and Expert Advisors.
Its primary purpose is date calculation; any trading application is the sole responsibility of the user.



Functions



bool IsGotobiDay(datetime t, const datetime &holidays[]) - Determines if the specified date 't' is a Gotobi day.

datetime NextGotobiDay(datetime from, const datetime &holidays[]) - Returns the first Gotobi day on or after the date 'from'. Returns 0 if no Gotobi day is found within the next 70 days.

int GotobiDaysOfMonth(datetime t, const datetime &holidays[], datetime &out[]) - Populates the 'out[]' array with the Gotobi days of the month corresponding to date 't' and returns the count of these days.

Helper functions include: GotobiAdjust, GotobiIsBusinessDay, GotobiIsHoliday, GotobiLastDayOfMonth, and GotobiDateOnly.

The 'holidays[]' array accepts a list of dates (day of the month is considered, time is ignored) that should be treated as non-business days, such as Japanese bank holidays.
The file does not include a holiday table; pass an empty array to consider only weekends.



Example



#include "GotobiDays.mqh"

void OnStart()
{
datetime holidays[]; // Use an empty array for weekends only
datetime next = NextGotobiDay(TimeCurrent(), holidays);
Print("Next Gotobi day: ", TimeToString(next, TIME_DATE));
}



The provided illustration shows November 2026, where the 5th, 10th, 20th, 25th, and 30th (last day) are identified as Gotobi days by IsGotobiDay().
The 15th, a Sunday, is correctly adjusted to Friday the 13th.

The accompanying script, GotobiDaysDemo.mq5, displays the Gotobi days for the current month and the next upcoming Gotobi day.
It also performs a brief self-test using predefined dates and supports an optional list of holidays in YYYY.MM.DD format, separated by semicolons.
Date calculations are based on the provided time's calendar date (e.g., server time) without time zone adjustments.

You may also like: Gap Trading Expert Advisor - excellent alternative for expert users on MetaTrader 5.

Source Code

#property copyright "RobotFX"
#property link "https://robotfx.org"
#property version   "1.00"
#property script_show_inputs
#include "GotobiDays.mqh"
input string InpHolidays = "";
int LoadHolidays(datetime &holidays[])
  {
   ArrayResize(holidays, 0);
   string parts[];

.......

Leave your opinion, ask a question, share some knowledge

⚠ Limitations & Risk Warning

  • This tool is provided for educational and testing purposes only.
  • Past performance does not guarantee future results.
  • Trading involves substantial risk of loss. Use on a demo account first.
  • Results may vary depending on market conditions, broker, and settings.
  • We recommend thorough backtesting and forward testing before using with real funds.
© ROBOTFX Free educational tools by RobotFX. Use entirely at your own risk; we are not liable for any financial losses incurred.