SYSTEM NOTICE

Auto translation by AI. Be sure, accuracy, nuances and authorial intent may not be fully reflected.
見出し画像

MTP Installation Guide 8 | Setting up MT4 Dashboard and GAS. Preparing the MTP Visualization URL.

MTP Installation Guide 8 | Setting up MT4 Dashboard and GAS. Preparing the MTP Visualization URL.

Hello, this is Tsumo.
This article is the 8th in the MTP installation guide series.

Last time, we downloaded the necessary files from the MTP distribution folder.

The three files downloaded are as follows:
GAS.txt
MirrorTrailPro_Master_v2.00.ex4
MirrorTrailPro_Slave_V2.00.ex4
This time, we will use the GAS.txt file from among these.

In MTP, account information and profit/loss data are sent to a Google Spreadsheet and visualized on the MT4 Dashboard.

To do this, you need to set up GAS on the Google Spreadsheet side and prepare a URL that can receive data from MTP.

Before installing the MTP core, we will prepare the GAS Web App URL and Spreadsheet ID for sending data to the Dashboard.

What we will do this time

The steps for this time are as follows:

Open the MT4 Dashboard.
Open Apps Script.
Delete all existing code.
Paste the entire contents of GAS.txt.
Save the GAS code.
Deploy as a Web App.
Obtain the GAS Web App URL.
Confirm the Spreadsheet ID.
Note down the GAS Web App URL and Spreadsheet ID in a notepad.

Once you have completed this, you can proceed to the installation of the MTP core.

Why set up GAS first?

MTP has settings for sending information to the Dashboard.

The GAS Web App URL we are creating this time is required for that purpose.

Furthermore, we also use the Spreadsheet ID to specify which Google Spreadsheet to send the data to.

In other words, even if you install the MTP core first, you will be stuck at the Dashboard integration settings without these two items.

The order is as follows:
Prepare the MT4 Dashboard

Set up GAS

Obtain the GAS Web App URL

Note down the Spreadsheet ID

Configure it in the MTP responsible for sending to the Dashboard

What is important here is that the GAS Web App URL and Spreadsheet ID are set in the MTP responsible for sending to the Dashboard.

It can be the Master.It can also be the Slave.

It is not a matter of which one is correct.Decide which MTP will send information to the Dashboard and configure it in that designated sender.

Open MT4 Dashboard

First, open the MT4 Dashboard in Google Sheets.

This is the spreadsheet you prepared in MTP Introduction Guide 2.

This Dashboard is used to visualize the status of MTP.

Account information.
Balance.
Margin level.
Account health rate.
Number of positions.
Total lots.
Unrealized profit/loss.
Realized profit/loss.

It receives this information from MTP and displays it.

Open Apps Script

Once the MT4 Dashboard is open, open Apps Script from the top menu.
Extensions
→ Apps Script
The Google Apps Script editor screen will open.

Paste the contents of the GAS.txt file you downloaded previously here.

Paste the contents of GAS.txt

Open the GAS.txt file saved in your VPS download folder.

Copy all of its contents.

Return to the Apps Script editor screen.

Delete all existing code that is already there.

Then, paste the contents of GAS.txt.

It is important not to paste only a part of it in the middle.

Please paste the entire content of GAS.txt from beginning to end.

GAS.txt is the code for receiving data sent from MTP and reflecting it on the Dashboard sheet.

This GAS is configured to use 'EA Profit/Loss Summary' as the sheet name, create 'Master' and 'Slave' categories, and handle balance, margin level, account health rate, number of positions, total lots, unrealized profit/loss, and realized profit/loss.

Save the GAS code

Once you have pasted the contents of GAS.txt, save it in Apps Script.

If you proceed without saving, there is a possibility that old content or empty code will be used during deployment.

After pasting, save first.

Make sure not to forget this step.

Deploy as a Web App

Next, deploy the GAS as a web app.

Select "Deploy" -> "New deployment" near the top right of the Apps Script screen.


For the type selection, choose "Web app".

The settings are basically based on the following logic: Execute as: Me, Who has access: Anyone. Since MTP sends data from the MT4 side to GAS, a web app URL that can be accessed from the outside is required.
Execute as: Me
Who has access: Anyone
Since MTP sends data from the MT4 side to GAS, a web app URL that can be accessed from the outside is required.

If you make the access restrictions too strict here, you will not be able to send data from the MT4 side.

However, the screen notation on Google's side may change.

Even if the names of the options are slightly different, the concept remains the same.

Create a web app URL that can send data from MT4.

This is the goal.

Obtain the GAS Web App URL

Once deployment is complete, the web app URL will be displayed.

Copy this URL and paste it into a notepad.

What you use here is the URL from "https://" to "/exec".

For example, it looks like the following URL:
https://script.google.com/macros/s/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/exec
In this case, the range to copy is this entire string.
It is important to include up to the final "/exec".

If it is cut off in the middle, you will not be able to send data from MTP to the Dashboard.

This URL will be set in the MTP responsible for sending data to the Dashboard from the next time onwards.

