Plug
Pine
BETA

Automate Any PineIndicators Strategy

You need active PineIndicators + PlugPine subscriptions

If you already have active subscriptions just proceed:

1. Prepare your strategy or indicator for automation

1.1 Open the PineIndicators strategy settings

  1. Enter your TradingView username (from your order at PlugPine)

  2. Enter an unique ID/key: Just generate any combination from letters and numbers that makes sense to you, like “XAUUSD1HPepperstone150924” for example. Make sure it’s not easy to guess.

  3. Enter the EXACT ticker/symbol from your broker for the instrument you want to trade: It varies from broker to broker and could be for example “XAUUSD”,  “BTCUSD.r”, “.US500Cash”,…

  4. Set the startdate to today

  5. Also make sure the initial capital and leverage is set like your want to have it. 

Step 1 done! Congratulations, that was the hardest part…

2. Create an alert in TradingView for sending signals

Now we need to create an alert to send the signals of your strategy/indicator to your broker/MT4.

  1. Click on the alert symbol in TradingView SuperCharts on the top right side of your screen.

  2. Click on “+” to create a new alert.

  3. Under Condition choose your strategy/indicator and choose “alert() function calls only”

    ONLY for the “Reversal Strategy” you need to use the default settings (NOT “alert() functions calls only”) and copy and paste this line into the “message” section:
    {{strategy.order.comment}}

  4. Then give your alert a proper individual name under Alert name

  5. Next click on Notifications on top of the alert popup, activate Webhook URL and paste this URL in there:
				
					https://hook.eu2.make.com/gcbrj2cr91q2wt2oyehnpttkkjo24c5x
				
			

6. Finally click on “Create

Step 2 done – Now your strategy is sending signals and is almost automated!

3. 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.

3.1 Add the PlugPine Expert Advisor to receive signals

  1. If you shouldn’t already have, download MetaTrader 4 from your broker or from metatrader4.com

     

  2. Then log into your trading account in MetaTrader 4. You should find instructions and login credentials at your broker.

  3. Now open the chart of the timeframe and instrument that you want to run your automated strategy on.

  4. Next download the following file (PlugPine 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

3.2 Add the PlugPine Expert Advisor to your chart

  1. Close and start MetaTrader 4 again.

  2. Open the Navigator by clicking on “View” > “Navigator” if it shouldn’t already be opened.

  3. Drag and drop the PlugPine Expert Advisor on the correct chart.

  4. Under Common activate “Allow live trading”

  5. Under Inputs enter the exact values that you have used in the strategy alerts in step 1

  6. Finally click on “OK”.

3.3 Final step: Activate live trading

  1. 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 MetraTrader 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.

Add as many strategies and accounts as you want.

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.