The Best Way to Automate Your Trading Strategies Using TradingView

Ashley Jessen - Chief Operating Officer

2023-10-16 11:31:24

If you are using TradingView as your trading platform and wish to use existing indicators to set automated alerts with zero coding, then this tutorial will be a game-changer. This is the best way to automate your trading strategies using TradingView Alerts we’ve found. This solution was based on countless feedback from many active traders using Capitalise.ai

You are no doubt aware you have access to all the standard indicators in TradingView, but more importantly, countless custom indicators supplied by the growing user base.

If I type in ‘RSI’ into the indicators on TradingView, you can see the normal RSI tools plus the ‘Community Scripts.’

And, with a few clicks, you can set an alert from TradingView and never miss a critical move that meets your criteria.

Easily create, test and automate any trading scenario code-free using TradingView alerts and Capitalise.ai

As mentioned, Capitalise.ai was constantly getting asked by ACY Securities and our clients if they could integrate with TradingView alerts to easily create, test and automate their trading strategies.

And their team went to work immediately, realising how valuable a tool like this would be to their clients and for ACY as their partner.

For you as a trader familiar with TradingView Alerts, this means endless possibilities when combined with the ability to create and then backtest your trading ideas.

Further to this, with a click of a button, you can then automate your trading strategies using TradingView and Captalise.ai with ease.

Let’s take a look at the first training video by Josh on how easy it is to automate any trading scenario. Click play on the video below.

 

How do Alerts work on the TradingView platform?

TradingView allows the creation of alerts based on any of the chart’s visual elements; lines, prices, indicators, but also sending alerts via the Pine script. TradingView Webhook is a way of sending a message to a third party when an alert has been triggered.

Understanding TradingView Alert Webhooks and How They Operate

With any TradingView alert, you can select ‘Webhook URL’ under ‘Alert Actions’.

Once selecting this option, you need to provide the webhook URL and message.

The webhook URL is the address to which the alert will be sent. The message is the content of the alert.

Integrating TradingView Alerts into Your Capitalise.ai Auto-Trading Strategy

On the Capitalise.ai wizard, add the condition ‘Webhook’ to your trading strategy:

Once you write ‘Webhook’, you will receive a URL & unique message that refers solely to this webhook condition.

Copy them into the required fields on the trading-view alert interface when defining the webhook.

Now, when the alert triggers, your strategy condition related to this webhook will be triggered.

<H2> A Walkthrough Example Using a VWAP Trading Strategy

VWAP (volume-weighted average price) is a technical indicator used at times when looking to buy into the market below the markets’ average price, and sell above the markets’ average price.

Using this logic, we can consider the following conditions as our trading strategy:

Entry

1. I will go long (buy) each time the price trades below the lower band of the VWAP indicator.

2. I would seek an entry after the first hour of the trading session, when the price settles, and up until 15:00 eastern time.

Exit

1. I want to close the trade when the price crosses above the higher VWAP band or at a stop-loss of 5%.

2. A trade will not remain open after the market official trading session.

This is how your entry and exit would look like on TradingView Charts with a dedicated open time and dedicated time to stop looking for signals/alerts:

Here are the simple steps you need to follow to automate this trading strategy:

1. Set the appropriate entry strategy on the Capitalise.ai wizard:

“Between 10:30 AM and 15:00 eastern time if Webhook triggers buy 30 MRNA”

2. Click the word Webhook and then copy the URL and Message (MSG1).

3. Open TradingView and setup a TradingView alert:

• Add the VWAP indicator to your chart of choice

• Open the Alert menu and set the trading-view alert:

Asset = MRNA
Crossing Down
VWAP, Lower Band

• Under “Options” choose “Once per bar” as we want it to trigger more than once (also in future bars) and ultimately create multiple trades over time. At the same time, we don’t wish to send more than 1 alert per bar.

•  It is better if we choose a chart time frame that is smaller than 1 hour.

• Under Alert Actions choose “Webhook URL” and paste the address you copied on step 2.

• On the message section, paste MSG1 you copied on step 2.

• Click “Create”.

4. Set the appropriate entry strategy on the Capitalise.ai wizard:

“Close position if Webhook triggers or at loss of 5% or at 15:59 eastern time”

