Strategy Automation Service (MT4)
Automate Any PineIndicators Strategy To Any Broker With MT4
If you already have both you can proceed here:
Requirements
Make sure you meet the following requirements, so you are able to automate your strategies:
1. Prepare your strategy for automation
Open the settings of the strategy you want to automate in TradingView
- Open the settings of the strategy you want to automate in TradingView
- Set the start date to today
This is really important, because if you don’t do it the strategy will execute orders with extremely high quantity per trade, as the strategy is already running for years simulated on TradingView. But if you start using it live today you also have to start it today in Tradingview. - Under properties set your individual initial capital that you will use for the strategy in your broker.
Step 1 done!
2. Create an alert in TradingView for sending webhook signals
Now we need to create an alert to send the signals of your strategy/indicator to your broker/MT4.
- Click on the alert symbol in TradingView SuperCharts on the top right side of your screen.
- Click on “+” to create a new alert.
- Under Condition choose your strategy/indicator
- Then give your alert a proper individual name under Alert name
- Under message copy and paste the following code:
{
"AccountID": "TRADINGVIEW USERNAME",
"Key": "MYSECRETKEY",
"symbol": "BTCUSD",
"action": "{{strategy.order.action}}",
"volume": {{strategy.order.contracts}}
}
Change the CAPITAL values to your individual values (don’t delete the “”):
A. AccountID: Use your exact TradingView username – So the system can identify you as a licensed user.
B Key: Create a random, safe unique key – It’s like a password that permits the order to get executed. You have to use it in MT4 later on as well.
C. Symbol: Enter the EXACT ticker of the symbol you want to trade at your broker
6. Finally click on Notifications on top of the alert popup, activate Webhook URL and paste this URL in there:
https://hook.eu2.make.com/gcbrj2cr91q2wt2oyehnpttkkjo24c5x
OPTIONAL: 3. Login to your VPS (If bought)
This step is only needed if you bought a VPS from us, too. Otherwise continue with step 4.
You will receive all login credentials etc. by mail within 24 hours of your order. If you have received them, continue:
4. Finally activate the automation in MT4
Finally we need to activate the automation of your strategy by receiving the signals of TradingView in MetaTrader 4.
4.1 Add the PineIndicators Expert Advisor to receive signals
- If you shouldn’t already have, download MetaTrader 4: (It’s from XM, but you can login to any broker)
Windows
Mac - Then log into your trading account in MetaTrader 4. You should find instructions and login credentials at your broker.
- Now open the chart of the timeframe and instrument that you want to run your automated strategy on.
- Next download the following file (PineIndicators Expert Advisor):
5. Paste the file (like it is) into the Experts folder of your MetaTrader 4 installation. You should find it here:
MetaTrader 4 > MQL 4 > Experts
4.2 Add the PineIndicators Expert Advisor to your chart
- Close and start MetaTrader 4 again.
- Open the Navigator by clicking on “View” > “Navigator” if it shouldn’t already be opened.
- Drag and drop the PineIndicators Expert Advisor on the correct chart.
- Under Common activate “Allow live trading”
- Under Inputs enter the exact values that you have used in the strategy alerts in step 1
pyramiding: Should be off (if not different in your strategy)
EA Magic Number: Any random number
querySeconds: Default 10 - Finally click on “OK”.
4.3 Final step: Activate live trading
- Click on Tools > Options > Expert Advisors, activate “Allow WebRequest for listed URL” and add the following URL:
https://pineindicators-trading-signals-default-rtdb.europe-west1.firebasedatabase.app/
2. Next click on “AutoTrading” in the top bar of MetaTrader 4 to finally start automated trading.
Done, you have successfully automated your TradingView strategy on MetaTrader!
Make sure you have chosen the correct inputs and settings and test the code before using it in live trading.
If it shouldn’t work make sure you did every step correct. If it still shouldn’t work after 24 hours please send us a message!
You can pause the automation anytime by pausing or deleting the alert in TradingView.
Make sure your PC is ON and MetaTrader 4 is running in trading times, otherwise no trade will get executed.
You can also use a VPS (virtual private server) where you can run MT4 24/7 – Many broker offer that for free. Or you buy one from another provider.