Fast API Copier MT4
- Utilità
- Konstantin Stratigenas
- Versione: 4.91
- Aggiornato: 3 settembre 2024
- Attivazioni: 12
Copy Trades: Effortlessly copy trades between terminals, local or remote. Just select the same channel for both terminals and set the Direction to "Send Signals" on one and "Receive Signals" on the other. Once connected, indicated by the "Connected" label in the top right corner, your trades will be mirrored seamlessly.
API Usage: Maximize your trading potential with our user-friendly API. Easily integrate with external systems, customize your strategies, and enjoy seamless innovation with straightforward syntax.
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: Test both http://YOUR_SERVER_IP/api/todoItems externally and 127.0.0.1/api/todoItems internally. You should see a JSON value [] . External access is optional.
- Go to MT5 Terminal, open Menu Tools->Options->Expert Advisors->Allow Web Request for listed URL. Type in: http://127.0.0.1 (MT4) or 127.0.0.1 (MT5)
- 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 packages after installation. You will see the download links in the CMD window, after do Step 7.
** 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.
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" }
API Command 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). For example: closelong tradesymbol=eurusd
closeshort Close all Short Trades on used tradesymbol (from this EA / Magic Number). For example: closeshort tradesymbol=eurusd
tradeid Unique Identifier for the Trade
close Close Trade. You need Parameter tradeid
sl Stoploss Price (price, pips, %. For example 200% = 200% from TakeProfit. 10pips = 10pips or 1.29535 as a Price)
tp Takeprofit Price (price, pips, %. For example 50% = 50% from StopLoss. 10pips = 10pips or 1.29535 as a 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
EA Settings
Your Secret API-Password: Your secret API password.
Magic Number: Identifies trades with a custom number.
Direction: Determines whether to send or receive trade signals.
Channel: Selects the communication channel (1-10).
IP Address or 127.0.0.1 (Local): IP address for communication (default is 127.0.0.1 ).
Symbol Suffix: Adds a suffix to the symbol name.
Symbol Prefix: Adds a prefix to the symbol name.
Max Lot Size: Sets the maximum lot size (0 for unlimited).
Foreign Currency Account Lot Size Converter
USD Rate: Sets the USD exchange rate.
Settings for Sending Signals
Copy Method: Chooses the method for copying trades (Percentage, Fixed Lot, etc.).
Copy Power in Percent: Adjusts trade size in percentage.
Fixed Lot Size: Sets a fixed lot size.
Include Symbols: Includes specific symbols for copying (comma separated).
Exclude Symbols: Excludes specific symbols from copying (comma separated).
Copy Settings for Cracks
Symbol to Use: Specifies a single symbol to use.
Inverse Orders (Hedge Copy): Inverses market orders for hedging.
Add Points to Inverse Pending Positions: Adds a small buffer to inverse pending orders, ensuring they trigger with better accuracy and avoid opening due to minor price fluctuations like spreads.
API Settings for Cracks
Close Hedge Positions Automatically: Closes existing positions rather than opening new opposite positions.
Riskbalance: Chooses risk balance mode (OFF, MaxBalance, etc.).
Riskbalance Custom Value: Sets a custom risk balance value.
First of let me say a big thank you, I read your comments on the chrome web-store page for the "TradingConnector" extension. I am happy you reached out and introduced your solution, the "Tradingview Connector Copier MT4" is freaking awesome! The trades get executed instantly and we don't have to rely on open chrome windows or anything, just beautiful. The connection is very stable and it uses a very reliable way of delivering the alerts. I have been looking for a server-client based solution like this for months, this product is exactly the way i want to implement the translation from TradingView to MT4. A little advise: Take your time to get familiar with the setup and the alert syntax, it is worth it. :)