5. Copy the URL and message (MSG2)

6. Open TradingView and setup the exit Webhook trigger – follow the same process but now for when price crosses above the upper VWAP.

7. Paste the URL and MSG2 under the Webhook URL section.

8. Go back to Capitalise.ai, and set the strategy to run in loop mode (so it can continuously enter and exit the trade automatically).

9. Click ‘Next’ and verify your strategy on the confirmation page.

10. Test your strategy risk-free using Simulation mode, or run it live and let Capitalise.ai execute your trades directly via your ACY trading account.

Some key points to consider with this webhook example:

• While a strategy is on the entry phase, any webhook message received which belongs to the exit will be ignored. And vice versa, while a strategy is on the exit phase, any webhook message received which belongs to the entry will be ignored.

• Whenever a message is received for a certain webhook, that webhook condition will remain triggered until the entire strategy moves to the next phase (From entry to exit and vice versa).

The simplicity of managing multiple strategies from one alert

The Webhook is a powerful feature that opens many opportunities, one of those is the option to trigger multiple automated strategies from a single alert. This option can be used to:

Trigger multiple conditions in multiple strategies you own:

For example, you can manage 2 identical strategies, one could be connected to your first ACY trading account and the second one connected to a 2nd ACY trading account (Sub account). This way you can create a scenario that once triggered will buy 15 SP500 contracts in your main ACY trading account and at the same time, buy 10 Nasdaq CFD contracts in your 2nd ACY trading account.

Risk management:

You can close all of your positions across all of our ACY accounts with a single trigger.

Managing trades for family and friends:

If your friend provides you with a webhook ID from her Capitalise.ai strategy, you can manage her trading by sending a TradingView alert to her webhook.

And you can do that to multiple parties at the same time. Importantly, your friends keep full control of trade size, switching between simulated and real trading, and whether to keep running or stopping this automated managed strategy.

 

How does it work with the JSON file and multiple IDs?

You see, the message we send is of a JSON type, in this JSON we send a list of IDs, This list can (and most times) be with just 1 ID, or, it can have multiple IDs.

• A message containing 1 ID:

{“alertId”: “3a89741a-2cea-49c9-a4ce-aef2840738c5”}

• A message containing multiple IDs:

{“alertIds”: [“38bb324b-4c2c-4582-b4be-bfecf534eda8”, “d2425ea0-e1b8-4554-a8e0-f2c658899283″,”3a89741a-2cea-49c9-a4ce-aef2840738c5”]}

When sending multiple Webhook IDs, we can trigger many conditions at the same time.

Concluding the best way to automate your trading strategies using TradingView

When it comes to easily automating your TradingView alerts for trading automation, you have several options, including:

• On the position Entry stage.

• On the position Exit stage.

• On both stages.

• Combining it with other conditions.

• Building scenarios with multiple Webhooks.

• Creating an entry and exit stages that only have webhook as a condition – by this, you are basically using Capitalise.ai connectivity to multiple brokers as an execution agent while managing the execution timing all by yourself.

I have no doubt your creativity is lighting up on what you can now achieve with two of the best trading tools and resources available to you as a trader.

You are only limited by your imagination and the ability to explore the various custom coded indicators supplied by the myriad of outstanding traders within the TradingView ecosystem.

What will be the first system you test? Have you got some existing trading setups and alerts you’d like to integrate with Capitalise straight away?

Set aside some time to focus on creating your new webhooks, so you can backtest your ideas and build absolute confidence in your trading edge.

Getting started with ACY and Capitalise.ai

There is no better time than now to automate your trading processes and trading systems.

ACY provides traders with free access to Capitalise.ai to remove the emotions from their trading and automate everything with zero coding knowledge required.

There has never been a better time to design, backtest, simulate and execute your new trading strategies, when combining ACY and Capitalise.ai

What are you waiting for?

Open a live trading account with ACY and connect your MT4 account to Capitalise and explore the world of automated trading opportunities available today.

المؤلف

Ashley Jessen is the author of CFDs Made Simple and Chief Operating Officer at ACY Securities. Jessen started in the industry in the year 2000, has educated thousands of traders globally, and has been instrumental in the growth of many of the world's largest CFD & FX companies.

الأسعار إرشادية فقط