Skip to main content

Automate TradingView Strategy

~ Approximately 15 min

1. Access to the TradingView Script

info

If you have successfully subscribed to the TradingView Strategy Script, you will be able to access the script.

You should be able to see it in TradingView platform

On TradingView website, you will notice a notification on the right sidebar.

TradingView Script Notification

2. Add the script to your chart

TradingView Script Add To Chart

3. Select a strategy you want to automate

We provide many backtested strategies for you to choose from as starter.

You can select the strategy you want to automate and copy the inputs to the strategy settings.

4. Setup the trading robot

tip

The provided Strategy Script, has a section to setup the trading robot.

You will need to provide the following information depends on the platform you use.

TradingView Script Robot Setup

Metatrader 5

caution

Make sure you have correctly setup Metatrader 5 and the Shadow.Trading Expert Advisor (EA) by following this step

Metatrader 5 Setup

In order to automate the strategy, you will need to provide the following information under the script settings:

Bybit or Binance

In order to automate the strategy, you will need to provide the following information under the script settings:

  • Shadow.Trading License Key - You can find it in your account.
  • Discord Channel ID - From the First Step Quick Start Guide.
  • Exchange name - It can be Bybit Futures or Binance USD M
  • Exchange API Key - That you have setup during the previous step.
  • Exchange API Secret - That you have setup during the previous step.

5. Setup alerts with webhooks

You can now create alerts on the strategy script, and setup webhooks to receive notifications on your Discord channel.

On the following screenshot, you can find important steps information:

TradingView Alert Message

  • 1 - Click on alert to show sidebar.
  • 2 - Add new alert.
  • 3 - Click on settings.
  • 4 - Select Shadow.Trading - Strategy Builder Script, it matches the strategy you have setup on your current chart.
  • 5 - Give a name to the alert.
  • 6 - Under message, it is important to put the following code, it will send corresponding alert message to the webhook to open and close position when needed.
{{strategy.order.alert_message}}
  • 7 - Click on Notifications to provide webhook url.

TradingView Webhook

  • 8 - Enable webhook URL by checking the box.
  • 9 - Put the Trading connector API URL (not the same urls depends on the market).
caution

For forex pairs with Metatrader 5

https://webhook.shadow.trading/view/trade-metatrader

For cryptocurrency pairs with Bybit or Binance

https://webhook.shadow.trading/view/trade-cryptocurrency
  • 10 - Click on Create

🎉 Enjoy 🎉

You have successfully setup your trading robot, you will now receive notifications on your Discord channel, when the bot enter a trade and close a trade.

We recommand you to play with the script settings and backtest the strategy carefully before going live, this was a quick introduction to the whole process that you can repeat for runnning multiple strategies.

caution

It is recommanded to run one strategy per symbol, due to conflit when closing positions.

Some platform will provide the ability to create sub-accounts, this feature can be useful if you want to run multiple strategies on the same symbol.