The sender can be either the Master or the Slave.

For example,
if you make the Master the sender
→ Set the GAS Web App URL in the Master

If you make the Slave the sender
→ Set the GAS Web App URL in the Slave
is the general idea.

This does not mean you must set it in both the Master and the Slave.

Decide which MTP will send information to the Dashboard and set it in that designated MTP.

If you close the screen without saving the URL, it will be more troublesome to find it later.

Be sure to copy it to a notepad.

Copy the Spreadsheet ID to the notepad as well

In MTP, you use not only the GAS URL but also the destination Spreadsheet ID.

The Spreadsheet ID is the long string of characters found within the Google Spreadsheet URL.

For example, if the URL looks like this,
https://docs.google.com/spreadsheets/d/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/edit#gid=0
the part you use as the Spreadsheet ID is only this xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx section.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In other words, you only copy the long string between /d/ and /edit/.

Copy this Spreadsheet ID to your notepad along with the GAS Web App URL.

You will use it when setting it in the MTP responsible for sending to the Dashboard from the next time onwards.

It is easier to keep track of it in your notepad as follows:
GAS Web App URL:
https://script.google.com/macros/s/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/exec

Spreadsheet ID:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Keeping these two as a set will make the next task much easier.

The GAS side is configured to open the target spreadsheet using the spreadsheet_id sent from the MTP. In other words, not only the Web App URL but also the Spreadsheet ID is required in the MTP settings.

Do not share the Web App URL with others

The GAS Web App URL is the gateway for sending information from the MTP to the Dashboard.

Therefore, it is better not to share it unnecessarily.

Do not post it directly on articles or social media.
Do not send it to third parties.
Do not leave it carelessly in shared memos.

This level of handling is sufficient.

There is no need to be overly afraid.

However, since it is the entry point for sending MTP operational information, manage it carefully.

We will not install the MTP itself here yet

What we are doing this time is just preparing the GAS Web App URL and the Spreadsheet ID.

We will not install MTP Master or MTP Slave into MT4 yet.

The installation of the MTP itself will be done in the next step or later.

The order is as follows:
⑦ Download MTP files
⑧ Set up MT4 Dashboard and GAS
⑨ Install MTP Master on the Demo account MT4
⑩ Install MTP Slave on the Real account MT4
The purpose of this step is to prepare the URL and Spreadsheet ID required for Dashboard integration before installing the MTP itself.

The MTP responsible for sending data to the Dashboard is the one that will actually input that information.

Things to check after GAS setup

Once the GAS setup is complete, check the following:

Did you paste all the contents of GAS.txt?
Did you delete all existing code?
Did you save the Apps Script?
Did you deploy it as a Web App?
Did you copy the GAS Web App URL from https:// to /exec into a notepad?
Did you copy only the string between /d/ and /edit of the MT4 Dashboard Spreadsheet ID into a notepad?

Once you have done this, you can proceed to the next step of installing MTP Master.


Key points for this session

Let's organize what we are doing this time.

Open the MT4 Dashboard.
Open Apps Script.
Delete all existing code.
Paste all the contents of GAS.txt.
Save the GAS code.
Deploy as a Web App.
Get the GAS Web App URL.
Copy the GAS Web App URL from https:// to /exec.
Check the Spreadsheet ID.
Copy only the long string between /d/ and /edit for the Spreadsheet ID.
Copy the GAS Web App URL and Spreadsheet ID to a notepad.
Prepare to set them in the MTP responsible for sending to the Dashboard in the next step or later.

Once you have done this, the entry point for Dashboard integration is ready.

Finally

In MTP Installation Guide 8, we organized the settings for the MT4 Dashboard and GAS.

With MTP, it is not just about putting the EA file into MT4.

Master.
Slave.
GAS.
Dashboard.

You use these four in combination.

The GAS Web App URL created this time is the gateway for sending information from MTP to the Dashboard.

Furthermore, we also use the Spreadsheet ID to specify the destination.

If you keep these two noted in a notepad, subsequent settings will go smoothly.

Today's conclusion is simple.

The GAS Web App URL is from https:// to /exec. The Spreadsheet ID is only the part between /d/ and /edit. Before installing the MTP main unit, keep these two noted in a notepad.

Next time, we will install MTP Master on the MT4 for the Demo account and create the side that sends copy signals.

* This article is intended for organizing general tasks for MTP installation preparation.
* Google Apps Script screen labels and deployment procedures may change due to Google's specification updates.
* The GAS Web App URL is for sending information from MTP to the Dashboard. Do not disclose it unnecessarily.
* Please use the GAS code and MTP files according to the specified procedures.
* Forex, automated trading, and offshore Forex involve significant risks.
* EA usage, account opening, deposits, and operations are at your own risk.

#FX
#OffshoreFX
#MT4
#EA
#AutomatedTrading
#MTP
#MirrorTrailPro
#MTPInstallationGuide
#GAS
#GoogleAppsScript
#GoogleSpreadsheet
#MT4Dashboard
#VPS
#FundManagement
#RiskManagement

いいなと思ったら応援しよう!