Fast API Copier
- Utilitaires
- Konstantin Stratigenas
- Version: 4.9
- Mise à jour: 3 septembre 2024
- Activations: 12
This EA Connects Trading-Systems or Terminals on a Windows Server (VPS). You can also use it as a Trade Copier Local or Remote. Fast and stable Solution with 10ms Reaction Time.
- It works on VPS which allows to Run it as a Webserver (fixed IP Address and open Port 80 for Incoming Connections).
- It works on your own Datacenter / Computer with fixed IP or DNS.
Installation
- Download and Install Visual Studio 2019 or Visual Studio 2022* on your Windows Server. Choose "ASP.NET and web Development". Download-URL: https://visualstudio.microsoft.com/downloads/?utm_content=download+vs2019
- Copy and extract this Files to C:\ or any Folder you want on your Windows Server: https://drive.google.com/file/d/1z24kXqLZ6sVJ6pwSZ7_uRb0v2vL1xZJ7/view?usp=sharing
- Set Windows Firewall to prompt when a new connection is needed. Alternatively, you can type the following in CMD to allow connections on Port 80: netsh advfirewall firewall add rule name="HTTP Port 80" dir=in action=allow protocol=TCP localport=80 .
- ** Make sure Port 80 is free. If IIS is installed change IIS Port for Example to 8080. https://youtu.be/2cnX1miEsas
- Open Command Line (Type Win+R and Enter "cmd").
- Navigate to the folder with the files by typing cd C:\ (or just D: without cd if the files are on the D: drive). Then, type cd tv2 twice to enter the correct subfolder.
- Type the follow Command to Run: dotnet run. (If your VPS Machine is slow and this Step takes more than 1 Minute, then disable Windows Defender Antivirus). Maybe press some key to see if its finish. Leave the window open.
- Check API Endpoint with external URL http://YOUR_SERVER_IP/api/todoItems and internal URL 127.0.0.1/api/todoItems. You must see a JSON Value []
- Go to MT5 Terminal, open Menu Tools->Options->Expert Advisors->Allow Web Request for listed URL. Type in: 127.0.0.1 (MT5) or http://27.0.0.1 (MT4)
- Start Expert Advisor, set a secret Password. A Label "Connected" on the Chart, says you that the API is Ready.
Tips
* If you use Visual Studio 2022, you may need to download and install these packages after installation (you will also see these download links in the CMD window, after do Step 7):
Do copy/paste:
- https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=5.0.17&arch=x64&rid=win-x64&os=win10
- https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-5.0.17-windows-x64-installer
** If you want to find out which program is blocking Port 80, type the following command in the black CMD window: netstat -ano | find ":80" . This will give you an ID. Replace 1234 with the ID you get and run: tasklist /FI "PID eq 1234" .
To open IIS on Windows Server 2012: Hold down the Windows key and press the R key (win+r), then type inetmgr . If IIS is not installed, port 80 may already be free.
If Step 8 is not Success with external URL http://YOUR_SERVER_IP/api/todoItems, then Install https://www.wireshark.org on your VPS Server to look for Incoming Connection on Port 80 like in Screenshot. You have to type in http://YOUR_SERVER_IP/api/todoItems from external Computer.
Setup Trading-System
Configure your Alerts in Trading-System. You need to make JSON Request like:
{ "Value":"{{strategy.order.comment}} tradesymbol=XAUUSD lot=0.03" ,"password":"YOUR_PASSWORD" }
In your Strategy write Comment "long" for Long Position or Comment "short" for Short Position. Write "closelong" to Close Long Position and "closeshort" to close Short Position. The Placeholder will be / must be replaced by the Alert and will look like this:
{ "Value":"long tradesymbol=XAUUSD lot=0.03" ,"password":"YOUR_PASSWORD" }
Alert Syntax
lot Set Fixed Lot
microlot Set the needed Amount for 1 microlot (Autolot)
For Example: Free Equity of 500$ and Microlot of 100$: (500$ / 100$) * 0.01 = 0.05 Lot. EA looks which is lower, Equity or Balance to Calculate the Autolot.
tradesymbol Symbol to Trade, for Example EURUSD or XAUUSD
long Open a Long Trade
short Open a Short Trade
closelong Close all Long Trades on used tradesymbol (from this EA / Magic Number)
closeshort Close all Short Trades on used tradesymbol (from this EA / Magic Number)
tradeid Unique Identifier for the Trade
close Close Trade. You need Parameter tradeid
sl Stoploss Price
tp Takeprofit Price
pyramiding defines how many Positions can be opened at same Symbol and Direction.
For example pyramiding=2 Maximal 2 eurusd long and 2 xauusd long.
closepart=%/Lot Close Percentage or Lot Amount of Winning Positions on same Symbol.
For example closepart=50% tradesymbol=eurusd Close 50% of eurusd.
riskpos=% open new Position if the Drawdown is not below %. Using negative Value=Drawdown is below %. Needs Parameter long or short to open the Position.
riskbalance=% open new Position if the Drawdown of Balance is not below %. Using negative Value=Drawdown is below %. Needs Parameter long or short to open the Position. To enable this Feature you need to activate Riskbalance in EA Settings.
hedge opens opposite Position of open Positions at same Position Size. Needs Param tradesymbol.
For example hedge tradesymbol=eurusd
closehedge close current hedge Position. So the Position is open again.
hedgeall Hedge all Positions without look on Magic Number.
hedgelong, hedgeshort Hedging only long or short Positions.
hedgeallshort, hedgealllong Hedging only long or short Positions without look on Magic Number.
risk Open new Position based on Risk in Percentage of Equity or Balance (the lower one). Needs Parameter "long" or "short" and Parameter tradesymbol.
For example: long tradesymbol=ustec risk=1.5% sl=5% tp=3%
Pending Order Syntax
selllimit Opens new Pending selllimit Order. Needs Parameter price
sellstop Opens new Pending sellstop Order. Needs Parameter price
buylimit Opens new Pending buylimit Order. Needs Parameter price
buystop Opens new Pending buystop Order. Needs Parameter price
Channels
You can Target different Channels from your Trading-System. The Default Channel Address is
http://YOUR_SERVER_IP/api/todoItems
For second Channel use:
http://YOUR_SERVER_IP/api2/todoItems
Use Parameter Channel in EA, to listen to a different Channel than the Default.
Do not use same Channel for Copy and your Trading-Systems
Works well. I miss some extra functionality like being able to set a Stop loss.